Giter Club home page Giter Club logo

hashgrid's Introduction

Half time software developer, half time Chemical Engineer and full time looking for software solutions to the industry.

I work on:

  • Python (particularly deep learning models with Pytorch)
  • Rust
  • SQL
  • Bash

hashgrid's People

Contributors

lfsalasg avatar

Stargazers

 avatar

Watchers

 avatar

hashgrid's Issues

Drop is unstable in iterators

A confusing facto of the drop_dweller method of the HashCell struct is that I cannot use it if I'm iterating over it. Neither can I iterate using the indexes because indexes will update every time I remove something from the collection. An alternative is to use something like the retain method of the Vec collection but it does not return the removed elements.

As an alternative, I can have a method called purge where I keep the elements from the vector and return a copy of the elements that do not belong. It could look something like:

fn purge(&mut self, cell) {
let elements_to_remove = self.get_dwellers(cell).iter().filter(|x| self.bounding_cell_coord(x.coord()) == cell)
self[cell].dwellers.retain(x| self.bounding_cell_coord(x.coord()) == cell)

elements_to_remove
}

However, I am not sure about the memory and cpu performance of this method, since it has to visit every element of the cell. Another option could be to store the indexes of the elements I want to remove, reorganize that list and then remove using swap_remove. It will take exactly time n where n is the number of elements to remove. If the list is pretty ordered, then it won't be a hurdle, anyway I have to compare both methodologies.

Expand the usage example in the README to include reading the grid and multithreading

The current example is a basic idea on how to create a 3D-Grid that contains Point3D elements, but it misses a lot of basic ideas of this crate such as:

  • Implementation of the common trait: Cardinality
  • Reading and walking through the grid
  • Spatial concepts such as neighbors and bounding cell.
  • The usage of IsoHashGrid for multithreading

All these points are features of the current crate and shoudl be depicted in the front page of the repo and the (future) documentation.

Macro to derive cardinality

The Cardinality trait is required to register an object to HashGrid and many objects could have a similar abstraction of its cardinality: A variable with a tuple, slice or vector representing the positions in the N-Dimensional space. In these trivial cases, it should be straightforward to derive this trait.

Implement SIMD for the Point<N> basic operations

the Point<N> struct is a the representation of a vector in the N-dimensional space and implement common lineal algebra operations like sum or multiplication. Currently it implements a naive approach. However many architectures can implement the SIMD processing and that could benefit systems of high dimensionality. So the task is:

  • To implement the simd crate for the common operations (sum, extract, multiply and divide)
  • To define a conditional compile option to either use SIMD or the naive approach.

Index trait for HashCell

Implement the Index and IndexMut traits for the HashCell struct. The index should return the elements registered in the given cell.

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.