⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tinysvm_wrap.c

📁 机器学习工具:非常流行的一种分类器
💻 C
📖 第 1 页 / 共 3 页
字号:
    dXSARGS;        if ((items < 1) || (items > 1))     croak("Usage: BaseExample_size(self);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_size. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    result = (int )arg0->size();    ST(argvi) = sv_newmortal();    sv_setiv(ST(argvi++),(IV) result);    XSRETURN(argvi);}XS(_wrap_BaseExample_read) {    BaseExample *arg0 ;    char *arg1 ;    char *arg2 = "r" ;    int arg3 = 0 ;    int argvi = 0;    int result ;    dXSARGS;        if ((items < 2) || (items > 4))     croak("Usage: BaseExample_read(self,char const *,mode,offset);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_read. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    if (! SvOK((SV*) ST(1))) {        arg1 = 0;     }    else {        arg1 = (char *) SvPV(ST(1),PL_na);     }    if (items > 2) {        if (! SvOK((SV*) ST(2))) {            arg2 = 0;         }        else {            arg2 = (char *) SvPV(ST(2),PL_na);         }    }    if (items > 3) {        arg3 = (int )SvIV(ST(3));    }    result = (int )arg0->read((char const *)arg1,(char const *)arg2,arg3);    ST(argvi) = sv_newmortal();    sv_setiv(ST(argvi++),(IV) result);    XSRETURN(argvi);}XS(_wrap_BaseExample_write) {    BaseExample *arg0 ;    char *arg1 ;    char *arg2 = "w" ;    int arg3 = 0 ;    int argvi = 0;    int result ;    dXSARGS;        if ((items < 2) || (items > 4))     croak("Usage: BaseExample_write(self,char const *,mode,offset);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_write. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    if (! SvOK((SV*) ST(1))) {        arg1 = 0;     }    else {        arg1 = (char *) SvPV(ST(1),PL_na);     }    if (items > 2) {        if (! SvOK((SV*) ST(2))) {            arg2 = 0;         }        else {            arg2 = (char *) SvPV(ST(2),PL_na);         }    }    if (items > 3) {        arg3 = (int )SvIV(ST(3));    }    result = (int )arg0->write((char const *)arg1,(char const *)arg2,arg3);    ST(argvi) = sv_newmortal();    sv_setiv(ST(argvi++),(IV) result);    XSRETURN(argvi);}XS(_wrap_BaseExample_readSVindex) {    BaseExample *arg0 ;    char *arg1 ;    char *arg2 = "r" ;    int arg3 = 0 ;    int argvi = 0;    int result ;    dXSARGS;        if ((items < 2) || (items > 4))     croak("Usage: BaseExample_readSVindex(self,char const *,mode,offset);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_readSVindex. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    if (! SvOK((SV*) ST(1))) {        arg1 = 0;     }    else {        arg1 = (char *) SvPV(ST(1),PL_na);     }    if (items > 2) {        if (! SvOK((SV*) ST(2))) {            arg2 = 0;         }        else {            arg2 = (char *) SvPV(ST(2),PL_na);         }    }    if (items > 3) {        arg3 = (int )SvIV(ST(3));    }    result = (int )arg0->readSVindex((char const *)arg1,(char const *)arg2,arg3);    ST(argvi) = sv_newmortal();    sv_setiv(ST(argvi++),(IV) result);    XSRETURN(argvi);}XS(_wrap_BaseExample_writeSVindex) {    BaseExample *arg0 ;    char *arg1 ;    char *arg2 = "w" ;    int arg3 = 0 ;    int argvi = 0;    int result ;    dXSARGS;        if ((items < 2) || (items > 4))     croak("Usage: BaseExample_writeSVindex(self,char const *,mode,offset);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_writeSVindex. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    if (! SvOK((SV*) ST(1))) {        arg1 = 0;     }    else {        arg1 = (char *) SvPV(ST(1),PL_na);     }    if (items > 2) {        if (! SvOK((SV*) ST(2))) {            arg2 = 0;         }        else {            arg2 = (char *) SvPV(ST(2),PL_na);         }    }    if (items > 3) {        arg3 = (int )SvIV(ST(3));    }    result = (int )arg0->writeSVindex((char const *)arg1,(char const *)arg2,arg3);    ST(argvi) = sv_newmortal();    sv_setiv(ST(argvi++),(IV) result);    XSRETURN(argvi);}XS(_wrap_delete_BaseExample) {    BaseExample *arg0 ;    int argvi = 0;    dXSARGS;        if ((items < 1) || (items > 1))     croak("Usage: delete_BaseExample(self);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of delete_BaseExample. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    delete arg0;    XSRETURN(argvi);}int  BaseExample_append(BaseExample *self,char *f) {    {        return self->write(f,"a");     }}XS(_wrap_BaseExample_append) {    BaseExample *arg0 ;    char *arg1 ;    int argvi = 0;    int result ;    dXSARGS;        if ((items < 2) || (items > 2))     croak("Usage: BaseExample_append(self,f);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_append. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    if (! SvOK((SV*) ST(1))) {        arg1 = 0;     }    else {        arg1 = (char *) SvPV(ST(1),PL_na);     }    result = (int )BaseExample_append(arg0,arg1);    ST(argvi) = sv_newmortal();    sv_setiv(ST(argvi++),(IV) result);    XSRETURN(argvi);}int  BaseExample_appendSVindex(BaseExample *self,char *f) {    {        return self->writeSVindex(f,"a");     }}XS(_wrap_BaseExample_appendSVindex) {    BaseExample *arg0 ;    char *arg1 ;    int argvi = 0;    int result ;    dXSARGS;        if ((items < 2) || (items > 2))     croak("Usage: BaseExample_appendSVindex(self,f);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_appendSVindex. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    if (! SvOK((SV*) ST(1))) {        arg1 = 0;     }    else {        arg1 = (char *) SvPV(ST(1),PL_na);     }    result = (int )BaseExample_appendSVindex(arg0,arg1);    ST(argvi) = sv_newmortal();    sv_setiv(ST(argvi++),(IV) result);    XSRETURN(argvi);}int  BaseExample_getDimension(BaseExample *self) {    {        return self->d;     }}XS(_wrap_BaseExample_getDimension) {    BaseExample *arg0 ;    int argvi = 0;    int result ;    dXSARGS;        if ((items < 1) || (items > 1))     croak("Usage: BaseExample_getDimension(self);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_getDimension. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    result = (int )BaseExample_getDimension(arg0);    ST(argvi) = sv_newmortal();    sv_setiv(ST(argvi++),(IV) result);    XSRETURN(argvi);}int  BaseExample_getNonzeroDimension(BaseExample *self) {    {        return self->pack_d;     }}XS(_wrap_BaseExample_getNonzeroDimension) {    BaseExample *arg0 ;    int argvi = 0;    int result ;    dXSARGS;        if ((items < 1) || (items > 1))     croak("Usage: BaseExample_getNonzeroDimension(self);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_getNonzeroDimension. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    result = (int )BaseExample_getNonzeroDimension(arg0);    ST(argvi) = sv_newmortal();    sv_setiv(ST(argvi++),(IV) result);    XSRETURN(argvi);}double  BaseExample_getY(BaseExample *self,int i) {    {        if (i >= 0 && i < self->l) return self->y[i];        fprintf(stderr, "BaseExample::getY() -- index is out of range\n");        return 0.0;    }}XS(_wrap_BaseExample_getY) {    BaseExample *arg0 ;    int arg1 ;    int argvi = 0;    double result ;    dXSARGS;        if ((items < 2) || (items > 2))     croak("Usage: BaseExample_getY(self,i);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_getY. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    arg1 = (int )SvIV(ST(1));    result = (double )BaseExample_getY(arg0,arg1);    ST(argvi) = sv_newmortal();    sv_setnv(ST(argvi++), (double) result);    XSRETURN(argvi);}char const * BaseExample_getX(BaseExample *self,int i) {    {        const char *s = self->get(i);        if (!s) return 0;                int len = strlen (s);        int i;        for (i = 0; i < len;) {            while (isspace (s[i])) i++;            while (i < len && !isspace (s[i])) i++;            while (i < len && isspace (s[i]))  i++;            break;        }                return (const char*)(s + i);    }}XS(_wrap_BaseExample_getX) {    BaseExample *arg0 ;    int arg1 ;    int argvi = 0;    char *result ;    dXSARGS;        if ((items < 2) || (items > 2))     croak("Usage: BaseExample_getX(self,i);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_getX. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    arg1 = (int )SvIV(ST(1));    result = (char *)BaseExample_getX(arg0,arg1);    ST(argvi) = sv_newmortal();    sv_setpv((SV*)ST(argvi++),(char *) result);    XSRETURN(argvi);}double  BaseExample_getAlpha(BaseExample *self,int i) {    {        if (self->alpha && i >= 0 && i < self->svindex_size) return self->alpha[i];        fprintf(stderr, "BaseExample::getAlpha() -- \nalpha is not available or index is out of range\n");        return 0.0;    }}XS(_wrap_BaseExample_getAlpha) {    BaseExample *arg0 ;    int arg1 ;    int argvi = 0;    double result ;    dXSARGS;        if ((items < 2) || (items > 2))     croak("Usage: BaseExample_getAlpha(self,i);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_getAlpha. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    arg1 = (int )SvIV(ST(1));    result = (double )BaseExample_getAlpha(arg0,arg1);    ST(argvi) = sv_newmortal();    sv_setnv(ST(argvi++), (double) result);    XSRETURN(argvi);}double  BaseExample_getGradient(BaseExample *self,int i) {    {        if (self->G && i >= 0 && i < self->svindex_size) return self->G[i];        fprintf(stderr, "BaseExample::getGradient() -- \ngradient is not available or index is out of range\n");        return 0.0;    }}XS(_wrap_BaseExample_getGradient) {    BaseExample *arg0 ;    int arg1 ;    int argvi = 0;    double result ;    dXSARGS;        if ((items < 2) || (items > 2))     croak("Usage: BaseExample_getGradient(self,i);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_getGradient. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    arg1 = (int )SvIV(ST(1));    result = (double )BaseExample_getGradient(arg0,arg1);    ST(argvi) = sv_newmortal();    sv_setnv(ST(argvi++), (double) result);    XSRETURN(argvi);}double  BaseExample_getG(BaseExample *self,int i) {    {        if (self->G && i >= 0 && i < self->svindex_size) return self->G[i];        fprintf(stderr, "BaseExample::getG() -- index is out of range\n");        return 0.0;    }}XS(_wrap_BaseExample_getG) {    BaseExample *arg0 ;    int arg1 ;    int argvi = 0;    double result ;    dXSARGS;        if ((items < 2) || (items > 2))     croak("Usage: BaseExample_getG(self,i);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_BaseExample) < 0) {        croak("Type error in argument 1 of BaseExample_getG. Expected %s", SWIGTYPE_p_BaseExample->name);        XSRETURN(1);    }    arg1 = (int )SvIV(ST(1));    result = (double )BaseExample_getG(arg0,arg1);    ST(argvi) = sv_newmortal();    sv_setnv(ST(argvi++), (double) result);    XSRETURN(argvi);}XS(_wrap_Model_read) {    Model *arg0 ;    char *arg1 ;    char *arg2 = "r" ;    int arg3 = 0 ;    int argvi = 0;    int result ;    dXSARGS;        if ((items < 2) || (items > 4))     croak("Usage: Model_read(self,char const *,mode,offset);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_Model) < 0) {        croak("Type error in argument 1 of Model_read. Expected %s", SWIGTYPE_p_Model->name);        XSRETURN(1);    }    if (! SvOK((SV*) ST(1))) {        arg1 = 0;     }    else {        arg1 = (char *) SvPV(ST(1),PL_na);     }    if (items > 2) {        if (! SvOK((SV*) ST(2))) {            arg2 = 0;         }        else {            arg2 = (char *) SvPV(ST(2),PL_na);         }    }    if (items > 3) {        arg3 = (int )SvIV(ST(3));    }    result = (int )arg0->read((char const *)arg1,(char const *)arg2,arg3);    ST(argvi) = sv_newmortal();    sv_setiv(ST(argvi++),(IV) result);    XSRETURN(argvi);}XS(_wrap_Model_write) {    Model *arg0 ;    char *arg1 ;    char *arg2 = "w" ;    int arg3 = 0 ;    int argvi = 0;    int result ;    dXSARGS;        if ((items < 2) || (items > 4))     croak("Usage: Model_write(self,char const *,mode,offset);");    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_Model) < 0) {        croak("Type error in argument 1 of Model_write. Expected %s", SWIGTYPE_p_Model->name);        XSRETURN(1);    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -