From 7617f176b5c2a1acd3f8fa11a3b3137f8cd6c111 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Mon, 13 Mar 2017 22:42:48 +0100
Subject: [PATCH] Group intenal function from spm

---
 CMakeLists.txt         |  4 ++--
 integer_sort.c         |  2 +-
 integer_sort_mtypes.c  |  2 +-
 spm.h                  |  2 +-
 spm_integers.c         | 12 ++++++------
 spm_io.c               | 18 +++++++++---------
 z_spm.c                |  6 +++---
 z_spm_2dense.c         | 10 +++++-----
 z_spm_convert_to_csc.c |  4 ++--
 z_spm_convert_to_csr.c |  4 ++--
 z_spm_convert_to_ijv.c |  4 ++--
 z_spm_dof_extend.c     |  2 +-
 z_spm_expand.c         |  8 ++++----
 z_spm_genrhs.c         |  8 ++++----
 z_spm_integer.c        |  2 +-
 z_spm_laplacian.c      | 10 +++++-----
 z_spm_matrixvector.c   |  8 ++++----
 z_spm_norm.c           |  6 ++++++
 z_spm_print.c          |  8 ++++----
 z_spm_scal.c           |  2 +-
 20 files changed, 64 insertions(+), 58 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32ea88cd..2f920662 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,7 +97,7 @@ add_documented_files(
   # Source files
   spm.c
   spm_io.c
-  spm_integers.c
-  spm_dofs.c
   spm_read_driver.c
+  spm_dof_extend.c
+  spm_integers.c
   )
diff --git a/integer_sort.c b/integer_sort.c
index dd519240..93cfb426 100644
--- a/integer_sort.c
+++ b/integer_sort.c
@@ -35,7 +35,7 @@
  *
  * @file integer_sort.c
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_integer
  *
  * File to include to create integer sort function using qsort based
  * algorithm. DO NOT compile directly.
diff --git a/integer_sort_mtypes.c b/integer_sort_mtypes.c
index e900c878..c79ee9ee 100644
--- a/integer_sort_mtypes.c
+++ b/integer_sort_mtypes.c
@@ -34,7 +34,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_integer
  *
  * @file integer_sort_mtypes.c
  *
diff --git a/spm.h b/spm.h
index f79b9a69..b931fbeb 100644
--- a/spm.h
+++ b/spm.h
@@ -185,7 +185,7 @@ pastix_spm_t *spmDofExtend( const int type, const int dof, const pastix_spm_t *s
  */
 
 /**
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_print
  * @brief Subroutines to print one element of an spm structure
  *
  * @param[in] f Pointer to the file
diff --git a/spm_integers.c b/spm_integers.c
index 18deca7d..1d74d6ce 100644
--- a/spm_integers.c
+++ b/spm_integers.c
@@ -68,7 +68,7 @@ spmIntConvert( pastix_int_t n, int *input )
  *******************************************************************************
  *
  * @fn      void spmIntSort1Asc1(void * const pbase, const pastix_int_t n);
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_integer
  *
  * Sorts in ascending order array of element composed of one single
  * pastix_int_t with a single key value.
@@ -104,7 +104,7 @@ spmIntConvert( pastix_int_t n, int *input )
  *******************************************************************************
  *
  * @fn      void spmIntSort2Asc1(void * const pbase, const pastix_int_t n);
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_integer
  *
  * Sorts in ascending order array of element composed of two
  * pastix_int_t by ascending order. The first value is used as key.
@@ -143,7 +143,7 @@ spmIntConvert( pastix_int_t n, int *input )
  *******************************************************************************
  *
  * @fn      void spmIntSort3Asc1(void * const pbase, const pastix_int_t n);
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_integer
  *
  * @brief Sorts in ascending order array of element composed of three
  * pastix_int_t by ascending order. The first value is used as key.
@@ -188,7 +188,7 @@ void spmIntSort3Asc1(void *const pbase, const pastix_int_t n);
  *******************************************************************************
  *
  * @fn      void spmIntSort2Asc2(void * const pbase, const pastix_int_t n);
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_integer
  * @brief Sorts in ascending order array of element composed of two
  * pastix_int_t by ascending order. Both values are used as key.
  *
@@ -226,7 +226,7 @@ void spmIntSort3Asc1(void *const pbase, const pastix_int_t n);
  *******************************************************************************
  *
  * @fn      void spmIntMSortIntAsc(void ** const pbase, const pastix_int_t n);
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_integer
  *
  * @brief Sort 2 arrays simultaneously, the first array is an array of
  * pastix_int_t and used as primary key for sorting.  The second array is an
@@ -279,7 +279,7 @@ void spmIntMSortIntAsc(void ** const pbase, const pastix_int_t n);
  *******************************************************************************
  *
  * @fn      void spmIntMSortSmallIntAsc(void **const pbase, const pastix_int_t n);
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_integer
  * @brief Sort 2 arrays simultaneously, the first array is an array of
  * pastix_int_t and used as primary key for sorting.  The second array is an
  * other array of pastix_int_t used as secondary key.
diff --git a/spm_io.c b/spm_io.c
index e4bf21fc..da1559cf 100644
--- a/spm_io.c
+++ b/spm_io.c
@@ -20,7 +20,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_io
  *
  * @brief Read an array of integer.
  *
@@ -101,7 +101,7 @@ readArrayOfInteger( FILE         *stream,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_io
  *
  * @brief  Read an array of 64bits complex.
  *
@@ -187,7 +187,7 @@ readArrayOfComplex64( FILE               *stream,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_io
  *
  * @brief  Read an array of 32bits complex.
  *
@@ -273,7 +273,7 @@ readArrayOfComplex32( FILE               *stream,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_io
  *
  * @brief  Read an array of double.
  *
@@ -357,7 +357,7 @@ readArrayOfDouble( FILE         *stream,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_io
  *
  * @brief  Read an array of float.
  *
@@ -605,7 +605,7 @@ spmLoad( pastix_spm_t  *spm,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_io
  *
  * @brief write an array of 64bits complex.
  *
@@ -646,7 +646,7 @@ writeArrayOfComplex64( FILE               *outfile,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_io
  *
  * @brief write an array of 32bits complex.
  *
@@ -687,7 +687,7 @@ writeArrayOfComplex32( FILE               *outfile,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_io
  *
  * @brief write an array of double.
  *
@@ -728,7 +728,7 @@ writeArrayOfDouble( FILE         *outfile,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_io
  *
  * @brief write an array of float.
  *
diff --git a/z_spm.c b/z_spm.c
index a9923f3c..b1e9fde9 100644
--- a/z_spm.c
+++ b/z_spm.c
@@ -21,7 +21,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_check
  *
  * @brief This routine sorts the subarray of edges of each vertex in a
  * centralized spm stored in CSC or CSR format.
@@ -92,7 +92,7 @@ z_spmSort( pastix_spm_t *spm )
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_check
  *
  * @brief This routine merge the multiple entries in a sparse
  * matrix by suming their values together.
@@ -186,7 +186,7 @@ z_spmMergeDuplicate( pastix_spm_t *spm )
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_check
  *
  * @brief This routine corrects the sparse matrix structure if it's
  * pattern is not symmetric.
diff --git a/z_spm_2dense.c b/z_spm_2dense.c
index ed2b4044..0c1da2d7 100644
--- a/z_spm_2dense.c
+++ b/z_spm_2dense.c
@@ -30,7 +30,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_convert
  *
  * @brief Convert a CSC matrix into a dense matrix.
  *
@@ -208,7 +208,7 @@ z_spmCSC2dense( const pastix_spm_t *spm )
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_convert
  *
  * @brief Convert a CSR matrix into a dense matrix.
  *
@@ -386,7 +386,7 @@ z_spmCSR2dense( const pastix_spm_t *spm )
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_convert
  *
  * @brief Convert a IJV matrix into a dense matrix.
  *
@@ -580,7 +580,7 @@ z_spmIJV2dense( const pastix_spm_t *spm )
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_convert
  *
  * @brief Convert a sparse matrix into a dense matrix.
  *
@@ -615,7 +615,7 @@ z_spm2dense( const pastix_spm_t *spm )
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_convert
  *
  * @brief Print a dense matrix to the given file
  *
diff --git a/z_spm_convert_to_csc.c b/z_spm_convert_to_csc.c
index 378fde18..c238ba27 100644
--- a/z_spm_convert_to_csc.c
+++ b/z_spm_convert_to_csc.c
@@ -22,7 +22,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_convert
  *
  * @brief convert a matrix in IJV format to a matrix in CSC
  * format.
@@ -127,7 +127,7 @@ z_spmConvertIJV2CSC( pastix_spm_t *spm )
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_convert
  *
  * @brief  convert a matrix in CSR format to a matrix in CSC
  * format.
diff --git a/z_spm_convert_to_csr.c b/z_spm_convert_to_csr.c
index 58631f87..7b5a458f 100644
--- a/z_spm_convert_to_csr.c
+++ b/z_spm_convert_to_csr.c
@@ -21,7 +21,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_convert
  *
  * @brief convert a matrix in CSC format to a matrix in CSR format.
  *
@@ -100,7 +100,7 @@ z_spmConvertCSC2CSR( pastix_spm_t *spm )
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_convert
  *
  * @brief convert a matrix in IJV format to a matrix in CSR
  * format.
diff --git a/z_spm_convert_to_ijv.c b/z_spm_convert_to_ijv.c
index 5f4e4dc4..9657f42f 100644
--- a/z_spm_convert_to_ijv.c
+++ b/z_spm_convert_to_ijv.c
@@ -21,7 +21,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_convert
  *
  * @brief convert a matrix in CSC format to a matrix in IJV format.
  *
@@ -70,7 +70,7 @@ z_spmConvertCSC2IJV( pastix_spm_t *spm )
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_convert
  *
  * @brief convert a matrix in CSR format to a matrix in IJV format.
  *
diff --git a/z_spm_dof_extend.c b/z_spm_dof_extend.c
index df45dc39..ecd88117 100644
--- a/z_spm_dof_extend.c
+++ b/z_spm_dof_extend.c
@@ -21,7 +21,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_dof
  *
  * @brief Extend a multi-dof sparse matrix to a single dof sparse matrix.
  *
diff --git a/z_spm_expand.c b/z_spm_expand.c
index d0ae69ba..9e62c153 100644
--- a/z_spm_expand.c
+++ b/z_spm_expand.c
@@ -21,7 +21,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_dof
  *
  * @brief Expand a single dof CSC to a multi-dofs CSC.
  *
@@ -206,7 +206,7 @@ z_spmCSCExpand(const pastix_spm_t *spm)
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_dof
  *
  * @brief Expand a single dof CSR to a multi-dofs CSR.
  *
@@ -389,7 +389,7 @@ z_spmCSRExpand(const pastix_spm_t *spm)
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_dof
  *
  * @brief Expand a single dof IJV to a multi-dofs IJV.
  *
@@ -562,7 +562,7 @@ z_spmIJVExpand(const pastix_spm_t *spm)
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_dof
  *
  * @brief Expand a single dof sparse matrix to a multi-dofs sparse matrix.
  *
diff --git a/z_spm_genrhs.c b/z_spm_genrhs.c
index 6e2983dc..e83f1f99 100644
--- a/z_spm_genrhs.c
+++ b/z_spm_genrhs.c
@@ -37,7 +37,7 @@ static pastix_complex64_t zzero = (pastix_complex64_t) 0.;
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_rhs
  *
  * @brief Random generator from the HPL library
  *
@@ -83,7 +83,7 @@ Rnd64_jump(unsigned long long int n, unsigned long long int seed ) {
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_rhs
  *
  * @brief Generate a vector of random values.
  *
@@ -148,7 +148,7 @@ z_spmRndVect( double scale, int m, int n, pastix_complex64_t *A, int lda,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_rhs
  *
  * @brief Generate nrhs right hand side vectors associated to a given
  * matrix to test a problem with a solver.
@@ -308,7 +308,7 @@ z_spmGenRHS( int type, int nrhs,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_rhs
  *
  * @brief Check the backward error, and the forward error if x0 is provided.
  *
diff --git a/z_spm_integer.c b/z_spm_integer.c
index a2dce680..5270c138 100644
--- a/z_spm_integer.c
+++ b/z_spm_integer.c
@@ -26,7 +26,7 @@
  *******************************************************************************
  *
  * @fn      void z_spmIntSortAsc(void ** const pbase, const pastix_int_t n)
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_integer
  * @brief Sort 2 arrays simultaneously, the first array is an array of
  * pastix_int_t and used as key for sorting.  The second array is an array of
  * pastix_complex64_t.
diff --git a/z_spm_laplacian.c b/z_spm_laplacian.c
index 5d8dbccc..56d388b4 100644
--- a/z_spm_laplacian.c
+++ b/z_spm_laplacian.c
@@ -22,7 +22,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_driver
+ * @ingroup spm_dev_driver
  *
  * z_spmLaplacian1D - Generate a 1D laplacian matrix.
  *
@@ -113,7 +113,7 @@ z_spmLaplacian1D( pastix_spm_t  *spm,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_driver
+ * @ingroup spm_dev_driver
  *
  * z_spmLaplacian2D - Generate a 2D laplacian matrix.
  *
@@ -222,7 +222,7 @@ z_spmLaplacian2D( pastix_spm_t  *spm,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_driver
+ * @ingroup spm_dev_driver
  *
  * z_spmLaplacian3D - Generate a 3D laplacian matrix.
  *
@@ -353,7 +353,7 @@ z_spmLaplacian3D( pastix_spm_t  *spm,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_driver
+ * @ingroup spm_dev_driver
  *
  * z_spmExtendedLaplacian2D - Generate a 2D extended laplacian matrix.
  *
@@ -476,7 +476,7 @@ z_spmExtendedLaplacian2D( pastix_spm_t  *spm,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_driver
+ * @ingroup spm_dev_driver
  *
  * z_spmExtendedLaplacian3D - Generate a 3D extended laplacian matrix.
  *
diff --git a/z_spm_matrixvector.c b/z_spm_matrixvector.c
index 05b503bb..e94d6791 100644
--- a/z_spm_matrixvector.c
+++ b/z_spm_matrixvector.c
@@ -21,7 +21,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_matvec
  *
  * @brief compute the matrix-vector product:
  *          y = alpha * op( A ) * x + beta * y
@@ -152,7 +152,7 @@ z_spmGeCSCv(const pastix_trans_t      trans,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_matvec
  *
  * @brief compute the matrix-vector product:
  *          y = alpha * A + beta * y
@@ -240,7 +240,7 @@ z_spmSyCSCv(      pastix_complex64_t  alpha,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_matvec
  *
  * @brief compute the matrix-vector product:
  *          y = alpha * A + beta * y
@@ -330,7 +330,7 @@ z_spmHeCSCv(      pastix_complex64_t  alpha,
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_matvec
  *
  * @brief compute the matrix-vector product:
  *          y = alpha * A + beta * y
diff --git a/z_spm_norm.c b/z_spm_norm.c
index 6432e18f..50419ded 100644
--- a/z_spm_norm.c
+++ b/z_spm_norm.c
@@ -14,6 +14,9 @@
  * @date 2015-06-01
  * @precisions normal z -> c d s
  *
+ * @addtogroup spm_dev_norm
+ * @{
+ *
  **/
 #include "common.h"
 #include "spm.h"
@@ -423,3 +426,6 @@ z_spmNorm( int ntype,
 
     return norm;
 }
+/**
+ * @}
+ */
diff --git a/z_spm_print.c b/z_spm_print.c
index d0c8c2f0..2da95721 100644
--- a/z_spm_print.c
+++ b/z_spm_print.c
@@ -30,7 +30,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_print
  *
  * @brief Write CSC matrix in a file
  *
@@ -215,7 +215,7 @@ z_spmCSCPrint( FILE *f, const pastix_spm_t *spm )
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_print
  *
  * @brief Write CSR matrix in a file
  *
@@ -400,7 +400,7 @@ z_spmCSRPrint( FILE *f, const pastix_spm_t *spm )
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_print
  *
  * @brief Write IJV matrix in a file
  *
@@ -603,7 +603,7 @@ z_spmIJVPrint( FILE *f, const pastix_spm_t *spm )
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_print
  *
  * @brief Write a spm matrix in a file
  *
diff --git a/z_spm_scal.c b/z_spm_scal.c
index 5536e8a9..50428b4f 100644
--- a/z_spm_scal.c
+++ b/z_spm_scal.c
@@ -22,7 +22,7 @@
 /**
  *******************************************************************************
  *
- * @ingroup pastix_spm_dev
+ * @ingroup spm_dev_scal
  *
  * @brief Scal the spm: A = alpha * A
  *
-- 
GitLab