ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
solver.cpp
Go to the documentation of this file.
1/* ============================================================================
2 Copyright (c) 2011-2022, Institute for Microelectronics,
3 Institute for Analysis and Scientific Computing,
4 TU Wien.
5
6 -----------------
7 ViennaSHE - The Vienna Spherical Harmonics Expansion Boltzmann Solver
8 -----------------
9
10 http://viennashe.sourceforge.net/
11
12 License: MIT (X11), see file LICENSE in the base directory
13 =============================================================================== */
14
15#include <iostream>
16#include <cstdlib>
17#include <vector>
18
19#ifndef NDEBUG
20#define NDEBUG
21#endif
22
23#include "viennashe/forwards.h"
24
25#include "src/solvers/solve.hpp"
28
31
32namespace viennashe
33{
34 namespace solvers
35 {
36
37 // sparse matrix
38 std::vector<double> solve(viennashe::math::sparse_matrix<double> & A,
39 std::vector<double> const & b, linear_solver_config const & config)
40 {
41 return solve_impl(A, b, config);
42 }
43
44 // dense matrix
45 std::vector<double> solve(viennashe::math::dense_matrix<double> & A,
46 std::vector<double> const & b)
47 {
48 linear_solver_config dummy_config;
49 return viennashe::solvers::solve(A, b, dummy_config,
51 }
52
53// // PETSC
54// std::vector<double>
55// solve(viennashe::math::sparse_matrix<double> & A,
56// std::vector<double> const & b,
57// linear_solver_config const & config)
58// {
59// linear_solver_config dummy_config(linear_solver_ids::petsc_parallel_linear_solver); //
60// return solve_impl(A, b, dummy_config);
61// }
62
63 }
64
65}
Internal tag used for the specification of a dense linear solver (Gauss, single-threaded)
Definition: forwards.h:203
Implements a dense Gauss solver.
Contains forward declarations and definition of small classes that must be defined at an early stage.
Implementation of various utilities related to linear algebra.
VectorType solve_impl(MatrixType &system_matrix, VectorType const &rhs, linear_solver_config const &config)
Public interface for solving a system of linear equations.
Definition: solve.hpp:49
std::vector< double > solve(viennashe::math::sparse_matrix< double > &A, std::vector< double > const &b, linear_solver_config const &config)
Public interface for solving a system of linear equations represented using a sparse matrix.
The main ViennaSHE namespace. All functionality resides inside this namespace.
Definition: accessors.hpp:40
Provides a generic solver layer, providing bindings to a dense Gauss solver, ViennaCL,...
Forward declarations for a generic solver layer, providing bindings to a native Gauss solver,...