Nektar++
ExpList3DHomogeneous1D.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File ExpList3DHomogeneous1D.cpp
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: An ExpList which is homogeneous in 1 direction and so
32 // uses much of the functionality from a ExpList and its daughters
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
37 #include <MultiRegions/ExpList.h>
38 
39 using namespace std;
40 
41 namespace Nektar
42 {
43  namespace MultiRegions
44  {
45  // Forward declaration for typedefs
46  ExpList3DHomogeneous1D::ExpList3DHomogeneous1D():
48  {
49  }
50 
53  const LibUtilities::BasisKey &HomoBasis,
54  const NekDouble lhom,
55  const bool useFFT,
56  const bool dealiasing):
57  ExpListHomogeneous1D(e3DH1D, pSession,HomoBasis,
58  lhom,useFFT,dealiasing)
59  {
60  }
61 
62  // Constructor for ExpList3DHomogeneous1D to act as a Explist field
65  const LibUtilities::BasisKey &HomoBasis,
66  const NekDouble lhom,
67  const bool useFFT,
68  const bool dealiasing,
70  const std::string &var,
71  const Collections::ImplementationType ImpType):
72  ExpListHomogeneous1D(e3DH1D, pSession,HomoBasis,
73  lhom,useFFT,dealiasing)
74  {
75  GenExpList3DHomogeneous1D(graph2D->GetExpansionInfo(var),ImpType);
76  m_expType = e3DH1D;
77  m_graph = graph2D;
78  }
79 
80  // Constructor for ExpList3DHomogeneous1D to act as a Explist field
83  const LibUtilities::BasisKey &HomoBasis,
84  const NekDouble lhom,
85  const bool useFFT,
86  const bool dealiasing,
87  const SpatialDomains::ExpansionInfoMap &expansions,
88  const Collections::ImplementationType ImpType):
89  ExpListHomogeneous1D(e3DH1D, pSession,HomoBasis,
90  lhom,useFFT,dealiasing)
91  {
92  GenExpList3DHomogeneous1D(expansions,ImpType);
93  }
94 
96  const SpatialDomains::ExpansionInfoMap &expansions,
97  const Collections::ImplementationType ImpType)
98  {
99  int n,j,nel;
100  bool False = false;
101  ExpListSharedPtr plane_zero;
102 
103  // note that nzplanes can be larger than nzmodes
105  (m_session, expansions, false, ImpType);
106 
108  nel = m_planes[0]->GetExpSize();
109 
110  for(j = 0; j < nel; ++j)
111  {
112  (*m_exp).push_back(m_planes[0]->GetExp(j));
113  }
114 
115  for(n = 1; n < m_planes.size(); ++n)
116  {
118  (*plane_zero,False);
119  for(j = 0; j < nel; ++j)
120  {
121  (*m_exp).push_back((*m_exp)[j]);
122  }
123  }
124 
125  SetCoeffPhys();
126  }
127 
128 
129  /**
130  * @param In ExpList3DHomogeneous1D object to copy.
131  */
132  ExpList3DHomogeneous1D::ExpList3DHomogeneous1D(const ExpList3DHomogeneous1D &In, bool DeclarePlanesSetCoeffPhys):
134  {
135  if(DeclarePlanesSetCoeffPhys)
136  {
137  bool False = false;
138  ExpListSharedPtr zero_plane = std::dynamic_pointer_cast<ExpList>
139  (In.m_planes[0]);
140 
141  for(int n = 0; n < m_planes.size(); ++n)
142  {
144  (*zero_plane,False);
145  }
146 
147  SetCoeffPhys();
148  }
149  }
150 
151  /**
152  * @param In ExpList3DHomogeneous1D object to copy.
153  * @param eIDs Id of elements that should be copied.
154  */
156  const ExpList3DHomogeneous1D &In,
157  const std::vector<unsigned int> &eIDs,
158  bool DeclarePlanesSetCoeffPhys,
159  const Collections::ImplementationType ImpType):
160  ExpListHomogeneous1D(In, eIDs)
161  {
162  if(DeclarePlanesSetCoeffPhys)
163  {
164  bool False = false;
165  std::vector<unsigned int> eIDsPlane;
166  int nel = eIDs.size()/m_planes.size();
167 
168  for (int i = 0; i < nel; ++i)
169  {
170  eIDsPlane.push_back(eIDs[i]);
171  }
172 
173  ExpListSharedPtr zero_plane_old =
174  std::dynamic_pointer_cast<ExpList> (In.m_planes[0]);
175 
176  ExpListSharedPtr zero_plane =
178  (*(zero_plane_old), eIDsPlane, ImpType);
179 
180  for(int n = 0; n < m_planes.size(); ++n)
181  {
183  (*zero_plane,False);
184  }
185 
186  SetCoeffPhys();
187  }
188  }
189 
190  /**
191  * Destructor
192  */
194  {
195  }
196 
198  {
199  int i,n,cnt;
200  int ncoeffs_per_plane = m_planes[0]->GetNcoeffs();
201  int npoints_per_plane = m_planes[0]->GetTotPoints();
202 
203  int nzplanes = m_planes.size();
204 
205  // Set total coefficients and points
206  m_ncoeffs = ncoeffs_per_plane*nzplanes;
207  m_npoints = npoints_per_plane*nzplanes;
208 
211 
212  int nel = m_planes[0]->GetExpSize();
213  m_coeff_offset = Array<OneD,int>(nel*nzplanes);
214  m_phys_offset = Array<OneD,int>(nel*nzplanes);
215  Array<OneD, NekDouble> tmparray;
216 
217  for(cnt = n = 0; n < nzplanes; ++n)
218  {
219  m_planes[n]->SetCoeffsArray(tmparray= m_coeffs + ncoeffs_per_plane*n);
220  m_planes[n]->SetPhysArray(tmparray = m_phys + npoints_per_plane*n);
221 
222  for(i = 0; i < nel; ++i)
223  {
224  m_coeff_offset[cnt] = m_planes[n]->GetCoeff_Offset(i) + n*ncoeffs_per_plane;
225  m_phys_offset[cnt++] = m_planes[n]->GetPhys_Offset(i) + n*npoints_per_plane;
226  }
227  }
228  }
229 
234  {
235  int n;
236  Array<OneD, NekDouble> tmp_xc;
237  int nzplanes = m_planes.size();
238  int npoints = GetTotPoints(eid);
239 
240  (*m_exp)[eid]->GetCoords(xc0,xc1);
241 
242  // Fill z-direction
244  Array<OneD, NekDouble> local_pts(m_planes.size());
245 
246  for(n = 0; n < m_planes.size(); n++)
247  {
248  local_pts[n] = pts[m_transposition->GetPlaneID(n)];
249  }
250 
251  Array<OneD, NekDouble> z(nzplanes);
252 
253  Vmath::Smul(nzplanes,m_lhom/2.0,local_pts,1,z,1);
254  Vmath::Sadd(nzplanes,m_lhom/2.0,z,1,z,1);
255 
256  for(n = 0; n < nzplanes; ++n)
257  {
258  Vmath::Fill(npoints,z[n],tmp_xc = xc2 + npoints*n,1);
259  if(n)
260  {
261  Vmath::Vcopy(npoints,xc0,1,tmp_xc = xc0+npoints*n,1);
262  Vmath::Vcopy(npoints,xc1,1,tmp_xc = xc1+npoints*n,1);
263  }
264  }
265  }
266 
267  /**
268  * The operation calls the 2D plane coordinates through the
269  * function ExpList#GetCoords and then evaluated the third
270  * coordinate using the member \a m_lhom
271  *
272  * @param coord_0 After calculation, the \f$x_1\f$ coordinate
273  * will be stored in this array.
274  *
275  * @param coord_1 After calculation, the \f$x_2\f$ coordinate
276  * will be stored in this array.
277  *
278  * @param coord_2 After calculation, the \f$x_3\f$ coordinate
279  * will be stored in this array. This
280  * coordinate is evaluated using the
281  * predefined value \a m_lhom
282  */
286  {
287  int n;
288  Array<OneD, NekDouble> tmp_xc;
289  int nzplanes = m_planes.size();
290  int npoints = m_planes[0]->GetTotPoints();
291 
292  m_planes[0]->GetCoords(xc0,xc1);
293 
294  // Fill z-direction
296 
297  Array<OneD, NekDouble> local_pts(m_planes.size());
298 
299  for(n = 0; n < m_planes.size(); n++)
300  {
301  local_pts[n] = pts[m_transposition->GetPlaneID(n)];
302  }
303 
304  Array<OneD, NekDouble> z(nzplanes);
305 
306  Vmath::Smul(nzplanes,m_lhom/2.0,local_pts,1,z,1);
307  Vmath::Sadd(nzplanes,m_lhom/2.0,z,1,z,1);
308 
309  for(n = 0; n < nzplanes; ++n)
310  {
311  Vmath::Fill(npoints,z[n],tmp_xc = xc2 + npoints*n,1);
312  if(n)
313  {
314  Vmath::Vcopy(npoints,xc0,1,tmp_xc = xc0+npoints*n,1);
315  Vmath::Vcopy(npoints,xc1,1,tmp_xc = xc1+npoints*n,1);
316  }
317  }
318  }
319 
320  void ExpList3DHomogeneous1D::v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
321  {
322  ASSERTL0(expansion == -1, "Multi-zone output not supported for homogeneous expansions.");
323 
324  const int nPtsPlane = m_planes[0]->GetNpoints();
325  const int nElmt = m_planes[0]->GetExpSize();
326  const int nPlanes = m_planes.size();
327 
328  int cnt = 0;
329  int cnt2 = 0;
330  for (int i = 0; i < nElmt; ++i)
331  {
332  const int np0 = (*m_exp)[i]->GetNumPoints(0);
333  const int np1 = (*m_exp)[i]->GetNumPoints(1);
334 
335  for (int n = 1; n < nPlanes; ++n)
336  {
337  const int o1 = (n-1) * nPtsPlane;
338  const int o2 = n * nPtsPlane;
339  for (int j = 1; j < np1; ++j)
340  {
341  for(int k = 1; k < np0; ++k)
342  {
343  outfile << cnt + (j-1)*np0 + (k-1) + o1 + 1 << " ";
344  outfile << cnt + (j-1)*np0 + (k-1) + o2 + 1 << " ";
345  outfile << cnt + (j-1)*np0 + k + o2 + 1 << " ";
346  outfile << cnt + (j-1)*np0 + k + o1 + 1 << " ";
347  outfile << cnt + j *np0 + (k-1) + o1 + 1 << " ";
348  outfile << cnt + j *np0 + (k-1) + o2 + 1 << " ";
349  outfile << cnt + j *np0 + k + o2 + 1 << " ";
350  outfile << cnt + j *np0 + k + o1 + 1 << endl;
351  cnt2++;
352  }
353  }
354  }
355 
356  cnt += np0*np1;
357  }
358  }
359 
360 
362  std::ostream &outfile,
363  int expansion,
364  int istrip)
365  {
366  // If there is only one plane (e.g. HalfMode), we write a 2D plane.
367  if (m_planes.size() == 1)
368  {
369  m_planes[0]->WriteVtkPieceHeader(outfile, expansion);
370  return;
371  }
372 
373  // If we are using Fourier points, output extra plane to fill domain
374  int outputExtraPlane = 0;
375  if ( m_homogeneousBasis->GetBasisType() == LibUtilities::eFourier
376  && m_homogeneousBasis->GetPointsType() ==
378  {
379  outputExtraPlane = 1;
380  }
381 
382  int i,j,k;
383  int nq0 = (*m_exp)[expansion]->GetNumPoints(0);
384  int nq1 = (*m_exp)[expansion]->GetNumPoints(1);
385  int nq2 = m_planes.size() + outputExtraPlane;
386  int ntot = nq0*nq1*nq2;
387  int ntotminus = (nq0-1)*(nq1-1)*(nq2-1);
388 
389  Array<OneD,NekDouble> coords[3];
390  coords[0] = Array<OneD,NekDouble>(ntot);
391  coords[1] = Array<OneD,NekDouble>(ntot);
392  coords[2] = Array<OneD,NekDouble>(ntot);
393  GetCoords(expansion,coords[0],coords[1],coords[2]);
394 
395  if (outputExtraPlane)
396  {
397  // Copy coords[0] and coords[1] to extra plane
399  Vmath::Vcopy (nq0*nq1, coords[0], 1,
400  tmp = coords[0] + (nq2-1)*nq0*nq1, 1);
401  Vmath::Vcopy (nq0*nq1, coords[1], 1,
402  tmp = coords[1] + (nq2-1)*nq0*nq1, 1);
403  // Fill coords[2] for extra plane
404  NekDouble z = coords[2][nq0*nq1*m_planes.size()-1] +
405  (coords[2][nq0*nq1] - coords[2][0]);
406  Vmath::Fill(nq0*nq1, z, tmp = coords[2] + (nq2-1)*nq0*nq1, 1);
407  }
408 
409  NekDouble DistStrip;
410  m_session->LoadParameter("DistStrip", DistStrip, 0);
411  // Reset the z-coords for homostrips
412  for(int i = 0; i < ntot; i++)
413  {
414  coords[2][i] += istrip*DistStrip;
415  }
416 
417  outfile << " <Piece NumberOfPoints=\""
418  << ntot << "\" NumberOfCells=\""
419  << ntotminus << "\">" << endl;
420  outfile << " <Points>" << endl;
421  outfile << " <DataArray type=\"Float64\" "
422  << "NumberOfComponents=\"3\" format=\"ascii\">" << endl;
423  outfile << " ";
424  for (i = 0; i < ntot; ++i)
425  {
426  for (j = 0; j < 3; ++j)
427  {
428  outfile << coords[j][i] << " ";
429  }
430  outfile << endl;
431  }
432  outfile << endl;
433  outfile << " </DataArray>" << endl;
434  outfile << " </Points>" << endl;
435  outfile << " <Cells>" << endl;
436  outfile << " <DataArray type=\"Int32\" "
437  << "Name=\"connectivity\" format=\"ascii\">" << endl;
438  for (i = 0; i < nq0-1; ++i)
439  {
440  for (j = 0; j < nq1-1; ++j)
441  {
442  for (k = 0; k < nq2-1; ++k)
443  {
444  outfile << k*nq0*nq1 + j*nq0 + i << " "
445  << k*nq0*nq1 + j*nq0 + i + 1 << " "
446  << k*nq0*nq1 + (j+1)*nq0 + i + 1 << " "
447  << k*nq0*nq1 + (j+1)*nq0 + i << " "
448  << (k+1)*nq0*nq1 + j*nq0 + i << " "
449  << (k+1)*nq0*nq1 + j*nq0 + i + 1 << " "
450  << (k+1)*nq0*nq1 + (j+1)*nq0 + i + 1 << " "
451  << (k+1)*nq0*nq1 + (j+1)*nq0 + i << endl;
452  }
453  }
454  }
455  outfile << endl;
456  outfile << " </DataArray>" << endl;
457  outfile << " <DataArray type=\"Int32\" "
458  << "Name=\"offsets\" format=\"ascii\">" << endl;
459  for (i = 0; i < ntotminus; ++i)
460  {
461  outfile << i*8+8 << " ";
462  }
463  outfile << endl;
464  outfile << " </DataArray>" << endl;
465  outfile << " <DataArray type=\"UInt8\" "
466  << "Name=\"types\" format=\"ascii\">" << endl;
467  for (i = 0; i < ntotminus; ++i)
468  {
469  outfile << "12 ";
470  }
471  outfile << endl;
472  outfile << " </DataArray>" << endl;
473  outfile << " </Cells>" << endl;
474  outfile << " <PointData>" << endl;
475  }
476 
478  const Array<OneD, const NekDouble> &inarray,
479  const Array<OneD, const NekDouble> &soln)
480  {
481  int cnt = 0;
482  NekDouble errL2, err = 0.0;
484  Array<OneD, NekDouble> local_w(m_planes.size());
485 
486  for(int n = 0; n < m_planes.size(); n++)
487  {
488  local_w[n] = w[m_transposition->GetPlaneID(n)];
489  }
490 
491  if (soln == NullNekDouble1DArray)
492  {
493  for(int n = 0; n < m_planes.size(); ++n)
494  {
495  errL2 = m_planes[n]->L2(inarray + cnt);
496  cnt += m_planes[n]->GetTotPoints();
497  err += errL2*errL2*local_w[n]*m_lhom*0.5;
498  }
499  }
500  else
501  {
502  for(int n = 0; n < m_planes.size(); ++n)
503  {
504  errL2 = m_planes[n]->L2(inarray + cnt, soln + cnt);
505  cnt += m_planes[n]->GetTotPoints();
506  err += errL2*errL2*local_w[n]*m_lhom*0.5;
507  }
508  }
509  m_comm->GetColumnComm()->AllReduce(err, LibUtilities::ReduceSum);
510 
511  return sqrt(err);
512  }
513 
515  {
516  Array<OneD, NekDouble> energy(m_planes.size()/2);
517  NekDouble area = 0.0;
518 
519  // Calculate total area of elements.
520  for (int n = 0; n < m_planes[0]->GetExpSize(); ++n)
521  {
522  Array<OneD, NekDouble> inarray(m_planes[0]->GetExp(n)->GetTotPoints(), 1.0);
523  area += m_planes[0]->GetExp(n)->Integral(inarray);
524  }
525 
526  m_comm->GetRowComm()->AllReduce(area, LibUtilities::ReduceSum);
527 
528  // Calculate L2 norm of real/imaginary planes.
529  for (int n = 0; n < m_planes.size(); n += 2)
530  {
531  NekDouble err;
532 
533  energy[n/2] = 0;
534 
535  for(int i = 0; i < m_planes[n]->GetExpSize(); ++i)
536  {
537  LocalRegions::ExpansionSharedPtr exp = m_planes[n]->GetExp( i );
538  Array<OneD, NekDouble> phys(exp->GetTotPoints());
539  exp->BwdTrans(m_planes[n]->GetCoeffs()+m_planes[n]->GetCoeff_Offset(i),
540  phys);
541  err = exp->L2(phys);
542  energy[n/2] += err*err;
543 
544  exp = m_planes[n+1]->GetExp(i);
545  exp->BwdTrans(m_planes[n+1]->GetCoeffs()+m_planes[n+1]->GetCoeff_Offset(i),
546  phys);
547  err = exp->L2(phys);
548  energy[n/2] += err*err;
549  }
550 
551  m_comm->GetRowComm()->AllReduce(energy[n/2], LibUtilities::ReduceSum);
552  energy[n/2] /= 2.0*area;
553  }
554 
555  return energy;
556  }
557  } //end of namespace
558 } //end of namespace
559 
560 
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
Describes the specification for a Basis.
Definition: Basis.h:50
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
void GenExpList3DHomogeneous1D(const SpatialDomains::ExpansionInfoMap &expansions, const Collections::ImplementationType ImpType)
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2)
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
void SetCoeffPhys(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
virtual void v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
void GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
This function calculates the coordinates of all the elemental quadrature points .
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
NekDouble m_lhom
Width of homogeneous direction.
LibUtilities::TranspositionSharedPtr m_transposition
Array< OneD, ExpListSharedPtr > m_planes
LibUtilities::BasisSharedPtr m_homogeneousBasis
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:1252
const Array< OneD, const NekDouble > & GetCoeffs() const
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
Definition: ExpList.h:2293
int GetCoeff_Offset(int n) const
Get the start offset position for a global list of m_coeffs correspoinding to element n.
Definition: ExpList.h:2431
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:1304
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:1220
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:1290
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:1230
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition: ExpList.h:2422
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:1226
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:1223
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:1307
ExpansionType m_expType
Exapnsion type.
Definition: ExpList.h:1212
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:1269
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1850
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ eFourierEvenlySpaced
1D Evenly-spaced points using Fourier Fit
Definition: PointsType.h:65
@ eFourier
Fourier Expansion .
Definition: BasisType.h:53
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
Definition: MeshGraph.h:143
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
static Array< OneD, NekDouble > NullNekDouble1DArray
double NekDouble
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.cpp:225
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:45
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha - x.
Definition: Vmath.cpp:341
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1199
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:267