solve_algo=7 and stack_solve_algo=2 are now allowed under Octave
The gmres() function has been implemented (actually since Octave 3.4.1!).time-shift
parent
fda021855c
commit
d03cc56587
|
@ -3352,7 +3352,7 @@ Newton algorithm with a sparse LU solver at each iteration (requires
|
||||||
@item 7
|
@item 7
|
||||||
Newton algorithm with a Generalized Minimal Residual (GMRES) solver at
|
Newton algorithm with a Generalized Minimal Residual (GMRES) solver at
|
||||||
each iteration (requires @code{bytecode} and/or @code{block} option,
|
each iteration (requires @code{bytecode} and/or @code{block} option,
|
||||||
@pxref{Model declaration}; not available under Octave)
|
@pxref{Model declaration})
|
||||||
|
|
||||||
@item 8
|
@item 8
|
||||||
Newton algorithm with a Stabilized Bi-Conjugate Gradient (BICGSTAB)
|
Newton algorithm with a Stabilized Bi-Conjugate Gradient (BICGSTAB)
|
||||||
|
@ -3984,7 +3984,7 @@ declaration}).
|
||||||
@item 2
|
@item 2
|
||||||
Use a Newton algorithm with a Generalized Minimal Residual (GMRES)
|
Use a Newton algorithm with a Generalized Minimal Residual (GMRES)
|
||||||
solver at each iteration (requires @code{bytecode} and/or @code{block}
|
solver at each iteration (requires @code{bytecode} and/or @code{block}
|
||||||
option, @pxref{Model declaration}; not available under Octave)
|
option, @pxref{Model declaration})
|
||||||
|
|
||||||
@item 3
|
@item 3
|
||||||
Use a Newton algorithm with a Stabilized Bi-Conjugate Gradient
|
Use a Newton algorithm with a Stabilized Bi-Conjugate Gradient
|
||||||
|
|
|
@ -37,10 +37,6 @@ if (DynareOptions.block || DynareOptions.bytecode) && DynareOptions.stack_solve_
|
||||||
error('perfect_foresight_solver:ArgCheck','PERFECT_FORESIGHT_SOLVER: you can''t use stack_solve_algo = 6 with block or bytecode option')
|
error('perfect_foresight_solver:ArgCheck','PERFECT_FORESIGHT_SOLVER: you can''t use stack_solve_algo = 6 with block or bytecode option')
|
||||||
end
|
end
|
||||||
|
|
||||||
if isoctave && DynareOptions.stack_solve_algo == 2
|
|
||||||
error('perfect_foresight_solver:ArgCheck','PERFECT_FORESIGHT_SOLVER: you can''t use stack_solve_algo = 2 under Octave')
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
if isempty(DynareResults.endo_simul) || any(size(DynareResults.endo_simul) ~= [ DynareModel.endo_nbr, DynareModel.maximum_lag+DynareOptions.periods+DynareModel.maximum_lead ])
|
if isempty(DynareResults.endo_simul) || any(size(DynareResults.endo_simul) ~= [ DynareModel.endo_nbr, DynareModel.maximum_lag+DynareOptions.periods+DynareModel.maximum_lead ])
|
||||||
|
|
||||||
|
|
|
@ -280,9 +280,6 @@ for it_=start:incr:finish
|
||||||
end
|
end
|
||||||
elseif (stack_solve_algo==2 && is_dynamic) || (options.solve_algo==7 && ~is_dynamic)
|
elseif (stack_solve_algo==2 && is_dynamic) || (options.solve_algo==7 && ~is_dynamic)
|
||||||
flag1=1;
|
flag1=1;
|
||||||
if isoctave
|
|
||||||
error('SOLVE_ONE_BOUNDARY: you can''t use solve_algo=7 since GMRES is not implemented in Octave')
|
|
||||||
end
|
|
||||||
if verbose == 1 && ~is_dynamic
|
if verbose == 1 && ~is_dynamic
|
||||||
disp('steady: GMRES ')
|
disp('steady: GMRES ')
|
||||||
end
|
end
|
||||||
|
|
|
@ -48,7 +48,7 @@ if ~options_.bytecode && options_.block && options_.solve_algo == 5
|
||||||
error('STEADY: you can''t use solve_algo = 5 without bytecode option')
|
error('STEADY: you can''t use solve_algo = 5 without bytecode option')
|
||||||
end
|
end
|
||||||
|
|
||||||
if isoctave && ismember(options_.solve_algo,[7,11])
|
if isoctave && options_.solve_algo == 11
|
||||||
error(['SIMUL: you can''t use solve_algo = %u under Octave'],options_.solve_algo)
|
error(['SIMUL: you can''t use solve_algo = %u under Octave'],options_.solve_algo)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4833,14 +4833,6 @@ dynSparseMatrix::Solve_CUDA_BiCGStab(int *Ap, int *Ai, double *Ax, int *Ap_tild,
|
||||||
void
|
void
|
||||||
dynSparseMatrix::Solve_Matlab_GMRES(mxArray *A_m, mxArray *b_m, int Size, double slowc, int block, bool is_two_boundaries, int it_, mxArray *x0_m)
|
dynSparseMatrix::Solve_Matlab_GMRES(mxArray *A_m, mxArray *b_m, int Size, double slowc, int block, bool is_two_boundaries, int it_, mxArray *x0_m)
|
||||||
{
|
{
|
||||||
#ifdef OCTAVE_MEX_FILE
|
|
||||||
ostringstream tmp;
|
|
||||||
if (steady_state)
|
|
||||||
tmp << " GMRES method is not implemented in Octave. You cannot use solve_algo=7, change solve_algo.\n";
|
|
||||||
else
|
|
||||||
tmp << " GMRES method is not implemented in Octave. You cannot use stack_solve_algo=2, change stack_solve_algo.\n";
|
|
||||||
throw FatalExceptionHandling(tmp.str());
|
|
||||||
#endif
|
|
||||||
size_t n = mxGetM(A_m);
|
size_t n = mxGetM(A_m);
|
||||||
const char *field_names[] = {"droptol", "type"};
|
const char *field_names[] = {"droptol", "type"};
|
||||||
mwSize dims[1] = { 1 };
|
mwSize dims[1] = { 1 };
|
||||||
|
|
|
@ -43,19 +43,17 @@ cd([top_test_dir filesep 'block_bytecode']);
|
||||||
tic;
|
tic;
|
||||||
for blockFlag = 0:1
|
for blockFlag = 0:1
|
||||||
for bytecodeFlag = 0:1
|
for bytecodeFlag = 0:1
|
||||||
## Recall that solve_algo=7 and stack_solve_algo=2 are not supported
|
|
||||||
## under Octave
|
|
||||||
default_solve_algo = 2;
|
default_solve_algo = 2;
|
||||||
default_stack_solve_algo = 0;
|
default_stack_solve_algo = 0;
|
||||||
if !blockFlag && !bytecodeFlag
|
if !blockFlag && !bytecodeFlag
|
||||||
solve_algos = 0:4;
|
solve_algos = 0:4;
|
||||||
stack_solve_algos = [0 6];
|
stack_solve_algos = [0 6];
|
||||||
elseif blockFlag && !bytecodeFlag
|
elseif blockFlag && !bytecodeFlag
|
||||||
solve_algos = [0:4 6 8];
|
solve_algos = [0:4 6:8];
|
||||||
stack_solve_algos = [0 1 3 4];
|
stack_solve_algos = 0:4;
|
||||||
else
|
else
|
||||||
solve_algos = [0:6 8];
|
solve_algos = 0:8;
|
||||||
stack_solve_algos = [0 1 3:5];
|
stack_solve_algos = 0:5;
|
||||||
endif
|
endif
|
||||||
|
|
||||||
sleep(1) # Workaround for strange race condition related to the _static.m file
|
sleep(1) # Workaround for strange race condition related to the _static.m file
|
||||||
|
|
Loading…
Reference in New Issue