同一数据集,不同的排序条件,有的可以,但某一条件,却能100%重现报错。

procedure TkbmIndex.InternalFastQuickSort(const L,R:Integer);
var
I,J:integer;
P:PkbmRecord;
begin
if ((R-L)>) then
// if ((R-L)>0) then
begin
I:=(R+L) div ;
if CompareRecords(FIndexFieldList,PkbmRecord(FReferences[L]),PkbmRecord(FReferences[I]),true,false)> then
InternalSwap(L,I);
if CompareRecords(FIndexFieldList,PkbmRecord(FReferences[L]),PkbmRecord(FReferences[R]),true,false)> then
InternalSwap(L,R);
if CompareRecords(FIndexFieldList,PkbmRecord(FReferences[I]),PkbmRecord(FReferences[R]),true,false)> then
InternalSwap(I,R); J:=R-;
InternalSwap(I,J);
I:=L;
P:=PkbmRecord(FReferences[J]);
while true do
begin
Inc(I);
Dec(J);
while CompareRecords(FIndexFieldList,PkbmRecord(FReferences[I]),P,true,false) < do Inc(I);
while CompareRecords(FIndexFieldList,PkbmRecord(FReferences[J]),P,true,false) > 0 do Dec(J);
if (J<I) then break;
InternalSwap(I,J);
end;
InternalSwap(I,R-);
InternalFastQuickSort(L,J);
InternalFastQuickSort(I+,R);
end;
end;

 反复跟代码,发现在  kbmMemTable.PAS中,当J减至0时,FReferences[J] 下标越界

试改为FIndexFieldList.Count>0前判断条件却未解决,说明并非是递减原因,改为大于J,未报错,是否有问题,待应用中再关注。

procedure TkbmIndex.InternalFastQuickSort(const L,R:Integer);
var
I,J:integer;
P:PkbmRecord;
begin
if ((R-L)>) then
// if ((R-L)>0) then
begin
I:=(R+L) div ;
if CompareRecords(FIndexFieldList,PkbmRecord(FReferences[L]),PkbmRecord(FReferences[I]),true,false)> then
InternalSwap(L,I);
if CompareRecords(FIndexFieldList,PkbmRecord(FReferences[L]),PkbmRecord(FReferences[R]),true,false)> then
InternalSwap(L,R);
if CompareRecords(FIndexFieldList,PkbmRecord(FReferences[I]),PkbmRecord(FReferences[R]),true,false)> then
InternalSwap(I,R); J:=R-;
InternalSwap(I,J);
I:=L;
P:=PkbmRecord(FReferences[J]);
while true do
begin
Inc(I);
Dec(J);
while CompareRecords(FIndexFieldList,PkbmRecord(FReferences[I]),P,true,false) < do Inc(I);
while (FIndexFieldList.Count>J )and (CompareRecords(FIndexFieldList,PkbmRecord(FReferences[J]),P,true,false) > ) do Dec(J);
if (J<I) then break;
InternalSwap(I,J);
end;
InternalSwap(I,R-);
InternalFastQuickSort(L,J);
InternalFastQuickSort(I+,R);
end;
end;

kbmmemtable sorton 报错 : List index out of bounds的更多相关文章

  1. git报错之index.lock

    当想回退到某个版本的时候,用git reset --hard commit_id,发现报错,原因是.git目录下多了个index.lock文件,可以通过rm命令删除,然后再回退 rm -f ./.gi ...

  2. Faster RCNN 运行自己的数据,刚开始正常,后来就报错: Index exceeds matrix dimensions. Error in ori_demo (line 114) boxes_cell{i} = [boxes(:, (1+(i-1)*4):(i*4)), scores(:, i)];

    function script_faster_rcnn_demo() close all; clc; clear mex; clear is_valid_handle; % to clear init ...

  3. 踩坑记录-nuxt引入vuex报错store/index.js should export a method that returns a Vuex instance.

    错误 store/index.js代码如下: import Vue from 'vue'; import Vuex from 'vuex'; import city from './moudle/ci ...

  4. jdbcTemplate异常:like模糊查询报错(Parameter index out of range (1 > number of parameters)

    http://cuisuqiang.iteye.com/blog/1480525   模糊查询like要这样写 注意Object参数和like语法   public static void main( ...

  5. vue打包后刷新页面报错:Unexpected token <

    前言 今天遇到了一个很怪的问题,在vue-cli+webpack的项目中,刷新特定页面后页面会变空白,报错为index.html文件中Unexpected token <. 怪点一是开发环境没有 ...

  6. Maven新建webapp项目index.jsp报错

    最近用eclipse新建了一个maven项目,结果刚新建完成index.jsp页面就报错了,先把错误信息贴出来看看 后来就找资料,结果发现两种解决办法,希望可以帮助用得上的人! 第一种:直接在pom. ...

  7. 报错:org.apache.jasper.JasperException: /index.jsp (line: 1, column: 17) equal symbol expected

    现象:写了如下一个jsp文件,导入需要用到的两个包: 运行结果报错:org.apache.jasper.JasperException: /index.jsp (line: 1, column: 17 ...

  8. mongodb 查询时没有索引报错(too much data for sort() with no index)

    报错信息: .... too much data for sort() with no index.... 给对应排序字段加索引就OK 了... 在对应"表"名上,右键--> ...

  9. eclipse里index.jsp头部报错的原因和解决方法

    index.jsp的头<%@这句报错的话,是因为没有引入Tomcat的原因.解决:A:Window---Preferences---server---RuntimeEnviroments--Ad ...

随机推荐

  1. git开发过程中的使用流程

    001.创建仓库 002.新建项目 003.初始化仓库  这一步不需要做 git init : 文件夹中会多出一个隐藏的.git文件 004.克隆项目 git clone <项目地址> 0 ...

  2. mac charles抓安卓(小米)http包

    网上有很多的教程说明如何操作,都写的很好,比如 https://blog.csdn.net/luochoudan/article/details/72801573,我在这里补充一点,非常重要的一点:手 ...

  3. 1 开发环境 eclipse oomph版本 jdk1.8 lucene 6.6.0,luke6.6.0

    第一个jar  是分词器,后面的是lucene  解压出来的 路径如下: lucene-analyzers-common-6.6.0.jar:lucene-6.6.0/common/ lucene-a ...

  4. @ConfigurationProperties注解取消location属性

    当我正在自学如何自定义properties配置文件,为了防止不必要的麻烦,重新创建了一个新的properties文件 fu.properties 然后在自定义的配置类中引入fu.properties/ ...

  5. python全栈开发 * 继承性 层叠性 盒模型 标准文档流 * 180809

    ---恢复内容开始--- 一继承性 1.继承: 给父级设置一些属性,子级继承了父级的该属性,这就是我们的css中的继承. 2. 可继承: color . font-*(size). text-*(de ...

  6. 关于python列表和元组的基本操作

    一.列表 列表是python中最常出现的一种数据存储形式,掌握列表的基本操作可以快速而有效的提高我们的代码书写效率.列表中存放的数据有如下基本操作:如增.删.改.查,掌握了这四个操作,就基本掌握了列表 ...

  7. Codeforces 1154E - Two Teams - [线段树+链表]

    题目链接:https://codeforces.com/contest/1154/problem/E 题意: $n$ 个人排成一排,第 $i$ 个人的能力值为 $a[i]$,$a[1 \sim n]$ ...

  8. ubuntu16.04升级Python3.5到Python3.7

    因为python3.5和python3.6之后的版本差异很大,所有需要改变python的版本 简易安装python后得到的3版本的版本号是python3.5. 可以使用下面的命令查看py版本: pyt ...

  9. Linux技术栈整理一:系统体系结构

    Linux操作系统必备的硬件构造: CPU 主板 显卡 硬盘 网卡 外设(键鼠-输入设备 / 显示器-输出设备) 内核管理调度: 内核体系结构: 来源于:极客专栏

  10. springcloud第五步:使用Zuul搭建服务接口网关

    路由网关(zuul) 什么是网关 Zuul的主要功能是路由转发和过滤器.路由功能是微服务的一部分,比如/api/user转发到到user服务,/api/shop转发到到shop服务.zuul默认和Ri ...