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