Ask Your Question

Wolfgang's profile - activity

2017-01-17 11:23:21 +0100 received badge  Student (source)
2017-01-17 10:08:44 +0100 asked a question 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.

2017-01-17 10:08:44 +0100 asked a question How to assign a vector

If I do the following:

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

then b[0] changes too. But I want b[0] = r1. How should I assign b. I do not want to do something like:

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

because of possible high dimension of vectors.