Commit 15bd08f
testing Eigen/xtensor/numpy inter-op (WIP) (#6)
* add Eigen
* make it compile
* fix
* add packaging
* pocketpy prime is slower, 3.7s vs. 2.5s
* 1. Mobile line numbers fix:
- Changed .line-numbers from fixed width: 50px to min-width: 36px — narrower on small screens, still grows if needed
- Reduced padding from 10px 8px 10px 5px to 10px 6px 10px 4px to save horizontal space
- Removed the problematic height: 100% (now set dynamically by JS to match editor)
2. Textarea auto-resize:
- Removed hardcoded min-height: 400px from both .editor-container and #editor
- Added max-height: 90vh on .editor-container to cap the overall height
- New autoResizeEditor() function calculates height based on line count:
- Minimum: 3 lines (~79px)
- Maximum: 60% of viewport height
- When content exceeds max, the editor scrolls with line numbers synced
- Removed the MutationObserver (unnecessary — input event + initial call covers all cases)
- Auto-resize triggers on input and window resize
This way, if the code is short (e.g. 5 lines), the editor will be compact and the output area below will be visible. If the code is long, it caps at 90vh with scrolling.
* 编译通过,运行正常。现在走的是完整的 Eigen-pybind11-numpy 链路:
- pybind11/eigen.h 做 Eigen::Ref<> / Eigen::Vector3d 和 numpy array 的 seamless 自动转换
- LineSegment 构造函数直接接收 Eigen::Vector3d,pybind11 自动从 numpy 转换
- rdp / rdp_mask 用 Eigen::Ref<const RowVectors> 直接零拷贝引用 numpy 数据
* test rdp
* fix
---------
Co-authored-by: tang zhixiong <zhixiong.tang@momenta.ai>1 parent d601fb7 commit 15bd08f
File tree
13 files changed
+94445
-42
lines changed- docs
- include/Eigen
- src
- pocket_numpy
- tests
13 files changed
+94445
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | | - | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
| |||
52 | 50 | | |
53 | 51 | | |
54 | 52 | | |
| 53 | + | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| |||
126 | 125 | | |
127 | 126 | | |
128 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
129 | 150 | | |
130 | 151 | | |
131 | 152 | | |
132 | | - | |
| 153 | + | |
133 | 154 | | |
134 | | - | |
| 155 | + | |
135 | 156 | | |
136 | 157 | | |
137 | 158 | | |
138 | 159 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 160 | + | |
146 | 161 | | |
147 | | - | |
| 162 | + | |
148 | 163 | | |
149 | | - | |
| 164 | + | |
150 | 165 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 166 | + | |
160 | 167 | | |
161 | 168 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 169 | | |
173 | 170 | | |
174 | 171 | | |
| |||
0 commit comments