Opened 10 years ago

Last modified 10 years ago

#625 new proposed feature

allow 'vector(matrix)'

Reported by: ren Owned by: somebody
Priority: trivial Milestone: 4-1-0 and higher
Component: dontKnow Version: 4-0-0
Keywords: Cc:

Description

Since Singular can cast a vector into a matrix consisting of a single column, it would in my opinion be intuitive if it could do the reverse.

ren@mandelbrot:~$ Singular
                     SINGULAR                                 /  Development
 A Computer Algebra System for Polynomial Computations       /   version 4.0.0
                                                           0<
 by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann     \   Dec 2013
FB Mathematik der Universitaet, D-67653 Kaiserslautern        \
> ring r;
> vector v=[x,y,z];
> print(matrix(v));
x,
y,
z 
> matrix w[3][1]=x,y,z;
> print(w);
x,
y,
z 
> vector(w);
   ? vector(`matrix`) failed
   ? expected vector(`vector`)
   ? error occurred in or before STDIN line 7: `vector(w);`
> module M;
> M[1]=v;
> M[2]=w;
   ? `vector` = `matrix` is not supported
   ? expected `vector` = `vector`
   ? error occurred in or before STDIN line 10: `M[2]=w;`

Change History (1)

comment:1 Changed 10 years ago by anne

Hi Ren,

this functionality is available in an intuitive way: the columns of a matrix are vectors and can be accessed in this way, e.g.

> matrix M[2][3]=x,y,z,y,z,x;
> print(M);
x,y,z,
y,z,x 
> vector v=M[1];
> v;
x*gen(1)+y*gen(2)
> vector v=transpose(M)[2];
// ** redefining v **
> v;
x*gen(3)+y*gen(1)+z*gen(2)

I hope this helps.

Best, Anne

Note: See TracTickets for help on using tickets.