Giter Site home page Giter Site logo

Comments (4)

matsen avatar matsen commented on September 18, 2024

I think I have this working. Here's an indexer:

12      01000|10101|00100
13      00010|10101|00100
15      10000|01111|00001
21      00100|10001|00001
22      01000|10111|00010
27      10000|01110|00100
31      00100|01010|00010
42      00100|11011|01010
43      00100|11011|00001
54      00001|01110|00100
57      00001|11110|01110
61      10001|01010|00010
63      00010|11101|01000
70      10001|01110|00100
73      01110|10001|00001
74      01010|10001|00001
75      01010|10101|00100
76      10101|01010|00010

Results for (2,(1,3)5,(0,4)6)7;:

[[54, 31, 15], [21, 13, 22], [74, 42, 61], [21, 12, 63], [27, 31, 57], [21, 75, 76], [70, 73, 31], []]

from bito.

matsen avatar matsen commented on September 18, 2024

Here's the rootsplit part of the indexer:

0       01000            
1       00011            
2       00110            
3       00100            
4       01010            
5       00010            
6       00111            
7       01001            
8       01111            
9       00101            
10      00001            
11      01110            

The rootsplit part of the results on the same tree is:

[8, 0, 3, 5, 10, 4, 11]

which also looks correct. These are now formalized in unit tests.

from bito.

matsen avatar matsen commented on September 18, 2024

Here's another test, on (((0,1)5,2)6,3,4)7;

0       01000
1       00011
3       00100
5       00010
6       00111
8       01111
10      00001
16      10000|01111|00111
23      01000|10111|00111
29      00001|11100|00100
30      00011|11100|00100
34      00011|11000|01000
36      01000|00111|00011
39      11000|00011|00001
40      11100|00011|00001
41      00010|11100|00100
44      00100|11011|00011
47      11000|00111|00011
49      10000|00111|00011
50      00100|00011|00001
51      00111|11000|01000
59      00001|11110|00010
65      00010|11101|00001
72      00100|11000|01000
[8, 0, 3, 5, 10, 6, 1],
[[50, 36, 16], [50, 49, 23], [39, 34, 44], [29, 65, 72], [59, 41, 72], [50, 47, 51], [40, 30, 72]]

This exercises the last part of the code with the conditional recursion.

from bito.

matsen avatar matsen commented on September 18, 2024

We could export the vector<size_t>s as buffers. I elected to not do so, but if we wanted to:

  py::class_<std::vector<size_t>>(m, "vector_size_t", py::buffer_protocol())
      .def_buffer([](std::vector<size_t> &v) -> py::buffer_info {
        return py::buffer_info(
            v.data(),                                 // Pointer to buffer
            sizeof(size_t),                           // Size of one scalar
            py::format_descriptor<size_t>::format(),  // See docs
            1,                                        // Number of dimensions
            {v.size()},                               // Buffer dimensions
            {sizeof(size_t)});                        // Stride
      });

...

// Same for vector<size_t>.
PYBIND11_MAKE_OPAQUE(std::vector<size_t>);

@zcrabbit If you want this, let me know.

from bito.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.