예제 #1
0
 def _debug_bcg(self):
     bcg_solver_obj = NativeBlockConjugateGradient(self._mat, self._X,
                                                   self._B, self._tol,
                                                   self._maxiter)
     self._final_X, self._final_R, self._residual_hist = bcg_solver_obj.bcg_variant_one_run(
         0)
     print(self._residual_hist)
예제 #2
0
    def _db_bcg_least_square (self):
        """ """
        m = 32
        self._BB_m  = np.random.random( ( self._mat.shape[0],m) )
        self._BX_m  = np.ones ( (self._mat.shape[1],m) )

        bcg_solver_obj = NativeBlockConjugateGradient(self._mat, self._BX_m, self._BB_m, self._tol, self._maxiter)
        self._final_X_bcg, self._final_R_bcg, self._residual_hist_bcg = bcg_solver_obj.bcg_variant_one_run(0)

        bcg_solver_obj = NativeBlockConjugateGradient(self._mat, self._BX_m, self._BB_m, self._tol, self._maxiter)
        self._final_X_bcg_lstsq, self._final_R_bcg_lstsq, self._residual_hist_bcg_lstsq = bcg_solver_obj.bcg_variant_lstsq_run(0)

        plot_worker = Presenter()
        residual_list = [self._residual_hist_bcg, self._residual_hist_bcg_lstsq]
        legend_list = ["bcg","bcg_lstsq"]
        color_list = ["r","k"]
        plot_worker.instant_plot_y_log10(residual_list, "test", "#iteration", "$\\mathbf{log_{10}\\frac{||x_1||}{||b_1||}}$", legend_list, color_list)
예제 #3
0
 def _debug_bcg(self):
     bcg_solver_obj = NativeBlockConjugateGradient(self._mat, self._X, self._B, self._tol, self._maxiter)
     self._final_X, self._final_R, self._residual_hist = bcg_solver_obj.bcg_variant_one_run(0) 
     print(self._residual_hist)