Input: Input the initial value matrices and the accurate value ;
Output: The algorithm export the matrix, that is ;
Begin: Assignment the matrix by the initial value matrix , that is ;
Assigned the matrix by , that is ;
Computed matrix , that is ;
Computed the error between and , that is ;
Judged that whether is lower than or not,
that is while , do ;
Defined the loop function: ;
Computed the error between and , that is ;
Finished the loop function
The matrix multiplied by and assigned to , that is ;
End the algorithm.
Algorithm 1: SMS algorithm for computing the generalized inverse .