本文整理汇总了C++中CheckLhs函数的典型用法代码示例。如果您正苦于以下问题:C++ CheckLhs函数的具体用法?C++ CheckLhs怎么用?C++ CheckLhs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CheckLhs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: interface_gravite
int interface_gravite(char *fname)
{
static int un = 1, nddl = N_DOF;
static int n, nbis;
static int q, G;
/* Define minls=1, maxlhs, minrhs, maxrhs */
static int minlhs = 1, minrhs = 1, maxlhs = 1, maxrhs = 1;
/* Check rhs and lhs */
CheckRhs(minrhs, maxrhs) ;
CheckLhs(minlhs, maxlhs) ;
GetRhsVar(1, "d", &n, &nbis, &q);
if (n * nbis != N_DOF)
{
sciprint("Wrong size!\r\n");
Error(999);
return 0;
}
CreateVar(2, "d", &nddl, &un, &G);
modele_gravite(stk(q), stk(G));
LhsVar(1) = 2;
return 0;
}
示例2: sip_get_verbose_int
SipExport int
sip_get_verbose_int(char *fname)
{
int rout,cout,
minlhs=1, maxlhs=1, minrhs=0, maxrhs=0;
char *pout;
CheckRhs(minrhs,maxrhs);
CheckLhs(minlhs,maxlhs);
switch (sip_verbose) {
case SIP_WORDY:
pout = "wordy";
break;
case SIP_QUIET:
pout = "quiet";
break;
default:
sip_error("BUG: internal variable has invalid value (please report)");
break;
}
cout = 1;
rout = strlen(pout);
CreateVarFromPtr(1, "c", &rout, &cout, &pout);
LhsVar(1)=1;
return true;
}
示例3: sci_gethistoryfile
/*--------------------------------------------------------------------------*/
int sci_gethistoryfile(char *fname, unsigned long fname_len)
{
char *filename = NULL;
int m1 = 0, n1 = 0;
CheckRhs(0, 0) ;
CheckLhs(0, 1) ;
filename = getFilenameScilabHistory();
if (filename)
{
n1 = 1;
m1 = (int)strlen(filename);
CreateVarFromPtr(Rhs + 1, STRING_DATATYPE, &m1, &n1, &filename);
if (filename)
{
FREE(filename);
filename = NULL;
}
LhsVar(1) = Rhs + 1;
PutLhsVar();
}
else
{
Scierror(999, _("%s: An error occurred: %s\n"), fname, _("filename not defined."));
}
return 0;
}
示例4: TagsInterface
int TagsInterface(char *fname)
{
static int one = 1, ndof = NDOF;
static int n, nbis;
static int q, N;
/* Define minls=1, maxlhs, minrhs, maxrhs */
static int minlhs = 1, minrhs = 2, maxlhs = 1, maxrhs = 2;
/* Check rhs and lhs */
CheckRhs(minrhs, maxrhs) ;
CheckLhs(minlhs, maxlhs) ;
GetRhsVar(1, "d", &n, &nbis, &q);
if (n * nbis != NDOF)
{
sciprint("Wrong size!\r\n");
Error(999);
return 0;
}
CreateVar(2, "d", &ndof, &one, &N);
Tags(stk(N), stk(q));
LhsVar(1) = 2;
return 0;
}
示例5: sci_timer
/*--------------------------------------------------------------------------*/
int sci_timer(char *fname,unsigned long fname_len)
{
double timerval = 0;
Rhs = Max(0, Rhs);
CheckLhs(0,1);
CheckRhs(0,0);
timerval = scilab_timer();
if (timerval >= 0.)
{
int l1 = 0, n1 = 1;
CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE, &n1, &n1,&l1);
*stk(l1) = (double)timerval;
LhsVar(1) = Rhs+1;
PutLhsVar();
}
else
{
Scierror(999,_("%s: An error occurred.\n"), fname);
}
return 0;
}
示例6: sci_ctree2
/*--------------------------------------------------------------------------*/
int sci_ctree2(char *fname, unsigned long fname_len)
{
int one = 1, ipvec = 0, nvec = 0, mvec = 0, noin = 0, moin = 0, ipoin = 0, noinr = 0, moinr = 0, ipoinr = 0;
int ndep = 0, mdep = 0, ipdep = 0, ndepuptr = 0, mdepuptr = 0, ipdepuptr = 0, ipord = 0, ipok = 0, n = 0, nord = 0;
CheckRhs(5, 5);
CheckLhs(2, 2);
GetRhsVar(1, MATRIX_OF_INTEGER_DATATYPE, &nvec, &mvec, &ipvec);
GetRhsVar(2, MATRIX_OF_INTEGER_DATATYPE, &noin, &moin, &ipoin);
GetRhsVar(3, MATRIX_OF_INTEGER_DATATYPE, &noinr, &moinr, &ipoinr);
GetRhsVar(4, MATRIX_OF_INTEGER_DATATYPE, &ndep, &mdep, &ipdep);
GetRhsVar(5, MATRIX_OF_INTEGER_DATATYPE, &ndepuptr, &mdepuptr, &ipdepuptr);
n = nvec * mvec;
CreateVar(6, MATRIX_OF_INTEGER_DATATYPE, &n, &one, &ipord);
CreateVar(7, MATRIX_OF_INTEGER_DATATYPE, &one, &one, &ipok);
ctree2(istk(ipvec), n, istk(ipdep), istk(ipdepuptr), istk(ipoin), istk(ipoinr), istk(ipord), &nord, istk(ipok));
*istk(iadr(C2F(intersci).iwhere[5]) + 1) = nord;
LhsVar(1) = 6;
LhsVar(2) = 7;
PutLhsVar();
return 0;
}
示例7: sci_deletefile
/*--------------------------------------------------------------------------*/
int sci_deletefile(char *fname,unsigned long fname_len)
{
CheckRhs(1,1);
CheckLhs(1,1);
if (GetType(1) == sci_strings)
{
int m1,n1,l1;
char *VarName=NULL;
GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
/* Bug 3089 */
VarName = cstk(l1);
n1=1;
if ( deleteafile(VarName) )
{
CreateVar(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &n1,&n1,&l1);
*istk(l1)=(int)(TRUE);
}
else
{
CreateVar(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &n1,&n1,&l1);
*istk(l1)=(int)(FALSE);
}
LhsVar(1)=Rhs+1;
PutLhsVar();
}
else
{
Scierror(999,_("%s: Wrong type for input argument: A string expected.\n"),fname);
}
return 0;
}
示例8: sci_deleteNamedVariable
int sci_deleteNamedVariable(char *fname, unsigned long fname_len)
{
SciErr sciErr;
int iRet = 0;
int* piAddr = NULL;
char* pstVarName = NULL;
CheckRhs(1, 1);
CheckLhs(1, 1);
sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
if (sciErr.iErr)
{
printError(&sciErr, 0);
return 1;
}
if (getAllocatedSingleString(pvApiCtx, piAddr, &pstVarName))
{
//error
return 1;
}
if (isNamedVarExist(pvApiCtx, pstVarName))
{
iRet = deleteNamedVariable(pvApiCtx, pstVarName);
}
createScalarBoolean(pvApiCtx, Rhs + 1, iRet);
AssignOutputVariable(pvApiCtx, 1) = Rhs + 1;
return 0;
}
示例9: sci_fromjava
/*--------------------------------------------------------------------------*/
int sci_fromjava(char *fname, unsigned long fname_len)
{
static int n1;
int *paramoutINT = (int*)MALLOC(sizeof(int) + 1);
Rhs = Max(0, Rhs);
CheckRhs(0, 0);
CheckLhs(1, 1);
if ( IsFromJava() )
{
*paramoutINT = (int)(TRUE);
}
else
{
*paramoutINT = (int)(FALSE);
}
n1 = 1;
CreateVarFromPtr(Rhs + 1, MATRIX_OF_BOOLEAN_DATATYPE, &n1, &n1, ¶moutINT);
if (paramoutINT)
{
FREE(paramoutINT);
paramoutINT = NULL;
}
LhsVar(1) = Rhs + 1;
PutLhsVar();
return 0;
}
示例10: sci_tzer
/*--------------------------------------------------------------------------*/
int sci_tzer(char *fname, unsigned long fname_len)
{
CheckRhs(4, 4);
CheckLhs(2, 3);
C2F(scitzer)(fname, fname_len);
return 0;
}
示例11: int_imread
int int_imread(char * fname)
{
int mR, nR, lR;
IplImage * pImage;
CheckRhs(1, 1);
CheckLhs(1, 1);
GetRhsVar(1, "c", &mR, &nR, &lR);
// fix default mode for compatibility with previous version of SIVP
pImage = cvLoadImage(cstk(lR), 1);
/* if load image failed */
if(pImage == NULL)
{
Scierror(999, "%s: Can not open file %s.\r\n", fname, cstk(lR));
return -1;
}
IplImg2Mat(pImage, 2);
LhsVar(1) = 2;
cvReleaseImage(&pImage);
return 0;
}
示例12: C2F
/*--------------------------------------------------------------------------*/
int C2F(sci_getlanguagealias)(char *fname,unsigned long fname_len)
{
static int l1,n1,m1;
char *Output=NULL;
CheckRhs(0,0);
CheckLhs(0,1);
Output=getlanguagealias();
if (Output)
{
n1=1;
CreateVarFromPtr( Rhs+1,STRING_DATATYPE,(m1=(int)strlen(Output), &m1),&n1,&Output);
LhsVar(1) = Rhs+1;
PutLhsVar();;
if (Output) {FREE(Output);Output=NULL;}
}
else
{
m1=0;
n1=0;
l1=0;
CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &l1);
LhsVar(1)=Rhs+1;
PutLhsVar();;
return 0;
}
return 0;
}
示例13: InertiaInterface
int InertiaInterface(char *fname)
{
static int ndof = NDOF;
static int n, nbis;
static int q, M;
/* Define minls=1, maxlhs, minrhs, maxrhs */
static int minlhs = 1, minrhs = 1, maxlhs = 1, maxrhs = 1;
/* Check rhs and lhs */
CheckRhs(minrhs, maxrhs) ;
CheckLhs(minlhs, maxlhs) ;
GetRhsVar(1, "d", &n, &nbis, &q);
if (n * nbis != NDOF)
{
sciprint("Wrong size!\r\n");
Error(999);
return 0;
}
CreateVar(2, "d", &ndof, &ndof, &M);
Inertia(stk(M), stk(q));
LhsVar(1) = 2;
return 0;
}
示例14: sci_gpuLoadDynLib
/* ========================================================================== */
int sci_gpuLoadDynLib(char* fname)
{
int row = 0;
int col = 0;
int* piLen = NULL;
char** pstData = NULL;
int* pstrA = NULL;
int inputType_A = 0;
int i = 0;
CheckRhs(1, 1);
CheckLhs(0, 1);
// get lib
getVarAddressFromPosition(pvApiCtx,1,&pstrA);
getVarType(pvApiCtx, pstrA, &inputType_A);
getMatrixOfString(pvApiCtx, pstrA, &row, &col, NULL, NULL);
piLen = (int*)malloc(sizeof(int) * row * col);
getMatrixOfString(pvApiCtx, pstrA, &row, &col, piLen, NULL);
pstData = (char**)malloc(sizeof(char*) * row * col);
for(i = 0 ; i < row * col ; i++)
{
pstData[i] = (char*)malloc(sizeof(char) * (piLen[i] + 1));
}
getMatrixOfString(pvApiCtx, pstrA, &row, &col, piLen, pstData);
// open lib
printf("%s\n", *pstData);
Sci_dlopen(*pstData);
LhsVar(1) = Rhs + 1;
PutLhsVar();
return 0;
}
示例15: sci_type
/*--------------------------------------------------------------------------*/
int sci_type(char *fname, void* pvApiCtx)
{
SciErr sciErr;
int* piAddr = NULL;
int iType = 0;
int iRet = 0;
CheckRhs(1, 1);
CheckLhs(1, 1);
sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
if (sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
}
sciErr = getVarType(pvApiCtx, piAddr, &iType);
if (sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
}
iRet = createMatrixOfDoubleFromInteger(pvApiCtx, Rhs + 1, 1, 1, &iType);
if (iRet)
{
return 0;
}
LhsVar(1) = Rhs + 1;
PutLhsVar();
return 0;
}