Exemplo n.º 1
0
 def _bcbcg_exp(self):
     bcbcg_solver_obj = BCBCG()
     step_val_a = 3
     step_val_b = 5
     self._final_X_a, self._final_R_a, self._residual_hist_a = \
            bcbcg_solver_obj.bcbcg_solver(self._mat, self._B, self._X, step_val_a, self._tol, self._maxiter,0)
     self._final_X_b, self._final_R_b, self._residual_hist_b = \
            bcbcg_solver_obj.bcbcg_solver(self._mat, self._B, self._X, step_val_b, self._tol, self._maxiter,0)
Exemplo n.º 2
0
 def _bcbcg_exp(self):
     bcbcg_solver_obj = BCBCG() 
     step_val_a = 3
     step_val_b = 5
     self._final_X_a, self._final_R_a, self._residual_hist_a = \
            bcbcg_solver_obj.bcbcg_solver(self._mat, self._B, self._X, step_val_a, self._tol, self._maxiter,0)
     self._final_X_b, self._final_R_b, self._residual_hist_b = \
            bcbcg_solver_obj.bcbcg_solver(self._mat, self._B, self._X, step_val_b, self._tol, self._maxiter,0)
Exemplo n.º 3
0
    def _db_bcbcg_lstsq (self):
        """ """
        bcbcg_solver_obj = BCBCG()
        self._final_X_a, self._final_R_a, self._residual_hist_a = \
               bcbcg_solver_obj.bcbcg_solver_least_square(self._mat, self._BB, self._BX, self._step_val, self._tol, self._maxiter,0)
        self._final_X_b, self._final_R_b, self._residual_hist_b = \
               bcbcg_solver_obj.bcbcg_solver(self._mat, self._BB, self._BX, self._step_val, self._tol, self._maxiter,0)

        plot_worker = Presenter()
        residual_list = [self._residual_hist_a, self._residual_hist_b]
        legend_list = ["bcbcg_s20b4_lstsq","bcbcg_s20b4"]
        color_list = ["r","k"]
        plot_worker.instant_plot_y_log10(residual_list, "crystm02", "#iteration", "$\\frac{||x_1||}{||b_1||}$", legend_list, color_list)
Exemplo n.º 4
0
    def _db_bcbcg_lstsq (self):
        """ """
        bcbcg_solver_obj = BCBCG()
        self._final_X_a, self._final_R_a, self._residual_hist_a = \
               bcbcg_solver_obj.bcbcg_solver_least_square(self._mat, self._BB, self._BX, self._step_val, self._tol, self._maxiter,0)
        self._final_X_b, self._final_R_b, self._residual_hist_b = \
               bcbcg_solver_obj.bcbcg_solver(self._mat, self._BB, self._BX, self._step_val, self._tol, self._maxiter,0)

        plot_worker = Presenter()
        residual_list = [self._residual_hist_a, self._residual_hist_b]
        legend_list = ["bcbcg_s20b4_lstsq","bcbcg_s20b4"]
        color_list = ["r","k"]
        plot_worker.instant_plot_y_log10(residual_list, "crystm02", "#iteration", "$\\frac{||x_1||}{||b_1||}$", legend_list, color_list)
Exemplo n.º 5
0
    def _db_blbcg_exp(self):
        """ """
        lbcg_solver_obj = LBCG()
        self._final_x_a, self._final_r_a, self._residual_hist_a = \
                 lbcg_solver_obj.lbcg_solver(self._mat, self._SB, self._SX, 8, self._tol, self._maxiter)

        blbcg_solver_obj = BLBCG()
        self._final_x_b, self._final_r_b, self._residual_hist_b = \
                 blbcg_solver_obj.blbcg_solver(self._mat, self._BB, self._BX, 8, self._tol, self._maxiter, 0)

        bcbcg_solver_obj = BCBCG()
        self._final_x_c, self._final_r_c, self._residual_hist_c = \
                 bcbcg_solver_obj.bcbcg_solver(self._mat, self._BB, self._BX, 8, self._tol, self._maxiter, 0)

        plot_worker = Presenter()
        residual_list = [self._residual_hist_a, self._residual_hist_b, self._residual_hist_c]
        legend_list = ["lbcg_s8","blbcg_s8b10", "bcbcg_s8b10"]
        color_list = ["r","k", "b"]
        plot_worker.instant_plot_y_log10(residual_list, "bodyy6", "#iteration", "$\\frac{||x_1||}{||b_1||}$", legend_list, color_list)
Exemplo n.º 6
0
    def _db_blbcg_exp(self):
        """ """
        lbcg_solver_obj = LBCG()
        self._final_x_a, self._final_r_a, self._residual_hist_a = \
                 lbcg_solver_obj.lbcg_solver(self._mat, self._SB, self._SX, 8, self._tol, self._maxiter)

        blbcg_solver_obj = BLBCG()
        self._final_x_b, self._final_r_b, self._residual_hist_b = \
                 blbcg_solver_obj.blbcg_solver(self._mat, self._BB, self._BX, 8, self._tol, self._maxiter, 0)

        bcbcg_solver_obj = BCBCG()
        self._final_x_c, self._final_r_c, self._residual_hist_c = \
                 bcbcg_solver_obj.bcbcg_solver(self._mat, self._BB, self._BX, 8, self._tol, self._maxiter, 0)

        plot_worker = Presenter()
        residual_list = [self._residual_hist_a, self._residual_hist_b, self._residual_hist_c]
        legend_list = ["lbcg_s8","blbcg_s8b10", "bcbcg_s8b10"]
        color_list = ["r","k", "b"]
        plot_worker.instant_plot_y_log10(residual_list, "bodyy6", "#iteration", "$\\frac{||x_1||}{||b_1||}$", legend_list, color_list)
Exemplo n.º 7
0
 def _bcbcg_exp(self):
     bcbcg_solver_obj = BCBCG()
     self._final_X, self._final_R, self._residual_hist = \
            bcbcg_solver_obj.bcbcg_solver(self._mat, self._B, self._X, self._step_val, self._tol, self._maxiter,1)
Exemplo n.º 8
0
 def _debug_bcbcg(self):
     bcbcg_solver_obj = BCBCG() 
     self._final_X, self._final_R, self._residual_hist = \
            bcbcg_solver_obj.bcbcg_solver(self._mat, self._B, self._X, self._step_val, self._tol, self._maxiter,1)
     print(self._residual_hist)
Exemplo n.º 9
0
 def _bcbcg_exp(self):
     bcbcg_solver_obj = BCBCG() 
     self._final_X, self._final_R, self._residual_hist = \
            bcbcg_solver_obj.bcbcg_solver(self._mat, self._B, self._X, self._step_val, self._tol, self._maxiter,0)