contents

calc_weight

Called by:   main each iteration.

Includes:   iscloc.h

Input arguments:
Pointer to solution structure.
Array of phase structures.

Calls:
Weighting function that depends on weighting_type in the solution structure.
print_pha if diagnostic is on.

Structure members updated:
prev_alpha, prev_sigma, and sigma in  solution structure.

Return:   0/1 for success/failure.

Calls the weighting function corresponding to the current value of weighting_type in the  solution structure.  After weighting has been done this function calculates sigma - a weighted measure of standard deviation of residuals that is used in iteration control in function decide_iter.   This function also records the values of alpha (which is calculated in the weighting function itself) and sigma from the previous iteration as prev_alpha and prev_sigma.  These are compared with the current values in function decide_iter to tell if the solution is converged or diverging.