]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/eja/eja_utils.py
Revert "eja: drop custom gram_schmidt() routine that isn't noticeably faster."
[sage.d.git] / mjo / eja / eja_utils.py
index cf75e325697dcefb3bf682b855f8d83e3e4f89e2..49e3078709ef72084de02050ec57f7f1d84a823e 100644 (file)
@@ -1,3 +1,5 @@
+from sage.functions.other import sqrt
+from sage.matrix.constructor import matrix
 from sage.modules.free_module_element import vector
 from sage.rings.number_field.number_field import NumberField
 from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
@@ -6,6 +8,9 @@ from sage.rings.real_lazy import RLF
 def _mat2vec(m):
         return vector(m.base_ring(), m.list())
 
+def _vec2mat(v):
+        return matrix(v.base_ring(), sqrt(v.degree()), v.list())
+
 def gram_schmidt(v):
     """
     Perform Gram-Schmidt on the list ``v`` which are assumed to be