Changeset 1175 for trunk/yat/classifier
- Timestamp:
- Feb 27, 2008, 5:27:13 PM (16 years ago)
- Location:
- trunk/yat/classifier
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/classifier/SVM.cc
r1121 r1175 60 60 61 61 SVM::SVM(const SVM& other) 62 : bias_(other.bias_), C_inverse_(other.C_inverse_), kernel_( NULL),62 : bias_(other.bias_), C_inverse_(other.C_inverse_), kernel_(kernel_), 63 63 margin_(0), max_epochs_(other.max_epochs_), tolerance_(other.tolerance_), 64 64 trained_(other.trained_) 65 65 { 66 if (other.kernel_)67 kernel_ = new KernelLookup(*other.kernel_);68 66 } 69 67 … … 71 69 SVM::~SVM() 72 70 { 73 if (kernel_)74 delete kernel_;75 71 } 76 72 … … 118 114 SVM* SVM::make_classifier(void) const 119 115 { 120 return new SVM(*this); 116 SVM* svm = new SVM(*this); 117 svm->trained_ = false; 118 return svm; 121 119 } 122 120 … … 181 179 void SVM::train(const KernelLookup& kernel, const Target& targ) 182 180 { 183 if (kernel_)184 delete kernel_;185 181 kernel_ = new KernelLookup(kernel); 186 182 target_ = targ; -
trunk/yat/classifier/SVM.h
r1170 r1175 230 230 double bias_; 231 231 double C_inverse_; 232 // not owned by SVM 232 233 const KernelLookup* kernel_; 233 234 double margin_;
Note: See TracChangeset
for help on using the changeset viewer.