Skip to content

Commit 1ef5183

Browse files
author
peng.li24
committed
docs: translate README to english
1 parent 44fb7fe commit 1ef5183

1 file changed

Lines changed: 27 additions & 28 deletions

File tree

README.md

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,27 @@
55
[![CMake](https://img.shields.io/badge/CMake-%3E%3D3.16-green.svg)](https://cmake.org/)
66
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
77

8-
## 背景
8+
## Background
99

10-
NumPy 的性能已经很快了,但它的上限被 Python 锁死了。
10+
NumPy is fast — but its ceiling is locked by Python.
1111

12-
我们创建了 `numpycpp` — 保留 NumPy 的使用习惯,但允许 C++ 突破 Python 的性能天花板,进一步加速你的代码。
12+
We created `numpycpp` to keep NumPy's familiar usage patterns while letting C++ break through Python's performance ceiling and accelerate your code further.
1313

14-
## 概述
14+
## Overview
1515

16-
`numpycpp` 是一个 **header-only C++ **,用 raw pointer + size 接口实现了 numpy 核心 API`numpy.*``numpy.linalg.*``numpy.einsum`)的像素级对齐。零外部依赖,纯 C++17 标准库即可编译。
16+
`numpycpp` is a **header-only C++ library** implementing numpy's core API (`numpy.*`, `numpy.linalg.*`, `numpy.einsum`) with pixel-level precision alignment. Raw pointer + size interface. Zero external dependencies — pure C++17 standard library.
1717

18-
## 快速开始
18+
## Quick Start
1919

20-
### 依赖
20+
### Dependencies
2121

22-
- **C++17** 编译器 (GCC >= 9, Clang >= 7, MSVC >= 2019)
22+
- **C++17** compiler (GCC >= 9, Clang >= 7, MSVC >= 2019)
2323

24-
### 使用
24+
### Usage
2525

2626
```cpp
2727
#include "numpy/core.h"
2828

29-
// 纯 C++ 调用,无 pybind11 依赖
3029
std::vector<double> data = {1.0, 4.0, 9.0};
3130
std::vector<double> result(data.size());
3231

@@ -37,46 +36,46 @@ double s = numpy::sum(data.data(), data.size());
3736
// s → 14.0
3837
```
3938
40-
### 安装
39+
### Install
4140
4241
```bash
4342
mkdir build && cd build
4443
cmake .. -DCMAKE_BUILD_TYPE=Release
45-
make deb # 生成 numpcpp-dev-1.21.2-Linux.deb
46-
sudo dpkg -i numpcpp-dev-1.21.2-Linux.deb
47-
# 头文件安装至 /usr/include/numpycpp/
44+
make deb
45+
sudo dpkg -i numpcpp-dev-*.deb
46+
# headers installed to /usr/include/numpycpp/
4847
```
4948

50-
### 精度测试
49+
### Testing
5150

52-
测试套件验证每个 C++ 函数与 Python numpy**像素级精度对齐**
51+
The test suite verifies pixel-level precision alignment between every C++ function and Python numpy.
5352

5453
```bash
5554
cd tests
56-
make # 编译测试模块
57-
make test # 运行全部 336 个测试
55+
make # compile test module
56+
make test # run all 336 tests
5857
```
5958

60-
## 项目结构
59+
## Project Structure
6160

6261
```
6362
numpycpp/
64-
├── numpy/ # C++ 头文件(零依赖)
65-
│ ├── core.h # numpy.* 等价函数(~80个)
66-
│ ├── linalg.h # numpy.linalg.* 等价函数
67-
│ └── einsum.h # numpy.einsum 等价实现
68-
├── pycpp/ # pybind11 包装层(可选引用)
63+
├── numpy/ # native C++ headers (zero dependency)
64+
│ ├── core.h # numpy.* equivalents (~80 functions)
65+
│ ├── linalg.h # numpy.linalg.* equivalents
66+
│ └── einsum.h # numpy.einsum
67+
├── pycpp/ # pybind11 wrappers (optional)
6968
│ ├── core_py.h
7069
│ ├── linalg_py.h
7170
│ └── einsum_py.h
72-
├── tests/ # Python 精度测试 + 测试用模块
73-
│ ├── module.cpp # 测试用 pybind11 模块
71+
├── tests/ # precision tests + test module
72+
│ ├── module.cpp # pybind11 module for testing
7473
│ ├── Makefile
7574
│ └── test_*.py
76-
├── CMakeLists.txt # 构建 & .deb 打包
75+
├── CMakeLists.txt # build & .deb packaging
7776
└── README.md
7877
```
7978

80-
## 许可
79+
## License
8180

8281
[MIT](LICENSE)

0 commit comments

Comments
 (0)