.. default-domain:: chpl .. module:: Operators Operators ========= **Usage** .. code-block:: chapel use Vector.Operators; or .. code-block:: chapel import Vector.Operators; .. function:: operator +(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR + VECTOR`` See :proc:`Intrin.add` for the intrinsic used. .. function:: operator +=(ref x: vector(?eltType, ?numElts), y: x.type) Implements ``VECTOR += VECTOR`` See :proc:`Intrin.add` for the intrinsic used. .. function:: operator +(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR + SCALAR`` See :proc:`Intrin.add` for the intrinsic used. .. function:: operator +=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) Implements ``VECTOR += SCALAR`` See :proc:`Intrin.add` for the intrinsic used. .. function:: operator +(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR + VECTOR`` See :proc:`Intrin.add` for the intrinsic used. .. function:: operator -(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR - VECTOR`` See :proc:`Intrin.sub` for the intrinsic used. .. function:: operator -=(ref x: vector(?eltType, ?numElts), y: x.type) Implements ``VECTOR -= VECTOR`` See :proc:`Intrin.sub` for the intrinsic used. .. function:: operator -(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR - SCALAR`` See :proc:`Intrin.sub` for the intrinsic used. .. function:: operator -=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) Implements ``VECTOR -= SCALAR`` See :proc:`Intrin.sub` for the intrinsic used. .. function:: operator -(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR - VECTOR`` See :proc:`Intrin.sub` for the intrinsic used. .. function:: operator *(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR * VECTOR`` See :proc:`Intrin.mul` for the intrinsic used. .. function:: operator *=(ref x: vector(?eltType, ?numElts), y: x.type) Implements ``VECTOR *= VECTOR`` See :proc:`Intrin.mul` for the intrinsic used. .. function:: operator *(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR * SCALAR`` See :proc:`Intrin.mul` for the intrinsic used. .. function:: operator *=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) Implements ``VECTOR *= SCALAR`` See :proc:`Intrin.mul` for the intrinsic used. .. function:: operator *(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR * VECTOR`` See :proc:`Intrin.mul` for the intrinsic used. .. function:: operator /(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR / VECTOR`` See :proc:`Intrin.div` for the intrinsic used. .. function:: operator /=(ref x: vector(?eltType, ?numElts), y: x.type) Implements ``VECTOR /= VECTOR`` See :proc:`Intrin.div` for the intrinsic used. .. function:: operator /(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR / SCALAR`` See :proc:`Intrin.div` for the intrinsic used. .. function:: operator /=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) Implements ``VECTOR /= SCALAR`` See :proc:`Intrin.div` for the intrinsic used. .. function:: operator /(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR / VECTOR`` See :proc:`Intrin.div` for the intrinsic used. .. function:: operator -(x: vector(?eltType, ?numElts)): x.type Implements ``VECTOR -`` See :proc:`Intrin.neg` for the intrinsic used. .. function:: operator &(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR & VECTOR`` See :proc:`Intrin.and` for the intrinsic used. .. function:: operator &=(ref x: vector(?eltType, ?numElts), y: x.type) Implements ``VECTOR &= VECTOR`` See :proc:`Intrin.and` for the intrinsic used. .. function:: operator &(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR & SCALAR`` See :proc:`Intrin.and` for the intrinsic used. .. function:: operator &=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) Implements ``VECTOR &= SCALAR`` See :proc:`Intrin.and` for the intrinsic used. .. function:: operator &(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR & VECTOR`` See :proc:`Intrin.and` for the intrinsic used. .. function:: operator |(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR | VECTOR`` See :proc:`Intrin.or` for the intrinsic used. .. function:: operator |=(ref x: vector(?eltType, ?numElts), y: x.type) Implements ``VECTOR |= VECTOR`` See :proc:`Intrin.or` for the intrinsic used. .. function:: operator |(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR | SCALAR`` See :proc:`Intrin.or` for the intrinsic used. .. function:: operator |=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) Implements ``VECTOR |= SCALAR`` See :proc:`Intrin.or` for the intrinsic used. .. function:: operator |(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR | VECTOR`` See :proc:`Intrin.or` for the intrinsic used. .. function:: operator ^(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR ^ VECTOR`` See :proc:`Intrin.xor` for the intrinsic used. .. function:: operator ^=(ref x: vector(?eltType, ?numElts), y: x.type) Implements ``VECTOR ^= VECTOR`` See :proc:`Intrin.xor` for the intrinsic used. .. function:: operator ^(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR ^ SCALAR`` See :proc:`Intrin.xor` for the intrinsic used. .. function:: operator ^=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) Implements ``VECTOR ^= SCALAR`` See :proc:`Intrin.xor` for the intrinsic used. .. function:: operator ^(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR ^ VECTOR`` See :proc:`Intrin.xor` for the intrinsic used. .. function:: operator ~(x: vector(?eltType, ?numElts)): x.type Implements ``VECTOR ~`` See :proc:`Intrin.not` for the intrinsic used. .. function:: operator >>(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR >> VECTOR`` See :proc:`Intrin.shiftRight` for the intrinsic used. .. function:: operator >>=(ref x: vector(?eltType, ?numElts), y: x.type) Implements ``VECTOR >>= VECTOR`` See :proc:`Intrin.shiftRight` for the intrinsic used. .. function:: operator >>(x: vector(?eltType, ?numElts), param imm: int): x.type Implements ``VECTOR >> IMMEDIATE`` See :proc:`Intrin.shiftRight` for the intrinsic used. .. function:: operator >>=(ref x: vector(?eltType, ?numElts), param imm: int) Implements ``VECTOR >>= IMMEDIATE`` See :proc:`Intrin.shiftRight` for the intrinsic used. .. function:: operator <<(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR << VECTOR`` See :proc:`Intrin.shiftLeft` for the intrinsic used. .. function:: operator <<=(ref x: vector(?eltType, ?numElts), y: x.type) Implements ``VECTOR <<= VECTOR`` See :proc:`Intrin.shiftLeft` for the intrinsic used. .. function:: operator <<(x: vector(?eltType, ?numElts), param imm: int): x.type Implements ``VECTOR << IMMEDIATE`` See :proc:`Intrin.shiftLeft` for the intrinsic used. .. function:: operator <<=(ref x: vector(?eltType, ?numElts), param imm: int) Implements ``VECTOR <<= IMMEDIATE`` See :proc:`Intrin.shiftLeft` for the intrinsic used. .. function:: operator ==(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR == VECTOR`` See :proc:`Intrin.cmpEq` for the intrinsic used. .. function:: operator ==(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR == SCALAR`` See :proc:`Intrin.cmpEq` for the intrinsic used. .. function:: operator ==(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR == VECTOR`` See :proc:`Intrin.cmpEq` for the intrinsic used. .. function:: operator !=(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR != VECTOR`` See :proc:`Intrin.cmpNe` for the intrinsic used. .. function:: operator !=(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR != SCALAR`` See :proc:`Intrin.cmpNe` for the intrinsic used. .. function:: operator !=(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR != VECTOR`` See :proc:`Intrin.cmpNe` for the intrinsic used. .. function:: operator <(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR < VECTOR`` See :proc:`Intrin.cmpLt` for the intrinsic used. .. function:: operator <(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR < SCALAR`` See :proc:`Intrin.cmpLt` for the intrinsic used. .. function:: operator <(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR < VECTOR`` See :proc:`Intrin.cmpLt` for the intrinsic used. .. function:: operator <=(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR <= VECTOR`` See :proc:`Intrin.cmpLe` for the intrinsic used. .. function:: operator <=(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR <= SCALAR`` See :proc:`Intrin.cmpLe` for the intrinsic used. .. function:: operator <=(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR <= VECTOR`` See :proc:`Intrin.cmpLe` for the intrinsic used. .. function:: operator >(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR > VECTOR`` See :proc:`Intrin.cmpGt` for the intrinsic used. .. function:: operator >(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR > SCALAR`` See :proc:`Intrin.cmpGt` for the intrinsic used. .. function:: operator >(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR > VECTOR`` See :proc:`Intrin.cmpGt` for the intrinsic used. .. function:: operator >=(x: vector(?eltType, ?numElts), y: x.type): x.type Implements ``VECTOR >= VECTOR`` See :proc:`Intrin.cmpGe` for the intrinsic used. .. function:: operator >=(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) Implements ``VECTOR >= SCALAR`` See :proc:`Intrin.cmpGe` for the intrinsic used. .. function:: operator >=(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) Implements ``SCALAR >= VECTOR`` See :proc:`Intrin.cmpGe` for the intrinsic used.