compose_trans: Compose a Series of Matrix Transformations

Description Usage Arguments Value Examples

View source: R/compose_transform.R

Description

This function multiplies out a list of matrices and/or vectors, yielding the composition of the transformations.

Usage

1

Arguments

mats

A list of matrices and/or vectors that can be multiplied in the conventional order, i.e., A(B(C)). Each matrix must have as many columns as the matrix to its right has rows, per the conventional definition of matrix multiplication. Vectors may also be included in the sequence, assuming they obey the above constraint.

Value

The composition of the transformations (i.e., the product of multiplying the matrices in order)

Examples

1
2
3
4
5
6
7
a <- matrix(c(1, 2, 3, 4, 5, 6), nrow = 3)
b <- matrix(c(1, 2, 3, 4, 5, 6), nrow = 2)
compose_trans(list(b,a))

#Matrix and inverse gives the identity
c <- matrix(c(5, 9, 7, 2), nrow = 2)
compose_trans(list(c, solve(c)))

ryan-heslin/matador documentation built on Dec. 22, 2021, 8:17 p.m.