Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11306 for trunk


Ignore:
Timestamp:
08/26/14 15:58:25 (10 years ago)
Author:
bburlacu
Message:

#2233: Check weight and weight_label fields for null when cloning svm_parameters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/3.12/LibSVM-3.12/SVM.cs

    r8607 r11306  
    26232623      clone.C = C;
    26242624      clone.nr_weight = nr_weight;
    2625       clone.weight_label = new int[weight_label.Length];
    2626       Array.Copy(weight_label, clone.weight_label, weight_label.Length);
    2627       clone.weight = new double[weight.Length];
    2628       Array.Copy(weight, clone.weight, weight.Length);
     2625      if (weight_label != null) {
     2626        clone.weight_label = new int[weight_label.Length];
     2627        Array.Copy(weight_label, clone.weight_label, weight_label.Length);
     2628      }
     2629      if (weight != null) {
     2630        clone.weight = new double[weight.Length];
     2631        Array.Copy(weight, clone.weight, weight.Length);
     2632      }
    26292633      clone.nu = nu;
    26302634      clone.p = p;
Note: See TracChangeset for help on using the changeset viewer.