Пример #1
0
    def setup(self, linsys, dim, qoi):

        if dim > 1000:
            # Operations on the posterior for large matrices can be very memory intensive.
            raise NotImplementedError()

        self.linsys = get_linear_system(name=linsys, dim=dim)
        x, A, Ainv, _ = problinsolve(A=self.linsys.A, b=self.linsys.b)
        self.qoi = get_quantity_of_interest(qoi, x, A, Ainv)
Пример #2
0
    def setup(self, output):
        # pylint: disable=attribute-defined-outside-init
        # pylint: disable=unused-argument, invalid-name

        # Sparse system
        self.A, self.b = load_poisson_linear_system()

        # Solve linear system
        self.xhat, self.Ahat, self.Ainvhat, _ = problinsolve(A=self.A, b=self.b)

        # Benchmark parameters
        self.n_samples = 10
Пример #3
0
    def setup(self, output):
        # pylint: disable=invalid-name

        # Sparse system
        self.A, self.b = load_poisson_linear_system()

        # Solve linear system
        self.xhat, self.Ahat, self.Ainvhat, _ = problinsolve(A=self.A,
                                                             b=self.b)

        # Benchmark parameters
        self.n_samples = 10
Пример #4
0
 def peakmem_solve(self, linsys, dim):
     problinsolve(A=self.linsys.A, b=self.linsys.b)
Пример #5
0
 def time_solve(self, linsys, dim):
     problinsolve(A=self.linsys.A, b=self.linsys.b)
Пример #6
0
 def setup(self, linsys, dim):
     self.linsys = get_linear_system(name=linsys, dim=dim)
     xhat, _, _, _ = problinsolve(A=self.linsys.A, b=self.linsys.b)
     self.xhat = xhat
Пример #7
0
 def peakmem_solve(self, system):
     """Time solving a linear system"""
     # pylint: disable=unused-argument
     problinsolve(A=self.A, b=self.b)
Пример #8
0
 def peakmem_solve(self, system):
     """Time solving a linear system."""
     problinsolve(A=self.A, b=self.b)