Skip to content

Commit

Permalink
28566: use ring-preserving constructor for Macaulay2 matrix/vector
Browse files Browse the repository at this point in the history
  • Loading branch information
mwageringel committed Oct 7, 2019
1 parent ce24186 commit 21025bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sage/matrix/matrix1.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ cdef class Matrix(Matrix0):
from sage.interfaces.macaulay2 import macaulay2 as m2_default
macaulay2 = m2_default
entries = [list(row) for row in self]
return macaulay2(entries).matrix().promote(self.base_ring())
return macaulay2(self.base_ring()).matrix(entries)


def _scilab_init_(self):
Expand Down
3 changes: 2 additions & 1 deletion src/sage/modules/free_module_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3517,7 +3517,8 @@ cdef class FreeModuleElement(Vector): # abstract base class
if macaulay2 is None:
from sage.interfaces.macaulay2 import macaulay2 as m2_default
macaulay2 = m2_default
return macaulay2(self.list()).vector().promote(self.base_ring())
return (macaulay2(self.base_ring()).matrix([self.list()]).transpose()
.vector())

def _mathematica_init_(self):
"""
Expand Down

0 comments on commit 21025bd

Please sign in to comment.