]> www.ginac.de Git - ginac.git/commitdiff
[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 c8b710ae7f1e63690cbb0356e2e1ccc10159f1e0..aa8500399e270facb7fa72a59a6c9277c26214fa 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;
        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());
                        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;
        }
        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;
                        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 821e184d3acc0e8f014e67216f90aba91390778c..d108bd4c04be6bb315a3966c3f4a716d77a45504 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.
                // 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;
                while ((indx<m) &&
                       (tmp_n[indx*n+c0].subs(srl, subs_options::no_pattern).expand().is_zero()))
                        ++indx;
index 5a7b94f8733adcebc7d1b83d7b5390ea23aef696..a5969f317d035bb48db1ce491c12491d491d3f60 100644 (file)
@@ -124,7 +124,7 @@ bool ncmul::info(unsigned inf) const
        return inherited::info(inf);
 }
 
        return inherited::info(inf);
 }
 
-typedef std::vector<int> intvector;
+typedef std::vector<std::size_t> uintvector;
 
 ex ncmul::expand(unsigned options) const
 {
 
 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.
        
        // 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;
 
        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);
 
        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;
 
        /* Rename indices in the static members of the product */
        exvector expanded_seq_mod;