---
title: NpySort
description: "numpy排序算法构造函数。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/msadg/mxvisionug_0414.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/msadg/mxvisionug_0414.html
indexId: 269119d676af4230ee54baf8e8b5076e994f0f7e27b6052d8f53d73e66ce797f102
---
# NpySort

#### 函数功能

numpy排序算法构造函数。


#### 函数原型

```
explicit NpySort() = default;
NpySort(std::vector<float> preSortVec, std::vector<int> sortIdx);
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| preSortVec | 输入 | 待排序数组，长度大于0。 |
| sortIdx | 输入 | 待排序索引数组。 单个索引最小为0， 最大为该数组长度\-1。长度与待排序数组相同。 |
