bridge/class-master/depend/pari/src/basemath/mftrace.c
/* Set flraw to 1 if do not need mf[5]: no mftobasis etc..., only the
   expansions of the basis elements are needed. */
Set flraw to 1 if do not need mf[5]: no mftobasis etc..., only the
expansions of the basis elements are needed.
Set flraw to 1 if do not need mf [ 5 ] : no mftobasis etc ... only the expansions of the basis elements are needed .
static GEN
mfinit_Nkchi(long N, long k, GEN CHI, long space, long flraw)
{
  GEN M = NULL, mf = NULL, mf1 = mkvec4(utoi(N), stoi(k), CHI, utoi(space));
  long sb = mfsturmNk(N, k);
  cachenew_t cache;
  if (k < 0 || badchar(N, k, CHI)) return mfEMPTY(mf1);
  if (k == 0) ;
  else if (k == 1)
  {
    switch (space)
    {
      case mf_NEW:
      case mf_FULL:
      case mf_CUSP: mf = mfwt1init(N, CHI, NULL, space, flraw); break;
      case mf_EISEN:break;
      case mf_OLD: pari_err_IMPL("mfinit in weight 1 for old space");
      default: pari_err_FLAG("mfinit");
    }
  }
  else 
  {
    long ord = mfcharorder_canon(CHI);
    GEN z = NULL, P = (ord == 1)? NULL: mfcharpol(CHI);
    switch(space)
    {
      case mf_EISEN:
        break;
      case mf_NEW:
        mf = mfnewinit(N, k, CHI, &cache, 1);
        if (mf && !flraw) { M = MF_get_M(mf); z = MF_get_Mindex(mf); }
        break;
      case mf_OLD:
      case mf_CUSP:
      case mf_FULL:
        mf = mfinitcusp(N, k, CHI, &cache, space);
        if (mf && !flraw)
        {
          GEN S = MF_get_S(mf);
          M = bhnmat_extend(M, sb+1, 1, S, &cache);
          if (space != mf_FULL) gel(mf,5) = mfcleanCHI(M, CHI, abundant(N));
        }
        dbg_cachenew(&cache);
        break;
      default: pari_err_FLAG("mfinit");
    }
    if (z) gel(mf,5) = mfclean2(M, z, P, ord);
  }
  if (!mf) mf = mfEMPTY(mf1);
  else
  {
    gel(mf,1) = mf1;
    if (flraw) gel(mf,5) = zerovec(3);
  }
  if (!space_is_cusp(space))
  {
    GEN E = mfeisensteinbasis(N, k, CHI);
    gel(mf,2) = E;
    if (!flraw)
    {
      if (M)
        M = shallowconcat(mfvectomat(E, sb+1, 1), M);
      else
        M = mfcoefs_mf(mf, sb+1, 1);
      gel(mf,5) = mfcleanCHI(M, CHI, abundant(N));
    }
  }
  return mf;
}
static GEN mfinit_Nkchi ( long N , long k , GEN CHI , long space , long flraw ) { GEN M = NULL , mf = NULL , mf1 = mkvec4 ( utoi ( N ) , stoi ( k ) , CHI , utoi ( space ) ) ; long sb = mfsturmNk ( N , k ) ; cachenew_t cache ; if ( k < 0 || badchar ( N , k , CHI ) ) return mfEMPTY ( mf1 ) ; if ( k == 0 ) ; else if ( k == 1 ) { switch ( space ) { case mf_NEW : case mf_FULL : case mf_CUSP : mf = mfwt1init ( N , CHI , NULL , space , flraw ) ; break ; case mf_EISEN : break ; case mf_OLD : pari_err_IMPL ( " " ) ; default : pari_err_FLAG ( " " ) ; } } else { long ord = mfcharorder_canon ( CHI ) ; GEN z = NULL , P = ( ord == 1 ) ? NULL : mfcharpol ( CHI ) ; switch ( space ) { case mf_EISEN : break ; case mf_NEW : mf = mfnewinit ( N , k , CHI , & cache , 1 ) ; if ( mf && ! flraw ) { M = MF_get_M ( mf ) ; z = MF_get_Mindex ( mf ) ; } break ; case mf_OLD : case mf_CUSP : case mf_FULL : mf = mfinitcusp ( N , k , CHI , & cache , space ) ; if ( mf && ! flraw ) { GEN S = MF_get_S ( mf ) ; M = bhnmat_extend ( M , sb + 1 , 1 , S , & cache ) ; if ( space != mf_FULL ) gel ( mf , 5 ) = mfcleanCHI ( M , CHI , abundant ( N ) ) ; } dbg_cachenew ( & cache ) ; break ; default : pari_err_FLAG ( " " ) ; } if ( z ) gel ( mf , 5 ) = mfclean2 ( M , z , P , ord ) ; } if ( ! mf ) mf = mfEMPTY ( mf1 ) ; else { gel ( mf , 1 ) = mf1 ; if ( flraw ) gel ( mf , 5 ) = zerovec ( 3 ) ; } if ( ! space_is_cusp ( space ) ) { GEN E = mfeisensteinbasis ( N , k , CHI ) ; gel ( mf , 2 ) = E ; if ( ! flraw ) { if ( M ) M = shallowconcat ( mfvectomat ( E , sb + 1 , 1 ) , M ) ; else M = mfcoefs_mf ( mf , sb + 1 , 1 ) ; gel ( mf , 5 ) = mfcleanCHI ( M , CHI , abundant ( N ) ) ; } } return mf ; }
Set flraw to 1 if do not need mf[5]: no mftobasis etc..., only the
expansions of the basis elements are needed.
Set flraw to 1 if do not need mf [ 5 ] : no mftobasis etc ... only the expansions of the basis elements are needed .
/*nothing*/ /* k >= 2 */