~ubuntu-branches/ubuntu/vivid/igraph/vivid

« back to all changes in this revision

Viewing changes to src/plfit/plfit.c

  • Committer: Package Import Robot
  • Author(s): Tamás Nepusz, Andreas Tille, Tamas Nepusz
  • Date: 2014-08-29 08:39:02 UTC
  • mfrom: (7.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140829083902-y4k2iu2mlizkq0o0
Tags: 0.7.1-2
[ Andreas Tille ]
* Move packagiong from SVN to Git

[ Tamas Nepusz ]
* Remove debian/patches/link_f2c.patch; f2c linkage not needed if
  BLAS, LAPACK and ARPACK are all linked dynamically
  Closes: #702882
* debian/patches/remove_unused_test_target.patch added to make
  dh_auto_test work
* debian/patches/fix_failing_tests.patch added to fix some failing
  test cases 
* debian/patches/cppflags_restore.patch added to fix incorrect
  handling of CPPFLAGS in the configure script
* debian/patches/drl_spelling_fix.patch added to fix a spelling
  error in the source and silence a lintian warning

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
        end = xs + n;
249
249
    while (xs < end && *xs < xmin)
250
250
        xs++;
251
 
    n = end - xs;
 
251
    n = (size_t) (end - xs);
252
252
 
253
253
    PLFIT_CHECK(plfit_i_estimate_alpha_continuous_sorted(xs, n,
254
254
                                xmin, &result->alpha));
281
281
        printf("Trying with xmin = %.4f\n", *begin);
282
282
#endif
283
283
 
284
 
        plfit_i_estimate_alpha_continuous_sorted(begin, data->end-begin, *begin,
 
284
        plfit_i_estimate_alpha_continuous_sorted(begin, (size_t) (data->end-begin), *begin,
285
285
                        &data->last.alpha);
286
286
        plfit_i_ks_test_continuous(begin, data->end, data->last.alpha, *begin,
287
287
                        &data->last.D);
348
348
                 * the index in opt_data.uniques that we have to look up in order to
349
349
                 * find the first element in the array that is included */
350
350
                px = opt_data.uniques[(int)x];
351
 
                best_n = opt_data.end-px+1;
 
351
                best_n = (size_t) (opt_data.end-px+1);
352
352
        } else {
353
353
                /* GSS failed or skipped; try linear search */
354
354
 
362
362
                        plfit_i_continuous_xmin_opt_evaluate(&opt_data, i);
363
363
                        if (opt_data.last.D < best_result.D) {
364
364
                                best_result = opt_data.last;
365
 
                                best_n = opt_data.end - opt_data.uniques[i] + 1;
 
365
                                best_n = (size_t) (opt_data.end - 
 
366
                                                   opt_data.uniques[i] + 1);
366
367
                        }
367
368
                }
368
369
        }
681
682
    xs = xs_copy; end = xs_copy + n;
682
683
    while (xs < end && *xs < xmin)
683
684
        xs++;
684
 
    n = end - xs;
 
685
    n = (size_t) (end - xs);
685
686
 
686
687
    PLFIT_CHECK(plfit_i_estimate_alpha_discrete(xs, n, xmin, &result->alpha,
687
688
                                options, /* sorted = */ 1));
704
705
    plfit_result_t best_result;
705
706
    double *xs_copy, *px, *end, *end_xmin, prev_x;
706
707
        size_t best_n;
707
 
    int m;
 
708
    size_t m;
708
709
 
709
710
        if (!options)
710
711
                options = &plfit_discrete_default_options;
748
749
            px++; m++;
749
750
        }
750
751
 
751
 
                plfit_i_estimate_alpha_discrete(px, n-m, *px, &curr_alpha, options,
752
 
                                /* sorted = */ 1);
 
752
        plfit_i_estimate_alpha_discrete(px, n - m, *px,
 
753
                                        &curr_alpha, options, /* sorted = */ 1);
753
754
        plfit_i_ks_test_discrete(px, end, curr_alpha, *px, &curr_D);
754
755
 
755
756
        if (curr_D < best_result.D) {
756
757
            best_result.alpha = curr_alpha;
757
758
            best_result.xmin = *px;
758
759
            best_result.D = curr_D;
759
 
                        best_n = n-m;
 
760
            best_n = n - m;
760
761
        }
761
762
 
762
763
        prev_x = *px;