[nitpick] don't use int instead of std::size_t.
authorAlexei Sheplyakov <varg@theor.jinr.ru>
Fri, 12 Sep 2008 15:55:36 +0000 (19:55 +0400)
committerAlexei Sheplyakov <varg@theor.jinr.ru>
Fri, 19 Sep 2008 09:15:49 +0000 (13:15 +0400)
This shuts up (some of) 'comparison between signed and unsigned integer
expressions'  warnings.

ginac/indexed.cpp
ginac/matrix.cpp
ginac/ncmul.cpp

index c8b710a..aa85003 100644 (file)
@@ -1409,7 +1409,7 @@ exvector get_all_dummy_indices_safely(const ex & e)
        else if (is_a<mul>(e) || is_a<ncmul>(e)) {
                exvector dummies;
                exvector free_indices;
-               for (int i=0; i<e.nops(); ++i) {
+               for (std::size_t i = 0; i < e.nops(); ++i) {
                        exvector dummies_of_factor = get_all_dummy_indices_safely(e.op(i));
                        dummies.insert(dummies.end(), dummies_of_factor.begin(),
                                dummies_of_factor.end());
@@ -1425,7 +1425,7 @@ exvector get_all_dummy_indices_safely(const ex & e)
        }
        else if(is_a<add>(e)) {
                exvector result;
-               for(int i=0; i<e.nops(); ++i) {
+               for(std::size_t i = 0; i < e.nops(); ++i) {
                        exvector dummies_of_term = get_all_dummy_indices_safely(e.op(i));
                        sort(dummies_of_term.begin(), dummies_of_term.end());
                        exvector new_vec;
index 821e184..d108bd4 100644 (file)
@@ -1418,7 +1418,7 @@ int matrix::fraction_free_elimination(const bool det)
                // Searching the first non-zero element in-place here instead of calling
                // pivot() allows us to do no more substitutions and back-substitutions
                // than are actually necessary.
-               int indx = r0;
+               unsigned indx = r0;
                while ((indx<m) &&
                       (tmp_n[indx*n+c0].subs(srl, subs_options::no_pattern).expand().is_zero()))
                        ++indx;
index 5a7b94f..a5969f3 100644 (file)
@@ -124,7 +124,7 @@ bool ncmul::info(unsigned inf) const
        return inherited::info(inf);
 }
 
-typedef std::vector<int> intvector;
+typedef std::vector<std::size_t> uintvector;
 
 ex ncmul::expand(unsigned options) const
 {
@@ -134,8 +134,8 @@ ex ncmul::expand(unsigned options) const
        
        // Now, look for all the factors that are sums and remember their
        // position and number of terms.
-       intvector positions_of_adds(expanded_seq.size());
-       intvector number_of_add_operands(expanded_seq.size());
+       uintvector positions_of_adds(expanded_seq.size());
+       uintvector number_of_add_operands(expanded_seq.size());
 
        size_t number_of_adds = 0;
        size_t number_of_expanded_terms = 1;
@@ -167,7 +167,7 @@ ex ncmul::expand(unsigned options) const
        exvector distrseq;
        distrseq.reserve(number_of_expanded_terms);
 
-       intvector k(number_of_adds);
+       uintvector k(number_of_adds);
 
        /* Rename indices in the static members of the product */
        exvector expanded_seq_mod;