Skip to content

Conversation

@Danil-Zaripov
Copy link
Contributor

@Danil-Zaripov Danil-Zaripov commented Feb 3, 2026

Conversions from coordinate list to btree/qtree, btree/qtree to coordinate list

@Danil-Zaripov Danil-Zaripov requested a review from gsvgit February 3, 2026 14:07
@Danil-Zaripov Danil-Zaripov changed the title Vector coordinate list conversions Matrix/Vector coordinate list conversions Feb 3, 2026
| 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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хорошоая ли это идея? А если матрица достаточно сильно прямоугольная? Скажем, 3х1000 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А. Или тогда будет более сложное дерево в итоге?

// the resulting matrix is always square
let storageSize = getNearestUpperPowerOfTwo (max (uint64 nrows) (uint64 ncols))

let predicate (px, py) size (entry: COOEntry<'a>) =
Copy link
Member

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)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут тоже не помешал бы тест на "схлопывание" одинаковых значений. Причём не тольео None или Dummy.

@Danil-Zaripov Danil-Zaripov requested a review from gsvgit February 4, 2026 08:20
@gsvgit gsvgit merged commit 07292ce into Lamagraph:main Feb 4, 2026
2 checks passed
@Danil-Zaripov Danil-Zaripov deleted the coordinate branch February 4, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants