1 Star 6 Fork 4

bywayboy / mexti

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

PHP 最小堆扩展

如何编译

  1. 修改 make.sh PHP_BASE_PATH=/usr/local/php 为你的php所在安装目录.
  2. 执行 make.sh

关于人脸算法库

人脸特征提取、活体检测、1v1 比对 1vN查找. 采用的是 中正公司的SDK. 如需获取授权文件请联系微信,QQ:150560739,电话15868108251 修改 zzface/tools/MXParaSet.ini 后执行 ./auth 获取授权信息

[MXParaSet]
IP=183.129.171.153
Port=1902
UserId=testuser
PWD=testuser

mexti\MinHeap

namespace mexti;

class MinHeap{
    
    /**
     * 获取内部成员数目
     */
    public function count() : int;

    /**
     * 是否为空 等价于 count() == 0
     */
    public function isEmpty() : bool;

    /**
     * 插入一个成员到最小堆中
     */
    public function insert(MinHeapNode $n) : bool|int;

    /**
     * 从最小堆中移除一个成员
     */
    public function erase(MinHeapNode $n) : bool|int;

    /**
     * 成员键值更新后, 调整在最小堆中的位置.
     * 返回值:
     *      true:  调整后 $n 位于堆头部
     *      false: 调整后 $n 不位于堆头部
     */
    public function adjust(MinHeapNode $n) : bool|int;

    /**
     * 从最小堆中弹出一个成员
     */
    public function extract() : MinHeapNode;

    /**
     * 获取最小堆中下一个将要弹出的成员(并不会弹出),
     */
    public function top() : MinHeapNode;
}

\mexti\MinHeapNode

namespace mexti;

class MinHeapNode{
    /**
     * 需要被继承类实现的比较方法
    */
    public abstract compare(\mexti\MinHeapNode $b) : int;

    /**
     * 是否在 MinHeap池中.
    */
    public function inHeap() : bool;

    /*
     * 获取自身所在的MinHeap
    */
    public function getHeap() : ?\mexti\MinHeap;
    /**
     * 索引更新后调整位置.
     *      true:  调整后 $n 位于堆头部
     *      false: 调整后 $n 不位于堆头部
     */
    public function adjust(): bool;
    /**
     * 从MinHeap中移除自身
    */
    public function erase() : bool;
}

class SampleNode extends MinHeapNode {
    // 比较键值
    protected int $key;
    /*
        实现比较方法
    */
    public function compare(\MinHeapNode $b) : int {
        if($this->key > $b->key) return 1;
        elseif($this->key < $b->key) return -1;
        return 0;
    }
} 

参考资料: https://blog.csdn.net/manwea/article/details/103557214

https://y2k38.github.io/posts/php-extension-writing-classes/

深入理解PHP7内核之OBJECT https://www.laruence.com/2020/03/23/5605.html

https://yaoguais.github.io/article/php/extension-php5to7.html

https://github.com/GoAnimate-Stuff-by-Zoccorus/wrapper-offline/blob/master/utilities/sourcecode/php-src-master/ext/spl/spl_heap_arginfo.h

BSD 3-Clause License Copyright (c) 2022, bywayboy All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

PHP 最小堆、指纹压缩比对、人脸识别、等接口 展开 收起
C 等 6 种语言
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C
1
https://gitee.com/bywayboy/mexti.git
git@gitee.com:bywayboy/mexti.git
bywayboy
mexti
mexti
master

搜索帮助