当前位置:网站首页>Detect whether the vector has an intersection
Detect whether the vector has an intersection
2022-06-12 12:41:00 【April 16!】
#include <iostream> // std::cout
#include <algorithm> // std::find_if
#include <vector> // std::vector
auto test(const std::vector< itk::Index<3>>& va, const std::vector< itk::Index<3>>& vb)
{
bool result{ false };
auto vbIter = std::find_if(vb.cbegin(), vb.cend(), [&va](const auto& bandItem)
{
auto vaIter = std::find_if(va.cbegin(), va.cend(), [&bandItem](const auto& nrBandItem)
{
return nrBandItem == bandItem;
});
return vaIter != va.cend();
});
result = (vbIter != vb.cend());
return result;
}
int main(int, char *[])
{
std::vector< itk::Index<3>> v1{ {0,1,2},{12,-10,25} };
std::vector< itk::Index<3>> v2{ {0,1,2} };
std::vector< itk::Index<3>> v3{ {1,2,3} };
std::cout << test(v1, v2) << std::endl;
std::cout << test(v1, v3) << std::endl;
return 0;
}
边栏推荐
- itkMultiResolutionImageRegistrationMethod
- Reasons for college students' leave
- From simple to deep - websocket
- NDT registration principle
- Map and set of ES6
- Is yuancosmos a short-term speculation or a future trend?
- Binary tree (construction)
- 号称下一代监控系统!来看看它有多牛逼
- Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference
- Problems encountered in generating MP3 from text to speech through iFLYTEK voice API
猜你喜欢
随机推荐
一个ES设置操作引发的“血案”
WebStorage
In depth anatomy of C language - key words & supplementary contents
itk itk::BSplineDeformableTransform
二叉树(思路篇)
Simple picture preview
八大误区,逐个击破(2):性能差?应用程序少?你对云的这些担心很多余!
Numpy numerical calculation basis
VNCTF2022 [WEB]
itk 多分辨率图像 itk::RecursiveMultiResolutionPyramidImageFilter
Array -- seven array topics with double pointer technique
Dasctf Sept x Zhejiang University of technology autumn challenge Web
sublime_ Textuse
vant 标签栏+上拉加载+下拉刷新demo van-tabs+van-pull-refresh+van-list demo
Tron API wave field transfer query interface PHP version package based on thinkphp5 attached interface document 20220602 version deployed interface applicable to any development language
机械臂改进的DH参数与标准DH参数理论知识
【数据库】navicat --oracle数据库创建
轻量化---Project
路由信息的来源
OpenMAX (OMX)框架




![VNCTF2022 [WEB]](/img/36/a70763d74e503ddc888b8fc38f8677.jpg)




