001 002// 003// This file is auto-generated. Please don't modify it! 004// 005package org.opencv.ml; 006 007import java.lang.String; 008import org.opencv.core.Mat; 009import org.opencv.core.TermCriteria; 010 011// C++: class SVM 012//javadoc: SVM 013public class SVM extends StatModel { 014 015 protected SVM(long addr) { super(addr); } 016 017 018 public static final int 019 C_SVC = 100, 020 NU_SVC = 101, 021 ONE_CLASS = 102, 022 EPS_SVR = 103, 023 NU_SVR = 104, 024 CUSTOM = -1, 025 LINEAR = 0, 026 POLY = 1, 027 RBF = 2, 028 SIGMOID = 3, 029 CHI2 = 4, 030 INTER = 5, 031 C = 0, 032 GAMMA = 1, 033 P = 2, 034 NU = 3, 035 COEF = 4, 036 DEGREE = 5; 037 038 039 // 040 // C++: Mat getClassWeights() 041 // 042 043 //javadoc: SVM::getClassWeights() 044 public Mat getClassWeights() 045 { 046 047 Mat retVal = new Mat(getClassWeights_0(nativeObj)); 048 049 return retVal; 050 } 051 052 053 // 054 // C++: Mat getSupportVectors() 055 // 056 057 //javadoc: SVM::getSupportVectors() 058 public Mat getSupportVectors() 059 { 060 061 Mat retVal = new Mat(getSupportVectors_0(nativeObj)); 062 063 return retVal; 064 } 065 066 067 // 068 // C++: Mat getUncompressedSupportVectors() 069 // 070 071 //javadoc: SVM::getUncompressedSupportVectors() 072 public Mat getUncompressedSupportVectors() 073 { 074 075 Mat retVal = new Mat(getUncompressedSupportVectors_0(nativeObj)); 076 077 return retVal; 078 } 079 080 081 // 082 // C++: static Ptr_SVM create() 083 // 084 085 //javadoc: SVM::create() 086 public static SVM create() 087 { 088 089 SVM retVal = new SVM(create_0()); 090 091 return retVal; 092 } 093 094 095 // 096 // C++: static Ptr_SVM load(String filepath) 097 // 098 099 //javadoc: SVM::load(filepath) 100 public static SVM load(String filepath) 101 { 102 103 SVM retVal = new SVM(load_0(filepath)); 104 105 return retVal; 106 } 107 108 109 // 110 // C++: TermCriteria getTermCriteria() 111 // 112 113 //javadoc: SVM::getTermCriteria() 114 public TermCriteria getTermCriteria() 115 { 116 117 TermCriteria retVal = new TermCriteria(getTermCriteria_0(nativeObj)); 118 119 return retVal; 120 } 121 122 123 // 124 // C++: double getC() 125 // 126 127 //javadoc: SVM::getC() 128 public double getC() 129 { 130 131 double retVal = getC_0(nativeObj); 132 133 return retVal; 134 } 135 136 137 // 138 // C++: double getCoef0() 139 // 140 141 //javadoc: SVM::getCoef0() 142 public double getCoef0() 143 { 144 145 double retVal = getCoef0_0(nativeObj); 146 147 return retVal; 148 } 149 150 151 // 152 // C++: double getDecisionFunction(int i, Mat& alpha, Mat& svidx) 153 // 154 155 //javadoc: SVM::getDecisionFunction(i, alpha, svidx) 156 public double getDecisionFunction(int i, Mat alpha, Mat svidx) 157 { 158 159 double retVal = getDecisionFunction_0(nativeObj, i, alpha.nativeObj, svidx.nativeObj); 160 161 return retVal; 162 } 163 164 165 // 166 // C++: double getDegree() 167 // 168 169 //javadoc: SVM::getDegree() 170 public double getDegree() 171 { 172 173 double retVal = getDegree_0(nativeObj); 174 175 return retVal; 176 } 177 178 179 // 180 // C++: double getGamma() 181 // 182 183 //javadoc: SVM::getGamma() 184 public double getGamma() 185 { 186 187 double retVal = getGamma_0(nativeObj); 188 189 return retVal; 190 } 191 192 193 // 194 // C++: double getNu() 195 // 196 197 //javadoc: SVM::getNu() 198 public double getNu() 199 { 200 201 double retVal = getNu_0(nativeObj); 202 203 return retVal; 204 } 205 206 207 // 208 // C++: double getP() 209 // 210 211 //javadoc: SVM::getP() 212 public double getP() 213 { 214 215 double retVal = getP_0(nativeObj); 216 217 return retVal; 218 } 219 220 221 // 222 // C++: int getKernelType() 223 // 224 225 //javadoc: SVM::getKernelType() 226 public int getKernelType() 227 { 228 229 int retVal = getKernelType_0(nativeObj); 230 231 return retVal; 232 } 233 234 235 // 236 // C++: int getType() 237 // 238 239 //javadoc: SVM::getType() 240 public int getType() 241 { 242 243 int retVal = getType_0(nativeObj); 244 245 return retVal; 246 } 247 248 249 // 250 // C++: void setC(double val) 251 // 252 253 //javadoc: SVM::setC(val) 254 public void setC(double val) 255 { 256 257 setC_0(nativeObj, val); 258 259 return; 260 } 261 262 263 // 264 // C++: void setClassWeights(Mat val) 265 // 266 267 //javadoc: SVM::setClassWeights(val) 268 public void setClassWeights(Mat val) 269 { 270 271 setClassWeights_0(nativeObj, val.nativeObj); 272 273 return; 274 } 275 276 277 // 278 // C++: void setCoef0(double val) 279 // 280 281 //javadoc: SVM::setCoef0(val) 282 public void setCoef0(double val) 283 { 284 285 setCoef0_0(nativeObj, val); 286 287 return; 288 } 289 290 291 // 292 // C++: void setDegree(double val) 293 // 294 295 //javadoc: SVM::setDegree(val) 296 public void setDegree(double val) 297 { 298 299 setDegree_0(nativeObj, val); 300 301 return; 302 } 303 304 305 // 306 // C++: void setGamma(double val) 307 // 308 309 //javadoc: SVM::setGamma(val) 310 public void setGamma(double val) 311 { 312 313 setGamma_0(nativeObj, val); 314 315 return; 316 } 317 318 319 // 320 // C++: void setKernel(int kernelType) 321 // 322 323 //javadoc: SVM::setKernel(kernelType) 324 public void setKernel(int kernelType) 325 { 326 327 setKernel_0(nativeObj, kernelType); 328 329 return; 330 } 331 332 333 // 334 // C++: void setNu(double val) 335 // 336 337 //javadoc: SVM::setNu(val) 338 public void setNu(double val) 339 { 340 341 setNu_0(nativeObj, val); 342 343 return; 344 } 345 346 347 // 348 // C++: void setP(double val) 349 // 350 351 //javadoc: SVM::setP(val) 352 public void setP(double val) 353 { 354 355 setP_0(nativeObj, val); 356 357 return; 358 } 359 360 361 // 362 // C++: void setTermCriteria(TermCriteria val) 363 // 364 365 //javadoc: SVM::setTermCriteria(val) 366 public void setTermCriteria(TermCriteria val) 367 { 368 369 setTermCriteria_0(nativeObj, val.type, val.maxCount, val.epsilon); 370 371 return; 372 } 373 374 375 // 376 // C++: void setType(int val) 377 // 378 379 //javadoc: SVM::setType(val) 380 public void setType(int val) 381 { 382 383 setType_0(nativeObj, val); 384 385 return; 386 } 387 388 389 @Override 390 protected void finalize() throws Throwable { 391 delete(nativeObj); 392 } 393 394 395 396 // C++: Mat getClassWeights() 397 private static native long getClassWeights_0(long nativeObj); 398 399 // C++: Mat getSupportVectors() 400 private static native long getSupportVectors_0(long nativeObj); 401 402 // C++: Mat getUncompressedSupportVectors() 403 private static native long getUncompressedSupportVectors_0(long nativeObj); 404 405 // C++: static Ptr_SVM create() 406 private static native long create_0(); 407 408 // C++: static Ptr_SVM load(String filepath) 409 private static native long load_0(String filepath); 410 411 // C++: TermCriteria getTermCriteria() 412 private static native double[] getTermCriteria_0(long nativeObj); 413 414 // C++: double getC() 415 private static native double getC_0(long nativeObj); 416 417 // C++: double getCoef0() 418 private static native double getCoef0_0(long nativeObj); 419 420 // C++: double getDecisionFunction(int i, Mat& alpha, Mat& svidx) 421 private static native double getDecisionFunction_0(long nativeObj, int i, long alpha_nativeObj, long svidx_nativeObj); 422 423 // C++: double getDegree() 424 private static native double getDegree_0(long nativeObj); 425 426 // C++: double getGamma() 427 private static native double getGamma_0(long nativeObj); 428 429 // C++: double getNu() 430 private static native double getNu_0(long nativeObj); 431 432 // C++: double getP() 433 private static native double getP_0(long nativeObj); 434 435 // C++: int getKernelType() 436 private static native int getKernelType_0(long nativeObj); 437 438 // C++: int getType() 439 private static native int getType_0(long nativeObj); 440 441 // C++: void setC(double val) 442 private static native void setC_0(long nativeObj, double val); 443 444 // C++: void setClassWeights(Mat val) 445 private static native void setClassWeights_0(long nativeObj, long val_nativeObj); 446 447 // C++: void setCoef0(double val) 448 private static native void setCoef0_0(long nativeObj, double val); 449 450 // C++: void setDegree(double val) 451 private static native void setDegree_0(long nativeObj, double val); 452 453 // C++: void setGamma(double val) 454 private static native void setGamma_0(long nativeObj, double val); 455 456 // C++: void setKernel(int kernelType) 457 private static native void setKernel_0(long nativeObj, int kernelType); 458 459 // C++: void setNu(double val) 460 private static native void setNu_0(long nativeObj, double val); 461 462 // C++: void setP(double val) 463 private static native void setP_0(long nativeObj, double val); 464 465 // C++: void setTermCriteria(TermCriteria val) 466 private static native void setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon); 467 468 // C++: void setType(int val) 469 private static native void setType_0(long nativeObj, int val); 470 471 // native support for java finalize() 472 private static native void delete(long nativeObj); 473 474}