Loading...
Searching...
No Matches
reflections Namespace Reference

## Functions

template<unsigned int Precision>
void | generatereflection (ap::template_1d_array< amp::ampf< Precision > > &x, int n, amp::ampf< Precision > &tau)
template<unsigned int Precision>
void | applyreflectionfromtheleft (ap::template_2d_array< amp::ampf< Precision > > &c, amp::ampf< Precision > tau, const ap::template_1d_array< amp::ampf< Precision > > &v, int m1, int m2, int n1, int n2, ap::template_1d_array< amp::ampf< Precision > > &work)
template<unsigned int Precision>
void | applyreflectionfromtheright (ap::template_2d_array< amp::ampf< Precision > > &c, amp::ampf< Precision > tau, const ap::template_1d_array< amp::ampf< Precision > > &v, int m1, int m2, int n1, int n2, ap::template_1d_array< amp::ampf< Precision > > &work)

## Function Documentation

## applyreflectionfromtheleft()

template<unsigned int Precision>

void reflections::applyreflectionfromtheleft | ( | ap::template_2d_array< amp::ampf< Precision > > & | c,
|  | amp::ampf< Precision > | tau,
|  | const ap::template_1d_array< amp::ampf< Precision > > & | v,
|  | int | m1,
|  | int | m2,
|  | int | n1,
|  | int | n2,
|  | ap::template_1d_array< amp::ampf< Precision > > & | work )

Definition at line 207 of file reflections.h.

{
amp::ampf<Precision> t;
int i;
int vm;
if( tau==0 || n1>n2 || m1>m2 )
{
return;
}
//
// w := C' * v
//
vm = m2-m1+1;
for(i=n1; i<=n2; i++)
{
work(i) = 0;
}
for(i=m1; i<=m2; i++)
{
t = v(i+1-m1);
ap::vadd(work.getvector(n1, n2), c.getrow(i, n1, n2), t);
}
//
// C := C - tau * v * w'
//
for(i=m1; i<=m2; i++)
{
t = v(i-m1+1)*tau;
ap::vsub(c.getrow(i, n1, n2), work.getvector(n1, n2), t);
}
}
i
int i
Definition cfEzgcd.cc:132
tau
void tau(int **points, int sizePoints, int k)
Definition cfNewtonPolygon.cc:461
amp::ampf
Definition amp.h:82
ap::template_1d_array::getvector
raw_vector< T > getvector(int iStart, int iEnd)
Definition ap.h:776
ap::template_2d_array::getrow
raw_vector< T > getrow(int iRow, int iColumnStart, int iColumnEnd)
Definition ap.h:939
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
ap::vadd
void vadd(raw_vector< T > vdst, const_raw_vector< T > vsrc)
Definition ap.h:413
ap::vsub
void vsub(raw_vector< T > vdst, const_raw_vector< T > vsrc)
Definition ap.h:533

## applyreflectionfromtheright()

template<unsigned int Precision>

void reflections::applyreflectionfromtheright | ( | ap::template_2d_array< amp::ampf< Precision > > & | c,
|  | amp::ampf< Precision > | tau,
|  | const ap::template_1d_array< amp::ampf< Precision > > & | v,
|  | int | m1,
|  | int | m2,
|  | int | n1,
|  | int | n2,
|  | ap::template_1d_array< amp::ampf< Precision > > & | work )

Definition at line 280 of file reflections.h.

{
amp::ampf<Precision> t;
int i;
int vm;
if( tau==0 || n1>n2 || m1>m2 )
{
return;
}
//
// w := C * v
//
vm = n2-n1+1;
for(i=m1; i<=m2; i++)
{
t = ap::vdotproduct(c.getrow(i, n1, n2), v.getvector(1, vm));
work(i) = t;
}
//
// C := C - w * v'
//
for(i=m1; i<=m2; i++)
{
t = work(i)*tau;
ap::vsub(c.getrow(i, n1, n2), v.getvector(1, vm), t);
}
}
ap::vdotproduct
T vdotproduct(const_raw_vector< T > v1, const_raw_vector< T > v2)
Definition ap.h:181

## generatereflection()

template<unsigned int Precision>

void reflections::generatereflection | ( | ap::template_1d_array< amp::ampf< Precision > > & | x,
|  | int | n,
|  | amp::ampf< Precision > & | tau )

Definition at line 112 of file reflections.h.

{
int j;
amp::ampf<Precision> alpha;
amp::ampf<Precision> xnorm;
amp::ampf<Precision> v;
amp::ampf<Precision> beta;
amp::ampf<Precision> mx;
//
// Executable Statements ..
//
if( n<=1 )
{
tau = 0;
return;
}
//
// XNORM = DNRM2( N-1, X, INCX )
//
alpha = x(1);
mx = 0;
for(j=2; j<=n; j++)
{
mx = amp::maximum<Precision>(amp::abs<Precision>(x(j)), mx);
}
xnorm = 0;
if( mx!=0 )
{
for(j=2; j<=n; j++)
{
xnorm = xnorm+amp::sqr<Precision>(x(j)/mx);
}
xnorm = amp::sqrt<Precision>(xnorm)*mx;
}
if( xnorm==0 )
{
//
// H = I
//
tau = 0;
return;
}
//
// general case
//
mx = amp::maximum<Precision>(amp::abs<Precision>(alpha), amp::abs<Precision>(xnorm));
beta = -mx*amp::sqrt<Precision>(amp::sqr<Precision>(alpha/mx)+amp::sqr<Precision>(xnorm/mx));
if( alpha<0 )
{
beta = -beta;
}
tau = (beta-alpha)/beta;
v = 1/(alpha-beta);
ap::vmul(x.getvector(2, n), v);
x(1) = beta;
}
x
Variable x
Definition cfModGcd.cc:4090
alpha
Variable alpha
Definition facAbsBiFact.cc:52
beta
Variable beta
Definition facAbsFact.cc:95
j
int j
Definition facHensel.cc:110
amp::abs
const ampf< Precision > abs(const ampf< Precision > &x)
Definition amp.h:713
amp::maximum
const ampf< Precision > maximum(const ampf< Precision > &x, const ampf< Precision > &y)
Definition amp.h:722
amp::sqrt
const ampf< Precision > sqrt(const ampf< Precision > &x)
Definition amp.h:740
amp::sqr
const ampf< Precision > sqr(const ampf< Precision > &x)
Definition amp.h:693
ap::vmul
void vmul(raw_vector< T > vdst, T2 alpha)
Definition ap.h:603