MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / N_VScale

Function N_VScale

externalpackages/PVODE/source/nvector.cpp:330–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328
329
330void N_VScale(real c, N_Vector x, N_Vector z)
331{
332 integer N;
333 real *xd, *zd;
334
335 if (z == x) { /* BLAS usage: scale x <- cx */
336 VScaleBy(c, x);
337 return;
338 }
339
340 if (c == ONE) {
341 VCopy(x, z);
342 } else if (c == -ONE) {
343 VNeg(x, z);
344 } else {
345 N = x->length;
346 xd = x->data;
347 zd = z->data;
348#ifndef _OPENMP
349 for (integer i=0; i < N; i++) *zd++ = c * (*xd++);
350#else
351 #pragma omp parallel for
352 for (integer i=0; i < N; i++)
353 zd[i] = c * xd[i];
354#endif
355 }
356}
357
358
359void N_VAbs(N_Vector x, N_Vector z)

Callers 15

PVBBDPSolFunction · 0.85
PVBBDDQJacFunction · 0.85
SpgmrSolveFunction · 0.85
ClassicalGSFunction · 0.85
CVSpgmrSolveFunction · 0.85
CVDiagSolveFunction · 0.85
CVodeMallocFunction · 0.85
CVodeFunction · 0.85
CVodeDkyFunction · 0.85
CVEwtSetSSFunction · 0.85
CVUpperBoundH0Function · 0.85
CVYddNormFunction · 0.85

Calls 3

VScaleByFunction · 0.85
VCopyFunction · 0.85
VNegFunction · 0.85

Tested by

no test coverage detected