module Ops:Nvector.NVECTOR_OPSwith type t = t
Underlying nvector operations on serial nvectors.
type t
The vector type.
val clone : t -> tCreate a new, distinct vector from an existing one.
val linearsum : float ->
t ->
float -> t -> t -> unitlinearsum a x b y z calculates z = a*x + b*y.
val const : float -> t -> unitconst c z sets all of z to c.
val prod : t ->
t -> t -> unitprod x y z calculates z = x * y (pointwise).
val div : t ->
t -> t -> unitdiv x y z calculates z = x / y (pointwise).
val scale : float -> t -> t -> unitscale c x z calculates z = c *. x.
val abs : t -> t -> unitabs x z calculates z = abs(x).
val inv : t -> t -> unitinv x z calculates z = 1/x (pointwise).
val addconst : t -> float -> t -> unitaddconst x b z calculates z = x + b.
val dotprod : t -> t -> floatdotprod x y returns the dot product of x and y.
val maxnorm : t -> floatmaxnorm x returns the maximum absolute value in x.
val wrmsnorm : t -> t -> floatwrmsnorm x w returns the weighted root-mean-square norm of x
with weight vector w.
val min : t -> floatmin x returns the smallest element in x.
val compare : float -> t -> t -> unitcompare c x z calculates
z(i) = if abs x(i) >= c then 1 else 0.
val invtest : t -> t -> boolinvtest x z calculates z(i) = 1 / x(i) with prior testing for
zero values. This routine returns true if all components of x are
nonzero (successful inversion) and false otherwise (not all elements
inverted).
val wl2norm : t -> t -> floatwl2norm x w returns the weighted (w) Euclidean l2 norm of x.
val l1norm : t -> floatl1norm x returns the l1 norm of x.
val wrmsnormmask : t ->
t -> t -> floatmaxnormmask x w id returns the weighted root-mean-square norm
of x using only elements where the corresponding id is non-zero.
val constrmask : t ->
t -> t -> boolconstrmask c x m calculates m(i) = Pi x(i) returning the
conjunction. The value of Pi depends on c(i): 2: x(i) > 0,
1: x(i) >= 0, 0: true, -1: x(i) <= 0, and -2: x(i) < 0.
val minquotient : t -> t -> floatminquotient num denom returns the minimum of num(i) / denom(i).
Zero denom elements are skipped.
val space : t -> int * intlrw, liw = space c returns the number of realtype words lrw and
integer words liw required to store c.
val getlength : t -> intReturns the number of "active" entries. This value is cumulative across all processes in a parallel environment.
val print : ?logfile:Sundials.Logfile.t -> t -> unitPrints to the given logfile (stdout, by default).
val linearcombination : Sundials.RealArray.t ->
t array -> t -> unitlinearcombination c x z calculates
$z_i = \sum_{j=0}^{n_v-1} c_j (x_j)_i$ .
The sum is over the $n_v$ elements of c and x.
val scaleaddmulti : Sundials.RealArray.t ->
t ->
t array -> t array -> unitscaleaddmulti c x y z scales x and adds it to the
$n_v$ vectors in y.
That is,
$\forall j=0,\ldots,n_v-1, (z_j)_i = c_j x_i + (y_j)_i}$ .
val dotprodmulti : t ->
t array -> Sundials.RealArray.t -> unitdotprodmulti x y d calculates the dot product of x with
the $n_v$ elements of y.
That is, $\forall j=0,\ldots,n_v-1,
d_j = \sum_{i=0}^{n-1} x_i (y_j)_i$ .
val linearsumvectorarray : float ->
t array ->
float -> t array -> t array -> unitlinearsumvectorarray a x b y z computes the linear sum of the
$n_v$ elements of x and y.
That is,
$\forall j=0,\ldots,n_v-1, (z_j)_i = a (x_j)_i + b (y_j)_i$ .
val scalevectorarray : Sundials.RealArray.t ->
t array -> t array -> unitscalevectorarray c x z scales each of the $n_v$ vectors
of x.
That is, $\forall j=0,\ldots,n_v-1, (z_j)_i = c_j (x_j)_i$ .
val constvectorarray : float -> t array -> unitconstvectorarray c x sets all elements of the $n_v$ nvectors
in x to c.
That is, $\forall j=0,\ldots,n_v, (z_j)_i = c$ .
val wrmsnormvectorarray : t array ->
t array -> Sundials.RealArray.t -> unitwrmsnormvectorarray x w m computes the weighted root mean
square norm of the $n_v$ vectors in x and w.
That is,
$\forall j=0,\ldots,n_v,
m_j = \left( \frac{1}{n}
\sum_{i=0}^{n-1} ((x_j)_i (w_j)_i)^2
\right)^\frac{1}{2}$ ,
where $n$ is the number of elements in each nvector.
val wrmsnormmaskvectorarray : t array ->
t array ->
t -> Sundials.RealArray.t -> unitwrmsnormmaskvectorarray x w id m computes the weighted root mean
square norm of the $n_v$ vectors in x and w.
That is,
$\forall j=0,\ldots,n_v,
m_j = \left( \frac{1}{n}
\sum_{i=0}^{n-1} ((x_j)_i (w_j)_i H(\mathit{id}_i))^2
\right)^\frac{1}{2}$ ,
where $H(x) = \begin{cases} 1 & \text{if } x > 0 \ 0 & \text{otherwise}
\end{cases}$ and
$n$ is the number of elements in each nvector.
val scaleaddmultivectorarray : Sundials.RealArray.t ->
t array ->
t array array ->
t array array -> unitscaleaddmultivectorarray a x yy zz scales and adds $n_v$
vectors in x across the $n_s$ vector arrays in yy.
That is, $\forall j=0,\ldots,n_s-1,
\forall k=0,\ldots,n_v-1,
(\mathit{zz}_{j,k})_i = a_k (x_k)_i + (\mathit{yy}_{j,k})_i$ .
val linearcombinationvectorarray : Sundials.RealArray.t ->
t array array -> t array -> unitlinearcombinationvectorarray c xx z computes the linear
combinations of $n_s$ vector arrays containing $n_v$
vectors.
That is, $\forall k=0,\ldots,n_v-1,
(z_k)_i = \sum_{j=0}^{n_s-1} c_j (x_{j,k})_i$ .
module Local:sig..end
Compute the task-local portions of certain operations.