Ask Your Question

Revision history [back]

How to assign a vector

I have the following code:

a=b=vector(ring, 2)
a = ([r1,r2])
b =a 
a[0] = s1

Then b[0] changes too but I want b[0] be r1. And I do not want to do something like this:

b = ([a[0],a[1]])

which works but inconvenient because of possible high dimensions of vectors.

click to hide/show revision 2
retagged

How to assign a vector

I have the following code:

a=b=vector(ring, 2)
a = ([r1,r2])
b =a 
a[0] = s1

Then b[0] changes too but I want b[0] be r1. And I do not want to do something like this:

b = ([a[0],a[1]])

which works but inconvenient because of possible high dimensions of vectors.