project_into_subspace
project_into_subspace(x, B, M=None)
Projects x into a subspace B via least squares.
Solves the following optimization problem:
argmin_z ||Bz - x||_2^2
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
(n, 1) float numpy array
|
Vector to be projected into the subspace |
required |
B |
(n, m) float numpy array
|
Subspace to project x into |
required |
M |
(m, m) float numpy array
|
Mass matrix defining the metric for projection. If None, set to identity matrix |
None
|
Returns:
Name | Type | Description |
---|---|---|
z |
(m, 1) float numpy array
|
Projection of x into the subspace B |
Source code in src\fast_cody\project_into_subspace.py
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 32 33 34 |
|