/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Copyright (c) 1997
* Moscow Center for SPARC Technology
*
* Copyright (c) 1999
* Boris Fomitchev
*
* This material is provided "as is", with absolutely no warranty expressed
* or implied. Any use is at your own risk.
*
* Permission to use or copy this software for any purpose is hereby granted
* without fee, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
*/
#ifndef _STLP_ALGO_C
#define _STLP_ALGO_C
#if !defined (_STLP_INTERNAL_ALGO_H)
# include <stl/_algo.h>
#endif
#ifndef _STLP_INTERNAL_TEMPBUF_H
# include <stl/_tempbuf.h>
#endif
_STLP_BEGIN_NAMESPACE
_STLP_MOVE_TO_PRIV_NAMESPACE
template <class _BidirectionalIter, class _Distance, class _Compare>
void __merge_without_buffer(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last,
_Distance __len1, _Distance __len2,
_Compare __comp);
template <class _BidirectionalIter1, class _BidirectionalIter2,
class _BidirectionalIter3, class _Compare>
_BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1,
_BidirectionalIter1 __last1,
_BidirectionalIter2 __first2,
_BidirectionalIter2 __last2,
_BidirectionalIter3 __result,
_Compare __comp);
template <class _Tp>
#if !(defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x420 ))
inline
#endif
const _Tp& __median(const _Tp& __a, const _Tp& __b, const _Tp& __c) {
if (__a < __b)
if (__b < __c)
return __b;
else if (__a < __c)
return __c;
else
return __a;
else if (__a < __c)
return __a;
else if (__b < __c)
return __c;
else
return __b;
}
template <class _Tp, class _Compare>
#if !(defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x420 ))
inline
#endif
const _Tp&
__median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp) {
if (__comp(__a, __b)) {
_STLP_VERBOSE_ASSERT(!__comp(__b, __a), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
if (__comp(__b, __c)) {
_STLP_VERBOSE_ASSERT(!__comp(__c, __b), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
return __b;
}
else if (__comp(__a, __c)) {
_STLP_VERBOSE_ASSERT(!__comp(__c, __a), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
return __c;
}
else
return __a;
}
else if (__comp(__a, __c)) {
_STLP_VERBOSE_ASSERT(!__comp(__c, __a), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
return __a;
}
else if (__comp(__b, __c)) {
_STLP_VERBOSE_ASSERT(!__comp(__c, __b), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
return __c;
}
else
return __b;
}
_STLP_MOVE_TO_STD_NAMESPACE
template <class _ForwardIter1, class _ForwardIter2>
_ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1,
_ForwardIter2 __first2, _ForwardIter2 __last2) {
_STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
_STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
// Test for empty ranges
if (__first1 == __last1 || __first2 == __last2)
return __first1;
// Test for a pattern of length 1.
_ForwardIter2 __p1(__first2);
if ( ++__p1 == __last2 )
return find(__first1, __last1, *__first2);
// General case.
for ( ; ; ) { // __first1 != __last1 will be checked in find below
__first1 = find(__first1, __last1, *__first2);
if (__first1 == __last1)
return __last1;
_ForwardIter2 __p = __p1;
_ForwardIter1 __current = __first1;
if (++__current == __last1)
return __last1;
while (*__current == *__p) {
if (++__p == __last2)
return __first1;
if (++__current == __last1)
return __last1;
}
++__first1;
}
return __first1;
}
_STLP_MOVE_TO_PRIV_NAMESPACE
template <class _RandomAccessIter, class _Integer, class _Tp,
class _BinaryPred, class _Distance>
_RandomAccessIter __search_n(_RandomAccessIter __first, _RandomAccessIter __last,
_Integer __count, const _Tp& __val, _BinaryPred __pred,
_Distance*, const random_access_iterator_tag &)
{
_Distance __tailSize = __last - __first;
const _Distance __pattSize = __count;
const _Distance __skipOffset = __pattSize - 1;
_RandomAccessIter __backTrack;
_Distance __remainder, __prevRemainder;
for ( _RandomAccessIter __lookAhead = __first + __skipOffset; __tailSize >= __pattSize; __lookAhead += __pattSize ) { // the main loop...
//__lookAhead here is always pointing to the last element of next possible match.
__tailSize -= __pattSize;
while ( !__pred(*__lookAhead, __val) ) { // the skip loop...
if (__tailSize < __pattSize)
return __last;
__lookAhead += __pattSize;
__tailSize -= __pattSize;
}
if ( __skipOffset == 0 ) {
return (__lookAhead - __skipOffset); //Success
}
__remainder = __skipOffset;
for (__backTrack = __lookAhead; __pred(*--__backTrack, __val); ) {
if (--__remainder == 0)
return (__lookAhead - __skipOffset); //Success
}
if (__remainder > __tailSize)
return __last; //failure
__lookAhead += __remainder;
__tailSize -= __remainder;
while ( __pred(*__lookAhead, __val) ) {
__prevRemainder = __remainder;
__backTrack = __lookAhead;
do {
if (--__remainder == 0)
return (__lookAhead - __skipOffset); //Success
} while (__pred(*--__backTrack, __val));
//adjust remainder for next comparison
__remainder += __pattSize - __prevRemainder;
if (__remainder > __tailSize)
return __last; //failure
__lookAhead += __remainder;
__tailSize -= __remainder;
}
//__lookAhead here is always pointing to the element of the last mismatch.
}
return __last; //failure
}
template <class _ForwardIter, class _Integer, class _Tp,
class _Distance, class _BinaryPred>
_ForwardIter __search_n(_ForwardIter __first, _ForwardIter __last,
_Integer __count, const _Tp& __val, _BinaryPred __pred,
_Distance*, const forward_iterator_tag &) {
for (; (__first != __last) && !__pred(*__first, __val); ++__first) {}
while (__first != __last) {
_Integer __n = __count - 1;
_ForwardIter __i = __first;
++__i;
while (__i != __last && __n != 0 && __pred(*__i, __val)) {
++__i;
--__n;
}
if (__n == 0)
return __first;
else if (__i != __last)
for (__first = ++__i; (__first != __last) && !__pred(*__first, __val); ++__first) {}
else
break;
}
return __last;
}
_STLP_MOVE_TO_STD_NAMESPACE
// search_n. Search for __count consecutive copies of __val.
template <class _ForwardIter, class _Integer, class _Tp>
_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
_Integer __count, const _Tp& __val) {
_STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
if (__count <= 0)
return __first;
if (__count == 1)
//We use find when __count == 1 to use potential find overload.
return find(__first, __last, __val);
return _STLP_PRIV __search_n(__first, __last, __count, __val, equal_to<_Tp>(),
_STLP_DISTANCE_TYPE(__first, _ForwardIter),
_STLP_ITERATOR_CATEGORY(__first, _ForwardIter));
}
template <class _ForwardIter, class _Integer, class _Tp, class _BinaryPred>
_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
_Integer
没有合适的资源?快使用搜索试试~ 我知道了~
android-ndk-r8c
共3433个文件
h:1017个
hpp:530个
cpp:409个
5星 · 超过95%的资源 需积分: 11 36 下载量 90 浏览量
2018-02-02
16:38:07
上传
评论 1
收藏 89.58MB 7Z 举报
温馨提示
ndk开发资源,原文博客地址:http://blog.csdn.net/u013171283/article/details/79240514
资源推荐
资源详情
资源评论
收起资源包目录
android-ndk-r8c (3433个子文件)
libgcc.a 4.86MB
libgcc.a 4.27MB
libgnustl_static.a 2.79MB
libgnustl_static.a 2.79MB
libgnustl_static.a 2.65MB
libgnustl_static.a 2.65MB
libgnustl_static.a 2.35MB
libgnustl_static.a 2.32MB
libgnustl_static.a 2.25MB
libgnustl_static.a 2.12MB
libbfd.a 1.09MB
libbfd.a 1.09MB
libgcc.a 1.02MB
libgcc.a 1.02MB
libgcc.a 968KB
libgcc.a 967KB
libbfd.a 883KB
libbfd.a 854KB
libbfd.a 769KB
libbfd.a 719KB
libmipsel-unknown-linux-android-sim.a 508KB
libmipsel-unknown-linux-android-sim.a 508KB
libgcc.a 504KB
libgcc.a 503KB
libgcc.a 502KB
libgcc.a 494KB
libgcc.a 441KB
libgcc.a 440KB
libgcc.a 438KB
libgcc.a 433KB
libarm-linux-android-sim.a 349KB
libarm-linux-android-sim.a 349KB
libgcov.a 299KB
libgcov.a 299KB
libgcov.a 298KB
libgcov.a 297KB
libiberty.a 296KB
libiberty.a 296KB
libiberty.a 296KB
libiberty.a 296KB
libiberty.a 296KB
libiberty.a 296KB
libgcov.a 290KB
libsupc++.a 283KB
libsupc++.a 283KB
libgcov.a 274KB
libgcov.a 271KB
libgcov.a 270KB
libgcov.a 265KB
libgcov.a 264KB
libsupc++.a 257KB
libgcov.a 255KB
libgcov.a 255KB
libsupc++.a 254KB
libsupc++.a 250KB
libsupc++.a 249KB
libgcov.a 249KB
libsupc++.a 249KB
libgcov.a 247KB
libsupc++.a 230KB
libgabi++_static.a 75KB
libgabi++_static.a 71KB
libgabi++_static.a 67KB
libgabi++_static.a 67KB
libintl.a 55KB
libintl.a 55KB
libintl.a 55KB
libintl.a 55KB
libintl.a 55KB
libintl.a 55KB
liblto_plugin.dll.a 53KB
liblto_plugin.dll.a 53KB
liblto_plugin.dll.a 53KB
libfunction_reordering_plugin.dll.a 33KB
libfunction_reordering_plugin.dll.a 33KB
libfunction_reordering_plugin.dll.a 33KB
algorithm 19KB
algorithm 17KB
algorithm 3KB
algorithm 2KB
algorithm 1KB
README.android 329B
array 8KB
array 8KB
array 7KB
array 2KB
array 2KB
atomic 30KB
bitset 42KB
bitset 37KB
bitset 11KB
bitset 10KB
bitset 10KB
bitset 2KB
BROKEN_BUILD 0B
BROKEN_BUILD 0B
BROKEN_RUN 0B
BUILD_SHOULD_FAIL 0B
BUILD_SHOULD_FAIL 0B
_algo.c 74KB
共 3433 条
- 1
- 2
- 3
- 4
- 5
- 6
- 35
资源评论
- 星蓝之光2018-12-29好,灰常好
- 码农0002019-08-28windows 的
啊sir_
- 粉丝: 165
- 资源: 29
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 办公效率:PDF-图片互转工具
- 一天的风格化规范化当时法国是
- 编译原理:正规式转NFA(有穷自动机)
- 通过 Navicat 备份文件读取连接信息和解析密码
- Linux下开箱即用的C++单元测试demo示例,public成员函数单元测试
- 连接Redis服务器 在使用Redis之前,首先需要使用redis-cli工具连接到Redis服务器 redis-cli是Re
- 连接Redis服务器 在使用Redis之前,首先需要使用redis-cli工具连接到Redis服务器 redis-cli是Red
- 连接Redis服务器 在使用Redis之前,首先需要使用redis-cli工具连接到Redis服务器 redis-cli是Red
- redis命令实践 详细教程
- redis命令实践 详细教程
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功