What is the best way to create a sparse array in C++?

后端 未结 11 2183
心在旅途
心在旅途 2020-11-29 01:45

I am working on a project that requires the manipulation of enormous matrices, specifically pyramidal summation for a copula calculation.

In short, I need to keep

11条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 01:48

    Small detail in the index comparison. You need to do a lexicographical compare, otherwise:

    a= (1, 2, 1); b= (2, 1, 2);
    (a

    Edit: So the comparison should probably be:

    return lhs.x

提交回复
热议问题