Skip to content

Assertion failure when using the --format binary option #51

@Ultrasanic

Description

@Ultrasanic

Steps to reproduce

  1. Generating a lower distance matrix in binary format
    Create a file gen.py with the following content, then run it in a virtual environment where NumPy is installed:

    import numpy as np
    
    arr = np.array([1, 1, 1], dtype=np.float32)
    arr.tofile('data.bin')
    python3 gen.py
  2. Compiling Ripser
    Compile Ripser with the following flags:

    c++ ripser.cpp -o ripser -std=c++11
  3. Run the program

    ./ripser --format binary data.bin
  4. Observe that the program crashes with the following assertion failure:

    ripser: ripser.cpp:223: compressed_distance_matrix<Layout>::compressed_distance_matrix(std::vector<float>&&) [with compressed_matrix_layout Layout = LOWER_TRIANGULAR]: Assertion `distances.size() == size() * (size() - 1) / 2' failed.
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions