tr: Matrix trace methods.

Description Usage Arguments Value Methods (by class) Author(s)

View source: R/tr.R

Description

Methods to efficiently calculate a matrix trace depending on the class of matrix.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
tr(X, ...)

## Default S3 method:
tr(X, ...)

## S3 method for class 'dgCMatrix'
tr(X, ...)

## S3 method for class 'dsCMatrix'
tr(X, ...)

Arguments

X

A matrix.

...

Additional arguments.

Value

A numeric value for the sum of the diagonal elements.

Methods (by class)

Author(s)

matthewwolak@gmail.com


gremlin documentation built on July 1, 2020, 10:22 p.m.