From 734b596a0eb2b9b8e7e000a7cc50e5f07859732f Mon Sep 17 00:00:00 2001 From: GitHub CI Documentation builder Date: Mon, 13 May 2024 08:54:28 +0000 Subject: [PATCH] Update docs --- matrix__batch__tridiag_8hpp_source.html | 141 ++++++++++++------------ 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/matrix__batch__tridiag_8hpp_source.html b/matrix__batch__tridiag_8hpp_source.html index 34e60ba46..06d8c8db6 100644 --- a/matrix__batch__tridiag_8hpp_source.html +++ b/matrix__batch__tridiag_8hpp_source.html @@ -163,10 +163,10 @@
97  "DiagDominant",
98  batch_policy,
99  KOKKOS_LAMBDA(int batch_idx, int k, bool& check_diag_dom) {
-
100  check_diag_dom
-
101  = (Kokkos::abs(subdiag_proxy(batch_idx, k))
-
102  + Kokkos::abs(uppdiag_proxy(batch_idx, k))
-
103  <= Kokkos::abs(diag_proxy(batch_idx, k)));
+
100  check_diag_dom = check_diag_dom
+
101  && (Kokkos::abs(subdiag_proxy(batch_idx, k))
+
102  + Kokkos::abs(uppdiag_proxy(batch_idx, k))
+
103  <= Kokkos::abs(diag_proxy(batch_idx, k)));
104  },
105  Kokkos::LAnd<bool>(is_diagdom));
106  Kokkos::parallel_reduce(
@@ -174,75 +174,76 @@
108  batch_policy,
109  KOKKOS_LAMBDA(int batch_idx, int k, bool& check_sym) {
110  check_sym
-
111  = (Kokkos::abs(
-
112  subdiag_proxy(batch_idx, k) - uppdiag_proxy(batch_idx, k))
-
113  < 1e-16);
-
114  },
-
115  Kokkos::LAnd<bool>(is_symmetric));
-
116 
-
117  return (is_diagdom || is_symmetric);
-
118  }
-
119 
-
126  DKokkosView2D solve_inplace(DKokkosView2D const rhs_view) const
-
127  {
-
128  assert(get_batch_size() == rhs_view.extent(0));
-
129  assert(get_size() == rhs_view.extent(1));
-
130 
-
131  int const tmp_batch_size = m_subdiag.extent(0);
-
132  int const tmp_mat_size = m_subdiag.extent(1);
-
133 
-
134  Kokkos::View<
-
135  double**,
-
136  Kokkos::LayoutRight,
-
137  Kokkos::DefaultExecutionSpace::memory_space> const
-
138  cprim("cprim", get_batch_size(), get_size());
-
139  Kokkos::View<
-
140  double**,
-
141  Kokkos::LayoutRight,
-
142  Kokkos::DefaultExecutionSpace::memory_space> const
-
143  dprim("dprim", get_batch_size(), get_size());
-
144 
-
145  DKokkosView2D subdiag_proxy = m_subdiag;
-
146  DKokkosView2D diag_proxy = m_diag;
-
147  DKokkosView2D uppdiag_proxy = m_uppdiag;
-
148 
-
149  Kokkos::parallel_for(
-
150  "Tridiagonal solver",
-
151  Kokkos::RangePolicy<ExecSpace>(0, tmp_batch_size),
-
152  KOKKOS_LAMBDA(const int batch_idx) {
-
153  //ForwardStep
-
154  cprim(batch_idx, 0) = uppdiag_proxy(batch_idx, 0) / diag_proxy(batch_idx, 0);
-
155  dprim(batch_idx, 0) = rhs_view(batch_idx, 0) / diag_proxy(batch_idx, 0);
-
156  for (int i = 1; i < tmp_mat_size; i++) {
-
157  cprim(batch_idx, i)
-
158  = uppdiag_proxy(batch_idx, i)
-
159  / (diag_proxy(batch_idx, i)
-
160  - subdiag_proxy(batch_idx, i) * cprim(batch_idx, i - 1));
-
161  dprim(batch_idx, i)
-
162  = (rhs_view(batch_idx, i)
-
163  - subdiag_proxy(batch_idx, i) * dprim(batch_idx, i - 1))
-
164  / (diag_proxy(batch_idx, i)
-
165  - subdiag_proxy(batch_idx, i) * cprim(batch_idx, i - 1));
-
166  }
-
167  //BackwardStep
-
168  rhs_view(batch_idx, tmp_mat_size - 1) = dprim(batch_idx, tmp_mat_size - 1);
-
169  for (int i = tmp_mat_size - 2; i >= 0; i--) {
-
170  rhs_view(batch_idx, i) = dprim(batch_idx, i)
-
171  - cprim(batch_idx, i) * rhs_view(batch_idx, i + 1);
-
172  }
-
173  });
-
174  return rhs_view;
-
175  }
-
180  void factorize() final
-
181  {
-
182  assert(check_stability());
-
183  }
-
184 };
+
111  = check_sym
+
112  && (Kokkos::abs(
+
113  subdiag_proxy(batch_idx, k) - uppdiag_proxy(batch_idx, k))
+
114  < 1e-16);
+
115  },
+
116  Kokkos::LAnd<bool>(is_symmetric));
+
117 
+
118  return (is_diagdom || is_symmetric);
+
119  }
+
120 
+
127  DKokkosView2D solve_inplace(DKokkosView2D const rhs_view) const
+
128  {
+
129  assert(get_batch_size() == rhs_view.extent(0));
+
130  assert(get_size() == rhs_view.extent(1));
+
131 
+
132  int const tmp_batch_size = m_subdiag.extent(0);
+
133  int const tmp_mat_size = m_subdiag.extent(1);
+
134 
+
135  Kokkos::View<
+
136  double**,
+
137  Kokkos::LayoutRight,
+
138  Kokkos::DefaultExecutionSpace::memory_space> const
+
139  cprim("cprim", get_batch_size(), get_size());
+
140  Kokkos::View<
+
141  double**,
+
142  Kokkos::LayoutRight,
+
143  Kokkos::DefaultExecutionSpace::memory_space> const
+
144  dprim("dprim", get_batch_size(), get_size());
+
145 
+
146  DKokkosView2D subdiag_proxy = m_subdiag;
+
147  DKokkosView2D diag_proxy = m_diag;
+
148  DKokkosView2D uppdiag_proxy = m_uppdiag;
+
149 
+
150  Kokkos::parallel_for(
+
151  "Tridiagonal solver",
+
152  Kokkos::RangePolicy<ExecSpace>(0, tmp_batch_size),
+
153  KOKKOS_LAMBDA(const int batch_idx) {
+
154  //ForwardStep
+
155  cprim(batch_idx, 0) = uppdiag_proxy(batch_idx, 0) / diag_proxy(batch_idx, 0);
+
156  dprim(batch_idx, 0) = rhs_view(batch_idx, 0) / diag_proxy(batch_idx, 0);
+
157  for (int i = 1; i < tmp_mat_size; i++) {
+
158  cprim(batch_idx, i)
+
159  = uppdiag_proxy(batch_idx, i)
+
160  / (diag_proxy(batch_idx, i)
+
161  - subdiag_proxy(batch_idx, i) * cprim(batch_idx, i - 1));
+
162  dprim(batch_idx, i)
+
163  = (rhs_view(batch_idx, i)
+
164  - subdiag_proxy(batch_idx, i) * dprim(batch_idx, i - 1))
+
165  / (diag_proxy(batch_idx, i)
+
166  - subdiag_proxy(batch_idx, i) * cprim(batch_idx, i - 1));
+
167  }
+
168  //BackwardStep
+
169  rhs_view(batch_idx, tmp_mat_size - 1) = dprim(batch_idx, tmp_mat_size - 1);
+
170  for (int i = tmp_mat_size - 2; i >= 0; i--) {
+
171  rhs_view(batch_idx, i) = dprim(batch_idx, i)
+
172  - cprim(batch_idx, i) * rhs_view(batch_idx, i + 1);
+
173  }
+
174  });
+
175  return rhs_view;
+
176  }
+
181  void factorize() final
+
182  {
+
183  assert(check_stability());
+
184  }
+
185 };
A structure for solving a set of independant tridiagonal systems using a direct method.
Definition: matrix_batch_tridiag.hpp:24
bool check_stability() const
Check if the matrices are in the stability area of the solver.
Definition: matrix_batch_tridiag.hpp:77
-
void factorize() final
function used to execute specific implementation details.
Definition: matrix_batch_tridiag.hpp:180
+
void factorize() final
function used to execute specific implementation details.
Definition: matrix_batch_tridiag.hpp:181
MatrixBatchTridiag(const int batch_size, const int mat_size, DKokkosView2D const aa, DKokkosView2D const bb, DKokkosView2D const cc)
Creates an instance of the MatrixBatchTridiag class.
Definition: matrix_batch_tridiag.hpp:52
-
DKokkosView2D solve_inplace(DKokkosView2D const rhs_view) const
Solves the collection of problems to find x_i such that: A_i x_i=rhs_i i=0,batch_size.
Definition: matrix_batch_tridiag.hpp:126
+
DKokkosView2D solve_inplace(DKokkosView2D const rhs_view) const
Solves the collection of problems to find x_i such that: A_i x_i=rhs_i i=0,batch_size.
Definition: matrix_batch_tridiag.hpp:127
MatrixBatch superclass for managing a collection of linear systems.
Definition: matrix_batch.hpp:24
Kokkos::View< double **, Kokkos::LayoutRight, typename ExecSpace::memory_space > DKokkosView2D
Alias for 2D double Kokkos views, LayoutRight is specified.
Definition: matrix_batch.hpp:30
int get_batch_size() const
Getter function for batch size, ie the number of linear systems to solve.
Definition: matrix_batch.hpp:66