真的
创建逻辑1(true)的编码阵列
Syntax
Description
creates anX
= true(n
)n
-by-n
逻辑矩阵的编码矩阵。
When you create the codistributed array in a communicating job orspmd
块,该函数在每个工人上创建一个数组。如果您在交流作业或spmd
block, the array is stored only on the worker or client that creates the codistributed array.
By default, the codistributed array has the underlying typedouble
。
creates anX
= true(SZ1,...,SZN
)sz1
-by-...-by-szN
codistributed array of logical ones whereSZ1,...,SZN
indicates the size of each dimension.
creates a codistributed array of logical ones where the size vectorX
= true(sz
)sz
defines the size ofX
。For example,真的(codistributed([2 3]))
creates a 2-by-3 codistributed array.
使用Codistributor对象X
= true(___,codist
)codist
to create a codistributed array of logical ones. You can use this syntax with any of the input arguments in the previous syntaxes.
Specify the distribution of the array values across the memory of workers using the codistributor objectcodist
。有关创建codistibutor的更多信息,请参阅Codistributor1d
和Codistributor2DBC
。
creates a codistributed array of logical ones without using communication between workers. You can specifyX
= true(___,codist
,"noCommunication")codist
或者编码师,“ Nocommunication”
, but not both.
When you create very large arrays or your communicating job orspmd
block uses many workers, worker-worker communication can slow down array creation. Use this syntax to improve the performance of your code by removing the time required for worker-worker communication.
Tip
当您使用此语法时,会跳过一些错误检查步骤。原型未指定后,请使用此语法来改善代码的性能“ nocommunication”
。
uses the arrayX
= true(___,"like",p
)p
返回一个逻辑上的编码阵列。您可以指定datatype
或者"like"
, but not both.
The returned arrayX
has the same sparsity asp
。
Examples
Input Arguments
提示
真的(codistributed(n))
is much faster and more memory efficient than逻辑(一个(codistribed(n)))
。