parfor slice
http://www.mathworks.cn/cn/help/distcomp/advanced-topics.html
PARFOR loops work by dividing the iterations of the loop among many
workers. Things work best when the inputs to the loop and outputs from
the loop can also be divided in the same way. The simplest example might
be:
N = 10;
in1 = rand(1, N);
in2 = rand(1, N);
out2 = 0;
parfor ii = 1:N
out1(ii) = in1(ii) * 2 + max(in2);
out2 = out2 + in1(ii);
end
In this case, both 'in1' and 'out1' are SLICED because PARFOR can see
how to divide them up - not all of 'in1' or 'out1' are required to
perform an iteration of the loop. 'in2' is *not* sliced, because the
whole value is needed for each loop iteration. 'out2' is not sliced
either, but PARFOR can still compute the value because it understands
that it is a REDUCTION variable. More info:
<http://www.mathworks.com/help/toolbox/distcomp/brdqtjj-1.html>
PARFOR warns you if you have a variable inside a PARFOR loop that you're
indexing, but that isn't sliced. This warning appears because you might
have intended the variable to be sliced, but PARFOR couldn't slice it.
PARFOR can slice multi-dimensional arrays providing that the indexing
expression matches various conditions layed out in the page referred to
above. For example:
in3 = rand(N);
parfor ii=1:N
out3(:,ii) = 1 - in3(:,ii);
end
both 'in3' and 'out3' can be sliced.
Cheers,
Edric.
parfor slice的更多相关文章
- Matlab slice方法和包络法绘制三维立体图
前言:在地球物理勘探,流体空间分布等多种场景中,定位空间点P(x,y,x)的物理属性值Q,并绘制三维空间分布图,对我们洞察空间场景有十分重要的意义. 1. 三维立体图的基本要件: 全空间网格化 网格节 ...
- jQuery之常用且重要方法梳理(target,arguments,slice,substring,data,trigger,Attr)-(一)
1.jquery data(name) data() 方法向被选元素附加数据,或者从被选元素获取数据. $("#btn1").click(function(){ $(" ...
- js url.slice(star,end) url.lastIndexOf('/') + 1, -4
var url = '"http://60.195.252.25:15518/20151228/XXSX/作三角形的高.mp4")' document.title = url.sl ...
- JavaScript中的slice,splice,substr,substring,split的区别
万恶的输入法,在sublime中会显示出繁体字,各位看官见谅. 1.slice()方法:该方法在数组和string对象中都拥有. var a = [1,2,3,4,5,6]; var s = 'thi ...
- Max double slice sum 的解法
1. 上题目: Task description A non-empty zero-indexed array A consisting of N integers is given. A tripl ...
- js中substr,substring,slice。截取字符串的区别
substr(n1,n2) n1:起始位置(可以为负数) n2:截取长度(不可以为0,不可以为负数,可以为空) 当n1为正数时,从字符串的n1下标处截取字符串(起始位置),长度为n2. 当n1为负数时 ...
- JS 中 Array.slice() 和 Array.splice()方法
slice slice()就是对应String的substring()版本,它截取Array的部分元素,然后返回一个新的Array: var arr = ['A', 'B', 'C', 'D', 'E ...
- 【javascript 技巧】Array.prototype.slice的妙用
Array.prototype.slice的妙用 开门见山,关于Array 的slice的用法可以参考这里 http://www.w3school.com.cn/js/jsref_slice_arra ...
- golang中的slice翻转存在以及map中的key判断
//slice翻转 func stringReverse(src []string){ if src == nil { panic(fmt.Errorf("the src can't be ...
随机推荐
- 微信小程序 数据绑定方式
与vue不同,在微信小程序中,js的数据和前端显示的数据是单数据流,也就是说,js里边的数据变了(通过setData),前端能立刻显示.但如果前端数据变了,js中的变量不能改变. 这个相比传统的前端已 ...
- How Many O's? UVA - 11038
这个题个人感觉有点难,不容易理解. 题意 给你两个数,n,m,找出从n到m所有的数一共包含几个0,看似简单,包含0的不就都是整数么,然后就用暴力循环来找,绝对TL.我自己写这题也没有什么好的办法,没有 ...
- tslint无法工作:Failed to load the TSLint library for the document
1--- 2--- 3---
- leecode第七题(整数反转)
题解给的思路: ; class Solution { public: int reverse(int x) { ;//如果这里还是int,会在判断前就被裁剪了,无法判断溢出 ; ) flag=; wh ...
- Creazy Ideas 智能汽车和智能交通
1.现在无人驾驶靠的是摄像头监测障碍物,计算可行路线(这个结论是看到相关视频中百度无人驾驶测试中大大的摄像头推测的,非确切信息).而非像人一样对客观事物的认知学习得到障碍物的信息,如果能将AI融入进去 ...
- 环境变量LD_LIBRARY_PATH的传递
http://bbs.chinaunix.net/thread-3680861-1-1.html execv明显没有传环境变量,execle或execve才会带在启动shell设置的LD_LIBRAR ...
- spring cloud: 关闭ribbon负载均衡
spring cloud: 关闭ribbon负载均衡 1.eureka服务 2.2个user服务:7900/7901 3,movie服务 movie服务去请求 user的用户信息,而此时只想请求790 ...
- lncRNA表达定量方法评估
见文章:Benchmark of lncRNA Quantification for RNA-Seq of Cancer Samples Overall, 10-16% of lncRNAs can ...
- Juniper基础配置
root> show configuration | display set 配置按set行显示,查看的配置为未commit的配置(commit check)root# set sys ...
- int __get_order(unsigned long size)
2017-12-6 10:26:504.9.51int __get_order(unsigned long size){ int order; size--; size >>= ...