Marine systems simulation
MatrixConnectome.h
1#pragma once
2
3#include "eigen_matrix_defs.h"
4#include <map>
5#include <set>
6#include <vector>
7
8namespace CoRiBoDynamics
9{
29{
30public:
31 struct CRix {
32 int cr; // column index = (cr>>16), row_index = (cr&0xffff)
33 int ix; // matrix index
34 };
35
36 explicit MatrixConnectome(int drop_size);
38
39 void Update(const bool* diagonal_connection, int num, std::vector<CRix> extra_connections);
40
41 void set_drop_size(int drop_size);
42
43 struct segment {
44 int ix0;
45 int ix1;
46 segment(int a, int b){ix0 = a; ix1 = b;}
47 };
48
49 std::vector<segment> m_tridiag_segments;
50 std::vector<segment> m_null_tridiag_segments;
51
52
54 int ix0; int ix1; int color;
56 colored_segment(int a,int b,int c){ix0=a;ix1=b;color=c;}
57 };
58
59 std::vector<colored_segment> all_segments;
60 std::vector<int> color_groups; // color merging lookup table. color_groups[c] contains the actual color group value that 'c' should be merged into
61
62protected:
63
64bool contains(const segment& o, const segment& i);
65int m_drop_size;
66segment drop_expand(const bool* diagonal_connection, int num, int expand_center);
67
68};
69}
Definition: MatrixConnectome.h:29
Definition: CollisionManager.h:6
Definition: MatrixConnectome.h:31
Definition: MatrixConnectome.h:53
Definition: MatrixConnectome.h:43
int ix1
start index
Definition: MatrixConnectome.h:45
segment(int a, int b)
end index
Definition: MatrixConnectome.h:46