Commit d32e076b authored by MichelJuillard's avatar MichelJuillard
Browse files

adding missing function linsolve for Octave (inefficient and minimal implementation

for current needs)
parent e7a8261b
......@@ -93,6 +93,11 @@ if (exist('OCTAVE_VERSION') && ~user_has_octave_forge_package('statistics')) ...
addpath([dynareroot '/missing/nanmean'])
end
% linsolve is missing in Octave
if (exist('OCTAVE_VERSION'))
addpath([dynareroot '/missing/linsolve'])
end
% Add path to MEX files
if exist('OCTAVE_VERSION')
addpath([dynareroot '../mex/octave/']);
......
function [x,c] = linsolve(A,B,opts)
% (very imperfect) Clone of Matlab's linsolve.
% Copyright (C) 2010-2011 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
c = [];
x = [];
if nargin == 3
if isfield(opts,'TRANSA')
A = A';
end
end
if nargout == 2
c = rcond(A);
end
x = A\B;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment