From 7b1663281bc101b86d0c48bc1563208693ab08fe Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx,de>
Date: Mon, 3 Nov 2014 15:29:21 +0100
Subject: [PATCH] Transform objective function in osr to full matrix

If the objective function only has one element, the scalar product of a sparse matrix and a full matrix is sparse (in contrast to two or more elements). This crashes the osr code subsequently.
---
 matlab/osr_obj.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/matlab/osr_obj.m b/matlab/osr_obj.m
index 431a941f7..378d2b06e 100644
--- a/matlab/osr_obj.m
+++ b/matlab/osr_obj.m
@@ -86,4 +86,4 @@ switch info(1)
 end
 
 vx = get_variance_of_endogenous_variables(dr,i_var);
-loss = weights(:)'*vx(:);
+loss = full(weights(:)'*vx(:));
-- 
GitLab