Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ExponentVector := proc (Qx,At) local x,results,tmp,Bt,a,counter2,counter;
- with(LinearAlgebra):
- tmp := Qx:
- Bt := Factorbase(At):
- x := 1:
- results :=[]:
- a := Matrix(1,nops(Bt)):
- counter := 0:
- counter2 := nops(Bt):
- if Qx < 0 then
- tmp := Qx*(-1);
- a[1,1] := 1;
- end if;
- while x = 1 do
- if Bt[-1] = 2 then
- if type(tmp/Bt[-1],integer) then
- tmp := tmp/Bt[-1];
- counter := counter +1:
- a[1,counter2] := counter:
- else
- x := 0;
- fi;
- fi;
- if type(tmp/Bt[-1],integer)and Bt[-1] > 2 then
- print(Bt[-1]);
- tmp := tmp/Bt[-1];
- counter := counter +1:
- else
- a[1,counter2] := counter:
- counter := 0:
- counter2 := counter2 - 1;
- Bt := subsop(-1=NULL,Bt):
- fi;
- if Bt[-1] = -1 then
- x := 0;
- fi;
- od;
- if tmp > 1 then
- a[1,1] := -2 fi;
- Transpose(a)
- end proc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement