det {GPUmatrix}R Documentation

Calculate the Determinant of a 'GPUMatrix'

Description

These functions mimic the 'base' functions det and determinant to operate on gpu.matrix-class objects: "det calculates the determinant of a matrix. determinant is a generic function that returns separately the modulus of the determinant, optionally on the logarithm scale, and the sign of the determinant."

Usage


## S4 method for signature 'gpu.matrix.tensorflow,logical'
determinant(x,logarithm,...)
## S4 method for signature 'gpu.matrix.tensorflow,missing'
determinant(x,logarithm,...)
## S4 method for signature 'gpu.matrix.torch,logical'
determinant(x,logarithm,...)
## S4 method for signature 'gpu.matrix.torch,missing'
determinant(x,logarithm,...)

## S4 method for signature 'gpu.matrix.tensorflow'
det(x,...)
## S4 method for signature 'gpu.matrix.torch'
det(x,...)

Arguments

x

a gpu.matrix object.

...

Optional parameters. For more details seee det

logarithm

logical; if TRUE (default) return the logarithm of the modulus of the determinant.

Details

The function det and determinant internally call the corresponding function of the library torch or tensorflow (depending on the type of input gpu.matrix-class).

If the input gpu.matrix-class object(s) are stored on the GPU, then the operations will be performed on the GPU. See gpu.matrix.

Value

det returns the same output corresponding to the base function det, which is the determinant of x. The returned value is a object of class numeric sotred in the cpu.

determinant returns the corresponding output of the base function determinant, which is an object of class det, that contains the following components:

modulus

a numeric value. The modulus (absolute value) of the determinant if logarithm is FALSE; otherwise the logarithm of the modulus.

sign

integer; either +1 or -1 according to whether the determinant is positive or negative.

See Also

For more information see: det.

Examples


## Not run: 

x <- gpu.matrix(1:4,nrow=2, ncol = 2)
determinant(x) #modulus of the determinant.
det(x)#the determinant.


## End(Not run)


[Package GPUmatrix version 1.0.2 Index]