-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathAdditiveCompoundMatrix.m
More file actions
31 lines (28 loc) · 973 Bytes
/
AdditiveCompoundMatrix.m
File metadata and controls
31 lines (28 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
%% ADDITIVECOMPOUNDMATRIX Computes the r-th additive compound matrix of a given square matrix
% This function has two required arguments:
% A: an arbitrary matrix
% r: a nonnegative integer
%
% comp = AdditiveCompoundMatrix(A, r) returns the r-th additive compound matrix of the square matrix A
%
% If r > n (the number of rows in A), then the r-th additive compound matrix of A is the 0x0 matrix.
% Otherwise, the size of the result is (n choose r) x (n choose r).
%
% URL: https://qetlab.com/AdditiveCompoundMatrix
%
% author: Nathaniel Johnston
% package: QETLAB
% last updated: January 8, 2026
function comp = AdditiveCompoundMatrix(A, r)
m = size(A, 1);
n = size(A, 2);
if(m ~= n)
error('AdditiveCompoundMatrix:InvalidDimensions', 'The matrix must be square.');
end
if r > n
comp = [];
return
end
P = AntisymmetricProjection(m,r,1);
comp = P'*KroneckerSum(A,r)*P;
end