diff options
author | Desire NUENTSA <desire.nuentsa_wakam@inria.fr> | 2012-06-12 18:19:59 +0200 |
---|---|---|
committer | Desire NUENTSA <desire.nuentsa_wakam@inria.fr> | 2012-06-12 18:19:59 +0200 |
commit | c0ad1094995e28a2d564e83a2ca1c6b76cfbd536 (patch) | |
tree | 2e9ec18c5734e9dc052bd035427d509bb580997a /Eigen/src/SparseLU/SparseLU_pruneL.h | |
parent | bccf64d34281066da48cf2da29fd61f7ed703025 (diff) |
Checking Data structures and function prototypes
Diffstat (limited to 'Eigen/src/SparseLU/SparseLU_pruneL.h')
-rw-r--r-- | Eigen/src/SparseLU/SparseLU_pruneL.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/Eigen/src/SparseLU/SparseLU_pruneL.h b/Eigen/src/SparseLU/SparseLU_pruneL.h index 687717d52..dd092b778 100644 --- a/Eigen/src/SparseLU/SparseLU_pruneL.h +++ b/Eigen/src/SparseLU/SparseLU_pruneL.h @@ -47,35 +47,35 @@ /** * \brief Prunes the L-structure. * - * It prunes the L-structure of supernodes whose L-structure constains the current pivot row "pivrow" + * It prunes the L-structure of supernodes whose L-structure contains the current pivot row "pivrow" * * * \param jcol The current column of L * \param [in]perm_r Row permutation * \param [out]pivrow The pivot row - * \param nseg Number of segments ??? + * \param nseg Number of segments * \param segrep * \param repfnz * \param [out]xprune * \param Glu Global LU data * */ -template <typename VectorType> -void SparseLU::LU_pruneL(const int jcol, const VectorXi& perm_r, const int pivrow, const int nseg, const VectorXi& segrep, VectorXi& repfnz, VectorXi& xprune, GlobalLU_t& Glu) +template <typename IndexVector, typename ScalarVector> +void SparseLU::LU_pruneL(const int jcol, const IndexVector& perm_r, const int pivrow, const int nseg, const IndexVector& segrep, IndexVector& repfnz, IndexVector& xprune, GlobalLU_t& Glu) { // Initialize pointers - VectorXi& xsup = Glu.xsup; - VectorXi& supno = Glu.supno; - VectorXi& lsub = Glu.lsub; - VectorXi& xlsub = Glu.xlsub; - VectorType& lusup = Glu.lusup; - VectorXi& xlusup = Glu.xlusup; + IndexVector& xsup = Glu.xsup; + IndexVector& supno = Glu.supno; + IndexVector& lsub = Glu.lsub; + IndexVector& xlsub = Glu.xlsub; + ScalarVector& lusup = Glu.lusup; + IndexVector& xlusup = Glu.xlusup; // For each supernode-rep irep in U(*,j] int jsupno = supno(jcol); int i,irep,irep1; bool movnum, do_prune = false; - int kmin, kmax, ktemp, minloc, maxloc; + Index kmin, kmax, ktemp, minloc, maxloc; for (i = 0; i < nseg; i++) { irep = segrep(i); @@ -125,9 +125,7 @@ void SparseLU::LU_pruneL(const int jcol, const VectorXi& perm_r, const int pivro { // kmin below pivrow (not yet pivoted), and kmax // above pivrow: interchange the two suscripts - ktemp = lsub(kmin); - lsub(kmin) = lsub(kmax); - lsub(kmax) = ktemp; + std::swap(lsub(kmin), lsub(kmax)); // If the supernode has only one column, then we // only keep one set of subscripts. For any subscript @@ -144,7 +142,7 @@ void SparseLU::LU_pruneL(const int jcol, const VectorXi& perm_r, const int pivro } } // end while - xprune(irep) = kmin; + xprune(irep) = kmin; //Pruning } // end if do_prune } // end pruning } // End for each U-segment |