@* Scheduling function for the lattice siever. Copyright (C) 2002 Jens Franke, T. Kleinjung. This file is part of gnfs4linux, distributed under the terms of the GNU General Public Licence and WITHOUT ANY WARRANTY. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @(medsched.h@>= u32_t *medsched(u32_t*,u32_t*,u32_t*,u32_t**,u32_t,u32_t); u32_t *medsched_1(u32_t*,u32_t*,u32_t*,u32_t,unsigned char *, unsigned char); @ @c #include #include #include "siever-config.h" #include "medsched.h" #include "../if.h" #define L1_SIZE (1<@; while(ij=a) ij+=ri[1]; } ri+=2; *(ij_ptr++)=ij-L1_SIZE; } return ri; } u32_t * medsched(ri,ij_ptr,ij_ptr_ub,sched_ptr,fbi_offs,ot) u32_t *ri,*ij_ptr,*ij_ptr_ub,**sched_ptr,fbi_offs,ot; { u32_t ij; u32_t ot_mask,ot_tester; u32_t *sched; sched=*sched_ptr; if(ot!=0) { ot_tester=(ot&1)|((ot&2)<<(i_bits-1)); ot_mask=n_i|1; } else return medsched0(ri,ij_ptr,ij_ptr_ub,sched_ptr,fbi_offs); while ( ij_ptr < ij_ptr_ub) { u16_t a,b; a=n_i-(ri[0]&(n_i-1)); b=n_i-(ri[1]&(n_i-1)); if(ot == 0) ij=*ij_ptr; else @@; while(ij=a) ij+=ri[1]; } ri+=2; *(ij_ptr++)=ij-L1_SIZE; fbi_offs++; } *sched_ptr=sched; return ri; } @ @= { ij=0; if( (ri[0]&ot_mask) == ot_tester ) ij=ri[0]; else { if( (ri[1]&ot_mask) == (ot_tester^n_i) ) ij=ri[1]; else { if((ri[0]&(n_i-1))<=(ri[1]&(n_i-1)) && ri[0]<=ri[1]) { /* This corresponds to the line |if(b+c<=A && s<=t)| in recurrence6.w */ if((ri[0]&(n_i-1))==(ri[1]&(n_i-1))) ij=ri[1]-ri[0]; else ij=n_i; if(ot != 2) Schlendrian("Exceptional situation for oddness type %u ?\n", ot); } else ij=ri[0]+ri[1]; } } ij=(ij+((~ot_tester)&n_i))/2; }