This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Derived from https://raw.githubusercontent.com/Coloquinte/stackexchange-fun/master/solver.py | |
% See also https://or.stackexchange.com/questions/5183/pava-like-solution-to-simple-qp | |
% Find X with minimal change such that L <= X <= U. | |
function X = FindBoundedMinChangePath( L, U ) | |
n = numel( L ); | |
assert( numel( U ) == n ); | |
assert( all( L <= U ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function result = LogLin( VarEndoNames, VarExoNames, Parameters, Equations, SolveMode, EvalMode, EvalString, Digits ) | |
% ------------------------------------------------------------ | |
% PURPOSE: Performs log-linearisation. | |
% ------------------------------------------------------------ | |
% SYNTAX: result = LogLin( VarEndoNames, VarExoNames, Parameters, Equations, SolveMode, EvalMode, EvalString, Digits ); | |
% ------------------------------------------------------------ | |
% EXAMPLE: result = LogLin( { 'R', 'A' }, { 'EPSILON' }, { 'beta', 'rho' }, { 'beta * R * A / A(+1) = 1', 'A = A(-1) ^ rho * exp( EPSILON )' }, 2, 2 ) | |
% ------------------------------------------------------------ | |
% OUTPUT: result: a cell array of log-linearised equations, with __d appended to variable names that are deviations from steady state. | |
% ------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [ B, C, D ] = NearestKroneckerProduct( A, SizeB, SizeC, Hermitian ) %#codegen | |
% https://doi.org/10.1007/978-94-015-8196-7_17 | |
m = size( A, 1 ); | |
n = size( A, 2 ); | |
m1 = SizeB( 1 ); | |
n1 = SizeB( 2 ); | |
m2 = SizeC( 1 ); | |
n2 = SizeC( 2 ); | |
if nargin < 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Advanced Window Snap | |
* Snaps the Active Window to one of nine different window positions. | |
* | |
* @author Andrew Moore <andrew+github@awmoore.com> | |
* @version 1.0 | |
*/ | |
/** | |
* SnapActiveWindow resizes and moves (snaps) the active window to a given position. |