OK, this is my very first vex code, so sorry for the superbasic question but here it goes:
I want to get a string attribute with the neighbours of each point. So, for point 0 it may be:
“0 1 2 5”
for point 2 it may be:
“1 0 54 4”
etc, etc.
The below code doesn't work. I think it tries to write an array and it doesn't convert it into a string. Now, I saw there is atoi to convert a string to an int , but nothing to convert an int or array to a string?
sop
my_sop()
{
int n;
string s = “”;
n = getneighbours( ptnum, 0 );
addattribute(“Neighbors”, n, “type”, “string”);
}
Supersimple Vex question
3200 5 1- Soothsayer
- Member
- 861 posts
- Joined: Oct. 2008
- Offline
- Simon
- Member
- 2199 posts
- Joined: July 2005
- Online
- Soothsayer
- Member
- 861 posts
- Joined: Oct. 2008
- Offline
- Simon
- Member
- 2199 posts
- Joined: July 2005
- Online
- Soothsayer
- Member
- 861 posts
- Joined: Oct. 2008
- Offline
- Soothsayer
- Member
- 861 posts
- Joined: Oct. 2008
- Offline
I have another, related question. I don't see an obvious way of doing this, and it may not be possible, but can we create an n*n matrix in vex, perhaps in such a way that it can be picked up by Python later on down the node chain?
I'm thinking of creating an adjacency matrix from my neighbour data.
I'm thinking of creating an adjacency matrix from my neighbour data.
--
Jobless
Jobless
-
- Quick Links