• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetRhsVar函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetRhsVar函数的典型用法代码示例。如果您正苦于以下问题:C++ GetRhsVar函数的具体用法?C++ GetRhsVar怎么用?C++ GetRhsVar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetRhsVar函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: get_colminmax_arg

/*--------------------------------------------------------------------------*/
int get_colminmax_arg(char *fname,int pos,rhs_opts opts[], int ** colminmax )
{
  int m,n,l,first_opt=FirstOpt(),kopt;

  if (pos < first_opt)
    {
      if (VarType(pos))
	{
	  GetRhsVar(pos,MATRIX_OF_INTEGER_DATATYPE, &m, &n, &l);
	  CheckLength(pos,m*n,2);
	  *colminmax=istk(l);
	}
      else
	{
	  /** global value can be modified  **/
    int zeros[2] = { 0, 0 } ;
    setDefColMinMax( zeros ) ;
	  *colminmax = getDefColMinMax() ;
	}
    }
  else if ((kopt=FindOpt("colminmax",opts)))
    {
      GetRhsVar(kopt,MATRIX_OF_INTEGER_DATATYPE, &m, &n, &l);
      CheckLength(kopt,m*n,2);
      *colminmax=istk(l);
    }
  else
    {
      /** global value can be modified  **/
      int zeros[2] = { 0, 0 } ;
      setDefColMinMax( zeros ) ;
      *colminmax = getDefColMinMax() ;
    }
  return 1;
}
开发者ID:vinayrajchoudhary,项目名称:scilab,代码行数:36,代码来源:GetCommandArg.c


示例2: get_legend_arg

/*--------------------------------------------------------------------------*/
int get_legend_arg(char *fname,int pos,rhs_opts opts[], char ** legend )
{
  int m,n,l,first_opt=FirstOpt(),kopt;

  if (pos < first_opt)
    {
      if (VarType(pos)) {
	GetRhsVar(pos,STRING_DATATYPE, &m, &n, &l);
	*legend = cstk(l);
      }
      else
	{
	  *legend = getDefLegend() ;
	}
    }
  else if ((kopt=FindOpt("leg",opts))) {
    GetRhsVar(kopt,STRING_DATATYPE, &m, &n, &l);
    *legend = cstk(l);
  }
  else
    {
      *legend = getDefLegend() ;
    }
  return 1;
}
开发者ID:vinayrajchoudhary,项目名称:scilab,代码行数:26,代码来源:GetCommandArg.c


示例3: get_with_mesh_arg

/*--------------------------------------------------------------------------*/
int get_with_mesh_arg(char *fname,int pos,rhs_opts opts[], BOOL * withMesh)
{
  int m,n,l,first_opt=FirstOpt(),kopt;

  if (pos < first_opt)
    {
      if (VarType(pos))
	{
	  GetRhsVar(pos,MATRIX_OF_BOOLEAN_DATATYPE, &m, &n, &l);
	  CheckLength(pos,m*n,1);
	  *withMesh = *(istk(l));
	}
      else
	{
	  /** global value can be modified  **/
	  setDefWithMesh( FALSE );
	  *withMesh = getDefWithMesh() ;
	}
    }
  else if ((kopt=FindOpt("mesh",opts)))
    {
      GetRhsVar(kopt,MATRIX_OF_BOOLEAN_DATATYPE, &m, &n, &l);
      CheckLength(kopt,m*n,1);
      *withMesh = *(istk(l));
    }
  else
    {
      /** global value can be modified  **/
      setDefWithMesh( FALSE );
      *withMesh = getDefWithMesh() ;
    }
  return 1;
}
开发者ID:vinayrajchoudhary,项目名称:scilab,代码行数:34,代码来源:GetCommandArg.c


示例4: sci_exec_if

int sci_exec_if(char *fname)
{
    static int l1, m1, n1;
    void *p_sci;
    static int l2, m2, n2;
    static int minrhs=2, maxrhs=2;
    static int err;

    debug_3 ("[sci_exec_if] ..................... \r\n");
    CheckRhs(minrhs,maxrhs);
    // example: pfir1
    m1=1;
    n1=1;
    GetRhsVar(1,"p",&m1,&n1,&l1);
    // example: SCI_RESET
    GetRhsVar(2, "i", &m2, &n2, &l2);
    p_sci = (void *) ((unsigned long int) *stk(l1));
    sci_exec_ifcpp(p_sci, *(istk(l2)));
    if (sci_err) {
        sciprint("\n%s:\n info:%d\n",sci_err_msg,sci_info);
        Scierror(999,"%s failed err=%d", fname, sci_err);
        return 0;
    }
    debug_3 ("[sci_exec_if] +++++++++++++++++++++ \r\n");
    return 0;
}
开发者ID:maki63,项目名称:c_sci,代码行数:26,代码来源:c_sci_if.c


示例5: sci_xfarcs

/*--------------------------------------------------------------------------*/
int sci_xfarcs(char *fname, unsigned long fname_len)
{
    int m1 = 0, n1 = 0, l1 = 0;
    int m2 = 0, n2 = 0, l2 = 0;

    long hdl = 0;

    int i = 0;

    double angle1 = 0.0;
    double angle2 = 0.0;

    CheckRhs(1, 2);

    GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &l1);
    if (m1 != 6)
    {
        Scierror(999, _("%s: Wrong size for input argument #%d: %s expected.\n"), fname, 1, "(6,n)");
        return 0;
    }

    if (Rhs == 2)
    {
        GetRhsVar(2, MATRIX_OF_INTEGER_DATATYPE, &m2, &n2, &l2);
        CheckVector(2, m2, n2);
        if (n1 != m2 * n2)
        {
            Scierror(999, _("%s: Wrong size for input arguments #%d and #%d.\n"), fname, 1, 2);
            return 0;
        }
    }
    else
    {
        m2 = 1;
        n2 = n1;
        CreateVar(2, MATRIX_OF_INTEGER_DATATYPE, &m2, &n2, &l2);
        for (i = 0; i < n2; ++i)
        {
            *istk(l2 + i) = i + 1;
        }
    }

    getOrCreateDefaultSubwin();

    for (i = 0; i < n1; ++i)
    {
        angle1 = DEG2RAD(*stk(l1 + (6 * i) + 4) / 64.0);
        angle2 = DEG2RAD(*stk(l1 + (6 * i) + 5) / 64.0);
        Objarc(&angle1, &angle2, stk(l1 + (6 * i)), stk(l1 + (6 * i) + 1),
               stk(l1 + (6 * i) + 2), stk(l1 + (6 * i) + 3), istk(l2 + i), istk(l2 + i), TRUE, FALSE, &hdl);
    }

    /** Construct Compound and make it current object **/
    setCurrentObject(ConstructCompoundSeq(n1));

    LhsVar(1) = 0;
    PutLhsVar();

    return 0;
}
开发者ID:vinayrajchoudhary,项目名称:scilab,代码行数:61,代码来源:sci_xfarcs.c


示例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;
}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:29,代码来源:sci_ctree2.c


示例7: empty

int empty(void)
{
    int m, n;
    int k;
    int m1, n1, p1;
    int m2, n2, p2;
    int NZMAX = 1;
    int jc = 5;
    int ir;
    int *header;
    double *value;
    GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &p1);
    GetRhsVar(2, MATRIX_OF_DOUBLE_DATATYPE, &m2, &n2, &p2);
    m = (int) * stk(p1);
    n = (int) * stk(p2);
    CreateData(3, (6 + n + 1)*sizeof(int) + sizeof(double));
    header = (int *) GetData(3);
    value = (double *) header;
    header[0] = 7;
    header[1] = m;
    header[2] = n;
    header[3] = 0;
    header[4] = NZMAX;
    header[jc] = 0;
    ir = jc + n + 1;
    for (k = 0; k < n; ++k)
    {
        header[jc + k + 1] = 0;
    }
    header[ir] = 0;
    value[(5 + header[2] + header[4]) / 2 + 1] = 0.0;
    LhsVar(1) = 3;
    PutLhsVar();
    return 1;
}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:35,代码来源:mspelm.c


示例8: get_colout_arg

/*--------------------------------------------------------------------------*/
int get_colout_arg(char *fname,int pos,rhs_opts opts[], int ** colout )
{
  int m,n,l,first_opt=FirstOpt(),kopt;

  if (pos < first_opt)
    {
      if (VarType(pos))
	{
	  GetRhsVar(pos,MATRIX_OF_INTEGER_DATATYPE, &m, &n, &l);
	  CheckLength(pos,m*n,2);
	  *colout = istk(l);
	}
      else
	{
	  /** global value can be modified  **/
    int newDefCO[2] = { -1, -1 } ;
    setDefColOut( newDefCO ) ;
	  *colout = getDefColOut() ;
	}
    }
  else if ((kopt=FindOpt("colout",opts)))
    {
      GetRhsVar(kopt,MATRIX_OF_INTEGER_DATATYPE, &m, &n, &l);
      CheckLength(kopt,m*n,2);
      *colout=istk(l);
    }
  else
    {
      /** global value can be modified  **/
      int newDefCO[2] = { -1, -1 } ;
      setDefColOut( newDefCO ) ;
      *colout = getDefColOut() ;
    }
  return 1;
}
开发者ID:vinayrajchoudhary,项目名称:scilab,代码行数:36,代码来源:GetCommandArg.c


示例9: sci_grep

/*------------------------------------------------------------------------*/
int sci_grep(char *fname, unsigned long fname_len)
{
    CheckRhs(2, 3);
    CheckLhs(1, 2);

    if (VarType(1) == sci_matrix)
    {
        int m1 = 0, n1 = 0;
        char **Str = NULL;

        GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &Str);

        if ((m1 == 0) && (n1 == 0))
        {
            int l = 0;

            CreateVar(Rhs + 1, MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &l);
            LhsVar(1) = Rhs + 1;
            PutLhsVar();

            return 0;
        }
    }

    if (Rhs == 3)
    {
        if (VarType(3) == sci_strings)
        {
            char typ = 'd';     /*default */
            int m3 = 0, n3 = 0, l3 = 0;

            GetRhsVar(3, STRING_DATATYPE, &m3, &n3, &l3);
            if (m3 * n3 != 0)
            {
                typ = cstk(l3)[0];
            }

            if (typ == 'r')
            {
                sci_grep_common(fname, TRUE);
            }
            else
            {
                Scierror(999, _("%s: Wrong value for input argument #%d: '%s' expected.\n"), fname, 3, "s");
                return 0;
            }
        }
        else
        {
            Scierror(999, _("%s: Wrong type for input argument #%d: String expected.\n"), fname, 3);
            return 0;
        }
    }
    else                        /* Rhs == 2 */
    {
        sci_grep_common(fname, FALSE);
    }
    return 0;
}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:60,代码来源:sci_grep.c


示例10: sci_get_if

int sci_get_if(char *fname)
{
    static int l1, m1, n1;
    void *p_sci;
    static int l2, m2, n2;
    static int lr3, lc3;
    static int minrhs=2, maxrhs=2;
    static int minlhs=0, maxlhs=1;
    static int err;
    struct sci_var s_v;


    debug_3 ("[if_sci_get] ..................... \r\n");
    CheckRhs(minrhs,maxrhs);
    CheckLhs(minlhs,maxlhs);
    // example: pfir1
    m1=1;
    n1=1;
    GetRhsVar(1,"p",&m1,&n1,&l1);
    // example: SCI_TAPS
    GetRhsVar(2, "i", &m2, &n2, &l2);

    p_sci = (void *) ((unsigned long int) *stk(l1));
    s_v = sci_get_ifcpp(p_sci, *istk(l2));

    if (sci_err) {
        sciprint("\n%s:\n info:%d\n",sci_err_msg,sci_info);
        Scierror(999,"%s failed err=%d", fname, sci_err);
        return 0;
    }
    // now when m3,n3 are set - create [mxn] sci variable on stack (it=is_complex)
    if (s_v.is_double)
    {   CreateCVar(3,"d", &s_v.is_complex, &s_v.m, &s_v.n, &lr3, &lc3);
        // alocated mem on scilab stack for [mxn] of (complex) double
        s_v.p_re=stk(lr3);
        s_v.p_im=stk(lc3);
    }
    else if (s_v.is_boolean)
    {   CreateVar(3,"b", &s_v.m, &s_v.n, &lr3);
        // alocated mem on scilab stack for [mxn] boolean
        s_v.p_re=istk(lr3);
        s_v.p_im=NULL;
    }
    else
    {   lr3 = I_INT32;;
        CreateVar(3,"I", &s_v.m, &s_v.n, &lr3);
        // alocated mem on scilab stack for [mxn] of U_INT32
        s_v.p_re=istk(lr3);
        s_v.p_im=NULL;
    }
    // copy values
    sci_pop_var(&s_v);
    // remove data from heap
    sci_delete_var(&s_v);
    LhsVar(1) = 3; /* return var */
    debug_3 ("[if_sci_get] +++++++++++++++++++++ \r\n");
    return 0;
}
开发者ID:maki63,项目名称:c_sci,代码行数:58,代码来源:c_sci_if.c


示例11: sci_relocate_handle

int sci_relocate_handle( char * fname, unsigned long fname_len )
{
  int handleCol ;
  int handleRow ;
  int nbHandle ;
  int handleStkIndex ;
  int parentCol ;
  int parentRow ;
  int parentStkIndex ;
  int outIndex ;
  int i ;
  unsigned long * handleArray = NULL ;

  /* the function should be called with relocate_handle( handle, parent_handle ) */
  CheckRhs(2,2) ;
  CheckLhs(0,1) ;


  GetRhsVar( 1,GRAPHICAL_HANDLE_DATATYPE, &handleRow, &handleCol, &handleStkIndex );
  nbHandle = handleRow * handleCol ;
  GetRhsVar( 2,GRAPHICAL_HANDLE_DATATYPE, &parentRow, &parentCol, &parentStkIndex );

  if ( parentCol * parentRow != 1 )
  {
    Scierror(999,_("%s: Handles must be relocated under a single parent.\n"),fname);
    return 0 ;
  }

  /* create an array of handles */
  handleArray = MALLOC( nbHandle * sizeof( unsigned long ) ) ;
  if ( handleArray == NULL )
  {
    Scierror(999,_("%s: No more memory.\n"),fname);
    return 0 ;
  }

  for ( i = 0 ; i < nbHandle ; i++ )
  {
    handleArray[i] = (unsigned long) *hstk( handleStkIndex + i ) ;
  }

// FIXME : loop on each handle and call MVC to enable new relationship.

//  if ( sciRelocateHandles( handleArray          ,
//                           handleRow * handleCol,
//                           (unsigned long) *hstk( parentStkIndex ) ) != 0 )
//  {
//		PutLhsVar();
//		return 0 ;
//  }
  FREE( handleArray ) ;
  CreateVar( Rhs + 1,GRAPHICAL_HANDLE_DATATYPE, &handleCol, &handleRow, &outIndex );
  *hstk(outIndex) = *hstk(handleStkIndex) ;
  LhsVar(1) = Rhs + 1 ;
  PutLhsVar();
  return 0 ;

}
开发者ID:vinayrajchoudhary,项目名称:scilab,代码行数:58,代码来源:sci_relocate_handle.c


示例12: sci_emptystr_two_rhs

/*--------------------------------------------------------------------------*/
static int sci_emptystr_two_rhs(char *fname)
{
    /*value_param_pos_1 is the number of row ; value_param_pos_2 is the number of col*/

    int Type_One = GetType(1);
    int Type_Two = GetType(2);

    if ((Type_One == sci_matrix) && (Type_Two == sci_matrix))
    {
        double value_param_pos_1 = 0;
        double value_param_pos_2 = 0;
        int matrixdimension = 0;

        int m1 = 0, n1 = 0, l1 = 0;
        int m2 = 0, n2 = 0, l2 = 0;
        GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &l1);
        GetRhsVar(2, MATRIX_OF_DOUBLE_DATATYPE, &m2, &n2, &l2);

        value_param_pos_1 = *stk(l1);
        value_param_pos_2 = *stk(l2);

        matrixdimension = (int)(value_param_pos_1 * value_param_pos_2);

        if (matrixdimension > 0)
        {
            int m = (int)value_param_pos_1;
            int n = (int)value_param_pos_2;
            CreateVarFromPtr(Rhs + 1, MATRIX_OF_STRING_DATATYPE, &m, &n, NULL);
        }
        else
        {
            /* returns [] */
            int l = 0;
            int m = 0;
            int n = 0;
            CreateVar(Rhs + 1, MATRIX_OF_DOUBLE_DATATYPE, &m, &n, &l);
        }
        LhsVar(1) = Rhs + 1;

        PutLhsVar();
    }
    else
    {
        if (Type_One != sci_matrix)
        {
            Scierror(999, _("%s: Wrong type for input argument #%d: Matrix of integers expected.\n"), fname, 1);
        }
        else /* Type_Two */
        {
            Scierror(999, _("%s: Wrong type for input argument #%d: Matrix of integers expected.\n"), fname, 2);
        }
    }
    return 0;
}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:55,代码来源:sci_emptystr.c


示例13: get_rect_arg

/*--------------------------------------------------------------------------*/
int get_rect_arg(char *fname,int pos,rhs_opts opts[], double ** rect )
{
	int m,n,l,first_opt=FirstOpt(),kopt,i;

	if (pos < first_opt)
		{
			if (VarType(pos)) {
				GetRhsVar(pos,MATRIX_OF_DOUBLE_DATATYPE, &m, &n, &l);
				if (m * n != 4) {
					Scierror(999,"%s: Wrong size for input argument #%d: %d expected\n",fname,pos,4);
					return 0;
				}
				*rect = stk(l);

				for(i=0;i<4;i++)
					if(finite((*rect)[i]) == 0){
						Scierror(999,"%s: Wrong values (Nan or Inf) for input argument: %d finite values expected\n",fname,4);
						return 0;
					}
			}
			else
				{
					/** global value can be modified  **/
					double zeros[4] = { 0.0, 0.0, 0.0, 0.0 } ;
					setDefRect( zeros ) ;
					*rect = getDefRect() ;
				}
		}
	else if ((kopt=FindOpt("rect",opts))) {/* named argument: rect=value */
		GetRhsVar(kopt,MATRIX_OF_DOUBLE_DATATYPE, &m, &n, &l);
		if (m * n != 4) {
			Scierror(999,"%s: Wrong size for input argument #%d: %d expected\n",fname,kopt,4);
			return 0;
		}
		*rect = stk(l);

		for(i=0;i<4;i++)
			if(finite((*rect)[i]) == 0){
				Scierror(999,"%s: Wrong values (Nan or Inf) for input argument: %d finite values expected\n",fname,4);
				return 0;
			}
	}
	else
		{
			/** global value can be modified  **/
			double zeros[4] = { 0.0, 0.0, 0.0, 0.0 } ;
			setDefRect( zeros ) ;
			*rect = getDefRect() ;
		}

	return 1;
}
开发者ID:vinayrajchoudhary,项目名称:scilab,代码行数:53,代码来源:GetCommandArg.c


示例14: get_labels_arg

/**
 * retrieve the labels from the command line and store them into labels
 */
int get_labels_arg(char *fname, int pos, rhs_opts opts[], char ** labels)
{
    int m,n,l,first_opt=FirstOpt(),kopt;

    if (pos < first_opt)
    {
        if (VarType(pos))
        {
            GetRhsVar(pos,STRING_DATATYPE, &m, &n, &l);
            *labels = cstk(l);
        }
        else
        {
            /* jb silvy 03/2006 */
            /* do not change the legend if one already exists */
            char * pSubWinUID = getOrCreateDefaultSubwin();
            if (sciGetLegendDefined(pSubWinUID))
            {
                *labels = NULL;
            }
            else
            {
                *labels = getDefLegend();
            }
        }
    }
    else if ((kopt=FindOpt("leg",opts)))
    {
        GetRhsVar(kopt,STRING_DATATYPE, &m, &n, &l);
        *labels = cstk(l);
    }
    else
    {
        /* jb silvy 03/2006 */
        /* do not change the legend if one already exists */
        char* pSubWinUID = getOrCreateDefaultSubwin();

        if (sciGetLegendDefined(pSubWinUID))
        {
            *labels = NULL;
        }
        else
        {
            *labels = getDefLegend();
        }
    }
    return 1;
}
开发者ID:vinayrajchoudhary,项目名称:scilab,代码行数:51,代码来源:GetCommandArg.c


示例15: 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;
}
开发者ID:acbalingit,项目名称:scilab-sivp,代码行数:29,代码来源:imread.cpp


示例16: sci_xname

/*--------------------------------------------------------------------------*/
int sci_xname(char *fname, unsigned long fname_len)
{
    int m1 = 0, n1 = 0, l1 = 0;

    char *pstCurrentFigure = NULL;

    CheckRhs(1, 1);
    CheckLhs(1, 1);

    GetRhsVar(1, STRING_DATATYPE, &m1, &n1, &l1);

    pstCurrentFigure = getCurrentFigure();

    if (pstCurrentFigure == NULL)
    {
        pstCurrentFigure = createNewFigureWithAxes();
    }

    setGraphicObjectProperty(pstCurrentFigure, __GO_NAME__, cstk(l1), jni_string, 1);

    LhsVar(1) = 0;
    PutLhsVar();

    return 0;
}
开发者ID:vinayrajchoudhary,项目名称:scilab,代码行数:26,代码来源:sci_xname.c


示例17: sci_multiply_by_two

int sci_multiply_by_two(char * fname)
{
    int m_in_var, n_in_var, l_in_var;
    int m_out_var, n_out_var, l_out_var;
    int i_row, j_col;

    // First, access to the input variable (a matrix of doubles)
    GetRhsVar(1, "d", &m_in_var, &n_in_var, &l_in_var);

    // Create the returned variable (a matrix of doubles)
    m_out_var = m_in_var;
    n_out_var = n_in_var;
    CreateVar(2, "d", &m_out_var, &n_out_var, &l_out_var);

    // Perform some simple operations on the matrix
    for (i_row = 0; i_row < m_in_var; i_row++)
    {
        for (j_col = 0; j_col < n_in_var; j_col++)
        {
            *stk(l_out_var + i_row + j_col * m_out_var) = 2 * (*stk(l_in_var + i_row + j_col * m_in_var));
        }
    }

    // Return the output variable
    LhsVar(1) = 2;

    return 0;
}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:28,代码来源:multiply_by_two.c


示例18: 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;
}
开发者ID:radarsat1,项目名称:siconos,代码行数:28,代码来源:interfaces.c


示例19: sci_create_if

int sci_create_if(char *fname)
{
    static int l1, m1, n1;
    static int l2, m2, n2;
    static int minlhs=1, maxlhs=1;
    static int minrhs=1, maxrhs=1;
    static int err;
    void *p_sci;

    debug_1 ("[if_sci_create] ..................... \r\n");
    CheckRhs(minrhs,maxrhs);
    CheckLhs(minlhs,maxlhs);
    // Example: SCI_FIR
    GetRhsVar(1, "i", &m1, &n1, &l1);

    p_sci = sci_create_ifcpp(*(istk(l1)));

    if (p_sci == NULL) {
        Scierror(999,"%s failed err=%d", fname, sci_err);
    }
    else {
        /* see C:\Program Files\scicoslab-44b7\examples\interface-tour-so\ex10intc.c */
        m2=1;
        n2=1;
        CreateVarFromPtr(2,"p",&m2,&n2, p_sci);
        LhsVar(1) =2; /* return pointer */
    }
    debug_1 ("p_sci = 0x%X \r\n", p_sci);
    debug_1 ("[if_sci_create] +++++++++++++++++++++ \r\n");
    return 0;
}
开发者ID:maki63,项目名称:c_sci,代码行数:31,代码来源:c_sci_if.c


示例20: sci_loadfftwlibrary

/*--------------------------------------------------------------------------*/ 
int sci_loadfftwlibrary(char *fname,unsigned long fname_len)
{
	static int l1,n1,m1;
	char *FFTWLibname=NULL;

	CheckRhs(1,1);

	if (GetType(1) == sci_strings)
	{
		GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
		FFTWLibname=cstk(l1);
		setfftwlibname(FFTWLibname);

		n1=1;
		if ( LoadFFTWLibrary(FFTWLibname) )
		{
			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 #%d: A string expected.\n"),fname,1);
	}
	return(0);
}
开发者ID:vinayrajchoudhary,项目名称:scilab,代码行数:35,代码来源:sci_loadfftwlibrary.c



注:本文中的GetRhsVar函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetRoot函数代码示例发布时间:2022-05-30
下一篇:
C++ GetResult函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap