module Ops:sig..end
Operations on any type of nvector.
val clone : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.tCreate a new, distinct vector from an existing one.
val linearsum : float ->
('d, 'k) Nvector.t ->
float -> ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> unitlinearsum a x b y z calculates z = a*x + b*y.
val const : float -> ('d, 'k) Nvector.t -> unitconst c z sets all of z to c.
val prod : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> unitprod x y z calculates z = x * y (pointwise).
val div : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> unitdiv x y z calculates z = x / y (pointwise).
val scale : float -> ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> unitscale c x z calculates z = c *. x.
val abs : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> unitabs x z calculates z = abs(x).
val inv : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> unitinv x z calculates z = 1/x (pointwise).
val addconst : ('d, 'k) Nvector.t -> float -> ('d, 'k) Nvector.t -> unitaddconst x b z calculates z = x + b.
val dotprod : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> floatdotprod x y returns the dot product of x and y.
val maxnorm : ('d, 'k) Nvector.t -> floatmaxnorm x returns the maximum absolute value in x.
val wrmsnorm : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> floatwrmsnorm x w returns the weighted root-mean-square norm of x
with weight vector w.
val min : ('d, 'k) Nvector.t -> floatmin x returns the smallest element in x.
val compare : float -> ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> unitcompare c x z calculates
z(i) = if abs x(i) >= c then 1 else 0.
val invtest : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.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 : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> floatwl2norm x w returns the weighted (w) Euclidean l2 norm of x.
val l1norm : ('d, 'k) Nvector.t -> floatl1norm x returns the l1 norm of x.
val wrmsnormmask : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> ('d, 'k) Nvector.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 : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> ('d, 'k) Nvector.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 : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> floatminquotient num denom returns the minimum of num(i) / denom(i).
Zero denom elements are skipped.
val space : ('d, 'k) Nvector.t -> int * intlrw, liw = space c returns the number of realtype words lrw and
integer words liw required to store c.
val getlength : ('d, 'k) Nvector.t -> intReturns the number of "active" entries. This value is cumulative across all processes in a parallel environment.
val print : ?logfile:Sundials.Logfile.t -> ('d, 'k) Nvector.t -> unitPrints to the given logfile (stdout, by default).
val linearcombination : Sundials.RealArray.t ->
('d, 'k) Nvector.t array -> ('d, 'k) Nvector.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 ->
('d, 'k) Nvector.t ->
('d, 'k) Nvector.t array -> ('d, 'k) Nvector.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 : ('d, 'k) Nvector.t ->
('d, 'k) Nvector.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 ->
('d, 'k) Nvector.t array ->
float -> ('d, 'k) Nvector.t array -> ('d, 'k) Nvector.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 ->
('d, 'k) Nvector.t array -> ('d, 'k) Nvector.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 -> ('d, 'k) Nvector.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 : ('d, 'k) Nvector.t array ->
('d, 'k) Nvector.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 : ('d, 'k) Nvector.t array ->
('d, 'k) Nvector.t array ->
('d, 'k) Nvector.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 ->
('d, 'k) Nvector.t array ->
('d, 'k) Nvector.t array array -> ('d, 'k) Nvector.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 ->
('d, 'k) Nvector.t array array -> ('d, 'k) Nvector.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$ .
val has_linearcombination : ('d, 'k) Nvector.t -> boolIndicates whether an nvector supports Nvector.Ops.linearcombination.
val has_scaleaddmulti : ('d, 'k) Nvector.t -> boolIndicates whether an nvector supports Nvector.Ops.scaleaddmulti.
val has_dotprodmulti : ('d, 'k) Nvector.t -> boolIndicates whether an nvector supports Nvector.Ops.dotprodmulti.
val has_linearsumvectorarray : ('d, 'k) Nvector.t -> boolIndicates whether an nvector supports Nvector.Ops.linearsumvectorarray.
val has_scalevectorarray : ('d, 'k) Nvector.t -> boolIndicates whether an nvector supports Nvector.Ops.scalevectorarray.
val has_constvectorarray : ('d, 'k) Nvector.t -> boolIndicates whether an nvector supports Nvector.Ops.constvectorarray.
val has_wrmsnormvectorarray : ('d, 'k) Nvector.t -> boolIndicates whether an nvector supports Nvector.Ops.wrmsnormvectorarray.
val has_wrmsnormmaskvectorarray : ('d, 'k) Nvector.t -> boolIndicates whether an nvector supports Nvector.Ops.wrmsnormmaskvectorarray.
val has_scaleaddmultivectorarray : ('d, 'k) Nvector.t -> boolIndicates whether an nvector supports Nvector.Ops.scaleaddmultivectorarray.
val has_linearcombinationvectorarray : ('d, 'k) Nvector.t -> boolIndicates whether an nvector supports Nvector.Ops.linearcombinationvectorarray.
module Local:sig..end
Compute the task-local portions of certain operations.