mat_power function

Compute the j:th power of a square matrix A

Compute the j:th power of a square matrix A

mat_power computes the j:th power of a square matrix A using exponentiation by squaring.

mat_power(A, j)

Arguments

  • A: A square numeric matrix.
  • j: A natural number representing the power to which the matrix will be raised.

Returns

A matrix which is A raised to the power j.

  • Maintainer: Savi Virolainen
  • License: GPL-3
  • Last published: 2025-02-27