change_weighting
Called by: main after convergence has been reached.
Includes: iscloc.h
External:
weighting1 set in read_config
weighting2 set in read_config
Input arguments:
Pointer to solution structure.
Structure members updated:
weighting_type in solution structure.
converged in solution structure.
Return: 0/1 for success/failure.
If a parameter weighting2 is present in config.txt then an external variable weighting2 will have been initialised in read_config. If this is the case and weighting_type in the solution structure is currently set to the value of weighting1 (i.e. this function has not been called before) then this function sets weighting_type to weighting2 and converged to 0. This has the effect of restarting the iteration process with the most recent solution as a starting point and using a different weighting function.
Note that the iteration process may be restarted after the first convergence even if no change is made to the weighting function because phases may have been purged in function purge_pha, which also updates converged in the solution structure if it does anything.