bridge/class-master/depend/pari/src/basemath/mftrace.c
/* transform mf to new_NEW if possible */
transform mf to new_NEW if possible
transform mf to new_NEW if possible
static GEN
MF_set_new(GEN mf)
{
  GEN vMjd, vj, gk = MF_get_gk(mf);
  long l, j;
  if (MF_get_space(mf) != mf_CUSP
      || typ(gk) != t_INT || itou(gk) == 1) return mf;
  vMjd = MFcusp_get_vMjd(mf); l = lg(vMjd);
  if (l > 1 && gel(vMjd,1)[1] != MF_get_N(mf)) return mf; 
  mf = shallowcopy(mf);
  gel(mf,1) = shallowcopy(gel(mf,1));
  MF_set_space(mf, mf_NEW);
  vj = cgetg(l, t_VECSMALL);
  for (j = 1; j < l; j++) vj[j] = gel(vMjd, j)[2];
  gel(mf,4) = vj; return mf;
}
static GEN MF_set_new ( GEN mf ) { GEN vMjd , vj , gk = MF_get_gk ( mf ) ; long l , j ; if ( MF_get_space ( mf ) != mf_CUSP || typ ( gk ) != t_INT || itou ( gk ) == 1 ) return mf ; vMjd = MFcusp_get_vMjd ( mf ) ; l = lg ( vMjd ) ; if ( l > 1 && gel ( vMjd , 1 ) [ 1 ] != MF_get_N ( mf ) ) return mf ; mf = shallowcopy ( mf ) ; gel ( mf , 1 ) = shallowcopy ( gel ( mf , 1 ) ) ; MF_set_space ( mf , mf_NEW ) ; vj = cgetg ( l , t_VECSMALL ) ; for ( j = 1 ; j < l ; j ++ ) vj [ j ] = gel ( vMjd , j ) [ 2 ] ; gel ( mf , 4 ) = vj ; return mf ; }
transform mf to new_NEW if possible
transform mf to new_NEW if possible
/* oldspace != 0 */