Mod_squared_cpp: Absolute Value or Modulus of a Complex Number Squared.

View source: R/RcppExports.R

Mod_squared_cppR Documentation

Absolute Value or Modulus of a Complex Number Squared.

Description

Computes the squared value of the Modulus.

Usage

Mod_squared_cpp(x)

Arguments

x

A cx_vec.

Details

Consider a complex number defined as: z = x + i y with real x and y, The modulus is defined as: r = Mod\left(z\right) = \sqrt{\left(x^2 + y^2\right)} This function will return: r^2 = Mod\left(z\right)^2 = x^2 + y^2

Value

A vec containing the modulus squared for each element.

Examples

Mod_squared_cpp(c(1+.5i, 2+1i, 5+9i))

SMAC-Group/gmwm documentation built on June 10, 2025, 6:10 a.m.