ojalgo-user Mailing List for oj! Algorithms (Page 4)
Mathematics, linear algebra and optimisation
Brought to you by:
apete
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
(1) |
Mar
|
Apr
(14) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2005 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(3) |
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
(1) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
(5) |
Sep
|
Oct
(3) |
Nov
(4) |
Dec
(2) |
2007 |
Jan
(8) |
Feb
(1) |
Mar
(2) |
Apr
(11) |
May
(6) |
Jun
|
Jul
(10) |
Aug
(2) |
Sep
|
Oct
(4) |
Nov
|
Dec
(11) |
2008 |
Jan
(22) |
Feb
(4) |
Mar
(2) |
Apr
(4) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(6) |
Nov
(17) |
Dec
(5) |
2009 |
Jan
(15) |
Feb
(2) |
Mar
(2) |
Apr
(3) |
May
(4) |
Jun
(5) |
Jul
(9) |
Aug
(2) |
Sep
|
Oct
(5) |
Nov
(14) |
Dec
|
2010 |
Jan
(3) |
Feb
(5) |
Mar
(2) |
Apr
(19) |
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
(5) |
Nov
(3) |
Dec
|
2011 |
Jan
|
Feb
(1) |
Mar
(7) |
Apr
(10) |
May
(1) |
Jun
(15) |
Jul
(1) |
Aug
|
Sep
|
Oct
(13) |
Nov
(9) |
Dec
(11) |
2012 |
Jan
|
Feb
(1) |
Mar
(9) |
Apr
(23) |
May
(16) |
Jun
(9) |
Jul
(13) |
Aug
|
Sep
(4) |
Oct
(1) |
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(12) |
Mar
(7) |
Apr
(24) |
May
|
Jun
(7) |
Jul
(4) |
Aug
|
Sep
(3) |
Oct
(16) |
Nov
(7) |
Dec
(3) |
2014 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
(3) |
Jul
(4) |
Aug
(4) |
Sep
(1) |
Oct
(2) |
Nov
(6) |
Dec
(2) |
2015 |
Jan
(11) |
Feb
(10) |
Mar
(1) |
Apr
(9) |
May
|
Jun
|
Jul
(1) |
Aug
(4) |
Sep
(6) |
Oct
(3) |
Nov
(15) |
Dec
(4) |
2016 |
Jan
(6) |
Feb
|
Mar
(18) |
Apr
(5) |
May
(9) |
Jun
(3) |
Jul
(5) |
Aug
(2) |
Sep
(5) |
Oct
(2) |
Nov
|
Dec
(5) |
2017 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
|
May
(12) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
(3) |
Oct
(1) |
Nov
|
Dec
(1) |
2018 |
Jan
(5) |
Feb
|
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(4) |
Aug
(1) |
Sep
(8) |
Oct
|
Nov
|
Dec
(1) |
2019 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Anders P. <an...@op...> - 2016-06-02 20:10:55
|
Yes, when I wrote that I had to fix a bug in CoordinationSet. I believe you can avoid the problem by explicitly setting names on the individual series in the CoordinationSet tmpSeriesAAPL.name(“…”) tmpSeriesGOOG.name(“…”) or switch to a recent snapshot. /Anders > On 2 juni 2016, at 21:44, Vincent de CHACUS C. <dec...@ya...> wrote: > > Hey Anders, > > I ran the example Financial Data class provided on the wiki: > > https://github.com/optimatika/ojAlgo/wiki/Financial-Data > > When it tries to extract the monthly data for AAPL (tmpMonthlyDataAAPL), it throws a null pointer exception. > I'm using ojalgo-39.0 jar. > > thanks, > Vince > > > > > > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Vincent de C. C. <dec...@ya...> - 2016-06-02 19:44:49
|
Hey Anders, I ran the example Financial Data class provided on the wiki: https://github.com/optimatika/ojAlgo/wiki/Financial-Data When it tries to extract the monthly data for AAPL (tmpMonthlyDataAAPL), it throws a null pointer exception.I'm using ojalgo-39.0 jar. thanks,Vince |
From: Anders P. <an...@op...> - 2016-05-29 21:13:22
|
I just checked in some changes that may interest you: 1) The multiply-method in MatrixStore PhysicalStore<N> multiply(Access1D<N>, PhysicalStore<N>) has changed to void multiply(Access1D<N>, ElementsConsumer<N>) 2) SparseStore now implements ElementsConsumer Those two changes in combination essentially makes it possible to do what you asked: a.fillByMultiplying(Cf.transpose(), Yf)); or Cf.transpose().multiply(Yf, a); I have not implemented any new multiplication algorithm, but the existing ones already to some extent exploit sparsity/structures. > On 22 maj 2016, at 17:04, Anders Peterson <an...@op...> wrote: > > ojAlgo does not support that (yet). > > >> On 21 maj 2016, at 16:31, Santiago Peñate Vera <san...@gm...> wrote: >> >> Hi, >> >> I am starting with OjAlgo and I find that the multiplication of 2 sparse >> matrices returns a full matrix (or so says netbeans) >> >> Here Cf and Yf are sparse matrices and I need their multiplication: >> >> SparseStore a = Cf.transpose().multiply(Yf); >> >> How do I do a sparse multiplication with OjAlgo? >> >> Thanks >> >> ------------------------------------------------------------------------------ >> Mobile security can be enabling, not merely restricting. Employees who >> bring their own devices (BYOD) to work are irked by the imposition of MDM >> restrictions. Mobile Device Manager Plus allows you to control only the >> apps on BYO-devices by containerizing them, leaving personal data untouched! >> https://ad.doubleclick.net/ddm/clk/304595813;131938128;j >> _______________________________________________ >> ojAlgo-user mailing list >> ojA...@li... >> https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Anders P. <an...@op...> - 2016-05-25 20:38:44
|
I just added a method nonzeros() It is marked as deprecated because It is very likely that the design/implementation will change. /Anders > On 25 maj 2016, at 20:26, Santiago Peñate Vera <san...@gm...> wrote: > > Hello, > > I am using a SparseStore element Y. > > How do I access its non-zero elements sequentially also getting the > indices of the row and the column? > > Best regards, > Santiago > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > |
From: Santiago P. V. <san...@gm...> - 2016-05-25 18:27:07
|
Hello, I am using a SparseStore element Y. How do I access its non-zero elements sequentially also getting the indices of the row and the column? Best regards, Santiago |
From: Anders P. <an...@op...> - 2016-05-22 15:04:38
|
ojAlgo does not support that (yet). > On 21 maj 2016, at 16:31, Santiago Peñate Vera <san...@gm...> wrote: > > Hi, > > I am starting with OjAlgo and I find that the multiplication of 2 sparse > matrices returns a full matrix (or so says netbeans) > > Here Cf and Yf are sparse matrices and I need their multiplication: > > SparseStore a = Cf.transpose().multiply(Yf); > > How do I do a sparse multiplication with OjAlgo? > > Thanks > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Santiago P. V. <san...@gm...> - 2016-05-21 14:31:32
|
Hi, I am starting with OjAlgo and I find that the multiplication of 2 sparse matrices returns a full matrix (or so says netbeans) Here Cf and Yf are sparse matrices and I need their multiplication: SparseStore a = Cf.transpose().multiply(Yf); How do I do a sparse multiplication with OjAlgo? Thanks |
From: Anders P. <an...@op...> - 2016-05-05 19:35:01
|
No, there is not. /Anders > On 5 maj 2016, at 20:56, Vincent de CHACUS C. <dec...@ya...> wrote: > > thank you for your reply. > I was talking about a 1D matrix of excess returns. > For example, if I have 16 assets, my input will be a 16 X 1 matrix of excess returns. > Is there a method in any of the classes that will return a 16 x 16 covariance matrix? > > thanks, > Vince > > > > > > > > > Le Jeudi 5 mai 2016 14h28, Anders Peterson <an...@op...> a écrit : > > > > > On 5 maj 2016, at 14:37, Vincent de CHACUS C. <dec...@ya...> wrote: > > > > Hey Anders, > > > > I think I made some progress, but I still have a few questions: > > > > - Is there any methods anywhere in the codebase that can take a 1D BasicMatrix (or any other > > Access1D data structure) and return an Access2D covariance matrix? > > In all the examples in the test package that use a covariance matrix, they all start with hardcoded values... > > > > - Same thing for the correlation matrix (the one used as input for the constructor of the SimplePortfolio class)? > > > I don’t understand. What does that 1D vector contain? > > > > > - One of the MarkowitzModel constructor takes an expected excess returns argument as input. Conceptually, what is the excess relative to? I'm asking this because in my model, i have an asset price, and an asset intrinsic value. My expected return is the improvement potential I see between the current price and what I think the intrinsic value is. Is that in line with the definition of the expected excess return argument? > > > It’s excess relative to the risk-free return. Generally it’s no problem to assume that to be zero. These are not questions regarding how ojAlgo works. You need to read up on modern portfolio theory: > > https://en.wikipedia.org/wiki/Modern_portfolio_theory > > > > > - Also, in one of your responses in the mail archive, you said the RAF is a value between 0 and 100. But in the TestEquilibrium class, the example uses an RAF of 1000. Is it a typo? > > > Just think of the RAF as a parameter that corresponds to one point on the efficient frontier. Zero is not a very good choice. It can be very large or very small, but not zero. Experiment with different values. Start with 1.0 to 10.0 range. > > > > /Anders > > > > > Best Regards, > > Vince > > > > PS: Thanks for making OjAlgo available to everyone. It's truly a useful tool!!!! > > > > > > > > > > > > > > > > To accomplish great things, we must not only act, but also dream; not only plan, but also believe > > > > > > Le Mercredi 13 avril 2016 10h06, Vincent de CHACUS C. <dec...@ya...> a écrit : > > > > > > Thanks for your prompt response Anders! > > > > I will go over it again with this new perspective and let you know if I hit a roadblock. > > If I get it to work, I will gladly contribute a small sample of my implementation as documentation for the finance package. > > > > > > Regards, > > Vince > > > > > > > > > > > > > > To accomplish great things, we must not only act, but also dream; not only plan, but also believe > > > > > > Le Mercredi 13 avril 2016 7h05, Anders Peterson <an...@op...> a écrit : > > > > > > There’s not yet any specific example documentation for the finanace.portfolio classes (MarkowitzModel). The test cases that you already found is probably the best alternative. > > > > https://github.com/optimatika/ojAlgo/tree/master/test/org/ojalgo/finance/portfolio > > > > There is no need or requirement to use a DataSource with the porfolio classes. The Yahoo and Google finance data sources are simply there to allow you to download and/or parse data. If you already have the data you need, in a database, the just fetch it and use it. > > > > If your database stores time series data then fetch that and put in CalendarDateSeries. Create a CoordinationSet with all your CalendarDateSeries instances.. Call #complete(), #prune() or #resample() as needed. Then there are methods in FinanceUtils that can give you a covariance matrix and other things. > > > > Also note that CalendarDateSeries also has a method getPrimitiveTimeSeries() that can be useful, and can be wrapped in SampleSet. > > > > /Anders > > > > > > > > > On 13 apr. 2016, at 04:26, Vincent de CHACUS C. <dec...@ya...> wrote: > > > > > > Hey Guys, > > > > > > I am working on a financial application and I am trying to use the finance module of ojalgo. > > > For the past week, I've been scouring the source code trying to understand how to use it and I have a few questions. > > > > > > - Is there any example that shows how to make use of the Markowitz Optimization? (Other than the one on the ConvexSolver Performance page in the wiki?) > > > > > > - Is there any way to get the datasource to use my DB as source directly without having to load all the symbols manually in an array? > > > > > > - Could you please point me to an example (if possible) that uses stock symbols, their price, etc....and runs through the optimization and returns a set of recommendations? > > > All the examples I found in the test package all have hardcoded numbers in the arrays and not a lot of explanation about the context. > > > > > > I understand you may not have the answers to all the questions. I just thought I would throw them out there in case someone does. > > > > > > thanks, > > > Vince > > > > > > > > > > > > > > > > > > > > > To accomplish great things, we must not only act, but also dream; not only plan, but also believe > > > > > ------------------------------------------------------------------------------ > > > Find and fix application performance issues faster with Applications Manager > > > Applications Manager provides deep performance insights into multiple tiers of > > > your business applications. It resolves application problems quickly and > > > reduces your MTTR.. Get your free trial! > > > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ > > > ojAlgo-user mailing list > > > ojA...@li... > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > Find and fix application performance issues faster with Applications Manager > > Applications Manager provides deep performance insights into multiple tiers of > > your business applications. It resolves application problems quickly and > > reduces your MTTR. Get your free trial! > > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Vincent de C. C. <dec...@ya...> - 2016-05-05 18:57:07
|
thank you for your reply.I was talking about a 1D matrix of excess returns.For example, if I have 16 assets, my input will be a 16 X 1 matrix of excess returns.Is there a method in any of the classes that will return a 16 x 16 covariance matrix? thanks, Vince Le Jeudi 5 mai 2016 14h28, Anders Peterson <an...@op...> a écrit : > On 5 maj 2016, at 14:37, Vincent de CHACUS C. <dec...@ya...> wrote: > > Hey Anders, > > I think I made some progress, but I still have a few questions: > > - Is there any methods anywhere in the codebase that can take a 1D BasicMatrix (or any other > Access1D data structure) and return an Access2D covariance matrix? > In all the examples in the test package that use a covariance matrix, they all start with hardcoded values... > > - Same thing for the correlation matrix (the one used as input for the constructor of the SimplePortfolio class)? I don’t understand. What does that 1D vector contain? > - One of the MarkowitzModel constructor takes an expected excess returns argument as input. Conceptually, what is the excess relative to? I'm asking this because in my model, i have an asset price, and an asset intrinsic value. My expected return is the improvement potential I see between the current price and what I think the intrinsic value is. Is that in line with the definition of the expected excess return argument? It’s excess relative to the risk-free return. Generally it’s no problem to assume that to be zero. These are not questions regarding how ojAlgo works. You need to read up on modern portfolio theory: https://en.wikipedia.org/wiki/Modern_portfolio_theory > - Also, in one of your responses in the mail archive, you said the RAF is a value between 0 and 100. But in the TestEquilibrium class, the example uses an RAF of 1000. Is it a typo? Just think of the RAF as a parameter that corresponds to one point on the efficient frontier. Zero is not a very good choice. It can be very large or very small, but not zero. Experiment with different values. Start with 1.0 to 10.0 range. /Anders > Best Regards, > Vince > > PS: Thanks for making OjAlgo available to everyone. It's truly a useful tool!!!! > > > > > > > > To accomplish great things, we must not only act, but also dream; not only plan, but also believe > > > Le Mercredi 13 avril 2016 10h06, Vincent de CHACUS C. <dec...@ya...> a écrit : > > > Thanks for your prompt response Anders! > > I will go over it again with this new perspective and let you know if I hit a roadblock. > If I get it to work, I will gladly contribute a small sample of my implementation as documentation for the finance package. > > > Regards, > Vince > > > > > > > To accomplish great things, we must not only act, but also dream; not only plan, but also believe > > > Le Mercredi 13 avril 2016 7h05, Anders Peterson <an...@op...> a écrit : > > > There’s not yet any specific example documentation for the finanace.portfolio classes (MarkowitzModel). The test cases that you already found is probably the best alternative. > > https://github.com/optimatika/ojAlgo/tree/master/test/org/ojalgo/finance/portfolio > > There is no need or requirement to use a DataSource with the porfolio classes. The Yahoo and Google finance data sources are simply there to allow you to download and/or parse data. If you already have the data you need, in a database, the just fetch it and use it. > > If your database stores time series data then fetch that and put in CalendarDateSeries. Create a CoordinationSet with all your CalendarDateSeries instances.. Call #complete(), #prune() or #resample() as needed. Then there are methods in FinanceUtils that can give you a covariance matrix and other things. > > Also note that CalendarDateSeries also has a method getPrimitiveTimeSeries() that can be useful, and can be wrapped in SampleSet. > > /Anders > > > > > On 13 apr. 2016, at 04:26, Vincent de CHACUS C. <dec...@ya...> wrote: > > > > Hey Guys, > > > > I am working on a financial application and I am trying to use the finance module of ojalgo. > > For the past week, I've been scouring the source code trying to understand how to use it and I have a few questions. > > > > - Is there any example that shows how to make use of the Markowitz Optimization? (Other than the one on the ConvexSolver Performance page in the wiki?) > > > > - Is there any way to get the datasource to use my DB as source directly without having to load all the symbols manually in an array? > > > > - Could you please point me to an example (if possible) that uses stock symbols, their price, etc....and runs through the optimization and returns a set of recommendations? > > All the examples I found in the test package all have hardcoded numbers in the arrays and not a lot of explanation about the context. > > > > I understand you may not have the answers to all the questions. I just thought I would throw them out there in case someone does. > > > > thanks, > > Vince > > > > > > > > > > > > > > To accomplish great things, we must not only act, but also dream; not only plan, but also believe > > > ------------------------------------------------------------------------------ > > Find and fix application performance issues faster with Applications Manager > > Applications Manager provides deep performance insights into multiple tiers of > > your business applications. It resolves application problems quickly and > > reduces your MTTR.. Get your free trial! > > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Anders P. <an...@op...> - 2016-05-05 18:29:09
|
> On 5 maj 2016, at 14:37, Vincent de CHACUS C. <dec...@ya...> wrote: > > Hey Anders, > > I think I made some progress, but I still have a few questions: > > - Is there any methods anywhere in the codebase that can take a 1D BasicMatrix (or any other > Access1D data structure) and return an Access2D covariance matrix? > In all the examples in the test package that use a covariance matrix, they all start with hardcoded values... > > - Same thing for the correlation matrix (the one used as input for the constructor of the SimplePortfolio class)? I don’t understand. What does that 1D vector contain? > - One of the MarkowitzModel constructor takes an expected excess returns argument as input. Conceptually, what is the excess relative to? I'm asking this because in my model, i have an asset price, and an asset intrinsic value. My expected return is the improvement potential I see between the current price and what I think the intrinsic value is. Is that in line with the definition of the expected excess return argument? It’s excess relative to the risk-free return. Generally it’s no problem to assume that to be zero. These are not questions regarding how ojAlgo works. You need to read up on modern portfolio theory: https://en.wikipedia.org/wiki/Modern_portfolio_theory > - Also, in one of your responses in the mail archive, you said the RAF is a value between 0 and 100. But in the TestEquilibrium class, the example uses an RAF of 1000. Is it a typo? Just think of the RAF as a parameter that corresponds to one point on the efficient frontier. Zero is not a very good choice. It can be very large or very small, but not zero. Experiment with different values. Start with 1.0 to 10.0 range. /Anders > Best Regards, > Vince > > PS: Thanks for making OjAlgo available to everyone. It's truly a useful tool!!!! > > > > > > > > To accomplish great things, we must not only act, but also dream; not only plan, but also believe > > > Le Mercredi 13 avril 2016 10h06, Vincent de CHACUS C. <dec...@ya...> a écrit : > > > Thanks for your prompt response Anders! > > I will go over it again with this new perspective and let you know if I hit a roadblock. > If I get it to work, I will gladly contribute a small sample of my implementation as documentation for the finance package. > > > Regards, > Vince > > > > > > > To accomplish great things, we must not only act, but also dream; not only plan, but also believe > > > Le Mercredi 13 avril 2016 7h05, Anders Peterson <an...@op...> a écrit : > > > There’s not yet any specific example documentation for the finanace.portfolio classes (MarkowitzModel). The test cases that you already found is probably the best alternative. > > https://github.com/optimatika/ojAlgo/tree/master/test/org/ojalgo/finance/portfolio > > There is no need or requirement to use a DataSource with the porfolio classes. The Yahoo and Google finance data sources are simply there to allow you to download and/or parse data. If you already have the data you need, in a database, the just fetch it and use it. > > If your database stores time series data then fetch that and put in CalendarDateSeries. Create a CoordinationSet with all your CalendarDateSeries instances.. Call #complete(), #prune() or #resample() as needed. Then there are methods in FinanceUtils that can give you a covariance matrix and other things. > > Also note that CalendarDateSeries also has a method getPrimitiveTimeSeries() that can be useful, and can be wrapped in SampleSet. > > /Anders > > > > > On 13 apr. 2016, at 04:26, Vincent de CHACUS C. <dec...@ya...> wrote: > > > > Hey Guys, > > > > I am working on a financial application and I am trying to use the finance module of ojalgo. > > For the past week, I've been scouring the source code trying to understand how to use it and I have a few questions. > > > > - Is there any example that shows how to make use of the Markowitz Optimization? (Other than the one on the ConvexSolver Performance page in the wiki?) > > > > - Is there any way to get the datasource to use my DB as source directly without having to load all the symbols manually in an array? > > > > - Could you please point me to an example (if possible) that uses stock symbols, their price, etc....and runs through the optimization and returns a set of recommendations? > > All the examples I found in the test package all have hardcoded numbers in the arrays and not a lot of explanation about the context. > > > > I understand you may not have the answers to all the questions. I just thought I would throw them out there in case someone does. > > > > thanks, > > Vince > > > > > > > > > > > > > > To accomplish great things, we must not only act, but also dream; not only plan, but also believe > > > ------------------------------------------------------------------------------ > > Find and fix application performance issues faster with Applications Manager > > Applications Manager provides deep performance insights into multiple tiers of > > your business applications. It resolves application problems quickly and > > reduces your MTTR.. Get your free trial! > > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Vincent de C. C. <dec...@ya...> - 2016-05-05 12:37:23
|
Hey Anders, I think I made some progress, but I still have a few questions: - Is there any methods anywhere in the codebase that can take a 1D BasicMatrix (or any other Access1D data structure) and return an Access2D covariance matrix? In all the examples in the test package that use a covariance matrix, they all start with hardcoded values... - Same thing for the correlation matrix (the one used as input for the constructor of the SimplePortfolio class)? - One of the MarkowitzModel constructor takes an expected excess returns argument as input. Conceptually, what is the excess relative to? I'm asking this because in my model, i have an asset price, and an asset intrinsic value. My expected return is the improvement potential I see between the current price and what I think the intrinsic value is. Is that in line with the definition of the expected excess return argument? - Also, in one of your responses in the mail archive, you said the RAF is a value between 0 and 100. But in the TestEquilibrium class, the example uses an RAF of 1000. Is it a typo? Best Regards,Vince PS: Thanks for making OjAlgo available to everyone. It's truly a useful tool!!!! To accomplish great things, we must not only act, but also dream; not only plan, but also believe Le Mercredi 13 avril 2016 10h06, Vincent de CHACUS C. <dec...@ya...> a écrit : Thanks for your prompt response Anders! I will go over it again with this new perspective and let you know if I hit a roadblock.If I get it to work, I will gladly contribute a small sample of my implementation as documentation for the finance package. Regards,Vince To accomplish great things, we must not only act, but also dream; not only plan, but also believe Le Mercredi 13 avril 2016 7h05, Anders Peterson <an...@op...> a écrit : There’s not yet any specific example documentation for the finanace.portfolio classes (MarkowitzModel). The test cases that you already found is probably the best alternative. https://github.com/optimatika/ojAlgo/tree/master/test/org/ojalgo/finance/portfolio There is no need or requirement to use a DataSource with the porfolio classes. The Yahoo and Google finance data sources are simply there to allow you to download and/or parse data. If you already have the data you need, in a database, the just fetch it and use it. If your database stores time series data then fetch that and put in CalendarDateSeries. Create a CoordinationSet with all your CalendarDateSeries instances. Call #complete(), #prune() or #resample() as needed. Then there are methods in FinanceUtils that can give you a covariance matrix and other things. Also note that CalendarDateSeries also has a method getPrimitiveTimeSeries() that can be useful, and can be wrapped in SampleSet. /Anders > On 13 apr. 2016, at 04:26, Vincent de CHACUS C. <dec...@ya...> wrote: > > Hey Guys, > > I am working on a financial application and I am trying to use the finance module of ojalgo. > For the past week, I've been scouring the source code trying to understand how to use it and I have a few questions. > > - Is there any example that shows how to make use of the Markowitz Optimization? (Other than the one on the ConvexSolver Performance page in the wiki?) > > - Is there any way to get the datasource to use my DB as source directly without having to load all the symbols manually in an array? > > - Could you please point me to an example (if possible) that uses stock symbols, their price, etc....and runs through the optimization and returns a set of recommendations? > All the examples I found in the test package all have hardcoded numbers in the arrays and not a lot of explanation about the context. > > I understand you may not have the answers to all the questions. I just thought I would throw them out there in case someone does. > > thanks, > Vince > > > > > > > To accomplish great things, we must not only act, but also dream; not only plan, but also believe > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: 常 超 <cha...@ho...> - 2016-04-20 07:20:48
|
Hi,Anders I created an issue(https://github.com/optimatika/ojAlgo/issues/17) and a pull request (https://github.com/optimatika/ojAlgo/pull/18) in github for this problem, would you please check it? Chao. ________________________________________ 发件人: Anders Peterson <an...@op...> 发送时间: 2016年4月20日 6:12 收件人: oja...@li... 主题: Re: [ojAlgo-user] 答复: How to compute the (Moore-Penrose) pseudo-inverse of a matrix. Checking the pseudoinverse is part of the unit tests for the SVD implementations, but the tests are typically done with smaller matrices. My guess is, as you also mentioned, that this is probably an accuracy problem that becomes more severe with larger matrices. I’ll have a look at this, but can’t promise anything about the solution. If you have a look inside RawSingularValue and SingularValueDecomposition I believe you’ll find code similar to what’s that page you linked to. Most likely the problem is there. /Anders > On 19 apr. 2016, at 10:19, 常 超 <cha...@ho...> wrote: > > > Hi,Anders > > Difference occured when the size of row or column is big,say a big matrix of 2000*2000. > > With the same input matrix,numpy and the following java code returns almost the same result, > While ojAlgo returns a different value. > > http://the-lost-beauty.blogspot.jp/2009/04/moore-penrose-pseudoinverse-in-jama.html > The basic properties are not met. > > > I used the compare code in the above article to check the property, > numpy and the the implementation in the above article passed, > But ojAlgo failed. > Is it just a problem of accuracy of ojAlgo when calcularing pseudo-inverse for a big matrix? > > boolean c1 = checkEquality(A.times(Aplus).times(A), A); > boolean c2 = checkEquality(Aplus.times(A).times(Aplus), Aplus); > boolean c3 = checkEquality(A.times(Aplus), A.times(Aplus).transpose()); > boolean c4 = checkEquality(Aplus.times(A), Aplus.times(A).transpose()); > > public static boolean checkEquality(Matrix A, Matrix B) { > return A.minus(B).normInf() < 1e-9; > } > > If needed,I can post my test data.(It is in a big test file container the double value of a 2000*2000 matrix,about 77M byte) > > Chao. > ________________________________________ > 发件人: Anders Peterson <an...@op...> > 发送时间: 2016年4月19日 15:07 > 收件人: oja...@li... > 主题: Re: [ojAlgo-user] How to compute the (Moore-Penrose) pseudo-inverse of a matrix. > > It should return the pseudoinverse. How are the results different? > > Please verify these basic properties on both the ojAlgo and numpy results. > > https://en.wikipedia.org/wiki/MoorePenrose_pseudoinverse#Basic_properties > > If both fulfil those then check which has the smallest frobeninius norm. > > > Let me know what you learn. > > > /Anders > > > >> On 19 apr. 2016, at 04:56, 常 超 <cha...@ho...> wrote: >> >> Hi,everyone. >> >> Is there a way to calculate the (Moore-Penrose) pseudo-inverse of a matrix just as numpy.linalg.pinv() does in python? >> I used SingularValue.makePrimitive().invert(matrix),but the result does not equals to the pinv result. >> >> Reference: >> http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.linalg.pinv.html >> >> Thanks in advance. >> Chao. >> ------------------------------------------------------------------------------ >> Find and fix application performance issues faster with Applications Manager >> Applications Manager provides deep performance insights into multiple tiers of >> your business applications. It resolves application problems quickly and >> reduces your MTTR. Get your free trial! >> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ >> ojAlgo-user mailing list >> ojA...@li... >> https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Anders P. <an...@op...> - 2016-04-19 21:12:18
|
Checking the pseudoinverse is part of the unit tests for the SVD implementations, but the tests are typically done with smaller matrices. My guess is, as you also mentioned, that this is probably an accuracy problem that becomes more severe with larger matrices. I’ll have a look at this, but can’t promise anything about the solution. If you have a look inside RawSingularValue and SingularValueDecomposition I believe you’ll find code similar to what’s that page you linked to. Most likely the problem is there. /Anders > On 19 apr. 2016, at 10:19, 常 超 <cha...@ho...> wrote: > > > Hi,Anders > > Difference occured when the size of row or column is big,say a big matrix of 2000*2000. > > With the same input matrix,numpy and the following java code returns almost the same result, > While ojAlgo returns a different value. > > http://the-lost-beauty.blogspot.jp/2009/04/moore-penrose-pseudoinverse-in-jama.html > The basic properties are not met. > > > I used the compare code in the above article to check the property, > numpy and the the implementation in the above article passed, > But ojAlgo failed. > Is it just a problem of accuracy of ojAlgo when calcularing pseudo-inverse for a big matrix? > > boolean c1 = checkEquality(A.times(Aplus).times(A), A); > boolean c2 = checkEquality(Aplus.times(A).times(Aplus), Aplus); > boolean c3 = checkEquality(A.times(Aplus), A.times(Aplus).transpose()); > boolean c4 = checkEquality(Aplus.times(A), Aplus.times(A).transpose()); > > public static boolean checkEquality(Matrix A, Matrix B) { > return A.minus(B).normInf() < 1e-9; > } > > If needed,I can post my test data.(It is in a big test file container the double value of a 2000*2000 matrix,about 77M byte) > > Chao. > ________________________________________ > 发件人: Anders Peterson <an...@op...> > 发送时间: 2016年4月19日 15:07 > 收件人: oja...@li... > 主题: Re: [ojAlgo-user] How to compute the (Moore-Penrose) pseudo-inverse of a matrix. > > It should return the pseudoinverse. How are the results different? > > Please verify these basic properties on both the ojAlgo and numpy results. > > https://en.wikipedia.org/wiki/Moore–Penrose_pseudoinverse#Basic_properties > > If both fulfil those then check which has the smallest frobeninius norm. > > > Let me know what you learn. > > > /Anders > > > >> On 19 apr. 2016, at 04:56, 常 超 <cha...@ho...> wrote: >> >> Hi,everyone. >> >> Is there a way to calculate the (Moore-Penrose) pseudo-inverse of a matrix just as numpy.linalg.pinv() does in python? >> I used SingularValue.makePrimitive().invert(matrix),but the result does not equals to the pinv result. >> >> Reference: >> http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.linalg.pinv.html >> >> Thanks in advance. >> Chao. >> ------------------------------------------------------------------------------ >> Find and fix application performance issues faster with Applications Manager >> Applications Manager provides deep performance insights into multiple tiers of >> your business applications. It resolves application problems quickly and >> reduces your MTTR. Get your free trial! >> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ >> ojAlgo-user mailing list >> ojA...@li... >> https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: 常 超 <cha...@ho...> - 2016-04-19 08:20:00
|
Hi,Anders Difference occured when the size of row or column is big,say a big matrix of 2000*2000. With the same input matrix,numpy and the following java code returns almost the same result, While ojAlgo returns a different value. http://the-lost-beauty.blogspot.jp/2009/04/moore-penrose-pseudoinverse-in-jama.html The basic properties are not met. I used the compare code in the above article to check the property, numpy and the the implementation in the above article passed, But ojAlgo failed. Is it just a problem of accuracy of ojAlgo when calcularing pseudo-inverse for a big matrix? boolean c1 = checkEquality(A.times(Aplus).times(A), A); boolean c2 = checkEquality(Aplus.times(A).times(Aplus), Aplus); boolean c3 = checkEquality(A.times(Aplus), A.times(Aplus).transpose()); boolean c4 = checkEquality(Aplus.times(A), Aplus.times(A).transpose()); public static boolean checkEquality(Matrix A, Matrix B) { return A.minus(B).normInf() < 1e-9; } If needed,I can post my test data.(It is in a big test file container the double value of a 2000*2000 matrix,about 77M byte) Chao. ________________________________________ 发件人: Anders Peterson <an...@op...> 发送时间: 2016年4月19日 15:07 收件人: oja...@li... 主题: Re: [ojAlgo-user] How to compute the (Moore-Penrose) pseudo-inverse of a matrix. It should return the pseudoinverse. How are the results different? Please verify these basic properties on both the ojAlgo and numpy results. https://en.wikipedia.org/wiki/Moore–Penrose_pseudoinverse#Basic_properties If both fulfil those then check which has the smallest frobeninius norm. Let me know what you learn. /Anders > On 19 apr. 2016, at 04:56, 常 超 <cha...@ho...> wrote: > > Hi,everyone. > > Is there a way to calculate the (Moore-Penrose) pseudo-inverse of a matrix just as numpy.linalg.pinv() does in python? > I used SingularValue.makePrimitive().invert(matrix),but the result does not equals to the pinv result. > > Reference: > http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.linalg.pinv.html > > Thanks in advance. > Chao. > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Anders P. <an...@op...> - 2016-04-19 06:07:43
|
It should return the pseudoinverse. How are the results different? Please verify these basic properties on both the ojAlgo and numpy results. https://en.wikipedia.org/wiki/Moore–Penrose_pseudoinverse#Basic_properties If both fulfil those then check which has the smallest frobeninius norm. Let me know what you learn. /Anders > On 19 apr. 2016, at 04:56, 常 超 <cha...@ho...> wrote: > > Hi,everyone. > > Is there a way to calculate the (Moore-Penrose) pseudo-inverse of a matrix just as numpy.linalg.pinv() does in python? > I used SingularValue.makePrimitive().invert(matrix),but the result does not equals to the pinv result. > > Reference: > http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.linalg.pinv.html > > Thanks in advance. > Chao. > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: 常 超 <cha...@ho...> - 2016-04-19 02:56:22
|
Hi,everyone. Is there a way to calculate the (Moore-Penrose) pseudo-inverse of a matrix just as numpy.linalg.pinv() does in python? I used SingularValue.makePrimitive().invert(matrix),but the result does not equals to the pinv result. Reference: http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.linalg.pinv.html Thanks in advance. Chao. |
From: Nico P. <Nic...@gm...> - 2016-03-17 09:12:57
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>I think it's easier if I send you some code that generates the model. I can write some code to generate this code automatically, but it takes some time. I can probably do it next week.</div> <div> </div> <div>I also realized that there might be another reason for the problem. What happens in the problem is basically that a sequence of LSE minimization problems is solved. The first problem looks like</div> <div> </div> <div>min x' (A1' A1) x</div> <div>s.t. B x <= b</div> <div> </div> <div>The feasible region is guaranteed to be non-empty. The solutions can be characterized by the equations</div> <div> </div> <div>B x <= b</div> <div>A1 x = c1,</div> <div> </div> <div>where c1 = A1 s for some solution s. Then the next problem is</div> <div> <div> </div> <div>min x' (A2' A2) x</div> <div>s.t. B x <= b</div> <div> A1 s = c1</div> <div> </div> <div>So we demand minimal violation of the constraints in A1 and now minimize the error for A2. This yields again an equation system A2 x = c2 and the next problem is <div> <div> </div> <div>min x' (A3' A3) x</div> <div>s.t. B x <= b</div> <div> A1 s = c1 <div> A2 s = c2</div> <div> </div> <div>Infeasibility occurs at the fourth level in v39.7. I guess this can be due to problems with numerical accuracy. Actually, when I first used v37, I was kind of surprised that all problems could be solved without slightly relaxing the minimality constraints. If the new algorithm provides better runtime guarantees at the cost of accuracy, this could be a reasonable explanation.</div> </div> </div> </div> </div> <div>Best regards</div> <div>Nico</div> <div> </div> <div> </div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Mittwoch, 16. März 2016 um 14:23 Uhr<br/> <b>Von:</b> "Anders Peterson" <an...@op...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div name="quoted-content">Ok, that doesn’t work. The toString method of the individual matrices is “intelligent” enough to not print the entire matrices when they’re too large. (I forgot about that.)<br/> <br/> Had the model instance been smaller this would have printed all the internal matrices used by the solver. I could have used that to construct a test case.<br/> <br/> MatrixUtils.toString(Access2D<?>) contains the code for the matrices toString method.<br/> <br/> <br/> /Anders<br/> <br/> <br/> <br/> > On 16 mars 2016, at 13:31, Nico Potyka <Nic...@gm...> wrote:<br/> ><br/> > Do you mean the object tmpSolver? It's an instance of IterativeMixedASS and seems to inherit toString from the BaseSolver, so it basically returns some matrices:<br/> ><br/> > <Builder><br/> > [AE] = org.ojalgo.matrix.PrimitiveMatrix < 1 x 100 ><br/> > [BE] = org.ojalgo.matrix.PrimitiveMatrix < 1 x 1 ><br/> > { { 1.0 } }<br/> > [Q] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 100 ><br/> > [C] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 1 ><br/> > [AI] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 100 ><br/> > [BI] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 1 ><br/> > [X] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 1 ><br/> > [SE] = org.ojalgo.matrix.PrimitiveMatrix < 1 x 1 ><br/> > { { -2.7197835095194023E-9 } }<br/> > [SI] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 1 ><br/> > </Builder><br/> ><br/> ><br/> ><br/> > Gesendet: Mittwoch, 16. März 2016 um 13:02 Uhr<br/> > Von: "Anders Peterson" <an...@op...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > toString() of the solver, not the model. You have to somehow step into (or modify) ojAlgo’s code. Setting a suitable breakpoint with the debugger in ExpressionsBasedModel's solve(…) method should be enough.<br/> ><br/> ><br/> > > On 16 mars 2016, at 12:45, Nico Potyka <Nic...@gm...> wrote:<br/> > ><br/> > > Of course I can send you the output of the toString-method. I didn't think it will help much. I attach it below. As I explained, it's not easy to generate a straightforward test case. However, I will try to automatically generate code that creates the optimization problem without the need for the whole library, when I find some time. By the way, I don't expect you to find a solution to the problem without further information, I am just responding to your questions.<br/> > ><br/> > ><br/> > > Status: INFEASIBLE<br/> > ><br/> > ><br/> > ><br/> > > Solver:<br/> > > ############################################<br/> > > 0 <= p0: 0<br/> > > 0 <= p1: 0<br/> > > 0 <= p2: 0<br/> > > 0 <= p3: 0<br/> > > 0 <= p4: 0<br/> > > 0 <= p5: 0<br/> > > 0 <= p6: 0<br/> > > 0 <= p7: 0<br/> > > 0 <= p8: 0<br/> > > 0 <= p9: 0<br/> > > 0 <= p10: 0<br/> > > 0 <= p11: 0<br/> > > 0 <= p12: 0<br/> > > 0 <= p13: 0<br/> > > 0 <= p14: 0<br/> > > 0 <= p15: 0<br/> > > 0 <= p16: 0<br/> > > 0 <= p17: 0<br/> > > 0 <= p18: 0<br/> > > 0 <= p19: 0<br/> > > 0 <= p20: 0<br/> > > 0 <= p21: 0<br/> > > 0 <= p22: 0<br/> > > 0 <= p23: 0<br/> > > 0 <= p24: 0<br/> > > 0 <= p25: 0<br/> > > 0 <= p26: 0<br/> > > 0 <= p27: 0<br/> > > 0 <= p28: 0<br/> > > 0 <= p29: 0<br/> > > 0 <= p30: 0<br/> > > 0 <= p31: 0<br/> > > 0 <= p32: 0<br/> > > 0 <= p33: 0<br/> > > 0 <= p34: 0<br/> > > 0 <= p35: 0<br/> > > 0 <= p36: 0<br/> > > 0 <= p37: 0<br/> > > 0 <= p38: 0<br/> > > 0 <= p39: 0<br/> > > 0 <= p40: 0<br/> > > 0 <= p41: 0<br/> > > 0 <= p42: 0<br/> > > 0 <= p43: 0<br/> > > 0 <= p44: 0<br/> > > 0 <= p45: 0<br/> > > 0 <= p46: 0<br/> > > 0 <= p47: 0<br/> > > 0 <= p48: 0<br/> > > 0 <= p49: 0<br/> > > 0 <= p50: 0<br/> > > 0 <= p51: 0<br/> > > 0 <= p52: 0<br/> > > 0 <= p53: 0<br/> > > 0 <= p54: 0<br/> > > 0 <= p55: 0<br/> > > 0 <= p56: 0<br/> > > 0 <= p57: 0<br/> > > 0 <= p58: 0<br/> > > 0 <= p59: 0<br/> > > 0 <= p60: 0<br/> > > 0 <= p61: 0<br/> > > 0 <= p62: 0<br/> > > 0 <= p63: 0<br/> > > 0 <= p64: 0<br/> > > 0 <= p65: 0<br/> > > 0 <= p66: 0<br/> > > 0 <= p67: 0<br/> > > 0 <= p68: 0<br/> > > 0 <= p69: 0<br/> > > 0 <= p70: 0<br/> > > 0 <= p71: 0<br/> > > 0 <= p72: 0<br/> > > 0 <= p73: 0<br/> > > 0 <= p74: 0<br/> > > 0 <= p75: 0<br/> > > 0 <= p76: 0<br/> > > 0 <= p77: 0<br/> > > 0 <= p78: 0<br/> > > 0 <= p79: 0<br/> > > 0 <= p80: 0<br/> > > 0 <= p81: 0<br/> > > 0 <= p82: 0<br/> > > 0 <= p83: 0<br/> > > 0 <= p84: 0<br/> > > 0 <= p85: 0<br/> > > 0 <= p86: 0<br/> > > 0 <= p87: 0<br/> > > 0 <= p88: 0<br/> > > 0 <= p89: 0<br/> > > 0 <= p90: 0<br/> > > 0 <= p91: 0<br/> > > 0 <= p92: 0<br/> > > 0 <= p93: 0<br/> > > 0 <= p94: 0<br/> > > 0 <= p95: 0<br/> > > 0 <= p96: 0<br/> > > 0 <= p97: 0<br/> > > 0 <= p98: 0<br/> > > 0 <= p99: 0<br/> > > 0.000001 <= subset of level 3 constraint 0: 0.0 <= 0.000001<br/> > > 0.000001 <= subset of level 3 constraint 1: 0.0 <= 0.000001<br/> > > 0 <= subset of level 5 constraint 0: 0.0 <= 0<br/> > > 0.700000 <= subset of level 3 constraint 2: 0.0 <= 0.700000<br/> > > 0 <= integrityConstraint4: 0.0 <= 0<br/> > > 0 <= subset of level 3 constraint 3: 0.0 <= 0<br/> > > 0 <= integrityConstraint5: 0.0 <= 0<br/> > > 0 <= integrityConstraint2: 0.0 <= 0<br/> > > 0 <= integrityConstraint3: 0.0 <= 0<br/> > > 0 <= integrityConstraint0: 0.0 <= 0<br/> > > 0 <= integrityConstraint1: 0.0 <= 0<br/> > > Objective: 0.0 (1.000000)<br/> > > 1.000000 <= Normalization: 0.0 <= 1.000000<br/> > > 0 <= subset of level 4 constraint 4: 0.0 <= 0<br/> > > 0 <= subset of level 4 constraint 5: 0.0 <= 0<br/> > > 0 <= subset of level 5 constraint 1: 0.0 <= 0<br/> > > 0 <= subset of level 4 constraint 2: 0.0 <= 0<br/> > > 0 <= subset of level 5 constraint 2: 0.0 <= 0<br/> > > 0 <= subset of level 4 constraint 3: 0.0 <= 0<br/> > > 0 <= subset of level 4 constraint 0: 0.0 <= 0<br/> > > 0 <= subset of level 4 constraint 1: 0.0 <= 0<br/> > > ############################################<br/> > ><br/> > ><br/> > ><br/> > > Gesendet: Mittwoch, 16. März 2016 um 11:12 Uhr<br/> > > Von: "Anders Peterson" <an...@op...><br/> > > An: oja...@li...<br/> > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > The setLinearFactor and setQuadraticFactor methods are deprecated but still do what they’ve always done. You should change your code to use the new alternatives.<br/> > ><br/> > ><br/> > > RE multiply, either you change:<br/> > ><br/> > > A.multiplyLeft(B) => B.multiply(A)<br/> > ><br/> > > or<br/> > ><br/> > > A.multiplyLeft(B) => A.multiplyLeft(B).get()<br/> > ><br/> > ><br/> > ><br/> > > RE your results with with v39.7:<br/> > ><br/> > > Since v37 the solvers have changed internally so I’m not very surprised that “someone” notices a change in behaviour. However all (previously existing) test cases related to convex optimisation pass! Unless you provide we with a test case I can’t do more. Your options are.<br/> > ><br/> > > 1) stick with v37<br/> > > 2) experiment with ways to reformulate your models<br/> > > 3) provide me with test cases that demonstrate your problem<br/> > ><br/> > > BTW I’m very surprised to hear that v39.7 fails to find a feasible solution.<br/> > ><br/> > > Modify your code to print each solver instance’ toString method and set a break point at when an infeasible solution is returned. That can’t be very hard to do.<br/> > ><br/> > ><br/> > > /Anders<br/> > ><br/> > ><br/> > ><br/> > > > On 16 mars 2016, at 10:31, Nico Potyka <Nic...@gm...> wrote:<br/> > > ><br/> > > > Another thing: I just noticed that the methods setLinearFactor and setQuadraticFactor of Expression are deprecated now. Could the use of these methods cause problems?<br/> > > ><br/> > > ><br/> > > ><br/> > > > Gesendet: Mittwoch, 16. März 2016 um 10:27 Uhr<br/> > > > Von: "Nico Potyka" <Nic...@gm...><br/> > > > An: oja...@li...<br/> > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > Just to make sure that there is not another problem: the matrix multiplication interface changed. So i replaced some lines with code like<br/> > > ><br/> > > > A.multiplyLeft(B)<br/> > > ><br/> > > > with<br/> > > ><br/> > > > B.multiply(A).<br/> > > ><br/> > > > Best wishes<br/> > > > Nico<br/> > > ><br/> > > ><br/> > > ><br/> > > > Gesendet: Mittwoch, 16. März 2016 um 10:23 Uhr<br/> > > > Von: "Nico Potyka" <Nic...@gm...><br/> > > > An: oja...@li...<br/> > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > Thanks, I tried it. Now the algorithms fails to find a feasible solution. However, the problem is guaranteed to be feasible and the algorithm from version 37 seems to find the correct solutions.<br/> > > ><br/> > > > Best<br/> > > > Nico<br/> > > ><br/> > > ><br/> > > ><br/> > > > Gesendet: Dienstag, 15. März 2016 um 23:18 Uhr<br/> > > > Von: "Anders Peterson" <an...@op...><br/> > > > An: oja...@li...<br/> > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > There is a new snapshot build v39.7 available at sourceforge:<br/> > > ><br/> > > > <a href="https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/" target="_blank">https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/</a><br/> > > ><br/> > > > Currently all test cases related to convex optimisation pass. Could you try it?<br/> > > ><br/> > > > /Anders<br/> > > ><br/> > > ><br/> > > > > On 9 mars 2016, at 10:45, Nico Potyka <Nic...@gm...> wrote:<br/> > > > ><br/> > > > > Sorry, I forgot to turn validation off. After turning validation off, there is no exception and it often says KKT system unsolvable as you already suspected.<br/> > > > ><br/> > > > ><br/> > > > > Gesendet: Mittwoch, 09. März 2016 um 10:39 Uhr<br/> > > > > Von: "Nico Potyka" <Nic...@gm...><br/> > > > > An: oja...@li...<br/> > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > > Thanks for all the hints. When I activate the debugging mode I actually get an exception:<br/> > > > ><br/> > > > > Exception in thread "main" java.lang.IllegalArgumentException: Q must be positive semidefinite!<br/> > > > ><br/> > > > > However, there is no exception without the debugging mode. I actually check the result for optimality with<br/> > > > ><br/> > > > > Result result = tmpModel.minimise();<br/> > > > > if(result.getState() == Optimisation.State.OPTIMAL) {<br/> > > > > ...<br/> > > > ><br/> > > > > So it seems that the solver regards the computed solutions indeed as optimal.<br/> > > > ><br/> > > > ><br/> > > > > I would love to send you a simple test case, but the example is rather complex and I currently don't find time to extract<br/> > > > > a straightforward example that shows this behaviour. You can find the project in the SVN repository<br/> > > > ><br/> > > > > ssh://svn.code.sf.net/p/kreator-ide/code/<br/> > > > ><br/> > > > > in the folder<br/> > > > ><br/> > > > > Software/Log4KR<br/> > > > ><br/> > > > > The test case is in the class<br/> > > > ><br/> > > > > /Log4KR/sourceExamples/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityReasoningExamples.java<br/> > > > ><br/> > > > > The problematic optimization problem is defined in the class<br/> > > > ><br/> > > > > /Log4KR/src/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityEntailment2Norm.java<br/> > > > ><br/> > > > > in the method initialize. The ExpressionBasedModel is initialized in line 87. If you want to try with this example,<br/> > > > > I can give you more details. Then you might also want to check out revision 3911, which still contained Ojalgo37<br/> > > > > and worked fine. Of course, I don't expect that you do because the example is rather complex. However, I will try to<br/> > > > > find some time to extract a straightforward example.<br/> > > > ><br/> > > > > Best wishes<br/> > > > > Nico<br/> > > > ><br/> > > > ><br/> > > > ><br/> > > > > Gesendet: Dienstag, 08. März 2016 um 12:59 Uhr<br/> > > > > Von: "Anders Peterson" <an...@op...><br/> > > > > An: oja...@li...<br/> > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > > When you do<br/> > > > ><br/> > > > > tmpModel.options.debug(ConvexSolver.class);<br/> > > > ><br/> > > > > it turns on debugging of that solver AND validation of the model/solver data.<br/> > > > ><br/> > > > > It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off.<br/> > > > ><br/> > > > > tmpModel.options.validate = false;<br/> > > > ><br/> > > > ><br/> > > > > With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”?<br/> > > > ><br/> > > > > Are the solutions you get feasible, but not (always) optimal?<br/> > > > ><br/> > > > ><br/> > > > > I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE.<br/> > > > ><br/> > > > ><br/> > > > > Still interested in getting some test case from you.<br/> > > > ><br/> > > > ><br/> > > > > /Anders<br/> > > > ><br/> > > > ><br/> > > > ><br/> > > > > > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote:<br/> > > > > ><br/> > > > > > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you.<br/> > > > > ><br/> > > > > > Best regards<br/> > > > > > Nico<br/> > > > > ><br/> > > > > ><br/> > > > > ><br/> > > > > > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr<br/> > > > > > Von: "Anders Peterson" <an...@op...><br/> > > > > > An: oja...@li...<br/> > > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > > > A common QP should be ok with v39.0 - I’d very much like to know what problems you have.<br/> > > > > ><br/> > > > > > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method.<br/> > > > > ><br/> > > > > > If you can construct a test case using ExpressionsBasedModel, that would be better.<br/> > > > > ><br/> > > > > > /Anders<br/> > > > > ><br/> > > > > ><br/> > > > > ><br/> > > > > > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote:<br/> > > > > > ><br/> > > > > > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time.<br/> > > > > > ><br/> > > > > > > Thanks for the hints on debugging.<br/> > > > > > ><br/> > > > > > ><br/> > > > > > ><br/> > > > > > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr<br/> > > > > > > Von: "Anders Peterson" <an...@op...><br/> > > > > > > An: oja...@li...<br/> > > > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > > > > Do you have integer variables?<br/> > > > > > ><br/> > > > > > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.)<br/> > > > > > ><br/> > > > > > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”.<br/> > > > > > ><br/> > > > > > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you.<br/> > > > > > ><br/> > > > > > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that.<br/> > > > > > ><br/> > > > > > > Are you aware that you can get debug output from the solvers?<br/> > > > > > > Do this:<br/> > > > > > ><br/> > > > > > > model.options.debug(ConvexSolver.class);<br/> > > > > > ><br/> > > > > > ><br/> > > > > > > If you don’t have any other way to construct a test case, you can try this:<br/> > > > > > ><br/> > > > > > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy.<br/> > > > > > ><br/> > > > > > ><br/> > > > > > > /Anders<br/> > > > > > ><br/> > > > > > ><br/> > > > > > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote:<br/> > > > > > > ><br/> > > > > > > > Hi everybody,<br/> > > > > > > ><br/> > > > > > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm?<br/> > > > > > > ><br/> > > > > > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated.<br/> > > > > > > ><br/> > > > > > > > Best<br/> > > > > > > > Nico<br/> > > > > > > > ------------------------------------------------------------------------------<br/> > > > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > > > > > ojAlgo-user mailing list<br/> > > > > > > > ojA...@li...<br/> > > > > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > > > ><br/> > > > > > ><br/> > > > > > > ------------------------------------------------------------------------------<br/> > > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > > > > > _______________________________________________<br/> > > > > > > ojAlgo-user mailing list<br/> > > > > > > ojA...@li...<br/> > > > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > > > > ------------------------------------------------------------------------------<br/> > > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > > > > ojAlgo-user mailing list<br/> > > > > > > ojA...@li...<br/> > > > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > > ><br/> > > > > ><br/> > > > > > ------------------------------------------------------------------------------<br/> > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > > > > _______________________________________________<br/> > > > > > ojAlgo-user mailing list<br/> > > > > > ojA...@li...<br/> > > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > > > ------------------------------------------------------------------------------<br/> > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > > > ojAlgo-user mailing list<br/> > > > > > ojA...@li...<br/> > > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > ><br/> > > > ><br/> > > > > ------------------------------------------------------------------------------<br/> > > > > Transform Data into Opportunity.<br/> > > > > Accelerate data analysis in your applications with<br/> > > > > Intel Data Analytics Acceleration Library.<br/> > > > > Click to learn more.<br/> > > > > <a href="http://makebettercode.com/inteldaal-eval" target="_blank">http://makebettercode.com/inteldaal-eval</a><br/> > > > > _______________________________________________<br/> > > > > ojAlgo-user mailing list<br/> > > > > ojA...@li...<br/> > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > > ------------------------------------------------------------------------------<br/> > > > > Transform Data into Opportunity.<br/> > > > > Accelerate data analysis in your applications with<br/> > > > > Intel Data Analytics Acceleration Library.<br/> > > > > Click to learn more.<br/> > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a><br/> > > > > ojAlgo-user mailing list<br/> > > > > ojA...@li...<br/> > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ><br/> > > ><br/> > > > ------------------------------------------------------------------------------<br/> > > > Transform Data into Opportunity.<br/> > > > Accelerate data analysis in your applications with<br/> > > > Intel Data Analytics Acceleration Library.<br/> > > > Click to learn more.<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140</a><br/> > > > _______________________________________________<br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > ------------------------------------------------------------------------------<br/> > > > Transform Data into Opportunity.<br/> > > > Accelerate data analysis in your applications with<br/> > > > Intel Data Analytics Acceleration Library.<br/> > > > Click to learn more.<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a><br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ><br/> > ><br/> > > ------------------------------------------------------------------------------<br/> > > Transform Data into Opportunity.<br/> > > Accelerate data analysis in your applications with<br/> > > Intel Data Analytics Acceleration Library.<br/> > > Click to learn more.<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140</a><br/> > > _______________________________________________<br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ------------------------------------------------------------------------------<br/> > > Transform Data into Opportunity.<br/> > > Accelerate data analysis in your applications with<br/> > > Intel Data Analytics Acceleration Library.<br/> > > Click to learn more.<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a><br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> ><br/> ><br/> > ------------------------------------------------------------------------------<br/> > Transform Data into Opportunity.<br/> > Accelerate data analysis in your applications with<br/> > Intel Data Analytics Acceleration Library.<br/> > Click to learn more.<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140</a><br/> > _______________________________________________<br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------<br/> > Transform Data into Opportunity.<br/> > Accelerate data analysis in your applications with<br/> > Intel Data Analytics Acceleration Library.<br/> > Click to learn more.<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a><br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> <br/> <br/> ------------------------------------------------------------------------------<br/> Transform Data into Opportunity.<br/> Accelerate data analysis in your applications with<br/> Intel Data Analytics Acceleration Library.<br/> Click to learn more.<br/> <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140</a><br/> _______________________________________________<br/> ojAlgo-user mailing list<br/> ojA...@li...<br/> <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div></div></body></html> |
From: Anders P. <an...@op...> - 2016-03-16 13:23:46
|
Ok, that doesn’t work. The toString method of the individual matrices is “intelligent” enough to not print the entire matrices when they’re too large. (I forgot about that.) Had the model instance been smaller this would have printed all the internal matrices used by the solver. I could have used that to construct a test case. MatrixUtils.toString(Access2D<?>) contains the code for the matrices toString method. /Anders > On 16 mars 2016, at 13:31, Nico Potyka <Nic...@gm...> wrote: > > Do you mean the object tmpSolver? It's an instance of IterativeMixedASS and seems to inherit toString from the BaseSolver, so it basically returns some matrices: > > <Builder> > [AE] = org.ojalgo.matrix.PrimitiveMatrix < 1 x 100 > > [BE] = org.ojalgo.matrix.PrimitiveMatrix < 1 x 1 > > { { 1.0 } } > [Q] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 100 > > [C] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 1 > > [AI] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 100 > > [BI] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 1 > > [X] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 1 > > [SE] = org.ojalgo.matrix.PrimitiveMatrix < 1 x 1 > > { { -2.7197835095194023E-9 } } > [SI] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 1 > > </Builder> > > > > Gesendet: Mittwoch, 16. März 2016 um 13:02 Uhr > Von: "Anders Peterson" <an...@op...> > An: oja...@li... > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > toString() of the solver, not the model. You have to somehow step into (or modify) ojAlgo’s code. Setting a suitable breakpoint with the debugger in ExpressionsBasedModel's solve(…) method should be enough. > > > > On 16 mars 2016, at 12:45, Nico Potyka <Nic...@gm...> wrote: > > > > Of course I can send you the output of the toString-method. I didn't think it will help much. I attach it below. As I explained, it's not easy to generate a straightforward test case. However, I will try to automatically generate code that creates the optimization problem without the need for the whole library, when I find some time. By the way, I don't expect you to find a solution to the problem without further information, I am just responding to your questions. > > > > > > Status: INFEASIBLE > > > > > > > > Solver: > > ############################################ > > 0 <= p0: 0 > > 0 <= p1: 0 > > 0 <= p2: 0 > > 0 <= p3: 0 > > 0 <= p4: 0 > > 0 <= p5: 0 > > 0 <= p6: 0 > > 0 <= p7: 0 > > 0 <= p8: 0 > > 0 <= p9: 0 > > 0 <= p10: 0 > > 0 <= p11: 0 > > 0 <= p12: 0 > > 0 <= p13: 0 > > 0 <= p14: 0 > > 0 <= p15: 0 > > 0 <= p16: 0 > > 0 <= p17: 0 > > 0 <= p18: 0 > > 0 <= p19: 0 > > 0 <= p20: 0 > > 0 <= p21: 0 > > 0 <= p22: 0 > > 0 <= p23: 0 > > 0 <= p24: 0 > > 0 <= p25: 0 > > 0 <= p26: 0 > > 0 <= p27: 0 > > 0 <= p28: 0 > > 0 <= p29: 0 > > 0 <= p30: 0 > > 0 <= p31: 0 > > 0 <= p32: 0 > > 0 <= p33: 0 > > 0 <= p34: 0 > > 0 <= p35: 0 > > 0 <= p36: 0 > > 0 <= p37: 0 > > 0 <= p38: 0 > > 0 <= p39: 0 > > 0 <= p40: 0 > > 0 <= p41: 0 > > 0 <= p42: 0 > > 0 <= p43: 0 > > 0 <= p44: 0 > > 0 <= p45: 0 > > 0 <= p46: 0 > > 0 <= p47: 0 > > 0 <= p48: 0 > > 0 <= p49: 0 > > 0 <= p50: 0 > > 0 <= p51: 0 > > 0 <= p52: 0 > > 0 <= p53: 0 > > 0 <= p54: 0 > > 0 <= p55: 0 > > 0 <= p56: 0 > > 0 <= p57: 0 > > 0 <= p58: 0 > > 0 <= p59: 0 > > 0 <= p60: 0 > > 0 <= p61: 0 > > 0 <= p62: 0 > > 0 <= p63: 0 > > 0 <= p64: 0 > > 0 <= p65: 0 > > 0 <= p66: 0 > > 0 <= p67: 0 > > 0 <= p68: 0 > > 0 <= p69: 0 > > 0 <= p70: 0 > > 0 <= p71: 0 > > 0 <= p72: 0 > > 0 <= p73: 0 > > 0 <= p74: 0 > > 0 <= p75: 0 > > 0 <= p76: 0 > > 0 <= p77: 0 > > 0 <= p78: 0 > > 0 <= p79: 0 > > 0 <= p80: 0 > > 0 <= p81: 0 > > 0 <= p82: 0 > > 0 <= p83: 0 > > 0 <= p84: 0 > > 0 <= p85: 0 > > 0 <= p86: 0 > > 0 <= p87: 0 > > 0 <= p88: 0 > > 0 <= p89: 0 > > 0 <= p90: 0 > > 0 <= p91: 0 > > 0 <= p92: 0 > > 0 <= p93: 0 > > 0 <= p94: 0 > > 0 <= p95: 0 > > 0 <= p96: 0 > > 0 <= p97: 0 > > 0 <= p98: 0 > > 0 <= p99: 0 > > 0.000001 <= subset of level 3 constraint 0: 0.0 <= 0.000001 > > 0.000001 <= subset of level 3 constraint 1: 0.0 <= 0.000001 > > 0 <= subset of level 5 constraint 0: 0.0 <= 0 > > 0.700000 <= subset of level 3 constraint 2: 0.0 <= 0.700000 > > 0 <= integrityConstraint4: 0.0 <= 0 > > 0 <= subset of level 3 constraint 3: 0.0 <= 0 > > 0 <= integrityConstraint5: 0.0 <= 0 > > 0 <= integrityConstraint2: 0.0 <= 0 > > 0 <= integrityConstraint3: 0.0 <= 0 > > 0 <= integrityConstraint0: 0.0 <= 0 > > 0 <= integrityConstraint1: 0.0 <= 0 > > Objective: 0.0 (1.000000) > > 1.000000 <= Normalization: 0.0 <= 1.000000 > > 0 <= subset of level 4 constraint 4: 0.0 <= 0 > > 0 <= subset of level 4 constraint 5: 0.0 <= 0 > > 0 <= subset of level 5 constraint 1: 0.0 <= 0 > > 0 <= subset of level 4 constraint 2: 0.0 <= 0 > > 0 <= subset of level 5 constraint 2: 0.0 <= 0 > > 0 <= subset of level 4 constraint 3: 0.0 <= 0 > > 0 <= subset of level 4 constraint 0: 0.0 <= 0 > > 0 <= subset of level 4 constraint 1: 0.0 <= 0 > > ############################################ > > > > > > > > Gesendet: Mittwoch, 16. März 2016 um 11:12 Uhr > > Von: "Anders Peterson" <an...@op...> > > An: oja...@li... > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > The setLinearFactor and setQuadraticFactor methods are deprecated but still do what they’ve always done. You should change your code to use the new alternatives. > > > > > > RE multiply, either you change: > > > > A.multiplyLeft(B) => B.multiply(A) > > > > or > > > > A.multiplyLeft(B) => A.multiplyLeft(B).get() > > > > > > > > RE your results with with v39.7: > > > > Since v37 the solvers have changed internally so I’m not very surprised that “someone” notices a change in behaviour. However all (previously existing) test cases related to convex optimisation pass! Unless you provide we with a test case I can’t do more. Your options are. > > > > 1) stick with v37 > > 2) experiment with ways to reformulate your models > > 3) provide me with test cases that demonstrate your problem > > > > BTW I’m very surprised to hear that v39.7 fails to find a feasible solution. > > > > Modify your code to print each solver instance’ toString method and set a break point at when an infeasible solution is returned. That can’t be very hard to do. > > > > > > /Anders > > > > > > > > > On 16 mars 2016, at 10:31, Nico Potyka <Nic...@gm...> wrote: > > > > > > Another thing: I just noticed that the methods setLinearFactor and setQuadraticFactor of Expression are deprecated now. Could the use of these methods cause problems? > > > > > > > > > > > > Gesendet: Mittwoch, 16. März 2016 um 10:27 Uhr > > > Von: "Nico Potyka" <Nic...@gm...> > > > An: oja...@li... > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > Just to make sure that there is not another problem: the matrix multiplication interface changed. So i replaced some lines with code like > > > > > > A.multiplyLeft(B) > > > > > > with > > > > > > B.multiply(A). > > > > > > Best wishes > > > Nico > > > > > > > > > > > > Gesendet: Mittwoch, 16. März 2016 um 10:23 Uhr > > > Von: "Nico Potyka" <Nic...@gm...> > > > An: oja...@li... > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > Thanks, I tried it. Now the algorithms fails to find a feasible solution. However, the problem is guaranteed to be feasible and the algorithm from version 37 seems to find the correct solutions. > > > > > > Best > > > Nico > > > > > > > > > > > > Gesendet: Dienstag, 15. März 2016 um 23:18 Uhr > > > Von: "Anders Peterson" <an...@op...> > > > An: oja...@li... > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > There is a new snapshot build v39.7 available at sourceforge: > > > > > > https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/ > > > > > > Currently all test cases related to convex optimisation pass. Could you try it? > > > > > > /Anders > > > > > > > > > > On 9 mars 2016, at 10:45, Nico Potyka <Nic...@gm...> wrote: > > > > > > > > Sorry, I forgot to turn validation off. After turning validation off, there is no exception and it often says KKT system unsolvable as you already suspected. > > > > > > > > > > > > Gesendet: Mittwoch, 09. März 2016 um 10:39 Uhr > > > > Von: "Nico Potyka" <Nic...@gm...> > > > > An: oja...@li... > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > > Thanks for all the hints. When I activate the debugging mode I actually get an exception: > > > > > > > > Exception in thread "main" java.lang.IllegalArgumentException: Q must be positive semidefinite! > > > > > > > > However, there is no exception without the debugging mode. I actually check the result for optimality with > > > > > > > > Result result = tmpModel.minimise(); > > > > if(result.getState() == Optimisation.State.OPTIMAL) { > > > > ... > > > > > > > > So it seems that the solver regards the computed solutions indeed as optimal. > > > > > > > > > > > > I would love to send you a simple test case, but the example is rather complex and I currently don't find time to extract > > > > a straightforward example that shows this behaviour. You can find the project in the SVN repository > > > > > > > > ssh://svn.code.sf.net/p/kreator-ide/code/ > > > > > > > > in the folder > > > > > > > > Software/Log4KR > > > > > > > > The test case is in the class > > > > > > > > /Log4KR/sourceExamples/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityReasoningExamples.java > > > > > > > > The problematic optimization problem is defined in the class > > > > > > > > /Log4KR/src/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityEntailment2Norm.java > > > > > > > > in the method initialize. The ExpressionBasedModel is initialized in line 87. If you want to try with this example, > > > > I can give you more details. Then you might also want to check out revision 3911, which still contained Ojalgo37 > > > > and worked fine. Of course, I don't expect that you do because the example is rather complex. However, I will try to > > > > find some time to extract a straightforward example. > > > > > > > > Best wishes > > > > Nico > > > > > > > > > > > > > > > > Gesendet: Dienstag, 08. März 2016 um 12:59 Uhr > > > > Von: "Anders Peterson" <an...@op...> > > > > An: oja...@li... > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > > When you do > > > > > > > > tmpModel.options.debug(ConvexSolver.class); > > > > > > > > it turns on debugging of that solver AND validation of the model/solver data. > > > > > > > > It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off. > > > > > > > > tmpModel.options.validate = false; > > > > > > > > > > > > With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”? > > > > > > > > Are the solutions you get feasible, but not (always) optimal? > > > > > > > > > > > > I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE. > > > > > > > > > > > > Still interested in getting some test case from you. > > > > > > > > > > > > /Anders > > > > > > > > > > > > > > > > > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote: > > > > > > > > > > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you. > > > > > > > > > > Best regards > > > > > Nico > > > > > > > > > > > > > > > > > > > > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr > > > > > Von: "Anders Peterson" <an...@op...> > > > > > An: oja...@li... > > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > > > A common QP should be ok with v39.0 - I’d very much like to know what problems you have. > > > > > > > > > > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method. > > > > > > > > > > If you can construct a test case using ExpressionsBasedModel, that would be better. > > > > > > > > > > /Anders > > > > > > > > > > > > > > > > > > > > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote: > > > > > > > > > > > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time. > > > > > > > > > > > > Thanks for the hints on debugging. > > > > > > > > > > > > > > > > > > > > > > > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr > > > > > > Von: "Anders Peterson" <an...@op...> > > > > > > An: oja...@li... > > > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > > > > Do you have integer variables? > > > > > > > > > > > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.) > > > > > > > > > > > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”. > > > > > > > > > > > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you. > > > > > > > > > > > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that. > > > > > > > > > > > > Are you aware that you can get debug output from the solvers? > > > > > > Do this: > > > > > > > > > > > > model.options.debug(ConvexSolver.class); > > > > > > > > > > > > > > > > > > If you don’t have any other way to construct a test case, you can try this: > > > > > > > > > > > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy. > > > > > > > > > > > > > > > > > > /Anders > > > > > > > > > > > > > > > > > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote: > > > > > > > > > > > > > > Hi everybody, > > > > > > > > > > > > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm? > > > > > > > > > > > > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated. > > > > > > > > > > > > > > Best > > > > > > > Nico > > > > > > > ------------------------------------------------------------------------------ > > > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > > > > Monitor end-to-end web transactions and take corrective actions now > > > > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > > > > > > ojAlgo-user mailing list > > > > > > > ojA...@li... > > > > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > > > Monitor end-to-end web transactions and take corrective actions now > > > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > > > > > > _______________________________________________ > > > > > > ojAlgo-user mailing list > > > > > > ojA...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > ------------------------------------------------------------------------------ > > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > > > Monitor end-to-end web transactions and take corrective actions now > > > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > > > > > ojAlgo-user mailing list > > > > > > ojA...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > > Monitor end-to-end web transactions and take corrective actions now > > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > > > > > _______________________________________________ > > > > > ojAlgo-user mailing list > > > > > ojA...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > ------------------------------------------------------------------------------ > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > > Monitor end-to-end web transactions and take corrective actions now > > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > > > > ojAlgo-user mailing list > > > > > ojA...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > Transform Data into Opportunity. > > > > Accelerate data analysis in your applications with > > > > Intel Data Analytics Acceleration Library. > > > > Click to learn more. > > > > http://makebettercode.com/inteldaal-eval > > > > _______________________________________________ > > > > ojAlgo-user mailing list > > > > ojA...@li... > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > ------------------------------------------------------------------------------ > > > > Transform Data into Opportunity. > > > > Accelerate data analysis in your applications with > > > > Intel Data Analytics Acceleration Library. > > > > Click to learn more. > > > > http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________ > > > > ojAlgo-user mailing list > > > > ojA...@li... > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > > > ------------------------------------------------------------------------------ > > > Transform Data into Opportunity. > > > Accelerate data analysis in your applications with > > > Intel Data Analytics Acceleration Library. > > > Click to learn more. > > > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 > > > _______________________________________________ > > > ojAlgo-user mailing list > > > ojA...@li... > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > > > Transform Data into Opportunity. > > > Accelerate data analysis in your applications with > > > Intel Data Analytics Acceleration Library. > > > Click to learn more. > > > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________ > > > ojAlgo-user mailing list > > > ojA...@li... > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > ------------------------------------------------------------------------------ > > Transform Data into Opportunity. > > Accelerate data analysis in your applications with > > Intel Data Analytics Acceleration Library. > > Click to learn more. > > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 > > _______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > ------------------------------------------------------------------------------ > > Transform Data into Opportunity. > > Accelerate data analysis in your applications with > > Intel Data Analytics Acceleration Library. > > Click to learn more. > > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Nico P. <Nic...@gm...> - 2016-03-16 12:32:14
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Do you mean the object tmpSolver? It's an instance of IterativeMixedASS and seems to inherit toString from the BaseSolver, so it basically returns some matrices:</div> <div> </div> <div><Builder><br/> [AE] = org.ojalgo.matrix.PrimitiveMatrix < 1 x 100 ><br/> [BE] = org.ojalgo.matrix.PrimitiveMatrix < 1 x 1 ><br/> { { 1.0 } }<br/> [Q] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 100 ><br/> [C] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 1 ><br/> [AI] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 100 ><br/> [BI] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 1 ><br/> [X] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 1 ><br/> [SE] = org.ojalgo.matrix.PrimitiveMatrix < 1 x 1 ><br/> { { -2.7197835095194023E-9 } }<br/> [SI] = org.ojalgo.matrix.PrimitiveMatrix < 100 x 1 ><br/> </Builder></div> <div> </div> <div> </div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Mittwoch, 16. März 2016 um 13:02 Uhr<br/> <b>Von:</b> "Anders Peterson" <an...@op...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div name="quoted-content">toString() of the solver, not the model. You have to somehow step into (or modify) ojAlgo’s code. Setting a suitable breakpoint with the debugger in ExpressionsBasedModel's solve(…) method should be enough.<br/> <br/> <br/> > On 16 mars 2016, at 12:45, Nico Potyka <Nic...@gm...> wrote:<br/> ><br/> > Of course I can send you the output of the toString-method. I didn't think it will help much. I attach it below. As I explained, it's not easy to generate a straightforward test case. However, I will try to automatically generate code that creates the optimization problem without the need for the whole library, when I find some time. By the way, I don't expect you to find a solution to the problem without further information, I am just responding to your questions.<br/> ><br/> ><br/> > Status: INFEASIBLE<br/> ><br/> ><br/> ><br/> > Solver:<br/> > ############################################<br/> > 0 <= p0: 0<br/> > 0 <= p1: 0<br/> > 0 <= p2: 0<br/> > 0 <= p3: 0<br/> > 0 <= p4: 0<br/> > 0 <= p5: 0<br/> > 0 <= p6: 0<br/> > 0 <= p7: 0<br/> > 0 <= p8: 0<br/> > 0 <= p9: 0<br/> > 0 <= p10: 0<br/> > 0 <= p11: 0<br/> > 0 <= p12: 0<br/> > 0 <= p13: 0<br/> > 0 <= p14: 0<br/> > 0 <= p15: 0<br/> > 0 <= p16: 0<br/> > 0 <= p17: 0<br/> > 0 <= p18: 0<br/> > 0 <= p19: 0<br/> > 0 <= p20: 0<br/> > 0 <= p21: 0<br/> > 0 <= p22: 0<br/> > 0 <= p23: 0<br/> > 0 <= p24: 0<br/> > 0 <= p25: 0<br/> > 0 <= p26: 0<br/> > 0 <= p27: 0<br/> > 0 <= p28: 0<br/> > 0 <= p29: 0<br/> > 0 <= p30: 0<br/> > 0 <= p31: 0<br/> > 0 <= p32: 0<br/> > 0 <= p33: 0<br/> > 0 <= p34: 0<br/> > 0 <= p35: 0<br/> > 0 <= p36: 0<br/> > 0 <= p37: 0<br/> > 0 <= p38: 0<br/> > 0 <= p39: 0<br/> > 0 <= p40: 0<br/> > 0 <= p41: 0<br/> > 0 <= p42: 0<br/> > 0 <= p43: 0<br/> > 0 <= p44: 0<br/> > 0 <= p45: 0<br/> > 0 <= p46: 0<br/> > 0 <= p47: 0<br/> > 0 <= p48: 0<br/> > 0 <= p49: 0<br/> > 0 <= p50: 0<br/> > 0 <= p51: 0<br/> > 0 <= p52: 0<br/> > 0 <= p53: 0<br/> > 0 <= p54: 0<br/> > 0 <= p55: 0<br/> > 0 <= p56: 0<br/> > 0 <= p57: 0<br/> > 0 <= p58: 0<br/> > 0 <= p59: 0<br/> > 0 <= p60: 0<br/> > 0 <= p61: 0<br/> > 0 <= p62: 0<br/> > 0 <= p63: 0<br/> > 0 <= p64: 0<br/> > 0 <= p65: 0<br/> > 0 <= p66: 0<br/> > 0 <= p67: 0<br/> > 0 <= p68: 0<br/> > 0 <= p69: 0<br/> > 0 <= p70: 0<br/> > 0 <= p71: 0<br/> > 0 <= p72: 0<br/> > 0 <= p73: 0<br/> > 0 <= p74: 0<br/> > 0 <= p75: 0<br/> > 0 <= p76: 0<br/> > 0 <= p77: 0<br/> > 0 <= p78: 0<br/> > 0 <= p79: 0<br/> > 0 <= p80: 0<br/> > 0 <= p81: 0<br/> > 0 <= p82: 0<br/> > 0 <= p83: 0<br/> > 0 <= p84: 0<br/> > 0 <= p85: 0<br/> > 0 <= p86: 0<br/> > 0 <= p87: 0<br/> > 0 <= p88: 0<br/> > 0 <= p89: 0<br/> > 0 <= p90: 0<br/> > 0 <= p91: 0<br/> > 0 <= p92: 0<br/> > 0 <= p93: 0<br/> > 0 <= p94: 0<br/> > 0 <= p95: 0<br/> > 0 <= p96: 0<br/> > 0 <= p97: 0<br/> > 0 <= p98: 0<br/> > 0 <= p99: 0<br/> > 0.000001 <= subset of level 3 constraint 0: 0.0 <= 0.000001<br/> > 0.000001 <= subset of level 3 constraint 1: 0.0 <= 0.000001<br/> > 0 <= subset of level 5 constraint 0: 0.0 <= 0<br/> > 0.700000 <= subset of level 3 constraint 2: 0.0 <= 0.700000<br/> > 0 <= integrityConstraint4: 0.0 <= 0<br/> > 0 <= subset of level 3 constraint 3: 0.0 <= 0<br/> > 0 <= integrityConstraint5: 0.0 <= 0<br/> > 0 <= integrityConstraint2: 0.0 <= 0<br/> > 0 <= integrityConstraint3: 0.0 <= 0<br/> > 0 <= integrityConstraint0: 0.0 <= 0<br/> > 0 <= integrityConstraint1: 0.0 <= 0<br/> > Objective: 0.0 (1.000000)<br/> > 1.000000 <= Normalization: 0.0 <= 1.000000<br/> > 0 <= subset of level 4 constraint 4: 0.0 <= 0<br/> > 0 <= subset of level 4 constraint 5: 0.0 <= 0<br/> > 0 <= subset of level 5 constraint 1: 0.0 <= 0<br/> > 0 <= subset of level 4 constraint 2: 0.0 <= 0<br/> > 0 <= subset of level 5 constraint 2: 0.0 <= 0<br/> > 0 <= subset of level 4 constraint 3: 0.0 <= 0<br/> > 0 <= subset of level 4 constraint 0: 0.0 <= 0<br/> > 0 <= subset of level 4 constraint 1: 0.0 <= 0<br/> > ############################################<br/> ><br/> ><br/> ><br/> > Gesendet: Mittwoch, 16. März 2016 um 11:12 Uhr<br/> > Von: "Anders Peterson" <an...@op...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > The setLinearFactor and setQuadraticFactor methods are deprecated but still do what they’ve always done. You should change your code to use the new alternatives.<br/> ><br/> ><br/> > RE multiply, either you change:<br/> ><br/> > A.multiplyLeft(B) => B.multiply(A)<br/> ><br/> > or<br/> ><br/> > A.multiplyLeft(B) => A.multiplyLeft(B).get()<br/> ><br/> ><br/> ><br/> > RE your results with with v39.7:<br/> ><br/> > Since v37 the solvers have changed internally so I’m not very surprised that “someone” notices a change in behaviour. However all (previously existing) test cases related to convex optimisation pass! Unless you provide we with a test case I can’t do more. Your options are.<br/> ><br/> > 1) stick with v37<br/> > 2) experiment with ways to reformulate your models<br/> > 3) provide me with test cases that demonstrate your problem<br/> ><br/> > BTW I’m very surprised to hear that v39.7 fails to find a feasible solution.<br/> ><br/> > Modify your code to print each solver instance’ toString method and set a break point at when an infeasible solution is returned. That can’t be very hard to do.<br/> ><br/> ><br/> > /Anders<br/> ><br/> ><br/> ><br/> > > On 16 mars 2016, at 10:31, Nico Potyka <Nic...@gm...> wrote:<br/> > ><br/> > > Another thing: I just noticed that the methods setLinearFactor and setQuadraticFactor of Expression are deprecated now. Could the use of these methods cause problems?<br/> > ><br/> > ><br/> > ><br/> > > Gesendet: Mittwoch, 16. März 2016 um 10:27 Uhr<br/> > > Von: "Nico Potyka" <Nic...@gm...><br/> > > An: oja...@li...<br/> > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > Just to make sure that there is not another problem: the matrix multiplication interface changed. So i replaced some lines with code like<br/> > ><br/> > > A.multiplyLeft(B)<br/> > ><br/> > > with<br/> > ><br/> > > B.multiply(A).<br/> > ><br/> > > Best wishes<br/> > > Nico<br/> > ><br/> > ><br/> > ><br/> > > Gesendet: Mittwoch, 16. März 2016 um 10:23 Uhr<br/> > > Von: "Nico Potyka" <Nic...@gm...><br/> > > An: oja...@li...<br/> > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > Thanks, I tried it. Now the algorithms fails to find a feasible solution. However, the problem is guaranteed to be feasible and the algorithm from version 37 seems to find the correct solutions.<br/> > ><br/> > > Best<br/> > > Nico<br/> > ><br/> > ><br/> > ><br/> > > Gesendet: Dienstag, 15. März 2016 um 23:18 Uhr<br/> > > Von: "Anders Peterson" <an...@op...><br/> > > An: oja...@li...<br/> > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > There is a new snapshot build v39.7 available at sourceforge:<br/> > ><br/> > > <a href="https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/" target="_blank">https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/</a><br/> > ><br/> > > Currently all test cases related to convex optimisation pass. Could you try it?<br/> > ><br/> > > /Anders<br/> > ><br/> > ><br/> > > > On 9 mars 2016, at 10:45, Nico Potyka <Nic...@gm...> wrote:<br/> > > ><br/> > > > Sorry, I forgot to turn validation off. After turning validation off, there is no exception and it often says KKT system unsolvable as you already suspected.<br/> > > ><br/> > > ><br/> > > > Gesendet: Mittwoch, 09. März 2016 um 10:39 Uhr<br/> > > > Von: "Nico Potyka" <Nic...@gm...><br/> > > > An: oja...@li...<br/> > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > Thanks for all the hints. When I activate the debugging mode I actually get an exception:<br/> > > ><br/> > > > Exception in thread "main" java.lang.IllegalArgumentException: Q must be positive semidefinite!<br/> > > ><br/> > > > However, there is no exception without the debugging mode. I actually check the result for optimality with<br/> > > ><br/> > > > Result result = tmpModel.minimise();<br/> > > > if(result.getState() == Optimisation.State.OPTIMAL) {<br/> > > > ...<br/> > > ><br/> > > > So it seems that the solver regards the computed solutions indeed as optimal.<br/> > > ><br/> > > ><br/> > > > I would love to send you a simple test case, but the example is rather complex and I currently don't find time to extract<br/> > > > a straightforward example that shows this behaviour. You can find the project in the SVN repository<br/> > > ><br/> > > > ssh://svn.code.sf.net/p/kreator-ide/code/<br/> > > ><br/> > > > in the folder<br/> > > ><br/> > > > Software/Log4KR<br/> > > ><br/> > > > The test case is in the class<br/> > > ><br/> > > > /Log4KR/sourceExamples/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityReasoningExamples.java<br/> > > ><br/> > > > The problematic optimization problem is defined in the class<br/> > > ><br/> > > > /Log4KR/src/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityEntailment2Norm.java<br/> > > ><br/> > > > in the method initialize. The ExpressionBasedModel is initialized in line 87. If you want to try with this example,<br/> > > > I can give you more details. Then you might also want to check out revision 3911, which still contained Ojalgo37<br/> > > > and worked fine. Of course, I don't expect that you do because the example is rather complex. However, I will try to<br/> > > > find some time to extract a straightforward example.<br/> > > ><br/> > > > Best wishes<br/> > > > Nico<br/> > > ><br/> > > ><br/> > > ><br/> > > > Gesendet: Dienstag, 08. März 2016 um 12:59 Uhr<br/> > > > Von: "Anders Peterson" <an...@op...><br/> > > > An: oja...@li...<br/> > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > When you do<br/> > > ><br/> > > > tmpModel.options.debug(ConvexSolver.class);<br/> > > ><br/> > > > it turns on debugging of that solver AND validation of the model/solver data.<br/> > > ><br/> > > > It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off.<br/> > > ><br/> > > > tmpModel.options.validate = false;<br/> > > ><br/> > > ><br/> > > > With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”?<br/> > > ><br/> > > > Are the solutions you get feasible, but not (always) optimal?<br/> > > ><br/> > > ><br/> > > > I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE.<br/> > > ><br/> > > ><br/> > > > Still interested in getting some test case from you.<br/> > > ><br/> > > ><br/> > > > /Anders<br/> > > ><br/> > > ><br/> > > ><br/> > > > > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote:<br/> > > > ><br/> > > > > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you.<br/> > > > ><br/> > > > > Best regards<br/> > > > > Nico<br/> > > > ><br/> > > > ><br/> > > > ><br/> > > > > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr<br/> > > > > Von: "Anders Peterson" <an...@op...><br/> > > > > An: oja...@li...<br/> > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > > A common QP should be ok with v39.0 - I’d very much like to know what problems you have.<br/> > > > ><br/> > > > > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method.<br/> > > > ><br/> > > > > If you can construct a test case using ExpressionsBasedModel, that would be better.<br/> > > > ><br/> > > > > /Anders<br/> > > > ><br/> > > > ><br/> > > > ><br/> > > > > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote:<br/> > > > > ><br/> > > > > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time.<br/> > > > > ><br/> > > > > > Thanks for the hints on debugging.<br/> > > > > ><br/> > > > > ><br/> > > > > ><br/> > > > > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr<br/> > > > > > Von: "Anders Peterson" <an...@op...><br/> > > > > > An: oja...@li...<br/> > > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > > > Do you have integer variables?<br/> > > > > ><br/> > > > > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.)<br/> > > > > ><br/> > > > > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”.<br/> > > > > ><br/> > > > > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you.<br/> > > > > ><br/> > > > > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that.<br/> > > > > ><br/> > > > > > Are you aware that you can get debug output from the solvers?<br/> > > > > > Do this:<br/> > > > > ><br/> > > > > > model.options.debug(ConvexSolver.class);<br/> > > > > ><br/> > > > > ><br/> > > > > > If you don’t have any other way to construct a test case, you can try this:<br/> > > > > ><br/> > > > > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy.<br/> > > > > ><br/> > > > > ><br/> > > > > > /Anders<br/> > > > > ><br/> > > > > ><br/> > > > > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote:<br/> > > > > > ><br/> > > > > > > Hi everybody,<br/> > > > > > ><br/> > > > > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm?<br/> > > > > > ><br/> > > > > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated.<br/> > > > > > ><br/> > > > > > > Best<br/> > > > > > > Nico<br/> > > > > > > ------------------------------------------------------------------------------<br/> > > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > > > > ojAlgo-user mailing list<br/> > > > > > > ojA...@li...<br/> > > > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > > ><br/> > > > > ><br/> > > > > > ------------------------------------------------------------------------------<br/> > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > > > > _______________________________________________<br/> > > > > > ojAlgo-user mailing list<br/> > > > > > ojA...@li...<br/> > > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > > > ------------------------------------------------------------------------------<br/> > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > > > ojAlgo-user mailing list<br/> > > > > > ojA...@li...<br/> > > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > ><br/> > > > ><br/> > > > > ------------------------------------------------------------------------------<br/> > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > > > _______________________________________________<br/> > > > > ojAlgo-user mailing list<br/> > > > > ojA...@li...<br/> > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > > ------------------------------------------------------------------------------<br/> > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > > ojAlgo-user mailing list<br/> > > > > ojA...@li...<br/> > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ><br/> > > ><br/> > > > ------------------------------------------------------------------------------<br/> > > > Transform Data into Opportunity.<br/> > > > Accelerate data analysis in your applications with<br/> > > > Intel Data Analytics Acceleration Library.<br/> > > > Click to learn more.<br/> > > > <a href="http://makebettercode.com/inteldaal-eval" target="_blank">http://makebettercode.com/inteldaal-eval</a><br/> > > > _______________________________________________<br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > ------------------------------------------------------------------------------<br/> > > > Transform Data into Opportunity.<br/> > > > Accelerate data analysis in your applications with<br/> > > > Intel Data Analytics Acceleration Library.<br/> > > > Click to learn more.<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a><br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ><br/> > ><br/> > > ------------------------------------------------------------------------------<br/> > > Transform Data into Opportunity.<br/> > > Accelerate data analysis in your applications with<br/> > > Intel Data Analytics Acceleration Library.<br/> > > Click to learn more.<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140</a><br/> > > _______________________________________________<br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ------------------------------------------------------------------------------<br/> > > Transform Data into Opportunity.<br/> > > Accelerate data analysis in your applications with<br/> > > Intel Data Analytics Acceleration Library.<br/> > > Click to learn more.<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a><br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> ><br/> ><br/> > ------------------------------------------------------------------------------<br/> > Transform Data into Opportunity.<br/> > Accelerate data analysis in your applications with<br/> > Intel Data Analytics Acceleration Library.<br/> > Click to learn more.<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140</a><br/> > _______________________________________________<br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------<br/> > Transform Data into Opportunity.<br/> > Accelerate data analysis in your applications with<br/> > Intel Data Analytics Acceleration Library.<br/> > Click to learn more.<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a><br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> <br/> <br/> ------------------------------------------------------------------------------<br/> Transform Data into Opportunity.<br/> Accelerate data analysis in your applications with<br/> Intel Data Analytics Acceleration Library.<br/> Click to learn more.<br/> <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140</a><br/> _______________________________________________<br/> ojAlgo-user mailing list<br/> ojA...@li...<br/> <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div></div></body></html> |
From: Anders P. <an...@op...> - 2016-03-16 12:03:05
|
toString() of the solver, not the model. You have to somehow step into (or modify) ojAlgo’s code. Setting a suitable breakpoint with the debugger in ExpressionsBasedModel's solve(…) method should be enough. > On 16 mars 2016, at 12:45, Nico Potyka <Nic...@gm...> wrote: > > Of course I can send you the output of the toString-method. I didn't think it will help much. I attach it below. As I explained, it's not easy to generate a straightforward test case. However, I will try to automatically generate code that creates the optimization problem without the need for the whole library, when I find some time. By the way, I don't expect you to find a solution to the problem without further information, I am just responding to your questions. > > > Status: INFEASIBLE > > > > Solver: > ############################################ > 0 <= p0: 0 > 0 <= p1: 0 > 0 <= p2: 0 > 0 <= p3: 0 > 0 <= p4: 0 > 0 <= p5: 0 > 0 <= p6: 0 > 0 <= p7: 0 > 0 <= p8: 0 > 0 <= p9: 0 > 0 <= p10: 0 > 0 <= p11: 0 > 0 <= p12: 0 > 0 <= p13: 0 > 0 <= p14: 0 > 0 <= p15: 0 > 0 <= p16: 0 > 0 <= p17: 0 > 0 <= p18: 0 > 0 <= p19: 0 > 0 <= p20: 0 > 0 <= p21: 0 > 0 <= p22: 0 > 0 <= p23: 0 > 0 <= p24: 0 > 0 <= p25: 0 > 0 <= p26: 0 > 0 <= p27: 0 > 0 <= p28: 0 > 0 <= p29: 0 > 0 <= p30: 0 > 0 <= p31: 0 > 0 <= p32: 0 > 0 <= p33: 0 > 0 <= p34: 0 > 0 <= p35: 0 > 0 <= p36: 0 > 0 <= p37: 0 > 0 <= p38: 0 > 0 <= p39: 0 > 0 <= p40: 0 > 0 <= p41: 0 > 0 <= p42: 0 > 0 <= p43: 0 > 0 <= p44: 0 > 0 <= p45: 0 > 0 <= p46: 0 > 0 <= p47: 0 > 0 <= p48: 0 > 0 <= p49: 0 > 0 <= p50: 0 > 0 <= p51: 0 > 0 <= p52: 0 > 0 <= p53: 0 > 0 <= p54: 0 > 0 <= p55: 0 > 0 <= p56: 0 > 0 <= p57: 0 > 0 <= p58: 0 > 0 <= p59: 0 > 0 <= p60: 0 > 0 <= p61: 0 > 0 <= p62: 0 > 0 <= p63: 0 > 0 <= p64: 0 > 0 <= p65: 0 > 0 <= p66: 0 > 0 <= p67: 0 > 0 <= p68: 0 > 0 <= p69: 0 > 0 <= p70: 0 > 0 <= p71: 0 > 0 <= p72: 0 > 0 <= p73: 0 > 0 <= p74: 0 > 0 <= p75: 0 > 0 <= p76: 0 > 0 <= p77: 0 > 0 <= p78: 0 > 0 <= p79: 0 > 0 <= p80: 0 > 0 <= p81: 0 > 0 <= p82: 0 > 0 <= p83: 0 > 0 <= p84: 0 > 0 <= p85: 0 > 0 <= p86: 0 > 0 <= p87: 0 > 0 <= p88: 0 > 0 <= p89: 0 > 0 <= p90: 0 > 0 <= p91: 0 > 0 <= p92: 0 > 0 <= p93: 0 > 0 <= p94: 0 > 0 <= p95: 0 > 0 <= p96: 0 > 0 <= p97: 0 > 0 <= p98: 0 > 0 <= p99: 0 > 0.000001 <= subset of level 3 constraint 0: 0.0 <= 0.000001 > 0.000001 <= subset of level 3 constraint 1: 0.0 <= 0.000001 > 0 <= subset of level 5 constraint 0: 0.0 <= 0 > 0.700000 <= subset of level 3 constraint 2: 0.0 <= 0.700000 > 0 <= integrityConstraint4: 0.0 <= 0 > 0 <= subset of level 3 constraint 3: 0.0 <= 0 > 0 <= integrityConstraint5: 0.0 <= 0 > 0 <= integrityConstraint2: 0.0 <= 0 > 0 <= integrityConstraint3: 0.0 <= 0 > 0 <= integrityConstraint0: 0.0 <= 0 > 0 <= integrityConstraint1: 0.0 <= 0 > Objective: 0.0 (1.000000) > 1.000000 <= Normalization: 0.0 <= 1.000000 > 0 <= subset of level 4 constraint 4: 0.0 <= 0 > 0 <= subset of level 4 constraint 5: 0.0 <= 0 > 0 <= subset of level 5 constraint 1: 0.0 <= 0 > 0 <= subset of level 4 constraint 2: 0.0 <= 0 > 0 <= subset of level 5 constraint 2: 0.0 <= 0 > 0 <= subset of level 4 constraint 3: 0.0 <= 0 > 0 <= subset of level 4 constraint 0: 0.0 <= 0 > 0 <= subset of level 4 constraint 1: 0.0 <= 0 > ############################################ > > > > Gesendet: Mittwoch, 16. März 2016 um 11:12 Uhr > Von: "Anders Peterson" <an...@op...> > An: oja...@li... > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > The setLinearFactor and setQuadraticFactor methods are deprecated but still do what they’ve always done. You should change your code to use the new alternatives. > > > RE multiply, either you change: > > A.multiplyLeft(B) => B.multiply(A) > > or > > A.multiplyLeft(B) => A.multiplyLeft(B).get() > > > > RE your results with with v39.7: > > Since v37 the solvers have changed internally so I’m not very surprised that “someone” notices a change in behaviour. However all (previously existing) test cases related to convex optimisation pass! Unless you provide we with a test case I can’t do more. Your options are. > > 1) stick with v37 > 2) experiment with ways to reformulate your models > 3) provide me with test cases that demonstrate your problem > > BTW I’m very surprised to hear that v39.7 fails to find a feasible solution. > > Modify your code to print each solver instance’ toString method and set a break point at when an infeasible solution is returned. That can’t be very hard to do. > > > /Anders > > > > > On 16 mars 2016, at 10:31, Nico Potyka <Nic...@gm...> wrote: > > > > Another thing: I just noticed that the methods setLinearFactor and setQuadraticFactor of Expression are deprecated now. Could the use of these methods cause problems? > > > > > > > > Gesendet: Mittwoch, 16. März 2016 um 10:27 Uhr > > Von: "Nico Potyka" <Nic...@gm...> > > An: oja...@li... > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > Just to make sure that there is not another problem: the matrix multiplication interface changed. So i replaced some lines with code like > > > > A.multiplyLeft(B) > > > > with > > > > B.multiply(A). > > > > Best wishes > > Nico > > > > > > > > Gesendet: Mittwoch, 16. März 2016 um 10:23 Uhr > > Von: "Nico Potyka" <Nic...@gm...> > > An: oja...@li... > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > Thanks, I tried it. Now the algorithms fails to find a feasible solution. However, the problem is guaranteed to be feasible and the algorithm from version 37 seems to find the correct solutions. > > > > Best > > Nico > > > > > > > > Gesendet: Dienstag, 15. März 2016 um 23:18 Uhr > > Von: "Anders Peterson" <an...@op...> > > An: oja...@li... > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > There is a new snapshot build v39.7 available at sourceforge: > > > > https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/ > > > > Currently all test cases related to convex optimisation pass. Could you try it? > > > > /Anders > > > > > > > On 9 mars 2016, at 10:45, Nico Potyka <Nic...@gm...> wrote: > > > > > > Sorry, I forgot to turn validation off. After turning validation off, there is no exception and it often says KKT system unsolvable as you already suspected. > > > > > > > > > Gesendet: Mittwoch, 09. März 2016 um 10:39 Uhr > > > Von: "Nico Potyka" <Nic...@gm...> > > > An: oja...@li... > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > Thanks for all the hints. When I activate the debugging mode I actually get an exception: > > > > > > Exception in thread "main" java.lang.IllegalArgumentException: Q must be positive semidefinite! > > > > > > However, there is no exception without the debugging mode. I actually check the result for optimality with > > > > > > Result result = tmpModel.minimise(); > > > if(result.getState() == Optimisation.State.OPTIMAL) { > > > ... > > > > > > So it seems that the solver regards the computed solutions indeed as optimal. > > > > > > > > > I would love to send you a simple test case, but the example is rather complex and I currently don't find time to extract > > > a straightforward example that shows this behaviour. You can find the project in the SVN repository > > > > > > ssh://svn.code.sf.net/p/kreator-ide/code/ > > > > > > in the folder > > > > > > Software/Log4KR > > > > > > The test case is in the class > > > > > > /Log4KR/sourceExamples/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityReasoningExamples.java > > > > > > The problematic optimization problem is defined in the class > > > > > > /Log4KR/src/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityEntailment2Norm.java > > > > > > in the method initialize. The ExpressionBasedModel is initialized in line 87. If you want to try with this example, > > > I can give you more details. Then you might also want to check out revision 3911, which still contained Ojalgo37 > > > and worked fine. Of course, I don't expect that you do because the example is rather complex. However, I will try to > > > find some time to extract a straightforward example. > > > > > > Best wishes > > > Nico > > > > > > > > > > > > Gesendet: Dienstag, 08. März 2016 um 12:59 Uhr > > > Von: "Anders Peterson" <an...@op...> > > > An: oja...@li... > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > When you do > > > > > > tmpModel.options.debug(ConvexSolver.class); > > > > > > it turns on debugging of that solver AND validation of the model/solver data. > > > > > > It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off. > > > > > > tmpModel.options.validate = false; > > > > > > > > > With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”? > > > > > > Are the solutions you get feasible, but not (always) optimal? > > > > > > > > > I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE. > > > > > > > > > Still interested in getting some test case from you. > > > > > > > > > /Anders > > > > > > > > > > > > > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote: > > > > > > > > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you. > > > > > > > > Best regards > > > > Nico > > > > > > > > > > > > > > > > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr > > > > Von: "Anders Peterson" <an...@op...> > > > > An: oja...@li... > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > > A common QP should be ok with v39.0 - I’d very much like to know what problems you have. > > > > > > > > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method. > > > > > > > > If you can construct a test case using ExpressionsBasedModel, that would be better. > > > > > > > > /Anders > > > > > > > > > > > > > > > > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote: > > > > > > > > > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time. > > > > > > > > > > Thanks for the hints on debugging. > > > > > > > > > > > > > > > > > > > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr > > > > > Von: "Anders Peterson" <an...@op...> > > > > > An: oja...@li... > > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > > > Do you have integer variables? > > > > > > > > > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.) > > > > > > > > > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”. > > > > > > > > > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you. > > > > > > > > > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that. > > > > > > > > > > Are you aware that you can get debug output from the solvers? > > > > > Do this: > > > > > > > > > > model.options.debug(ConvexSolver.class); > > > > > > > > > > > > > > > If you don’t have any other way to construct a test case, you can try this: > > > > > > > > > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy. > > > > > > > > > > > > > > > /Anders > > > > > > > > > > > > > > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote: > > > > > > > > > > > > Hi everybody, > > > > > > > > > > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm? > > > > > > > > > > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated. > > > > > > > > > > > > Best > > > > > > Nico > > > > > > ------------------------------------------------------------------------------ > > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > > > Monitor end-to-end web transactions and take corrective actions now > > > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > > > > > ojAlgo-user mailing list > > > > > > ojA...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > > Monitor end-to-end web transactions and take corrective actions now > > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > > > > > _______________________________________________ > > > > > ojAlgo-user mailing list > > > > > ojA...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > ------------------------------------------------------------------------------ > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > > Monitor end-to-end web transactions and take corrective actions now > > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > > > > ojAlgo-user mailing list > > > > > ojA...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > Monitor end-to-end web transactions and take corrective actions now > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > > > > _______________________________________________ > > > > ojAlgo-user mailing list > > > > ojA...@li... > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > ------------------------------------------------------------------------------ > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > Monitor end-to-end web transactions and take corrective actions now > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > > > ojAlgo-user mailing list > > > > ojA...@li... > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > > > ------------------------------------------------------------------------------ > > > Transform Data into Opportunity. > > > Accelerate data analysis in your applications with > > > Intel Data Analytics Acceleration Library. > > > Click to learn more. > > > http://makebettercode.com/inteldaal-eval > > > _______________________________________________ > > > ojAlgo-user mailing list > > > ojA...@li... > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > > > Transform Data into Opportunity. > > > Accelerate data analysis in your applications with > > > Intel Data Analytics Acceleration Library. > > > Click to learn more. > > > http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________ > > > ojAlgo-user mailing list > > > ojA...@li... > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > ------------------------------------------------------------------------------ > > Transform Data into Opportunity. > > Accelerate data analysis in your applications with > > Intel Data Analytics Acceleration Library. > > Click to learn more. > > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 > > _______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > ------------------------------------------------------------------------------ > > Transform Data into Opportunity. > > Accelerate data analysis in your applications with > > Intel Data Analytics Acceleration Library. > > Click to learn more. > > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Nico P. <Nic...@gm...> - 2016-03-16 11:45:33
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Of course I can send you the output of the toString-method. I didn't think it will help much. I attach it below. As I explained, it's not easy to generate a straightforward test case. However, I will try to automatically generate code that creates the optimization problem without the need for the whole library, when I find some time. By the way, I don't expect you to find a solution to the problem without further information, I am just responding to your questions.</div> <div> </div> <div> </div> <div> <p><font size="2">Status: INFEASIBLE</font></p> </div> <div> </div> <div> </div> <div>Solver:<br/> ############################################<br/> 0 <= p0: 0<br/> 0 <= p1: 0<br/> 0 <= p2: 0<br/> 0 <= p3: 0<br/> 0 <= p4: 0<br/> 0 <= p5: 0<br/> 0 <= p6: 0<br/> 0 <= p7: 0<br/> 0 <= p8: 0<br/> 0 <= p9: 0<br/> 0 <= p10: 0<br/> 0 <= p11: 0<br/> 0 <= p12: 0<br/> 0 <= p13: 0<br/> 0 <= p14: 0<br/> 0 <= p15: 0<br/> 0 <= p16: 0<br/> 0 <= p17: 0<br/> 0 <= p18: 0<br/> 0 <= p19: 0<br/> 0 <= p20: 0<br/> 0 <= p21: 0<br/> 0 <= p22: 0<br/> 0 <= p23: 0<br/> 0 <= p24: 0<br/> 0 <= p25: 0<br/> 0 <= p26: 0<br/> 0 <= p27: 0<br/> 0 <= p28: 0<br/> 0 <= p29: 0<br/> 0 <= p30: 0<br/> 0 <= p31: 0<br/> 0 <= p32: 0<br/> 0 <= p33: 0<br/> 0 <= p34: 0<br/> 0 <= p35: 0<br/> 0 <= p36: 0<br/> 0 <= p37: 0<br/> 0 <= p38: 0<br/> 0 <= p39: 0<br/> 0 <= p40: 0<br/> 0 <= p41: 0<br/> 0 <= p42: 0<br/> 0 <= p43: 0<br/> 0 <= p44: 0<br/> 0 <= p45: 0<br/> 0 <= p46: 0<br/> 0 <= p47: 0<br/> 0 <= p48: 0<br/> 0 <= p49: 0<br/> 0 <= p50: 0<br/> 0 <= p51: 0<br/> 0 <= p52: 0<br/> 0 <= p53: 0<br/> 0 <= p54: 0<br/> 0 <= p55: 0<br/> 0 <= p56: 0<br/> 0 <= p57: 0<br/> 0 <= p58: 0<br/> 0 <= p59: 0<br/> 0 <= p60: 0<br/> 0 <= p61: 0<br/> 0 <= p62: 0<br/> 0 <= p63: 0<br/> 0 <= p64: 0<br/> 0 <= p65: 0<br/> 0 <= p66: 0<br/> 0 <= p67: 0<br/> 0 <= p68: 0<br/> 0 <= p69: 0<br/> 0 <= p70: 0<br/> 0 <= p71: 0<br/> 0 <= p72: 0<br/> 0 <= p73: 0<br/> 0 <= p74: 0<br/> 0 <= p75: 0<br/> 0 <= p76: 0<br/> 0 <= p77: 0<br/> 0 <= p78: 0<br/> 0 <= p79: 0<br/> 0 <= p80: 0<br/> 0 <= p81: 0<br/> 0 <= p82: 0<br/> 0 <= p83: 0<br/> 0 <= p84: 0<br/> 0 <= p85: 0<br/> 0 <= p86: 0<br/> 0 <= p87: 0<br/> 0 <= p88: 0<br/> 0 <= p89: 0<br/> 0 <= p90: 0<br/> 0 <= p91: 0<br/> 0 <= p92: 0<br/> 0 <= p93: 0<br/> 0 <= p94: 0<br/> 0 <= p95: 0<br/> 0 <= p96: 0<br/> 0 <= p97: 0<br/> 0 <= p98: 0<br/> 0 <= p99: 0<br/> 0.000001 <= subset of level 3 constraint 0: 0.0 <= 0.000001<br/> 0.000001 <= subset of level 3 constraint 1: 0.0 <= 0.000001<br/> 0 <= subset of level 5 constraint 0: 0.0 <= 0<br/> 0.700000 <= subset of level 3 constraint 2: 0.0 <= 0.700000<br/> 0 <= integrityConstraint4: 0.0 <= 0<br/> 0 <= subset of level 3 constraint 3: 0.0 <= 0<br/> 0 <= integrityConstraint5: 0.0 <= 0<br/> 0 <= integrityConstraint2: 0.0 <= 0<br/> 0 <= integrityConstraint3: 0.0 <= 0<br/> 0 <= integrityConstraint0: 0.0 <= 0<br/> 0 <= integrityConstraint1: 0.0 <= 0<br/> Objective: 0.0 (1.000000)<br/> 1.000000 <= Normalization: 0.0 <= 1.000000<br/> 0 <= subset of level 4 constraint 4: 0.0 <= 0<br/> 0 <= subset of level 4 constraint 5: 0.0 <= 0<br/> 0 <= subset of level 5 constraint 1: 0.0 <= 0<br/> 0 <= subset of level 4 constraint 2: 0.0 <= 0<br/> 0 <= subset of level 5 constraint 2: 0.0 <= 0<br/> 0 <= subset of level 4 constraint 3: 0.0 <= 0<br/> 0 <= subset of level 4 constraint 0: 0.0 <= 0<br/> 0 <= subset of level 4 constraint 1: 0.0 <= 0<br/> ############################################</div> <div> </div> <div> </div> <div> <div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);"> <div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Mittwoch, 16. März 2016 um 11:12 Uhr<br/> <b>Von:</b> "Anders Peterson" <an...@op...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div>The setLinearFactor and setQuadraticFactor methods are deprecated but still do what they’ve always done. You should change your code to use the new alternatives.<br/> <br/> <br/> RE multiply, either you change:<br/> <br/> A.multiplyLeft(B) => B.multiply(A)<br/> <br/> or<br/> <br/> A.multiplyLeft(B) => A.multiplyLeft(B).get()<br/> <br/> <br/> <br/> RE your results with with v39.7:<br/> <br/> Since v37 the solvers have changed internally so I’m not very surprised that “someone” notices a change in behaviour. However all (previously existing) test cases related to convex optimisation pass! Unless you provide we with a test case I can’t do more. Your options are.<br/> <br/> 1) stick with v37<br/> 2) experiment with ways to reformulate your models<br/> 3) provide me with test cases that demonstrate your problem<br/> <br/> BTW I’m very surprised to hear that v39.7 fails to find a feasible solution.<br/> <br/> Modify your code to print each solver instance’ toString method and set a break point at when an infeasible solution is returned. That can’t be very hard to do.<br/> <br/> <br/> /Anders<br/> <br/> <br/> <br/> > On 16 mars 2016, at 10:31, Nico Potyka <Nic...@gm...> wrote:<br/> ><br/> > Another thing: I just noticed that the methods setLinearFactor and setQuadraticFactor of Expression are deprecated now. Could the use of these methods cause problems?<br/> ><br/> ><br/> ><br/> > Gesendet: Mittwoch, 16. März 2016 um 10:27 Uhr<br/> > Von: "Nico Potyka" <Nic...@gm...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > Just to make sure that there is not another problem: the matrix multiplication interface changed. So i replaced some lines with code like<br/> ><br/> > A.multiplyLeft(B)<br/> ><br/> > with<br/> ><br/> > B.multiply(A).<br/> ><br/> > Best wishes<br/> > Nico<br/> ><br/> ><br/> ><br/> > Gesendet: Mittwoch, 16. März 2016 um 10:23 Uhr<br/> > Von: "Nico Potyka" <Nic...@gm...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > Thanks, I tried it. Now the algorithms fails to find a feasible solution. However, the problem is guaranteed to be feasible and the algorithm from version 37 seems to find the correct solutions.<br/> ><br/> > Best<br/> > Nico<br/> ><br/> ><br/> ><br/> > Gesendet: Dienstag, 15. März 2016 um 23:18 Uhr<br/> > Von: "Anders Peterson" <an...@op...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > There is a new snapshot build v39.7 available at sourceforge:<br/> ><br/> > <a href="https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/" target="_blank">https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/</a><br/> ><br/> > Currently all test cases related to convex optimisation pass. Could you try it?<br/> ><br/> > /Anders<br/> ><br/> ><br/> > > On 9 mars 2016, at 10:45, Nico Potyka <Nic...@gm...> wrote:<br/> > ><br/> > > Sorry, I forgot to turn validation off. After turning validation off, there is no exception and it often says KKT system unsolvable as you already suspected.<br/> > ><br/> > ><br/> > > Gesendet: Mittwoch, 09. März 2016 um 10:39 Uhr<br/> > > Von: "Nico Potyka" <Nic...@gm...><br/> > > An: oja...@li...<br/> > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > Thanks for all the hints. When I activate the debugging mode I actually get an exception:<br/> > ><br/> > > Exception in thread "main" java.lang.IllegalArgumentException: Q must be positive semidefinite!<br/> > ><br/> > > However, there is no exception without the debugging mode. I actually check the result for optimality with<br/> > ><br/> > > Result result = tmpModel.minimise();<br/> > > if(result.getState() == Optimisation.State.OPTIMAL) {<br/> > > ...<br/> > ><br/> > > So it seems that the solver regards the computed solutions indeed as optimal.<br/> > ><br/> > ><br/> > > I would love to send you a simple test case, but the example is rather complex and I currently don't find time to extract<br/> > > a straightforward example that shows this behaviour. You can find the project in the SVN repository<br/> > ><br/> > > ssh://svn.code.sf.net/p/kreator-ide/code/<br/> > ><br/> > > in the folder<br/> > ><br/> > > Software/Log4KR<br/> > ><br/> > > The test case is in the class<br/> > ><br/> > > /Log4KR/sourceExamples/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityReasoningExamples.java<br/> > ><br/> > > The problematic optimization problem is defined in the class<br/> > ><br/> > > /Log4KR/src/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityEntailment2Norm.java<br/> > ><br/> > > in the method initialize. The ExpressionBasedModel is initialized in line 87. If you want to try with this example,<br/> > > I can give you more details. Then you might also want to check out revision 3911, which still contained Ojalgo37<br/> > > and worked fine. Of course, I don't expect that you do because the example is rather complex. However, I will try to<br/> > > find some time to extract a straightforward example.<br/> > ><br/> > > Best wishes<br/> > > Nico<br/> > ><br/> > ><br/> > ><br/> > > Gesendet: Dienstag, 08. März 2016 um 12:59 Uhr<br/> > > Von: "Anders Peterson" <an...@op...><br/> > > An: oja...@li...<br/> > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > When you do<br/> > ><br/> > > tmpModel.options.debug(ConvexSolver.class);<br/> > ><br/> > > it turns on debugging of that solver AND validation of the model/solver data.<br/> > ><br/> > > It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off.<br/> > ><br/> > > tmpModel.options.validate = false;<br/> > ><br/> > ><br/> > > With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”?<br/> > ><br/> > > Are the solutions you get feasible, but not (always) optimal?<br/> > ><br/> > ><br/> > > I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE.<br/> > ><br/> > ><br/> > > Still interested in getting some test case from you.<br/> > ><br/> > ><br/> > > /Anders<br/> > ><br/> > ><br/> > ><br/> > > > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote:<br/> > > ><br/> > > > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you.<br/> > > ><br/> > > > Best regards<br/> > > > Nico<br/> > > ><br/> > > ><br/> > > ><br/> > > > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr<br/> > > > Von: "Anders Peterson" <an...@op...><br/> > > > An: oja...@li...<br/> > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > A common QP should be ok with v39.0 - I’d very much like to know what problems you have.<br/> > > ><br/> > > > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method.<br/> > > ><br/> > > > If you can construct a test case using ExpressionsBasedModel, that would be better.<br/> > > ><br/> > > > /Anders<br/> > > ><br/> > > ><br/> > > ><br/> > > > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote:<br/> > > > ><br/> > > > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time.<br/> > > > ><br/> > > > > Thanks for the hints on debugging.<br/> > > > ><br/> > > > ><br/> > > > ><br/> > > > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr<br/> > > > > Von: "Anders Peterson" <an...@op...><br/> > > > > An: oja...@li...<br/> > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > > Do you have integer variables?<br/> > > > ><br/> > > > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.)<br/> > > > ><br/> > > > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”.<br/> > > > ><br/> > > > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you.<br/> > > > ><br/> > > > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that.<br/> > > > ><br/> > > > > Are you aware that you can get debug output from the solvers?<br/> > > > > Do this:<br/> > > > ><br/> > > > > model.options.debug(ConvexSolver.class);<br/> > > > ><br/> > > > ><br/> > > > > If you don’t have any other way to construct a test case, you can try this:<br/> > > > ><br/> > > > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy.<br/> > > > ><br/> > > > ><br/> > > > > /Anders<br/> > > > ><br/> > > > ><br/> > > > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote:<br/> > > > > ><br/> > > > > > Hi everybody,<br/> > > > > ><br/> > > > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm?<br/> > > > > ><br/> > > > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated.<br/> > > > > ><br/> > > > > > Best<br/> > > > > > Nico<br/> > > > > > ------------------------------------------------------------------------------<br/> > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > > > ojAlgo-user mailing list<br/> > > > > > ojA...@li...<br/> > > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > ><br/> > > > ><br/> > > > > ------------------------------------------------------------------------------<br/> > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > > > _______________________________________________<br/> > > > > ojAlgo-user mailing list<br/> > > > > ojA...@li...<br/> > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > > ------------------------------------------------------------------------------<br/> > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > > ojAlgo-user mailing list<br/> > > > > ojA...@li...<br/> > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ><br/> > > ><br/> > > > ------------------------------------------------------------------------------<br/> > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > > _______________________________________________<br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > ------------------------------------------------------------------------------<br/> > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ><br/> > ><br/> > > ------------------------------------------------------------------------------<br/> > > Transform Data into Opportunity.<br/> > > Accelerate data analysis in your applications with<br/> > > Intel Data Analytics Acceleration Library.<br/> > > Click to learn more.<br/> > > <a href="http://makebettercode.com/inteldaal-eval" target="_blank">http://makebettercode.com/inteldaal-eval</a><br/> > > _______________________________________________<br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ------------------------------------------------------------------------------<br/> > > Transform Data into Opportunity.<br/> > > Accelerate data analysis in your applications with<br/> > > Intel Data Analytics Acceleration Library.<br/> > > Click to learn more.<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a><br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> ><br/> ><br/> > ------------------------------------------------------------------------------<br/> > Transform Data into Opportunity.<br/> > Accelerate data analysis in your applications with<br/> > Intel Data Analytics Acceleration Library.<br/> > Click to learn more.<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140</a><br/> > _______________________________________________<br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------<br/> > Transform Data into Opportunity.<br/> > Accelerate data analysis in your applications with<br/> > Intel Data Analytics Acceleration Library.<br/> > Click to learn more.<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a><br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> <br/> <br/> ------------------------------------------------------------------------------<br/> Transform Data into Opportunity.<br/> Accelerate data analysis in your applications with<br/> Intel Data Analytics Acceleration Library.<br/> Click to learn more.<br/> <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140</a><br/> _______________________________________________<br/> ojAlgo-user mailing list<br/> ojA...@li...<br/> <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div></div></body></html> |
From: Anders P. <an...@op...> - 2016-03-16 10:12:23
|
The setLinearFactor and setQuadraticFactor methods are deprecated but still do what they’ve always done. You should change your code to use the new alternatives. RE multiply, either you change: A.multiplyLeft(B) => B.multiply(A) or A.multiplyLeft(B) => A.multiplyLeft(B).get() RE your results with with v39.7: Since v37 the solvers have changed internally so I’m not very surprised that “someone” notices a change in behaviour. However all (previously existing) test cases related to convex optimisation pass! Unless you provide we with a test case I can’t do more. Your options are. 1) stick with v37 2) experiment with ways to reformulate your models 3) provide me with test cases that demonstrate your problem BTW I’m very surprised to hear that v39.7 fails to find a feasible solution. Modify your code to print each solver instance’ toString method and set a break point at when an infeasible solution is returned. That can’t be very hard to do. /Anders > On 16 mars 2016, at 10:31, Nico Potyka <Nic...@gm...> wrote: > > Another thing: I just noticed that the methods setLinearFactor and setQuadraticFactor of Expression are deprecated now. Could the use of these methods cause problems? > > > > Gesendet: Mittwoch, 16. März 2016 um 10:27 Uhr > Von: "Nico Potyka" <Nic...@gm...> > An: oja...@li... > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > Just to make sure that there is not another problem: the matrix multiplication interface changed. So i replaced some lines with code like > > A.multiplyLeft(B) > > with > > B.multiply(A). > > Best wishes > Nico > > > > Gesendet: Mittwoch, 16. März 2016 um 10:23 Uhr > Von: "Nico Potyka" <Nic...@gm...> > An: oja...@li... > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > Thanks, I tried it. Now the algorithms fails to find a feasible solution. However, the problem is guaranteed to be feasible and the algorithm from version 37 seems to find the correct solutions. > > Best > Nico > > > > Gesendet: Dienstag, 15. März 2016 um 23:18 Uhr > Von: "Anders Peterson" <an...@op...> > An: oja...@li... > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > There is a new snapshot build v39.7 available at sourceforge: > > https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/ > > Currently all test cases related to convex optimisation pass. Could you try it? > > /Anders > > > > On 9 mars 2016, at 10:45, Nico Potyka <Nic...@gm...> wrote: > > > > Sorry, I forgot to turn validation off. After turning validation off, there is no exception and it often says KKT system unsolvable as you already suspected. > > > > > > Gesendet: Mittwoch, 09. März 2016 um 10:39 Uhr > > Von: "Nico Potyka" <Nic...@gm...> > > An: oja...@li... > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > Thanks for all the hints. When I activate the debugging mode I actually get an exception: > > > > Exception in thread "main" java.lang.IllegalArgumentException: Q must be positive semidefinite! > > > > However, there is no exception without the debugging mode. I actually check the result for optimality with > > > > Result result = tmpModel.minimise(); > > if(result.getState() == Optimisation.State.OPTIMAL) { > > ... > > > > So it seems that the solver regards the computed solutions indeed as optimal. > > > > > > I would love to send you a simple test case, but the example is rather complex and I currently don't find time to extract > > a straightforward example that shows this behaviour. You can find the project in the SVN repository > > > > ssh://svn.code.sf.net/p/kreator-ide/code/ > > > > in the folder > > > > Software/Log4KR > > > > The test case is in the class > > > > /Log4KR/sourceExamples/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityReasoningExamples.java > > > > The problematic optimization problem is defined in the class > > > > /Log4KR/src/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityEntailment2Norm.java > > > > in the method initialize. The ExpressionBasedModel is initialized in line 87. If you want to try with this example, > > I can give you more details. Then you might also want to check out revision 3911, which still contained Ojalgo37 > > and worked fine. Of course, I don't expect that you do because the example is rather complex. However, I will try to > > find some time to extract a straightforward example. > > > > Best wishes > > Nico > > > > > > > > Gesendet: Dienstag, 08. März 2016 um 12:59 Uhr > > Von: "Anders Peterson" <an...@op...> > > An: oja...@li... > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > When you do > > > > tmpModel.options.debug(ConvexSolver.class); > > > > it turns on debugging of that solver AND validation of the model/solver data. > > > > It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off. > > > > tmpModel.options.validate = false; > > > > > > With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”? > > > > Are the solutions you get feasible, but not (always) optimal? > > > > > > I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE. > > > > > > Still interested in getting some test case from you. > > > > > > /Anders > > > > > > > > > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote: > > > > > > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you. > > > > > > Best regards > > > Nico > > > > > > > > > > > > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr > > > Von: "Anders Peterson" <an...@op...> > > > An: oja...@li... > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > A common QP should be ok with v39.0 - I’d very much like to know what problems you have. > > > > > > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method. > > > > > > If you can construct a test case using ExpressionsBasedModel, that would be better. > > > > > > /Anders > > > > > > > > > > > > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote: > > > > > > > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time. > > > > > > > > Thanks for the hints on debugging. > > > > > > > > > > > > > > > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr > > > > Von: "Anders Peterson" <an...@op...> > > > > An: oja...@li... > > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > > Do you have integer variables? > > > > > > > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.) > > > > > > > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”. > > > > > > > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you. > > > > > > > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that. > > > > > > > > Are you aware that you can get debug output from the solvers? > > > > Do this: > > > > > > > > model.options.debug(ConvexSolver.class); > > > > > > > > > > > > If you don’t have any other way to construct a test case, you can try this: > > > > > > > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy. > > > > > > > > > > > > /Anders > > > > > > > > > > > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote: > > > > > > > > > > Hi everybody, > > > > > > > > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm? > > > > > > > > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated. > > > > > > > > > > Best > > > > > Nico > > > > > ------------------------------------------------------------------------------ > > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > > Monitor end-to-end web transactions and take corrective actions now > > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > > > > ojAlgo-user mailing list > > > > > ojA...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > Monitor end-to-end web transactions and take corrective actions now > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > > > > _______________________________________________ > > > > ojAlgo-user mailing list > > > > ojA...@li... > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > ------------------------------------------------------------------------------ > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > Monitor end-to-end web transactions and take corrective actions now > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > > > ojAlgo-user mailing list > > > > ojA...@li... > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > > > ------------------------------------------------------------------------------ > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > Monitor end-to-end web transactions and take corrective actions now > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > > > _______________________________________________ > > > ojAlgo-user mailing list > > > ojA...@li... > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > Monitor end-to-end web transactions and take corrective actions now > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > > ojAlgo-user mailing list > > > ojA...@li... > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > ------------------------------------------------------------------------------ > > Transform Data into Opportunity. > > Accelerate data analysis in your applications with > > Intel Data Analytics Acceleration Library. > > Click to learn more. > > http://makebettercode.com/inteldaal-eval > > _______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > ------------------------------------------------------------------------------ > > Transform Data into Opportunity. > > Accelerate data analysis in your applications with > > Intel Data Analytics Acceleration Library. > > Click to learn more. > > http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Nico P. <Nic...@gm...> - 2016-03-16 09:32:04
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Another thing: I just noticed that the methods setLinearFactor and setQuadraticFactor of Expression are deprecated now. Could the use of these methods cause problems?</div> <div> </div> <div> </div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Mittwoch, 16. März 2016 um 10:27 Uhr<br/> <b>Von:</b> "Nico Potyka" <Nic...@gm...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div name="quoted-content"> <div style="font-family: Verdana;font-size: 12.0px;"> <div> <div>Just to make sure that there is not another problem: the matrix multiplication interface changed. So i replaced some lines with code like</div> <div> </div> <div> A.multiplyLeft(B)</div> <div> </div> <div>with</div> <div> </div> <div> B.multiply(A).</div> <div> </div> <div>Best wishes</div> <div>Nico</div> <div> </div> <div> </div> <div> <div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);"> <div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Mittwoch, 16. März 2016 um 10:23 Uhr<br/> <b>Von:</b> "Nico Potyka" <Nic...@gm...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div> <div style="font-family: Verdana;font-size: 12.0px;"> <div> <div>Thanks, I tried it. Now the algorithms fails to find a feasible solution. However, the problem is guaranteed to be feasible and the algorithm from version 37 seems to find the correct solutions.</div> <div> </div> <div>Best</div> <div>Nico</div> <div> </div> <div> </div> <div> <div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);"> <div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Dienstag, 15. März 2016 um 23:18 Uhr<br/> <b>Von:</b> "Anders Peterson" <an...@op...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div>There is a new snapshot build v39.7 available at sourceforge:<br/> <br/> <a href="https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/" target="_blank">https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/</a><br/> <br/> Currently all test cases related to convex optimisation pass. Could you try it?<br/> <br/> /Anders<br/> <br/> <br/> > On 9 mars 2016, at 10:45, Nico Potyka <Nic...@gm...> wrote:<br/> ><br/> > Sorry, I forgot to turn validation off. After turning validation off, there is no exception and it often says KKT system unsolvable as you already suspected.<br/> ><br/> ><br/> > Gesendet: Mittwoch, 09. März 2016 um 10:39 Uhr<br/> > Von: "Nico Potyka" <Nic...@gm...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > Thanks for all the hints. When I activate the debugging mode I actually get an exception:<br/> ><br/> > Exception in thread "main" java.lang.IllegalArgumentException: Q must be positive semidefinite!<br/> ><br/> > However, there is no exception without the debugging mode. I actually check the result for optimality with<br/> ><br/> > Result result = tmpModel.minimise();<br/> > if(result.getState() == Optimisation.State.OPTIMAL) {<br/> > ...<br/> ><br/> > So it seems that the solver regards the computed solutions indeed as optimal.<br/> ><br/> ><br/> > I would love to send you a simple test case, but the example is rather complex and I currently don't find time to extract<br/> > a straightforward example that shows this behaviour. You can find the project in the SVN repository<br/> ><br/> > ssh://svn.code.sf.net/p/kreator-ide/code/<br/> ><br/> > in the folder<br/> ><br/> > Software/Log4KR<br/> ><br/> > The test case is in the class<br/> ><br/> > /Log4KR/sourceExamples/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityReasoningExamples.java<br/> ><br/> > The problematic optimization problem is defined in the class<br/> ><br/> > /Log4KR/src/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityEntailment2Norm.java<br/> ><br/> > in the method initialize. The ExpressionBasedModel is initialized in line 87. If you want to try with this example,<br/> > I can give you more details. Then you might also want to check out revision 3911, which still contained Ojalgo37<br/> > and worked fine. Of course, I don't expect that you do because the example is rather complex. However, I will try to<br/> > find some time to extract a straightforward example.<br/> ><br/> > Best wishes<br/> > Nico<br/> ><br/> ><br/> ><br/> > Gesendet: Dienstag, 08. März 2016 um 12:59 Uhr<br/> > Von: "Anders Peterson" <an...@op...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > When you do<br/> ><br/> > tmpModel.options.debug(ConvexSolver.class);<br/> ><br/> > it turns on debugging of that solver AND validation of the model/solver data.<br/> ><br/> > It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off.<br/> ><br/> > tmpModel.options.validate = false;<br/> ><br/> ><br/> > With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”?<br/> ><br/> > Are the solutions you get feasible, but not (always) optimal?<br/> ><br/> ><br/> > I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE.<br/> ><br/> ><br/> > Still interested in getting some test case from you.<br/> ><br/> ><br/> > /Anders<br/> ><br/> ><br/> ><br/> > > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote:<br/> > ><br/> > > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you.<br/> > ><br/> > > Best regards<br/> > > Nico<br/> > ><br/> > ><br/> > ><br/> > > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr<br/> > > Von: "Anders Peterson" <an...@op...><br/> > > An: oja...@li...<br/> > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > A common QP should be ok with v39.0 - I’d very much like to know what problems you have.<br/> > ><br/> > > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method.<br/> > ><br/> > > If you can construct a test case using ExpressionsBasedModel, that would be better.<br/> > ><br/> > > /Anders<br/> > ><br/> > ><br/> > ><br/> > > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote:<br/> > > ><br/> > > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time.<br/> > > ><br/> > > > Thanks for the hints on debugging.<br/> > > ><br/> > > ><br/> > > ><br/> > > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr<br/> > > > Von: "Anders Peterson" <an...@op...><br/> > > > An: oja...@li...<br/> > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > Do you have integer variables?<br/> > > ><br/> > > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.)<br/> > > ><br/> > > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”.<br/> > > ><br/> > > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you.<br/> > > ><br/> > > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that.<br/> > > ><br/> > > > Are you aware that you can get debug output from the solvers?<br/> > > > Do this:<br/> > > ><br/> > > > model.options.debug(ConvexSolver.class);<br/> > > ><br/> > > ><br/> > > > If you don’t have any other way to construct a test case, you can try this:<br/> > > ><br/> > > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy.<br/> > > ><br/> > > ><br/> > > > /Anders<br/> > > ><br/> > > ><br/> > > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote:<br/> > > > ><br/> > > > > Hi everybody,<br/> > > > ><br/> > > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm?<br/> > > > ><br/> > > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated.<br/> > > > ><br/> > > > > Best<br/> > > > > Nico<br/> > > > > ------------------------------------------------------------------------------<br/> > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > > ojAlgo-user mailing list<br/> > > > > ojA...@li...<br/> > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ><br/> > > ><br/> > > > ------------------------------------------------------------------------------<br/> > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > > _______________________________________________<br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > ------------------------------------------------------------------------------<br/> > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ><br/> > ><br/> > > ------------------------------------------------------------------------------<br/> > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > Monitor end-to-end web transactions and take corrective actions now<br/> > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > _______________________________________________<br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ------------------------------------------------------------------------------<br/> > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > Monitor end-to-end web transactions and take corrective actions now<br/> > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> ><br/> ><br/> > ------------------------------------------------------------------------------<br/> > Transform Data into Opportunity.<br/> > Accelerate data analysis in your applications with<br/> > Intel Data Analytics Acceleration Library.<br/> > Click to learn more.<br/> > <a href="http://makebettercode.com/inteldaal-eval" target="_blank">http://makebettercode.com/inteldaal-eval</a><br/> > _______________________________________________<br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------<br/> > Transform Data into Opportunity.<br/> > Accelerate data analysis in your applications with<br/> > Intel Data Analytics Acceleration Library.<br/> > Click to learn more.<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a><br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> <br/> <br/> ------------------------------------------------------------------------------<br/> Transform Data into Opportunity.<br/> Accelerate data analysis in your applications with<br/> Intel Data Analytics Acceleration Library.<br/> Click to learn more.<br/> <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140</a><br/> _______________________________________________<br/> ojAlgo-user mailing list<br/> ojA...@li...<br/> <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div> </div> ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div> </div> ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div></div></body></html> |
From: Nico P. <Nic...@gm...> - 2016-03-16 09:28:04
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Just to make sure that there is not another problem: the matrix multiplication interface changed. So i replaced some lines with code like</div> <div> </div> <div> A.multiplyLeft(B)</div> <div> </div> <div>with</div> <div> </div> <div> B.multiply(A).</div> <div> </div> <div>Best wishes</div> <div>Nico</div> <div> </div> <div> </div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Mittwoch, 16. März 2016 um 10:23 Uhr<br/> <b>Von:</b> "Nico Potyka" <Nic...@gm...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div name="quoted-content"> <div style="font-family: Verdana;font-size: 12.0px;"> <div> <div>Thanks, I tried it. Now the algorithms fails to find a feasible solution. However, the problem is guaranteed to be feasible and the algorithm from version 37 seems to find the correct solutions.</div> <div> </div> <div>Best</div> <div>Nico</div> <div> </div> <div> </div> <div> <div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);"> <div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Dienstag, 15. März 2016 um 23:18 Uhr<br/> <b>Von:</b> "Anders Peterson" <an...@op...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div>There is a new snapshot build v39.7 available at sourceforge:<br/> <br/> <a href="https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/" target="_blank">https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/</a><br/> <br/> Currently all test cases related to convex optimisation pass. Could you try it?<br/> <br/> /Anders<br/> <br/> <br/> > On 9 mars 2016, at 10:45, Nico Potyka <Nic...@gm...> wrote:<br/> ><br/> > Sorry, I forgot to turn validation off. After turning validation off, there is no exception and it often says KKT system unsolvable as you already suspected.<br/> ><br/> ><br/> > Gesendet: Mittwoch, 09. März 2016 um 10:39 Uhr<br/> > Von: "Nico Potyka" <Nic...@gm...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > Thanks for all the hints. When I activate the debugging mode I actually get an exception:<br/> ><br/> > Exception in thread "main" java.lang.IllegalArgumentException: Q must be positive semidefinite!<br/> ><br/> > However, there is no exception without the debugging mode. I actually check the result for optimality with<br/> ><br/> > Result result = tmpModel.minimise();<br/> > if(result.getState() == Optimisation.State.OPTIMAL) {<br/> > ...<br/> ><br/> > So it seems that the solver regards the computed solutions indeed as optimal.<br/> ><br/> ><br/> > I would love to send you a simple test case, but the example is rather complex and I currently don't find time to extract<br/> > a straightforward example that shows this behaviour. You can find the project in the SVN repository<br/> ><br/> > ssh://svn.code.sf.net/p/kreator-ide/code/<br/> ><br/> > in the folder<br/> ><br/> > Software/Log4KR<br/> ><br/> > The test case is in the class<br/> ><br/> > /Log4KR/sourceExamples/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityReasoningExamples.java<br/> ><br/> > The problematic optimization problem is defined in the class<br/> ><br/> > /Log4KR/src/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityEntailment2Norm.java<br/> ><br/> > in the method initialize. The ExpressionBasedModel is initialized in line 87. If you want to try with this example,<br/> > I can give you more details. Then you might also want to check out revision 3911, which still contained Ojalgo37<br/> > and worked fine. Of course, I don't expect that you do because the example is rather complex. However, I will try to<br/> > find some time to extract a straightforward example.<br/> ><br/> > Best wishes<br/> > Nico<br/> ><br/> ><br/> ><br/> > Gesendet: Dienstag, 08. März 2016 um 12:59 Uhr<br/> > Von: "Anders Peterson" <an...@op...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > When you do<br/> ><br/> > tmpModel.options.debug(ConvexSolver.class);<br/> ><br/> > it turns on debugging of that solver AND validation of the model/solver data.<br/> ><br/> > It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off.<br/> ><br/> > tmpModel.options.validate = false;<br/> ><br/> ><br/> > With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”?<br/> ><br/> > Are the solutions you get feasible, but not (always) optimal?<br/> ><br/> ><br/> > I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE.<br/> ><br/> ><br/> > Still interested in getting some test case from you.<br/> ><br/> ><br/> > /Anders<br/> ><br/> ><br/> ><br/> > > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote:<br/> > ><br/> > > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you.<br/> > ><br/> > > Best regards<br/> > > Nico<br/> > ><br/> > ><br/> > ><br/> > > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr<br/> > > Von: "Anders Peterson" <an...@op...><br/> > > An: oja...@li...<br/> > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > A common QP should be ok with v39.0 - I’d very much like to know what problems you have.<br/> > ><br/> > > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method.<br/> > ><br/> > > If you can construct a test case using ExpressionsBasedModel, that would be better.<br/> > ><br/> > > /Anders<br/> > ><br/> > ><br/> > ><br/> > > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote:<br/> > > ><br/> > > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time.<br/> > > ><br/> > > > Thanks for the hints on debugging.<br/> > > ><br/> > > ><br/> > > ><br/> > > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr<br/> > > > Von: "Anders Peterson" <an...@op...><br/> > > > An: oja...@li...<br/> > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > Do you have integer variables?<br/> > > ><br/> > > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.)<br/> > > ><br/> > > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”.<br/> > > ><br/> > > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you.<br/> > > ><br/> > > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that.<br/> > > ><br/> > > > Are you aware that you can get debug output from the solvers?<br/> > > > Do this:<br/> > > ><br/> > > > model.options.debug(ConvexSolver.class);<br/> > > ><br/> > > ><br/> > > > If you don’t have any other way to construct a test case, you can try this:<br/> > > ><br/> > > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy.<br/> > > ><br/> > > ><br/> > > > /Anders<br/> > > ><br/> > > ><br/> > > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote:<br/> > > > ><br/> > > > > Hi everybody,<br/> > > > ><br/> > > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm?<br/> > > > ><br/> > > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated.<br/> > > > ><br/> > > > > Best<br/> > > > > Nico<br/> > > > > ------------------------------------------------------------------------------<br/> > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > > ojAlgo-user mailing list<br/> > > > > ojA...@li...<br/> > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ><br/> > > ><br/> > > > ------------------------------------------------------------------------------<br/> > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > > _______________________________________________<br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > ------------------------------------------------------------------------------<br/> > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ><br/> > ><br/> > > ------------------------------------------------------------------------------<br/> > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > Monitor end-to-end web transactions and take corrective actions now<br/> > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > _______________________________________________<br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ------------------------------------------------------------------------------<br/> > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > Monitor end-to-end web transactions and take corrective actions now<br/> > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> ><br/> ><br/> > ------------------------------------------------------------------------------<br/> > Transform Data into Opportunity.<br/> > Accelerate data analysis in your applications with<br/> > Intel Data Analytics Acceleration Library.<br/> > Click to learn more.<br/> > <a href="http://makebettercode.com/inteldaal-eval" target="_blank">http://makebettercode.com/inteldaal-eval</a><br/> > _______________________________________________<br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------<br/> > Transform Data into Opportunity.<br/> > Accelerate data analysis in your applications with<br/> > Intel Data Analytics Acceleration Library.<br/> > Click to learn more.<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a><br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> <br/> <br/> ------------------------------------------------------------------------------<br/> Transform Data into Opportunity.<br/> Accelerate data analysis in your applications with<br/> Intel Data Analytics Acceleration Library.<br/> Click to learn more.<br/> <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140</a><br/> _______________________________________________<br/> ojAlgo-user mailing list<br/> ojA...@li...<br/> <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div> </div> ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div></div></body></html> |
From: Nico P. <Nic...@gm...> - 2016-03-16 09:23:41
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Thanks, I tried it. Now the algorithms fails to find a feasible solution. However, the problem is guaranteed to be feasible and the algorithm from version 37 seems to find the correct solutions.</div> <div> </div> <div>Best</div> <div>Nico</div> <div> </div> <div> </div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Dienstag, 15. März 2016 um 23:18 Uhr<br/> <b>Von:</b> "Anders Peterson" <an...@op...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div name="quoted-content">There is a new snapshot build v39.7 available at sourceforge:<br/> <br/> <a href="https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/" target="_blank">https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/</a><br/> <br/> Currently all test cases related to convex optimisation pass. Could you try it?<br/> <br/> /Anders<br/> <br/> <br/> > On 9 mars 2016, at 10:45, Nico Potyka <Nic...@gm...> wrote:<br/> ><br/> > Sorry, I forgot to turn validation off. After turning validation off, there is no exception and it often says KKT system unsolvable as you already suspected.<br/> ><br/> ><br/> > Gesendet: Mittwoch, 09. März 2016 um 10:39 Uhr<br/> > Von: "Nico Potyka" <Nic...@gm...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > Thanks for all the hints. When I activate the debugging mode I actually get an exception:<br/> ><br/> > Exception in thread "main" java.lang.IllegalArgumentException: Q must be positive semidefinite!<br/> ><br/> > However, there is no exception without the debugging mode. I actually check the result for optimality with<br/> ><br/> > Result result = tmpModel.minimise();<br/> > if(result.getState() == Optimisation.State.OPTIMAL) {<br/> > ...<br/> ><br/> > So it seems that the solver regards the computed solutions indeed as optimal.<br/> ><br/> ><br/> > I would love to send you a simple test case, but the example is rather complex and I currently don't find time to extract<br/> > a straightforward example that shows this behaviour. You can find the project in the SVN repository<br/> ><br/> > ssh://svn.code.sf.net/p/kreator-ide/code/<br/> ><br/> > in the folder<br/> ><br/> > Software/Log4KR<br/> ><br/> > The test case is in the class<br/> ><br/> > /Log4KR/sourceExamples/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityReasoningExamples.java<br/> ><br/> > The problematic optimization problem is defined in the class<br/> ><br/> > /Log4KR/src/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityEntailment2Norm.java<br/> ><br/> > in the method initialize. The ExpressionBasedModel is initialized in line 87. If you want to try with this example,<br/> > I can give you more details. Then you might also want to check out revision 3911, which still contained Ojalgo37<br/> > and worked fine. Of course, I don't expect that you do because the example is rather complex. However, I will try to<br/> > find some time to extract a straightforward example.<br/> ><br/> > Best wishes<br/> > Nico<br/> ><br/> ><br/> ><br/> > Gesendet: Dienstag, 08. März 2016 um 12:59 Uhr<br/> > Von: "Anders Peterson" <an...@op...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > When you do<br/> ><br/> > tmpModel.options.debug(ConvexSolver.class);<br/> ><br/> > it turns on debugging of that solver AND validation of the model/solver data.<br/> ><br/> > It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off.<br/> ><br/> > tmpModel.options.validate = false;<br/> ><br/> ><br/> > With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”?<br/> ><br/> > Are the solutions you get feasible, but not (always) optimal?<br/> ><br/> ><br/> > I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE.<br/> ><br/> ><br/> > Still interested in getting some test case from you.<br/> ><br/> ><br/> > /Anders<br/> ><br/> ><br/> ><br/> > > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote:<br/> > ><br/> > > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you.<br/> > ><br/> > > Best regards<br/> > > Nico<br/> > ><br/> > ><br/> > ><br/> > > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr<br/> > > Von: "Anders Peterson" <an...@op...><br/> > > An: oja...@li...<br/> > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > A common QP should be ok with v39.0 - I’d very much like to know what problems you have.<br/> > ><br/> > > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method.<br/> > ><br/> > > If you can construct a test case using ExpressionsBasedModel, that would be better.<br/> > ><br/> > > /Anders<br/> > ><br/> > ><br/> > ><br/> > > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote:<br/> > > ><br/> > > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time.<br/> > > ><br/> > > > Thanks for the hints on debugging.<br/> > > ><br/> > > ><br/> > > ><br/> > > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr<br/> > > > Von: "Anders Peterson" <an...@op...><br/> > > > An: oja...@li...<br/> > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > > Do you have integer variables?<br/> > > ><br/> > > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.)<br/> > > ><br/> > > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”.<br/> > > ><br/> > > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you.<br/> > > ><br/> > > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that.<br/> > > ><br/> > > > Are you aware that you can get debug output from the solvers?<br/> > > > Do this:<br/> > > ><br/> > > > model.options.debug(ConvexSolver.class);<br/> > > ><br/> > > ><br/> > > > If you don’t have any other way to construct a test case, you can try this:<br/> > > ><br/> > > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy.<br/> > > ><br/> > > ><br/> > > > /Anders<br/> > > ><br/> > > ><br/> > > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote:<br/> > > > ><br/> > > > > Hi everybody,<br/> > > > ><br/> > > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm?<br/> > > > ><br/> > > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated.<br/> > > > ><br/> > > > > Best<br/> > > > > Nico<br/> > > > > ------------------------------------------------------------------------------<br/> > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > > ojAlgo-user mailing list<br/> > > > > ojA...@li...<br/> > > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ><br/> > > ><br/> > > > ------------------------------------------------------------------------------<br/> > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > > _______________________________________________<br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > > ------------------------------------------------------------------------------<br/> > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ><br/> > ><br/> > > ------------------------------------------------------------------------------<br/> > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > Monitor end-to-end web transactions and take corrective actions now<br/> > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > _______________________________________________<br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ------------------------------------------------------------------------------<br/> > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > Monitor end-to-end web transactions and take corrective actions now<br/> > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> ><br/> ><br/> > ------------------------------------------------------------------------------<br/> > Transform Data into Opportunity.<br/> > Accelerate data analysis in your applications with<br/> > Intel Data Analytics Acceleration Library.<br/> > Click to learn more.<br/> > <a href="http://makebettercode.com/inteldaal-eval" target="_blank">http://makebettercode.com/inteldaal-eval</a><br/> > _______________________________________________<br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------<br/> > Transform Data into Opportunity.<br/> > Accelerate data analysis in your applications with<br/> > Intel Data Analytics Acceleration Library.<br/> > Click to learn more.<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a><br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> <br/> <br/> ------------------------------------------------------------------------------<br/> Transform Data into Opportunity.<br/> Accelerate data analysis in your applications with<br/> Intel Data Analytics Acceleration Library.<br/> Click to learn more.<br/> <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140</a><br/> _______________________________________________<br/> ojAlgo-user mailing list<br/> ojA...@li...<br/> <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div></div></body></html> |