Learn R Programming

rkeops (version 2.2.2)

real2complex: Element-wise "real to complex" operation.

Description

Symbolic element-wise "real to complex" operation.

Usage

real2complex(x)

# S3 method for LazyTensor real2complex(x)

# S3 method for ComplexLazyTensor real2complex(x)

Value

An object of class ComplexLazyTensor.

Arguments

x

a LazyTensor.

Author

Chloe Serre-Combe, Amelie Vernay

Details

real2complex(x) returns a ComplexLazyTensor that encodes, symbolically, the element-wise "real to complex" transformation of x (i.e. with additional zero imaginary part: x + 0*i).

Note: real2complex(x) will exit with an error if x is a ComplexLazyTensor.

Examples

Run this code
if (FALSE) {
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, "i")           # creating LazyTensor from matrix x, 
                                    # indexed by 'i'
z <- real2complex(x_i)              # ComplexLazyTensor object
}

Run the code above in your browser using DataLab