Re: [ojAlgo-user] ExpressionsBasedModel and absolute constraints
Mathematics, linear algebra and optimisation
                
                Brought to you by:
                
                    apete
                    
                
            
            
        
        
        
    | 
      
      
      From: Anders P. <an...@op...> - 2015-02-16 13:11:35
      
     | 
| This is a modelling question not directly related to ojAlgo, Strictly speaking you're off topic for this mailing list, but I'm leaning towards allowing it if the discussion context is "how do I do this with ojAlgo". I will however only participate if the discussion leads to more concrete questions regarding ojAlgo.
/Anders
> On 16 feb 2015, at 13:01, Anthony Edwards <ant...@al...> wrote:
> 
> Hi
> 
> I am using an expressions based model (for a portfolio optimisation 
> problem) and can add a constraint such that the sum of the weights in 
> the portfolio is equals to 1 as follows:
> 
> Expression balanceExpr = model.addExpression("Balance");
>             for (int i=0; i<ers.length; i++) 
> balanceExpr.setLinearFactor(i, BigMath.ONE);
>             balanceExpr.lower(BigMath.ONE);
>             balanceExpr.upper(BigMath.ONE);
> 
> What I would like to do is add another constrains such that the sum of 
> the absolute values of the weights is less than 2.  Any idea how I can 
> do this?  There is no setAbsoluteValueLinearFactor function or any way 
> of doing this as far as I can see.
> 
> Any pointers would be gratefully appreciated!
> 
> Thanks
> 
> Tony
> 
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
> _______________________________________________
> ojAlgo-user mailing list
> ojA...@li...
> https://lists.sourceforge.net/lists/listinfo/ojalgo-user
> 
> 
 |