1 2 // 3 // This file is auto-generated. Please don't modify it! 4 // 5 package org.opencv.ml; 6 7 import org.opencv.core.Mat; 8 import org.opencv.core.TermCriteria; 9 10 // C++: class SVM 11 //javadoc: SVM 12 public class SVM extends StatModel { 13 SVM(long addr)14 protected SVM(long addr) { super(addr); } 15 16 17 public static final int 18 C_SVC = 100, 19 NU_SVC = 101, 20 ONE_CLASS = 102, 21 EPS_SVR = 103, 22 NU_SVR = 104, 23 CUSTOM = -1, 24 LINEAR = 0, 25 POLY = 1, 26 RBF = 2, 27 SIGMOID = 3, 28 CHI2 = 4, 29 INTER = 5, 30 C = 0, 31 GAMMA = 1, 32 P = 2, 33 NU = 3, 34 COEF = 4, 35 DEGREE = 5; 36 37 38 // 39 // C++: int getType() 40 // 41 42 //javadoc: SVM::getType() getType()43 public int getType() 44 { 45 46 int retVal = getType_0(nativeObj); 47 48 return retVal; 49 } 50 51 52 // 53 // C++: void setType(int val) 54 // 55 56 //javadoc: SVM::setType(val) setType(int val)57 public void setType(int val) 58 { 59 60 setType_0(nativeObj, val); 61 62 return; 63 } 64 65 66 // 67 // C++: double getGamma() 68 // 69 70 //javadoc: SVM::getGamma() getGamma()71 public double getGamma() 72 { 73 74 double retVal = getGamma_0(nativeObj); 75 76 return retVal; 77 } 78 79 80 // 81 // C++: void setGamma(double val) 82 // 83 84 //javadoc: SVM::setGamma(val) setGamma(double val)85 public void setGamma(double val) 86 { 87 88 setGamma_0(nativeObj, val); 89 90 return; 91 } 92 93 94 // 95 // C++: double getCoef0() 96 // 97 98 //javadoc: SVM::getCoef0() getCoef0()99 public double getCoef0() 100 { 101 102 double retVal = getCoef0_0(nativeObj); 103 104 return retVal; 105 } 106 107 108 // 109 // C++: void setCoef0(double val) 110 // 111 112 //javadoc: SVM::setCoef0(val) setCoef0(double val)113 public void setCoef0(double val) 114 { 115 116 setCoef0_0(nativeObj, val); 117 118 return; 119 } 120 121 122 // 123 // C++: double getDegree() 124 // 125 126 //javadoc: SVM::getDegree() getDegree()127 public double getDegree() 128 { 129 130 double retVal = getDegree_0(nativeObj); 131 132 return retVal; 133 } 134 135 136 // 137 // C++: void setDegree(double val) 138 // 139 140 //javadoc: SVM::setDegree(val) setDegree(double val)141 public void setDegree(double val) 142 { 143 144 setDegree_0(nativeObj, val); 145 146 return; 147 } 148 149 150 // 151 // C++: double getC() 152 // 153 154 //javadoc: SVM::getC() getC()155 public double getC() 156 { 157 158 double retVal = getC_0(nativeObj); 159 160 return retVal; 161 } 162 163 164 // 165 // C++: void setC(double val) 166 // 167 168 //javadoc: SVM::setC(val) setC(double val)169 public void setC(double val) 170 { 171 172 setC_0(nativeObj, val); 173 174 return; 175 } 176 177 178 // 179 // C++: double getNu() 180 // 181 182 //javadoc: SVM::getNu() getNu()183 public double getNu() 184 { 185 186 double retVal = getNu_0(nativeObj); 187 188 return retVal; 189 } 190 191 192 // 193 // C++: void setNu(double val) 194 // 195 196 //javadoc: SVM::setNu(val) setNu(double val)197 public void setNu(double val) 198 { 199 200 setNu_0(nativeObj, val); 201 202 return; 203 } 204 205 206 // 207 // C++: double getP() 208 // 209 210 //javadoc: SVM::getP() getP()211 public double getP() 212 { 213 214 double retVal = getP_0(nativeObj); 215 216 return retVal; 217 } 218 219 220 // 221 // C++: void setP(double val) 222 // 223 224 //javadoc: SVM::setP(val) setP(double val)225 public void setP(double val) 226 { 227 228 setP_0(nativeObj, val); 229 230 return; 231 } 232 233 234 // 235 // C++: Mat getClassWeights() 236 // 237 238 //javadoc: SVM::getClassWeights() getClassWeights()239 public Mat getClassWeights() 240 { 241 242 Mat retVal = new Mat(getClassWeights_0(nativeObj)); 243 244 return retVal; 245 } 246 247 248 // 249 // C++: void setClassWeights(Mat val) 250 // 251 252 //javadoc: SVM::setClassWeights(val) setClassWeights(Mat val)253 public void setClassWeights(Mat val) 254 { 255 256 setClassWeights_0(nativeObj, val.nativeObj); 257 258 return; 259 } 260 261 262 // 263 // C++: TermCriteria getTermCriteria() 264 // 265 266 //javadoc: SVM::getTermCriteria() getTermCriteria()267 public TermCriteria getTermCriteria() 268 { 269 270 TermCriteria retVal = new TermCriteria(getTermCriteria_0(nativeObj)); 271 272 return retVal; 273 } 274 275 276 // 277 // C++: void setTermCriteria(TermCriteria val) 278 // 279 280 //javadoc: SVM::setTermCriteria(val) setTermCriteria(TermCriteria val)281 public void setTermCriteria(TermCriteria val) 282 { 283 284 setTermCriteria_0(nativeObj, val.type, val.maxCount, val.epsilon); 285 286 return; 287 } 288 289 290 // 291 // C++: int getKernelType() 292 // 293 294 //javadoc: SVM::getKernelType() getKernelType()295 public int getKernelType() 296 { 297 298 int retVal = getKernelType_0(nativeObj); 299 300 return retVal; 301 } 302 303 304 // 305 // C++: void setKernel(int kernelType) 306 // 307 308 //javadoc: SVM::setKernel(kernelType) setKernel(int kernelType)309 public void setKernel(int kernelType) 310 { 311 312 setKernel_0(nativeObj, kernelType); 313 314 return; 315 } 316 317 318 // 319 // C++: Mat getSupportVectors() 320 // 321 322 //javadoc: SVM::getSupportVectors() getSupportVectors()323 public Mat getSupportVectors() 324 { 325 326 Mat retVal = new Mat(getSupportVectors_0(nativeObj)); 327 328 return retVal; 329 } 330 331 332 // 333 // C++: double getDecisionFunction(int i, Mat& alpha, Mat& svidx) 334 // 335 336 //javadoc: SVM::getDecisionFunction(i, alpha, svidx) getDecisionFunction(int i, Mat alpha, Mat svidx)337 public double getDecisionFunction(int i, Mat alpha, Mat svidx) 338 { 339 340 double retVal = getDecisionFunction_0(nativeObj, i, alpha.nativeObj, svidx.nativeObj); 341 342 return retVal; 343 } 344 345 346 // 347 // C++: static Ptr_SVM create() 348 // 349 350 //javadoc: SVM::create() create()351 public static SVM create() 352 { 353 354 SVM retVal = new SVM(create_0()); 355 356 return retVal; 357 } 358 359 360 @Override finalize()361 protected void finalize() throws Throwable { 362 delete(nativeObj); 363 } 364 365 366 367 // C++: int getType() getType_0(long nativeObj)368 private static native int getType_0(long nativeObj); 369 370 // C++: void setType(int val) setType_0(long nativeObj, int val)371 private static native void setType_0(long nativeObj, int val); 372 373 // C++: double getGamma() getGamma_0(long nativeObj)374 private static native double getGamma_0(long nativeObj); 375 376 // C++: void setGamma(double val) setGamma_0(long nativeObj, double val)377 private static native void setGamma_0(long nativeObj, double val); 378 379 // C++: double getCoef0() getCoef0_0(long nativeObj)380 private static native double getCoef0_0(long nativeObj); 381 382 // C++: void setCoef0(double val) setCoef0_0(long nativeObj, double val)383 private static native void setCoef0_0(long nativeObj, double val); 384 385 // C++: double getDegree() getDegree_0(long nativeObj)386 private static native double getDegree_0(long nativeObj); 387 388 // C++: void setDegree(double val) setDegree_0(long nativeObj, double val)389 private static native void setDegree_0(long nativeObj, double val); 390 391 // C++: double getC() getC_0(long nativeObj)392 private static native double getC_0(long nativeObj); 393 394 // C++: void setC(double val) setC_0(long nativeObj, double val)395 private static native void setC_0(long nativeObj, double val); 396 397 // C++: double getNu() getNu_0(long nativeObj)398 private static native double getNu_0(long nativeObj); 399 400 // C++: void setNu(double val) setNu_0(long nativeObj, double val)401 private static native void setNu_0(long nativeObj, double val); 402 403 // C++: double getP() getP_0(long nativeObj)404 private static native double getP_0(long nativeObj); 405 406 // C++: void setP(double val) setP_0(long nativeObj, double val)407 private static native void setP_0(long nativeObj, double val); 408 409 // C++: Mat getClassWeights() getClassWeights_0(long nativeObj)410 private static native long getClassWeights_0(long nativeObj); 411 412 // C++: void setClassWeights(Mat val) setClassWeights_0(long nativeObj, long val_nativeObj)413 private static native void setClassWeights_0(long nativeObj, long val_nativeObj); 414 415 // C++: TermCriteria getTermCriteria() getTermCriteria_0(long nativeObj)416 private static native double[] getTermCriteria_0(long nativeObj); 417 418 // C++: void setTermCriteria(TermCriteria val) setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon)419 private static native void setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon); 420 421 // C++: int getKernelType() getKernelType_0(long nativeObj)422 private static native int getKernelType_0(long nativeObj); 423 424 // C++: void setKernel(int kernelType) setKernel_0(long nativeObj, int kernelType)425 private static native void setKernel_0(long nativeObj, int kernelType); 426 427 // C++: Mat getSupportVectors() getSupportVectors_0(long nativeObj)428 private static native long getSupportVectors_0(long nativeObj); 429 430 // C++: double getDecisionFunction(int i, Mat& alpha, Mat& svidx) getDecisionFunction_0(long nativeObj, int i, long alpha_nativeObj, long svidx_nativeObj)431 private static native double getDecisionFunction_0(long nativeObj, int i, long alpha_nativeObj, long svidx_nativeObj); 432 433 // C++: static Ptr_SVM create() create_0()434 private static native long create_0(); 435 436 // native support for java finalize() delete(long nativeObj)437 private static native void delete(long nativeObj); 438 439 } 440