-
Notifications
You must be signed in to change notification settings - Fork 1
Matrix/Vector coordinate list conversions #4
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
Conversation
6edf4f8 to
f7d2a29
Compare
QuadTree/Matrix.fs
Outdated
| | Leaf(v1), Leaf(v2), Leaf(v3), Leaf(v4) when v1 = v2 && v2 = v3 && v3 = v4 -> Leaf(v1) | ||
| | _ -> Node(x1, x2, x3, x4) | ||
|
|
||
| type COOEntry<'value> = uint64 * uint64 * 'value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А чего здесь единицы измерения не добавили?
| let nrows = coo.nrows | ||
| let ncols = coo.ncols | ||
|
|
||
| // the resulting matrix is always square |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хорошоая ли это идея? А если матрица достаточно сильно прямоугольная? Скажем, 3х1000 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А. Или тогда будет более сложное дерево в итоге?
QuadTree/Matrix.fs
Outdated
| // the resulting matrix is always square | ||
| let storageSize = getNearestUpperPowerOfTwo (max (uint64 nrows) (uint64 ncols)) | ||
|
|
||
| let predicate (px, py) size (entry: COOEntry<'a>) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что проверяет этот предикат? Может более говорящее название дать?
| let eq = actual = expected | ||
|
|
||
| Assert.True(eq) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут тоже не помешал бы тест на "схлопывание" одинаковых значений. Причём не тольео None или Dummy.
Conversions from coordinate list to btree/qtree, btree/qtree to coordinate list