Skip to contents

Computes the determinant of a square matrix via nv_determinant().

Usage

nv_det(x)

Arguments

x

(arrayish)
One input, a square matrix with exactly 2 axes. Can be any numeric data type: a float keeps its own, and an integer one is converted to the default float data type (see default_dtypes()). An R value materializes at its default data type and is converted in the same way.

Value

(arrayish)
A scalar with the input's data type – or the default float data type (see default_dtypes()) where the input was an integer one.

Examples

# a scalar with the matrix's data type
a <- nv_matrix(c(4, 3, 6, 3), nrow = 2, dtype = "f64")
nv_det(a)
#> AnvlArray
#>  -6
#> [ CPUf64{} ]