Changeset 1271 for trunk/yat/classifier
- Timestamp:
- Apr 9, 2008, 6:11:07 PM (15 years ago)
- Location:
- trunk/yat/classifier
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/classifier/IGP.h
r1158 r1271 116 116 igp_ = utility::Vector(target_.nof_classes()); 117 117 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; 120 120 double mindist=std::numeric_limits<double>::max(); 121 121 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++) { 123 123 DataLookup1D b(matrix_,j,false); 124 124 double dist=distance_(a.begin, a.end(), b.begin()); … … 132 132 133 133 } 134 for( u_int i=0; i<target_.nof_classes(); i++) {134 for(size_t i=0; i<target_.nof_classes(); i++) { 135 135 igp_(i)/=static_cast<double>(target_.size(i)); 136 136 } -
trunk/yat/classifier/KNN.h
r1189 r1271 96 96 \return The number of neighbors. 97 97 */ 98 u _int k() const;98 unsigned int k() const; 99 99 100 100 /** … … 103 103 Sets the number of neighbors to \a k_in. 104 104 */ 105 void k(u _int k_in);105 void k(unsigned int k_in); 106 106 107 107 … … 166 166 167 167 // The number of neighbors 168 u _int k_;168 unsigned int k_; 169 169 170 170 Distance distance_; … … 240 240 241 241 template <typename Distance, typename NeighborWeighting> 242 u _int KNN<Distance, NeighborWeighting>::k() const242 unsigned int KNN<Distance, NeighborWeighting>::k() const 243 243 { 244 244 return k_; … … 246 246 247 247 template <typename Distance, typename NeighborWeighting> 248 void KNN<Distance, NeighborWeighting>::k(u _intk)248 void KNN<Distance, NeighborWeighting>::k(unsigned k) 249 249 { 250 250 k_=k; -
trunk/yat/classifier/Kernel.cc
r1168 r1271 42 42 { 43 43 if (own) 44 ref_count_ = new u _int(1);44 ref_count_ = new unsigned int(1); 45 45 else 46 46 ref_count_ = NULL; … … 53 53 { 54 54 if (own){ 55 ref_count_w_ = new u _int(1);55 ref_count_w_ = new unsigned int(1); 56 56 } 57 57 else { … … 68 68 if (other.weighted()){ 69 69 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); 71 71 ml_=NULL; 72 72 ref_count_ = NULL; … … 74 74 else{ 75 75 ml_ = new MatrixLookup(*other.ml_, utility::Index(index),true); 76 ref_count_ = new u _int(1);76 ref_count_ = new unsigned int(1); 77 77 mlw_=NULL; 78 78 ref_count_w_ = NULL; -
trunk/yat/classifier/Kernel.h
r1260 r1271 30 30 #include "KernelFunction.h" 31 31 32 #include <c ctype>32 #include <cstddef> 33 33 #include <vector> 34 35 #include <sys/types.h>36 34 37 35 namespace theplu { … … 183 181 /// (data_). NULL if this is not an owner. 184 182 /// 185 u _int* ref_count_;183 unsigned int* ref_count_; 186 184 187 185 /// … … 189 187 /// (data_w_). NULL if this is not an owner. 190 188 /// 191 u _int* ref_count_w_;189 unsigned int* ref_count_w_; 192 190 193 191 private: -
trunk/yat/classifier/SupervisedClassifier.h
r1188 r1271 27 27 */ 28 28 29 #include < stddef.h>29 #include <cstddef> 30 30 31 31 namespace theplu { -
trunk/yat/classifier/utility.cc
r1120 r1271 36 36 { 37 37 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++) 39 39 vector(i)=lookup(i); 40 40 } … … 46 46 value = utility::Vector(lookup.size()); 47 47 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++){ 49 49 value(i)=lookup.data(i); 50 50 weight(i)=lookup.weight(i);
Note: See TracChangeset
for help on using the changeset viewer.