Changeset 1271 for trunk/yat/classifier


Ignore:
Timestamp:
Apr 9, 2008, 6:11:07 PM (13 years ago)
Author:
Peter
Message:

replaced u_int with unsigned int or size_t

Location:
trunk/yat/classifier
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/classifier/IGP.h

    r1158 r1271  
    116116    igp_ = utility::Vector(target_.nof_classes());
    117117   
    118     for(u_int i=0; i<target_.size(); i++) {
    119       u_int neighbor=i;
     118    for(size_t i=0; i<target_.size(); i++) {
     119      size_t neighbor=i;
    120120      double mindist=std::numeric_limits<double>::max();
    121121      const DataLookup1D a(matrix_,i,false);
    122       for(u_int j=0; j<target_.size(); j++) {           
     122      for(size_t j=0; j<target_.size(); j++) {           
    123123        DataLookup1D b(matrix_,j,false);
    124124        double dist=distance_(a.begin, a.end(), b.begin());
     
    132132     
    133133    }
    134     for(u_int i=0; i<target_.nof_classes(); i++) {
     134    for(size_t i=0; i<target_.nof_classes(); i++) {
    135135      igp_(i)/=static_cast<double>(target_.size(i));
    136136    }
  • trunk/yat/classifier/KNN.h

    r1189 r1271  
    9696       \return The number of neighbors.
    9797    */
    98     u_int k() const;
     98    unsigned int k() const;
    9999
    100100    /**
     
    103103       Sets the number of neighbors to \a k_in.
    104104    */
    105     void k(u_int k_in);
     105    void k(unsigned int k_in);
    106106
    107107
     
    166166
    167167    // The number of neighbors
    168     u_int k_;
     168    unsigned int k_;
    169169
    170170    Distance distance_;
     
    240240 
    241241  template <typename Distance, typename NeighborWeighting>
    242   u_int KNN<Distance, NeighborWeighting>::k() const
     242  unsigned int KNN<Distance, NeighborWeighting>::k() const
    243243  {
    244244    return k_;
     
    246246
    247247  template <typename Distance, typename NeighborWeighting>
    248   void KNN<Distance, NeighborWeighting>::k(u_int k)
     248  void KNN<Distance, NeighborWeighting>::k(unsigned k)
    249249  {
    250250    k_=k;
  • trunk/yat/classifier/Kernel.cc

    r1168 r1271  
    4242  {
    4343    if (own)
    44       ref_count_ = new u_int(1);
     44      ref_count_ = new unsigned int(1);
    4545    else
    4646      ref_count_ = NULL;
     
    5353  {
    5454    if (own){
    55       ref_count_w_ = new u_int(1);
     55      ref_count_w_ = new unsigned int(1);
    5656    }
    5757    else {
     
    6868    if (other.weighted()){
    6969      mlw_ = new MatrixLookupWeighted(*other.mlw_, utility::Index(index),true);
    70       ref_count_w_ = new u_int(1);
     70      ref_count_w_ = new unsigned int(1);
    7171      ml_=NULL;
    7272      ref_count_ = NULL;
     
    7474    else{
    7575      ml_ = new MatrixLookup(*other.ml_, utility::Index(index),true);
    76       ref_count_ = new u_int(1);
     76      ref_count_ = new unsigned int(1);
    7777      mlw_=NULL;
    7878      ref_count_w_ = NULL;
  • trunk/yat/classifier/Kernel.h

    r1260 r1271  
    3030#include "KernelFunction.h"
    3131
    32 #include <cctype>
     32#include <cstddef>
    3333#include <vector>
    34 
    35 #include <sys/types.h>
    3634
    3735namespace theplu {
     
    183181    /// (data_). NULL if this is not an owner.
    184182    ///
    185     u_int* ref_count_;
     183    unsigned int* ref_count_;
    186184
    187185    ///
     
    189187    /// (data_w_). NULL if this is not an owner.
    190188    ///
    191     u_int* ref_count_w_;
     189    unsigned int* ref_count_w_;
    192190
    193191  private:
  • trunk/yat/classifier/SupervisedClassifier.h

    r1188 r1271  
    2727*/
    2828
    29 #include <stddef.h>
     29#include <cstddef>
    3030
    3131namespace theplu {
  • trunk/yat/classifier/utility.cc

    r1120 r1271  
    3636  {
    3737    vector = utility::Vector(lookup.size());
    38     for(u_int i=0; i<lookup.size(); i++)
     38    for(size_t i=0; i<lookup.size(); i++)
    3939      vector(i)=lookup(i);
    4040  }
     
    4646    value = utility::Vector(lookup.size());
    4747    weight = utility::Vector(lookup.size());
    48     for(u_int i=0; i<lookup.size(); i++){
     48    for(size_t i=0; i<lookup.size(); i++){
    4949      value(i)=lookup.data(i);
    5050      weight(i)=lookup.weight(i);
Note: See TracChangeset for help on using the changeset viewer.