tr: trace of a matrix

Description Usage Arguments Details Value Note Author(s)

View source: R/math__tr.R

Description

Give the trace of a squire matrix.

Usage

1
tr(X)

Arguments

X

squire matrix.

Details

It is essentially "sum(diag(X))" but faster.

Value

scalor

Note

First version: Wed Dec 29 16:25:04 CET 2010; Current: Wed Dec 29 16:25:10 CET 2010.

Author(s)

Feng Li, Department of Statistics, Stockholm University, Sweden.


feng-li/flutils documentation built on Oct. 1, 2020, 9:09 p.m.