Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 4
0
 def peakmem_solve(self, linsys, dim):
     problinsolve(A=self.linsys.A, b=self.linsys.b)
Exemplo n.º 5
0
 def time_solve(self, linsys, dim):
     problinsolve(A=self.linsys.A, b=self.linsys.b)
Exemplo n.º 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
Exemplo n.º 7
0
 def peakmem_solve(self, system):
     """Time solving a linear system"""
     # pylint: disable=unused-argument
     problinsolve(A=self.A, b=self.b)
Exemplo n.º 8
0
 def peakmem_solve(self, system):
     """Time solving a linear system."""
     problinsolve(A=self.A, b=self.b)