Skip to contents

Symbolic element-wise square root operation for LazyTensor objects or standard element-wise square root operation otherwise, i.e. \(\sqrt{x}\).

Usage

sqrt(x)

Arguments

x

input for sqrt.default() or sqrt.LazyTensor().

Value

See value of sqrt.default() or sqrt.LazyTensor().

Details

If x is a LazyTensor, see sqrt.LazyTensor(), else see sqrt.default().

Note: for complex input argument z, then the absolute value corresponds to the complex modulus sqrt(z) = z^0.5.

Author

Chloe Serre-Combe, Amelie Vernay

Examples

if (FALSE) {
# R base operation
sqrt(4)
sqrt(c(1,4,9,16))
# LazyTensor symbolic element-wise square root
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i')   # creating LazyTensor from matrix x, 
                                    # indexed by 'i'
Sqrt_x <- sqrt(x_i)                 # symbolic matrix, 150 rows and 3 columns
}