Skip to content

Commit e02127d

Browse files
committed
use doxygen math \f$, and some doc descriptions
1 parent ffcd4ca commit e02127d

25 files changed

Lines changed: 222 additions & 168 deletions

include/ginkgo/core/base/lin_op.hpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,22 @@ class Diagonal;
6969
* and preconditioners is that the most common operation performed on all of
7070
* them can be expressed as an application of a linear operator to a vector:
7171
*
72-
* + the sparse matrix-vector product with a matrix $A$ is a linear
73-
* operator application $y = Ax$;
72+
* + the sparse matrix-vector product with a matrix \f$A\f$ is a linear
73+
* operator application \f$y = Ax\f$;
7474
* + the application of a preconditioner is a linear operator application
75-
* $y = M^{-1}x$, where $M$ is an approximation of the original
76-
* system matrix $A$ (thus a preconditioner represents an "approximate
77-
* inverse" operator $M^{-1}$).
78-
* + the system solve $Ax = b$ can be viewed as linear operator
75+
* \f$y = M^{-1}x\f$, where \f$M\f$ is an approximation of the original
76+
* system matrix \f$A\f$ (thus a preconditioner represents an "approximate
77+
* inverse" operator \f$M^{-1}\f$).
78+
* + the system solve \f$Ax = b\f$ can be viewed as linear operator
7979
* application
80-
* $x = A^{-1}b$ (it goes without saying that the implementation of
80+
* \f$x = A^{-1}b\f$ (it goes without saying that the implementation of
8181
* linear system solves does not follow this conceptual idea), so a linear
8282
* system solver can be viewed as a representation of the operator
83-
* $A^{-1}$.
83+
* \f$A^{-1}\f$.
8484
*
8585
* Finally, direct manipulation of LinOp objects is rarely required in
8686
* simple scenarios. As an illustrative example, one could construct a
87-
* fixed-point iteration routine $x_{k+1} = Lx_k + b$ as follows:
87+
* fixed-point iteration routine \f$x_{k+1} = Lx_k + b\f$ as follows:
8888
*
8989
* ```cpp
9090
* std::unique_ptr<matrix::Dense<>> calculate_fixed_point(
@@ -103,9 +103,9 @@ class Diagonal;
103103
* }
104104
* ```
105105
*
106-
* Here, if $L$ is a matrix, LinOp::apply() refers to the matrix vector
107-
* product, and `L->apply(a, b)` computes $b = L \cdot a$.
108-
* `x->add_scaled(one, b)` is the `axpy` vector update $x:=x+b$.
106+
* Here, if \f$L\f$ is a matrix, LinOp::apply() refers to the matrix vector
107+
* product, and `L->apply(a, b)` computes \f$b = L \cdot a\f$.
108+
* `x->add_scaled(one, b)` is the `axpy` vector update \f$x:=x+b\f$.
109109
*
110110
* The interesting part of this example is the apply() routine at line 4 of the
111111
* function body. Since this routine is part of the LinOp base class, the
@@ -291,34 +291,34 @@ class LinOp : public EnableAbstractPolymorphicObject<LinOp> {
291291
* linear operator into another.
292292
*
293293
* In Ginkgo, every linear solver is viewed as a mapping. For example,
294-
* given an s.p.d linear system $Ax = b$, the solution $x = A^{-1}b$
294+
* given an s.p.d linear system \f$Ax = b\f$, the solution \f$x = A^{-1}b\f$
295295
* can be computed using the CG method. This algorithm can be represented in
296296
* terms of linear operators and mappings between them as follows:
297297
*
298298
* - A Cg::Factory is a higher order mapping which, given an input operator
299-
* $A$, returns a new linear operator $A^{-1}$ stored in "CG
299+
* \f$A\f$, returns a new linear operator \f$A^{-1}\f$ stored in "CG
300300
* format"
301-
* - Storing the operator $A^{-1}$ in "CG format" means that the data
301+
* - Storing the operator \f$A^{-1}\f$ in "CG format" means that the data
302302
* structure used to store the operator is just a simple pointer to the
303-
* original matrix $A$. The application $x = A^{-1}b$ of such an
303+
* original matrix \f$A\f$. The application \f$x = A^{-1}b\f$ of such an
304304
* operator can then be implemented by solving the linear system
305-
* $Ax = b$ using the CG method. This is achieved in code by having a
305+
* \f$Ax = b\f$ using the CG method. This is achieved in code by having a
306306
* special class for each of those "formats" (e.g. the "Cg" class defines
307307
* such a format for the CG solver).
308308
*
309309
* Another example of a LinOpFactory is a preconditioner. A preconditioner for
310-
* a linear operator $A$ is a linear operator $M^{-1}$, which
311-
* approximates $A^{-1}$. In addition, it is stored in a way such that
312-
* both the data of $M^{-1}$ is cheap to compute from $A$, and the
313-
* operation $x = M^{-1}b$ can be computed quickly. These operators are
310+
* a linear operator \f$A\f$ is a linear operator \f$M^{-1}\f$, which
311+
* approximates \f$A^{-1}\f$. In addition, it is stored in a way such that
312+
* both the data of \f$M^{-1}\f$ is cheap to compute from \f$A\f$, and the
313+
* operation \f$x = M^{-1}b\f$ can be computed quickly. These operators are
314314
* useful to accelerate the convergence of Krylov solvers.
315315
* Thus, a preconditioner also fits into the LinOpFactory framework:
316316
*
317-
* - The factory maps a linear operator $A$ into a preconditioner
318-
* $M^{-1}$ which is stored in suitable format (e.g. as a product of
317+
* - The factory maps a linear operator \f$A\f$ into a preconditioner
318+
* \f$M^{-1}\f$ which is stored in suitable format (e.g. as a product of
319319
* two factors in case of ILU preconditioners).
320320
* - The resulting linear operator implements the application operation
321-
* $x = M^{-1}b$ depending on the format the preconditioner is stored
321+
* \f$x = M^{-1}b\f$ depending on the format the preconditioner is stored
322322
* in (e.g. as two triangular solves in case of ILU)
323323
*
324324
* Example: using CG in Ginkgo
@@ -372,7 +372,7 @@ class LinOpFactory
372372
* conjugate transpose.
373373
*
374374
* The normal transpose returns the transpose of the linear operator without
375-
* changing any of its elements representing the operation, $B = A^{T}$.
375+
* changing any of its elements representing the operation, \f$B = A^{T}\f$.
376376
*
377377
* The conjugate transpose returns the conjugate of each of the elements and
378378
* additionally transposes the linear operator representing the operation, $B
@@ -451,7 +451,7 @@ class Permutable {
451451
* value `(perm[i],perm[j])`.
452452
*
453453
* From the linear algebra perspective, with $P_{ij} = \delta_{i
454-
* \pi(i)}$, this represents the operation $P A P^T$.
454+
* \pi(i)}$, this represents the operation \f$P A P^T\f$.
455455
*
456456
* @param permutation_indices the array of indices containing the
457457
* permutation order.
@@ -472,7 +472,7 @@ class Permutable {
472472
* contains the input value `(i,j)`.
473473
*
474474
* From the linear algebra perspective, with $P_{ij} = \delta_{i
475-
* \pi(i)}$, this represents the operation $P^{-1} A P^{-T}$.
475+
* \pi(i)}$, this represents the operation \f$P^{-1} A P^{-T}\f$.
476476
*
477477
* @param permutation_indices the array of indices containing the
478478
* permutation order.
@@ -492,7 +492,7 @@ class Permutable {
492492
* In the resulting LinOp, the row `i` contains the input row `perm[i]`.
493493
*
494494
* From the linear algebra perspective, with $P_{ij} = \delta_{i
495-
* \pi(i)}$, this represents the operation $P A$.
495+
* \pi(i)}$, this represents the operation \f$P A\f$.
496496
*
497497
* @param permutation_indices the array of indices containing the
498498
* permutation order.
@@ -509,7 +509,7 @@ class Permutable {
509509
* `perm[i]`.
510510
*
511511
* From the linear algebra perspective, with $P_{ij} = \delta_{i
512-
* \pi(i)}$, this represents the operation $A P^T$.
512+
* \pi(i)}$, this represents the operation \f$A P^T\f$.
513513
*
514514
* @param permutation_indices the array of indices containing the
515515
* permutation order `perm`.
@@ -525,7 +525,7 @@ class Permutable {
525525
* In the resulting LinOp, the row `perm[i]` contains the input row `i`.
526526
*
527527
* From the linear algebra perspective, with $P_{ij} = \delta_{i
528-
* \pi(i)}$, this represents the operation $P^{-1} A$.
528+
* \pi(i)}$, this represents the operation \f$P^{-1} A\f$.
529529
*
530530
* @param permutation_indices the array of indices containing the
531531
* permutation order `perm`.
@@ -542,7 +542,7 @@ class Permutable {
542542
* `i`.
543543
*
544544
* From the linear algebra perspective, with $P_{ij} = \delta_{i
545-
* \pi(i)}$, this represents the operation $A P^{-T}$.
545+
* \pi(i)}$, this represents the operation \f$A P^{-T}\f$.
546546
*
547547
* @param permutation_indices the array of indices containing the
548548
* permutation order `perm`.

include/ginkgo/core/distributed/index_map.hpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ enum class index_space {
3030
/**
3131
* \brief This class defines mappings between global and local indices.
3232
*
33-
* Given an index space $I = [0, \dots, N)$ that is partitioned into $P$
34-
* disjoint subsets $I_k, k = 1, \dots, P$, this class defines for each
35-
* subset an extended global index set $\hat{I}_k \supset I_K$. The extended
36-
* index set contains the global indices owned by part $k$, as well as
37-
* remote indices $R_k = \hat{I}_k \setminus I_k$, which are also accessed by
38-
* part $k$, but owned by parts $l \neq k$.
39-
* At the core, this class provides mappings from the global index space $I$
33+
* Given an index space \f$I = [0, \dots, N)\f$ that is partitioned into \f$P\f$
34+
* disjoint subsets \f$I_k, k = 1, \dots, P\f$, this class defines for each
35+
* subset an extended global index set \f$\hat{I}_k \supset I_K\f$. The extended
36+
* index set contains the global indices owned by part \f$k\f$, as well as
37+
* remote indices \f$R_k = \hat{I}_k \setminus I_k\f$, which are also accessed by
38+
* part \f$k\f$, but owned by parts \f$l \neq k\f$.
39+
* At the core, this class provides mappings from the global index space \f$I\f$
4040
* into different local index spaces. The combined local index space
4141
* (index_space::combined) is then defined as
4242
* $[0, \dots, |\hat{I}_k|)$. Additionally, the combined index space can be
@@ -45,19 +45,19 @@ enum class index_space {
4545
* $[0, \dots, |I_k|)$, and the non-locally owned as $[0, \dots, |R_k|)$.
4646
* With these index sets, the following mappings are defined:
4747
*
48-
* - $c_k : \hat{I}_k \mapsto [0, \dots, |\hat{I}_k|)$ which maps global indices
48+
* - \f$c_k : \hat{I}_k \mapsto [0, \dots, |\hat{I}_k|)\f$ which maps global indices
4949
* into the combined/full local index space (denoted as
5050
* index_space::combined),
51-
* - $l_k: I_k \mapsto [0, \dots, |I_k|)$ which maps global indices into the
51+
* - \f$l_k: I_k \mapsto [0, \dots, |I_k|)\f$ which maps global indices into the
5252
* locally owned index space (denoted as index_space::local),
53-
* - $r_k: R_k \mapsto [0, \dots, |R_k|)$ which maps global indices into the
53+
* - \f$r_k: R_k \mapsto [0, \dots, |R_k|)\f$ which maps global indices into the
5454
* non-locally owned index space (denoted as index_space::non_local).
5555
*
5656
* The required map can be selected by passing the appropriate type of an
5757
* index_space.
5858
*
59-
* The index map for $I_k$ has no knowledge about any other index maps for
60-
* $I_l, l \neq k$. In particular, any global index passed to the `map_to_local`
59+
* The index map for \f$I_k\f$ has no knowledge about any other index maps for
60+
* \f$I_l, l \neq k\f$. In particular, any global index passed to the `map_to_local`
6161
* map that is not part of the specified index space, will be mapped to an
6262
* invalid_index.
6363
*
@@ -135,25 +135,25 @@ class index_map {
135135
index_map(std::shared_ptr<const Executor> exec);
136136

137137
/**
138-
* \brief get the index set $R_k$ for this rank.
138+
* \brief get the index set \f$R_k\f$ for this rank.
139139
*
140140
* The indices are ordered by their owning rank and global index.
141141
*/
142142
const segmented_array<GlobalIndexType>& get_remote_global_idxs() const;
143143

144144
/**
145-
* \brief get the index set $R_k$, but mapped to their respective local
145+
* \brief get the index set \f$R_k\f$, but mapped to their respective local
146146
* index space.
147147
*
148148
* The indices are grouped by their owning rank and sorted according to
149149
* their global index within each group.
150150
*
151-
* The set $R_k = \hat{I}_k \setminus I_k$ can also be written as the union
152-
* of the intersection of $\hat{I}_k$ with other disjoint sets
153-
* $I_l, l \neq k$, i.e.
151+
* The set \f$R_k = \hat{I}_k \setminus I_k\f$ can also be written as the union
152+
* of the intersection of \f$\hat{I}_k\f$ with other disjoint sets
153+
* \f$I_l, l \neq k\f$, i.e.
154154
* $R_k = \bigcup_{j \neq k} \hat{I}_k \cap I_j = \bigcup_{j \neq k}
155-
* R_{k,j}$. The set $R_{k,j}$ can then be mapped by $l_j$ to get the local
156-
* indices wrt. part $j$. The indices here are mapped by $l_j$.
155+
* R_{k,j}$. The set \f$R_{k,j}\f$ can then be mapped by \f$l_j\f$ to get the local
156+
* indices wrt. part \f$j\f$. The indices here are mapped by \f$l_j\f$.
157157
*/
158158
const segmented_array<LocalIndexType>& get_remote_local_idxs() const;
159159

include/ginkgo/core/distributed/vector.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ class Vector
345345
array<char>& tmp) const;
346346

347347
/**
348-
* Computes the square of the column-wise Euclidean ($L^2$) norm of this
348+
* Computes the square of the column-wise Euclidean (\f$L^2\f$) norm of this
349349
* (multi-)vector using a global reduction.
350350
*
351351
* @param result a Dense row vector, used to store the norm
@@ -355,7 +355,7 @@ class Vector
355355
void compute_squared_norm2(ptr_param<LinOp> result) const;
356356

357357
/**
358-
* Computes the square of the column-wise Euclidean ($L^2$) norm of this
358+
* Computes the square of the column-wise Euclidean (\f$L^2\f$) norm of this
359359
* (multi-)vector using a global reduction.
360360
*
361361
* @param result a Dense row vector, used to store the norm

include/ginkgo/core/factorization/ic.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ namespace factorization {
2929
/**
3030
* Represents an incomplete Cholesky factorization (IC(0)) of a sparse matrix.
3131
*
32-
* More specifically, it consists of a lower triangular factor $L$ and
33-
* its conjugate transpose $L^H$ with sparsity pattern
34-
* $\mathcal S(L + L^H)$ = $\mathcal S(A)$
35-
* fulfilling $LL^H = A$ at every non-zero location of $A$.
32+
* More specifically, it consists of a lower triangular factor \f$L\f$ and
33+
* its conjugate transpose \f$L^H\f$ with sparsity pattern
34+
* \f$\mathcal S(L + L^H)\f$ = \f$\mathcal S(A)\f$
35+
* fulfilling \f$LL^H = A\f$ at every non-zero location of \f$A\f$.
3636
*
3737
* @tparam ValueType Type of the values of all matrices used in this class
3838
* @tparam IndexType Type of the indices of all matrices used in this class

include/ginkgo/core/factorization/ilu.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ namespace factorization {
2929
/**
3030
* Represents an incomplete LU factorization -- ILU(0) -- of a sparse matrix.
3131
*
32-
* More specifically, it consists of a lower unitriangular factor $L$ and
33-
* an upper triangular factor $U$ with sparsity pattern
34-
* $\mathcal S(L + U)$ = $\mathcal S(A)$
35-
* fulfilling $LU = A$ at every non-zero location of $A$.
32+
* More specifically, it consists of a lower unitriangular factor \f$L\f$ and
33+
* an upper triangular factor \f$U\f$ with sparsity pattern
34+
* \f$\mathcal S(L + U)\f$ = \f$\mathcal S(A)\f$
35+
* fulfilling \f$LU = A\f$ at every non-zero location of \f$A\f$.
3636
*
3737
* @tparam ValueType Type of the values of all matrices used in this class
3838
* @tparam IndexType Type of the indices of all matrices used in this class

include/ginkgo/core/factorization/par_ic.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ namespace factorization {
2828
/**
2929
* ParIC is an incomplete Cholesky factorization which is computed in parallel.
3030
*
31-
* $L$ is a lower triangular matrix, which approximates a given matrix $A$ with
32-
* $A \approx LL^H$. Here, $L + L^H$ has the same sparsity pattern as $A$, which
31+
* \f$L\f$ is a lower triangular matrix, which approximates a given matrix \f$A\f$ with
32+
* \f$A \approx LL^H\f$. Here, \f$L + L^H\f$ has the same sparsity pattern as \f$A\f$, which
3333
* is also called IC(0).
3434
*
3535
* The ParIC algorithm generates the incomplete factors iteratively, using a
@@ -43,12 +43,12 @@ namespace factorization {
4343
* \end{cases}
4444
* $
4545
*
46-
* In general, the entries of $L$ can be iterated in parallel and in
46+
* In general, the entries of \f$L\f$ can be iterated in parallel and in
4747
* asynchronous fashion, the algorithm asymptotically converges to the
48-
* incomplete factors $L$ and $L^H$ fulfilling $\left(R = A - L \cdot
49-
* L^H\right)\vert_\mathcal{S} = 0\vert_\mathcal{S}$ where $\mathcal{S}$ is the
48+
* incomplete factors \f$L\f$ and \f$L^H\f$ fulfilling $\left(R = A - L \cdot
49+
* L^H\right)\vert_\mathcal{S} = 0\vert_\mathcal{S}$ where \f$\mathcal{S}\f$ is the
5050
* pre-defined sparsity pattern (in case of IC(0) the sparsity pattern of the
51-
* system matrix $A$). The number of ParIC sweeps needed for convergence
51+
* system matrix \f$A\f$). The number of ParIC sweeps needed for convergence
5252
* depends on the parallelism level: For sequential execution, a single sweep
5353
* is sufficient, for fine-grained parallelism, the number of sweeps necessary
5454
* to get a good approximation of the incomplete factors depends heavily on the

include/ginkgo/core/factorization/par_ict.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ namespace factorization {
2929
* ParICT is an incomplete threshold-based Cholesky factorization which is
3030
* computed in parallel.
3131
*
32-
* $L$ is a lower triangular matrix which approximates a given symmetric
33-
* positive definite matrix $A$ with $A \approx LL^T$. Here, $L$ has a sparsity
32+
* \f$L\f$ is a lower triangular matrix which approximates a given symmetric
33+
* positive definite matrix \f$A\f$ with \f$A \approx LL^T\f$. Here, \f$L\f$ has a sparsity
3434
* pattern that is improved iteratively based on its element-wise magnitude.
35-
* The initial sparsity pattern is chosen based on the lower triangle of $A$.
35+
* The initial sparsity pattern is chosen based on the lower triangle of \f$A\f$.
3636
*
3737
* One iteration of the ParICT algorithm consists of the following steps:
3838
*
39-
* 1. Calculating the residual $R = A - LL^T$
40-
* 2. Adding new non-zero locations from $R$ to $L$.
39+
* 1. Calculating the residual \f$R = A - LL^T\f$
40+
* 2. Adding new non-zero locations from \f$R\f$ to \f$L\f$.
4141
* The new non-zero locations are initialized based on the corresponding
4242
* residual value.
43-
* 3. Executing a fixed-point iteration on $L$ according to
43+
* 3. Executing a fixed-point iteration on \f$L\f$ according to
4444
* $
4545
* F(L) =
4646
* \begin{cases}
@@ -49,11 +49,11 @@ namespace factorization {
4949
* \sqrt{a_{ij}-\sum_{k=1}^{j-1}l_{ik}l_{jk}}, \quad & i = j \\
5050
* \end{cases}
5151
* $
52-
* 4. Removing the smallest entries (by magnitude) from $L$
53-
* 5. Executing a fixed-point iteration on the (now sparser) $L$
52+
* 4. Removing the smallest entries (by magnitude) from \f$L\f$
53+
* 5. Executing a fixed-point iteration on the (now sparser) \f$L\f$
5454
*
5555
* This ParICT algorithm thus improves the sparsity pattern and the
56-
* approximation of $L$ simultaneously.
56+
* approximation of \f$L\f$ simultaneously.
5757
*
5858
* The implementation follows the design of H. Anzt et al.,
5959
* ParILUT - A Parallel Threshold ILU for GPUs, 2019 IEEE International

include/ginkgo/core/factorization/par_ilu.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ namespace factorization {
2828
/**
2929
* ParILU is an incomplete LU factorization which is computed in parallel.
3030
*
31-
* $L$ is a lower unitriangular, while $U$ is an upper triangular matrix, which
32-
* approximate a given matrix $A$ with $A \approx LU$. Here, $L$ and $U$ have
33-
* the same sparsity pattern as $A$, which is also called ILU(0).
31+
* \f$L\f$ is a lower unitriangular, while \f$U\f$ is an upper triangular matrix, which
32+
* approximate a given matrix \f$A\f$ with \f$A \approx LU\f$. Here, \f$L\f$ and \f$U\f$ have
33+
* the same sparsity pattern as \f$A\f$, which is also called ILU(0).
3434
*
3535
* The ParILU algorithm generates the incomplete factors iteratively, using a
3636
* fixed-point iteration of the form
@@ -44,12 +44,12 @@ namespace factorization {
4444
* \end{cases}
4545
* $
4646
*
47-
* In general, the entries of $L$ and $U$ can be iterated in parallel and in
47+
* In general, the entries of \f$L\f$ and \f$U\f$ can be iterated in parallel and in
4848
* asynchronous fashion, the algorithm asymptotically converges to the
49-
* incomplete factors $L$ and $U$ fulfilling $\left(R = A - L \cdot
50-
* U\right)\vert_\mathcal{S} = 0\vert_\mathcal{S}$ where $\mathcal{S}$ is the
49+
* incomplete factors \f$L\f$ and \f$U\f$ fulfilling $\left(R = A - L \cdot
50+
* U\right)\vert_\mathcal{S} = 0\vert_\mathcal{S}$ where \f$\mathcal{S}\f$ is the
5151
* pre-defined sparsity pattern (in case of ILU(0) the sparsity pattern of the
52-
* system matrix $A$). The number of ParILU sweeps needed for convergence
52+
* system matrix \f$A\f$). The number of ParILU sweeps needed for convergence
5353
* depends on the parallelism level: For sequential execution, a single sweep
5454
* is sufficient, for fine-grained parallelism, the number of sweeps necessary
5555
* to get a good approximation of the incomplete factors depends heavily on the

0 commit comments

Comments
 (0)