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
A N-dimensional, agnostic API of the hash grid data structures for physics, ML and game development.
License: MIT License
Half time software developer, half time Chemical Engineer and full time looking for software solutions to the industry.
I work on:
If I run println!("{}", grid[cell_index].neighbors.len());
for a grid generated with PeriodicImage::NONE
for all dimensions, it is returning 0 neighbors.
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.
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:
Cardinality
All these points are features of the current crate and shoudl be depicted in the front page of the repo and the (future) documentation.
Before implementing:
dyn
. Solving #12 could help to determine this overheadThe 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.
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:
simd
crate for the common operations (sum, extract, multiply and divide)Implement the Index
and IndexMut
traits for the HashCell
struct. The index should return the elements registered in the given cell.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.