My Project  UNKNOWN_GIT_VERSION
Functions
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 243 of file reflections.h.

244  {
245  t = v(i-m1+1)*tau;
246  ap::vsub(c.getrow(i, n1, n2), work.getvector(n1, n2), t);
247  }
248  }
249 
250 
251  /*************************************************************************
252  Application of an elementary reflection to a rectangular matrix of size MxN
253 
254  The algorithm post-multiplies the matrix by an elementary reflection transformation
255  which is given by column V and scalar Tau (see the description of the
256  GenerateReflection procedure). Not the whole matrix but only a part of it
257  is transformed (rows from M1 to M2, columns from N1 to N2). Only the
258  elements of this submatrix are changed.
259 
260  Input parameters:
261  C - matrix to be transformed.
262  Tau - scalar defining the transformation.
263  V - column defining the transformation.
264  Array whose index ranges within [1..N2-N1+1].
265  M1, M2 - range of rows to be transformed.
266  N1, N2 - range of columns to be transformed.
267  WORK - working array whose indexes goes from M1 to M2.
268 
269  Output parameters:
270  C - the result of multiplying the input matrix C by the
271  transformation matrix which is given by Tau and V.
272  If N1>N2 or M1>M2, C is not modified.
273 
274  -- LAPACK auxiliary routine (version 3.0) --
275  Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
276  Courant Institute, Argonne National Lab, and Rice University
277  September 30, 1994
278  *************************************************************************/
279  template<unsigned int Precision>
283  int m1,
284  int m2,

◆ 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 316 of file reflections.h.

◆ 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 148 of file reflections.h.

153  {
154 
155  //
156  // H = I
157  //
158  tau = 0;
159  return;
160  }
161 
162  //
163  // general case
164  //
165  mx = amp::maximum<Precision>(amp::abs<Precision>(alpha), amp::abs<Precision>(xnorm));
166  beta = -mx*amp::sqrt<Precision>(amp::sqr<Precision>(alpha/mx)+amp::sqr<Precision>(xnorm/mx));
167  if( alpha<0 )
168  {
169  beta = -beta;
170  }
171  tau = (beta-alpha)/beta;
172  v = 1/(alpha-beta);
173  ap::vmul(x.getvector(2, n), v);
174  x(1) = beta;
175  }
176 
177 
178  /*************************************************************************
179  Application of an elementary reflection to a rectangular matrix of size MxN
180 
181  The algorithm pre-multiplies the matrix by an elementary reflection transformation
182  which is given by column V and scalar Tau (see the description of the
183  GenerateReflection procedure). Not the whole matrix but only a part of it
184  is transformed (rows from M1 to M2, columns from N1 to N2). Only the elements
185  of this submatrix are changed.
186 
187  Input parameters:
188  C - matrix to be transformed.
189  Tau - scalar defining the transformation.
190  V - column defining the transformation.
191  Array whose index ranges within [1..M2-M1+1].
192  M1, M2 - range of rows to be transformed.
193  N1, N2 - range of columns to be transformed.
194  WORK - working array whose indexes goes from N1 to N2.
195 
196  Output parameters:
197  C - the result of multiplying the input matrix C by the
198  transformation matrix which is given by Tau and V.
199  If N1>N2 or M1>M2, C is not modified.
200 
201  -- LAPACK auxiliary routine (version 3.0) --
202  Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
203  Courant Institute, Argonne National Lab, and Rice University
204  September 30, 1994
205  *************************************************************************/
206  template<unsigned int Precision>
210  int m1,
211  int m2,
x
Variable x
Definition: cfModGcd.cc:4023
ap::template_1d_array::getvector
raw_vector< T > getvector(int iStart, int iEnd)
Definition: ap.h:783
ap::template_1d_array
Definition: ap.h:662
ap::template_2d_array
Definition: ap.h:812
amp::ampf
Definition: amp.h:83
reflections::applyreflectionfromtheleft
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)
Definition: reflections.h:243
ap::vmul
void vmul(raw_vector< T > vdst, T2 alpha)
Definition: ap.h:608
i
int i
Definition: cfEzgcd.cc:125
alpha
Variable alpha
Definition: facAbsBiFact.cc:52
ap::template_2d_array::getrow
raw_vector< T > getrow(int iRow, int iColumnStart, int iColumnEnd)
Definition: ap.h:946
ap::vsub
void vsub(raw_vector< T > vdst, const_raw_vector< T > vsrc)
Definition: ap.h:538
beta
Variable beta
Definition: facAbsFact.cc:99
reflections::applyreflectionfromtheright
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)
Definition: reflections.h:316
tau
void tau(int **points, int sizePoints, int k)
Definition: cfNewtonPolygon.cc:461
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37