2018-03-11 17:07:48 -04:00
|
|
|
function sum = gfsubstitute(polynomial,value,terms,n,field)
|
|
|
|
|
|
|
|
|
|
%use: gfsubstitute(polynomial,value,terms,n,field)
|
Fix typos found by codespell
- Typos were found by codespell v1.17.0.dev0 (commit 44fea6d)
- Command used:
codespell -q 2 \
-L ba,bloc,blocs,doubleclick,dur,fille,frmat,numer,optin,passtime \
-L pres,strack,te,tim,tre,uint,whn \
--skip="*.de-DE.resx,./Bwg*,./Freedb,./MusicBrainz,./ProgressODoom" \
--skip="./ThirdParty"
2020-02-13 21:42:55 +01:00
|
|
|
%Substitute i^value in polynomial
|
2018-03-11 17:07:48 -04:00
|
|
|
%the number of terms in polynomial
|
|
|
|
|
%n = n of the decoder
|
|
|
|
|
|
|
|
|
|
sum = polynomial(1);
|
|
|
|
|
for cc = 2:terms
|
|
|
|
|
sum = gfadd(sum,gfmul(polynomial(cc),gfpow(value,cc-1,n),field),field); %Sum all the terms
|
|
|
|
|
end
|