bridge/class-master/depend/pari/src/language/eval.c
/* assign res at *pt in "simple array object" p and return it, or a copy.*/
assign res at *pt in "simple array object" p and return it, or a copy.
assign res at * pt in " simple array object " p and return it or a copy .
static void
change_compo(matcomp *c, GEN res)
{
  GEN p = c->parent, *pt = c->ptcell;
  long i, t;
  if (typ(p) == t_VECSMALL)
  {
    if (typ(res) != t_INT || is_bigint(res))
      pari_err_TYPE("t_VECSMALL assignment", res);
    *pt = (GEN)itos(res); return;
  }
  t = typ(res);
  if (c->full_row)
  {
    if (t != t_VEC) pari_err_TYPE("matrix row assignment", res);
    if (lg(res) != lg(p)) pari_err_DIM("matrix row assignment");
    for (i=1; i<lg(p); i++)
    {
      GEN p1 = gcoeff(p,c->full_row,i); 
      gcoeff(p,c->full_row,i) = gclone(gel(res,i));
      if (isclone(p1)) gunclone_deep(p1);
    }
    return;
  }
  if (c->full_col)
  {
    if (t != t_COL) pari_err_TYPE("matrix col assignment", res);
    if (lg(res) != lg(*pt)) pari_err_DIM("matrix col assignment");
  }
  res = gclone(res);
  gunclone_deep(*pt);
  *pt = res;
}
static void change_compo ( matcomp * c , GEN res ) { GEN p = c -> parent , * pt = c -> ptcell ; long i , t ; if ( typ ( p ) == t_VECSMALL ) { if ( typ ( res ) != t_INT || is_bigint ( res ) ) pari_err_TYPE ( " " , res ) ; * pt = ( GEN ) itos ( res ) ; return ; } t = typ ( res ) ; if ( c -> full_row ) { if ( t != t_VEC ) pari_err_TYPE ( " " , res ) ; if ( lg ( res ) != lg ( p ) ) pari_err_DIM ( " " ) ; for ( i = 1 ; i < lg ( p ) ; i ++ ) { GEN p1 = gcoeff ( p , c -> full_row , i ) ; gcoeff ( p , c -> full_row , i ) = gclone ( gel ( res , i ) ) ; if ( isclone ( p1 ) ) gunclone_deep ( p1 ) ; } return ; } if ( c -> full_col ) { if ( t != t_COL ) pari_err_TYPE ( " " , res ) ; if ( lg ( res ) != lg ( * pt ) ) pari_err_DIM ( " " ) ; } res = gclone ( res ) ; gunclone_deep ( * pt ) ; * pt = res ; }
assign res at *pt in "simple array object" p and return it, or a copy.
assign res at * pt in " simple array object " p and return it or a copy .
/* Protect against SIGINT */