Code beautification with uncrustify
[alexxy/gromacs.git] / src / gromacs / linearalgebra / sparsematrix.h
index a8479b99b36bb36c923100afc5ecd8fbf978817f..b1aa9e87e04e7b3a94c8736efb3036b0734c441b 100644 (file)
@@ -1,34 +1,34 @@
 /*
- * 
+ *
  *                This source code is part of
- * 
+ *
  *                 G   R   O   M   A   C   S
- * 
+ *
  *          GROningen MAchine for Chemical Simulations
- * 
+ *
  *                        VERSION 3.2.0
  * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team,
  * check out http://www.gromacs.org for more information.
+
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * of the License, or (at your option) any later version.
- * 
+ *
  * If you want to redistribute modifications, please consider that
  * scientific software is very special. Version control is crucial -
  * bugs must be traceable. We will be happy to consider code for
  * inclusion in the official distribution, but derived work must not
  * be called official GROMACS. Details are found in the README & COPYING
  * files - if they are missing, get the official version at www.gromacs.org.
- * 
+ *
  * To help us fund GROMACS development, we humbly ask that you cite
  * the papers on the package - you can find them in the top README file.
- * 
+ *
  * For more info, check our website at http://www.gromacs.org
- * 
+ *
  * And Hey:
  * Green Red Orange Magenta Azure Cyan Skyblue
  */
@@ -44,7 +44,7 @@ extern "C" {
 #endif
 
 typedef struct
-gmx_sparsematrix_entry
+    gmx_sparsematrix_entry
 {
     int      col;
     real     value;
@@ -70,7 +70,7 @@ gmx_sparsematrix_entry
  *
  *  index[nrow] should be equal to the total number of elements stored.
  *
- *  Thus, to find the value of matrix element [5,4] you should loop 
+ *  Thus, to find the value of matrix element [5,4] you should loop
  *  over positions index[5] to index[6]-1 in column until you either find
  *  the value 4, or a higher value (meaning the element was zero).
  *
@@ -79,14 +79,14 @@ gmx_sparsematrix_entry
  *
  *  IMPORTANT:
  *  If compressed_symmetric is set to TRUE, you should only store EITHER the upper OR
- *  lower triangle (and the diagonal), and the other half is assumed to be 
- *  symmetric. Otherwise, if compressed_symmetric==FALSE, no symmetry is implied and all 
+ *  lower triangle (and the diagonal), and the other half is assumed to be
+ *  symmetric. Otherwise, if compressed_symmetric==FALSE, no symmetry is implied and all
  *  elements should be stored.
- *  
+ *
  *  The symmetry compression saves us a factor 2 both in storage and
  *  matrix multiplication CPU-time, which can be very useful for huge eigenproblems.
  *
- *  If you are unsure, just set compressed_symmetric to FALSE and list all elements. If 
+ *  If you are unsure, just set compressed_symmetric to FALSE and list all elements. If
  *  you enable it but still list all elements (both upper and lower triangle) you will be sorry...
  *
  *  Internally, the sparse data is stored as a separate list for each row, where the list
@@ -96,26 +96,26 @@ gmx_sparsematrix_entry
  *  The matrix data could be stored in a single contiguous array with indices for each row,
  *  but then we could only insert elements at the end without copying the entire matrix.
  *
- *  After you have 
+ *  After you have
  *
  *  In other words: Not perfect, but it works.
- */ 
-typedef struct 
-gmx_sparsematrix 
+ */
+typedef struct
+    gmx_sparsematrix
 {
     gmx_bool                     compressed_symmetric; /**< Store half elements and assume symmetry. */
     int                          nrow;                 /**< Number of rows in matrix                 */
     int *                        ndata;                /**< Number of entries on each row (list)     */
     int *                        nalloc;               /**< Allocated entry list length for each row */
     gmx_sparsematrix_entry_t **  data;                 /**< data[i] is a list with entries on row i  */
-} 
+}
 gmx_sparsematrix_t;
 
 
 /*! \brief Allocate a new sparse matrix structure
  *
  *  The number of rows is used to allocate the index array entry. Obviously you
- *  can reallocate these later yourself if necessary - this is a 
+ *  can reallocate these later yourself if necessary - this is a
  *  convenience routine.
  *
  *  By default, the compressed_symmetric flag in the structure will
@@ -128,7 +128,7 @@ gmx_sparsematrix_init            (int                    nrow);
 
 /*! \brief Release all resources used by a sparse matrix structure
  *
- *  All arrays in the structure will be freed, and the structure itself.  
+ *  All arrays in the structure will be freed, and the structure itself.
  */
 void
 gmx_sparsematrix_destroy         (gmx_sparsematrix_t *   A);
@@ -145,25 +145,25 @@ gmx_sparsematrix_print           (FILE *                 stream,
 
 /* Adds value at row,col. If the value did not exist
  * previously it is added, otherwise it is incremented with difference.
- * 
+ *
  * The column sort order might change, so you need to run fix_sparsematrix
  * once you are done changing the matrix.
  */
 real
 gmx_sparsematrix_value          (gmx_sparsematrix_t *    A,
-                                 int                     row, 
+                                 int                     row,
                                  int                     col);
 
 
 /* Adds value at row,col. If the value did not exist
-* previously it is added, otherwise it is incremented with difference.
-* 
-* The column sort order might change, so you need to run fix_sparsematrix
-* once you are done changing the matrix.
-*/
+ * previously it is added, otherwise it is incremented with difference.
+ *
+ * The column sort order might change, so you need to run fix_sparsematrix
+ * once you are done changing the matrix.
+ */
 void
 gmx_sparsematrix_increment_value(gmx_sparsematrix_t *    A,
-                                 int                     row, 
+                                 int                     row,
                                  int                     col,
                                  real                    difference);
 
@@ -171,7 +171,7 @@ gmx_sparsematrix_increment_value(gmx_sparsematrix_t *    A,
 
 /*! \brief Sort elements in each column and remove zeros.
  *
- *  Sparse matrix access is faster when the elements are stored in 
+ *  Sparse matrix access is faster when the elements are stored in
  *  increasing column order in each row. In some cases previously non-zero
  *  elements will be zero after adding more data, and this routine also removes
  *  those entries to reduce the storage requirements.
@@ -183,9 +183,9 @@ gmx_sparsematrix_compress       (gmx_sparsematrix_t *    A);
 
 
 
-/*! \brief Sparse matrix vector multiplication 
- * 
- * Calculate y = A * x for a sparse matrix A. 
+/*! \brief Sparse matrix vector multiplication
+ *
+ * Calculate y = A * x for a sparse matrix A.
  */
 void
 gmx_sparsematrix_vector_multiply(gmx_sparsematrix_t *    A,
@@ -198,5 +198,3 @@ gmx_sparsematrix_vector_multiply(gmx_sparsematrix_t *    A,
 
 
 #endif
-
-