MPS-Basic
Loading...
Searching...
No Matches
particles.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "particle.hpp"
4
5#include <vector>
6
10class Particles {
11public:
12 // functions to make Particles iterable
13 std::vector<Particle>::iterator begin();
14 std::vector<Particle>::const_iterator begin() const;
15 std::vector<Particle>::iterator end();
16 std::vector<Particle>::const_iterator end() const;
17
23 int size() const;
24
30 void add(const Particle& particle);
31
38 Particle& operator[](size_t index);
39
46 const Particle& operator[](size_t index) const;
47
48private:
49 std::vector<Particle> particles;
50};
Class for particle in MPS method.
Definition particle.hpp:47
A collection of particles.
Definition particles.hpp:10
std::vector< Particle >::iterator end()
Definition particles.cpp:13
Particle & operator[](size_t index)
Get a particle by index.
Definition particles.cpp:32
std::vector< Particle > particles
Definition particles.hpp:49
int size() const
Get the number of particles.
Definition particles.cpp:21
std::vector< Particle >::iterator begin()
Definition particles.cpp:5
void add(const Particle &particle)
Add a particle to the collection.
Definition particles.cpp:25