-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLifeGrid256.h
More file actions
41 lines (30 loc) · 768 Bytes
/
Copy pathLifeGrid256.h
File metadata and controls
41 lines (30 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include <iostream>
#include <vector>
class LifeGrid256
{
private:
__m256i *_data;
__m256i *_new_data;
__m256i *_bit0;
__m256i *_bit1;
__m256i *_single;
int _N;
std::vector<int> _minx, _maxx;
std::vector<int> minx, maxx;
__m256i zero;
void Add(__m256i& b1, __m256i &b0, const __m256i& val);
void Add(__m256i& b2, __m256i& b1, __m256i &b0, const __m256i& val);
bool inline IsZero(const __m256i& v);
public:
void Init(int N);
void Set(int x, int y, const __m256i& val);
void Set(int x, int y, int l);
__m256i Get(int x, int y);
bool Get(int x, int y, int l);
void ClearLevel(int l);
void RecalculateBorders();
void Iterate();
void Iterate(int num_iter);
void PrintLevel(int l);
};