Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do we need to deal w/ 0-based and 1-based matrices? #4

Closed
billyc opened this issue Jul 31, 2013 · 3 comments
Closed

Do we need to deal w/ 0-based and 1-based matrices? #4

billyc opened this issue Jul 31, 2013 · 3 comments
Labels

Comments

@billyc
Copy link
Member

billyc commented Jul 31, 2013

Cube, Transcad, and Emme all use zone numbers that are 1-based, which is a huge pain in the ass.

How do we want to deal with this? A flag? Ignore it and leave it to the user?

@pschmied
Copy link

Just as a thought exercise, imagine a zone system where zones all have
names: ["curly", "moe", "larry"]. The index itself would be a simple
relation:
[("curly", 0),
("moe", 1),
("larry", 2)]

In our 3x3 example, mat["curly"]["larry"] would return the value at
position (0,2). This seems good.

Now, this is where things start to break down. Imagine an index where the
"name" is a integer:
[(1,0),
(2,1),
(3,2)]

mat[0,0] == out of bounds. Ouch.
mat[3,1] == position (2,0). Double ouch.

So, on the one hand, not being prescriptive about zone names seems good. On
the other hand, the temptation for users to name their zones in a patently
confusing off-by-one sort of way seems... bad.

Other thoughts?

On Wed, Jul 31, 2013 at 12:04 PM, Billy Charlton
notifications@github.comwrote:

Cube, Transcad, and Emme all use zone numbers that are 1-based, which is a
huge pain in the ass.

How do we want to deal with this? A flag? Ignore it and leave it to the
user?


Reply to this email directly or view it on GitHubhttps://github.com//issues/4
.

@pschmied
Copy link

Oops, that last example is wrong. Should have written mat[0][0]. Y'all knew
what I meant :-)

On Wed, Jul 31, 2013 at 12:22 PM, Peter Schmiedeskamp <peter@thoughtspot.net

wrote:

Just as a thought exercise, imagine a zone system where zones all have
names: ["curly", "moe", "larry"]. The index itself would be a simple
relation:
[("curly", 0),
("moe", 1),
("larry", 2)]

In our 3x3 example, mat["curly"]["larry"] would return the value at
position (0,2). This seems good.

Now, this is where things start to break down. Imagine an index where the
"name" is a integer:
[(1,0),
(2,1),
(3,2)]

mat[0,0] == out of bounds. Ouch.
mat[3,1] == position (2,0). Double ouch.

So, on the one hand, not being prescriptive about zone names seems good.
On the other hand, the temptation for users to name their zones in a
patently confusing off-by-one sort of way seems... bad.

Other thoughts?

On Wed, Jul 31, 2013 at 12:04 PM, Billy Charlton <notifications@github.com

wrote:

Cube, Transcad, and Emme all use zone numbers that are 1-based, which is
a huge pain in the ass.

How do we want to deal with this? A flag? Ignore it and leave it to the
user?


Reply to this email directly or view it on GitHubhttps://github.com//issues/4
.

@billyc
Copy link
Member Author

billyc commented Aug 7, 2013

The new Mapping API handles the case where you have an equivalency list which maps row/column offsets to an index value (e.g. zone number).

I've also hacked ViTables to show the mapping as the row/column header, if one and only one mapping exists.

So maybe this covers the most basic cases.

@billyc billyc closed this as completed Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants