Module Nvector.Ops.Local

module Local: sig .. end

Compute the task-local portions of certain operations.


val dotprod : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> float

dotprod x y returns the dot product of x and y.

val maxnorm : ('d, 'k) Nvector.t -> float

maxnorm x returns the maximum absolute value in x.

val min : ('d, 'k) Nvector.t -> float

min x returns the smallest element in x.

val l1norm : ('d, 'k) Nvector.t -> float

l1norm x returns the l1 norm of x.

val invtest : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> bool

invtest 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 constrmask : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> bool

constrmask 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 -> float

minquotient num denom returns the minimum of num(i) / denom(i). Zero denom elements are skipped.

val wsqrsum : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> float

wsqrsum x w calculates the weighted squared sum of x with weight vector w. That is, $s = \sum_{i=0}^{n_\mathit{local} - 1}(x_i w_i)^2$ .

val wsqrsummask : ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> float

wsqrsummask x w id calculates the weighted squared sum of x with weight vector w for the elements where id is positive. That is, $m = \sum_{i=0}^{n_\mathit{local} - 1}(x_i w_i H(\math{id}_i))^2$ where $H(\alpha) = \begin{cases} 1 & \alpha > 0 \ 0 & \alpha \le 0 \end{cases} $ .

val dotprodmulti : ('d, 'k) Nvector.t ->
('d, 'k) Nvector.t array -> Sundials.RealArray.t -> unit

dotprodmulti x yy d calculates the task-local portion of the dot product of a vector x with vectors yy. I.e., $d_j = \sum_{i=0}^{n_{\mathit{local}} - 1} x_i y_{j,i}$ .

val dotprodmulti_allreduce : ('d, 'k) Nvector.t -> Sundials.RealArray.t -> unit

dotprodmulti_allreduce x d combines the task-local portions of the dot product of a vector x with an array of vectors.

Availability of nvector local operations

val has_dotprod : ('d, 'k) Nvector.t -> bool

Indicates whether an nvector supports a local Nvector.Ops.Local.dotprod.

val has_maxnorm : ('d, 'k) Nvector.t -> bool

Indicates whether an nvector supports a local Nvector.Ops.Local.maxnorm.

val has_min : ('d, 'k) Nvector.t -> bool

Indicates whether an nvector supports a local Nvector.Ops.Local.min.

val has_l1norm : ('d, 'k) Nvector.t -> bool

Indicates whether an nvector supports a local Nvector.Ops.Local.l1norm.

val has_invtest : ('d, 'k) Nvector.t -> bool

Indicates whether an nvector supports a local Nvector.Ops.Local.invtest.

val has_constrmask : ('d, 'k) Nvector.t -> bool

Indicates whether an nvector supports a local Nvector.Ops.Local.constrmask.

val has_minquotient : ('d, 'k) Nvector.t -> bool

Indicates whether an nvector supports a local Nvector.Ops.Local.minquotient.

val has_wsqrsum : ('d, 'k) Nvector.t -> bool

Indicates whether an nvector supports a local Nvector.Ops.Local.wsqrsum.

val has_wsqrsummask : ('d, 'k) Nvector.t -> bool

Indicates whether an nvector supports a local Nvector.Ops.Local.wsqrsummask.

val has_dotprodmulti : ('d, 'k) Nvector.t -> bool

Indicates whether an nvector supports a local Nvector.Ops.Local.dotprodmulti.

val has_dotprodmulti_allreduce : ('d, 'k) Nvector.t -> bool

Indicates whether an nvector supports a local Nvector.Ops.Local.dotprodmulti_allreduce.