cr.sparse.la.subspaces.is_in_subspace¶
- cr.sparse.la.subspaces.is_in_subspace(U, v)[source]¶
Checks whether a vector v is in the subspace spanned by an ONB U or not
- Parameters
U (jax.numpy.ndarray) – ONB for the subspace
v (jax.numpy.ndarray) – A vector in the ambient space
- Returns
True if v lies in the subspace spanned by U, False otherwise
- Return type
(bool)
Example
>>> A = jnp.eye(6)[:, :3] >>> v = jnp.arange(6) + 0. >>> print(is_in_subspace(A, v)) False >>> u = project_to_subspace(A, v) >>> print(is_in_subspace(A, u)) True