Answer the question
In order to leave comments, you need to log in
How do squaring iterations occur in Lobachevsky's method?
If possible, an example. The books have everything - except for at least one example that describes how this iteration happens.
Answer the question
In order to leave comments, you need to log in
//Младший коэффициент возводится в квадрат
coeff[l][0]=coeff[1-l][0]*coeff[1-l][0];
//Старший коэффициент возводится в квадрат
coeff[l][prox->power()]=coeff[1-l][prox->power()]*coeff[1-l][prox->power()];
//для всех коэффициентов, кроме старшего и младшего
for(idx i=1;i<prox->power();i++)
{
const idx d=std::min(prox->power()-i,i);
//коэффициент с индексом i возводится в квадрат
coeff[l][i]=coeff[1-l][i]*coeff[1-l][i];
//и домножается на дополнительный набор коэффициентов
for(idx j=1;j<=d;j++)
{
idx k=(((1+j)%2)*2-1)<<1;
coeff[l][i]+=k*coeff[1-l][i-j]*coeff[1-l][i+j];
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question