NonThreadable

NonThreadable

is an attribute that can be assigned to a symbol f to indicate that f and f[arg1,arg2,] should not combine with other list arguments in arithmetic and many other functions that work with lists.

Details

  • The NonThreadable attribute is typically used for symbols that represent nonscalar quantities.
  • VectorSymbol, MatrixSymbol and ArraySymbol have the NonThreadable attribute.
  • Most standard builtin functions that produce array results have the NonThreadable attribute.
  • Expressions whose heads are non-threadable objects are non-threadable.
  • Expressions obtained by applying Listable functions to non-threadable objects are non-threadable.

Examples

open allclose all

Basic Examples  (1)

Give the NonThreadable attribute to symbol x:

Arithmetic operations do not combine x with list elements:

Expressions with non-threadable heads are non-threadable:

Expressions obtained by applying Listable functions to non-threadable objects are non-threadable:

Scope  (4)

ArraySymbol has the NonThreadable attribute:

Arithmetic operations do not combine symbolic arrays with list elements:

SymbolicOnesArray has the NonThreadable attribute:

A symbolic matrix of ones is not added to matrix elements:

When the symbolic matrix is converted to an explicit matrix, the matrices are added correctly:

Inverse has the NonThreadable attribute:

Arithmetic operations do not combine expressions with head Inverse with list elements:

Dot does not have the NonThreadable attribute:

Expressions with head Dot are threadable, unless they are known to be nonscalars:

Wolfram Research (2024), NonThreadable, Wolfram Language function, https://reference.wolfram.com/language/ref/NonThreadable.html.

Text

Wolfram Research (2024), NonThreadable, Wolfram Language function, https://reference.wolfram.com/language/ref/NonThreadable.html.

CMS

Wolfram Language. 2024. "NonThreadable." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NonThreadable.html.

APA

Wolfram Language. (2024). NonThreadable. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NonThreadable.html

BibTeX

@misc{reference.wolfram_2024_nonthreadable, author="Wolfram Research", title="{NonThreadable}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/NonThreadable.html}", note=[Accessed: 12-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_nonthreadable, organization={Wolfram Research}, title={NonThreadable}, year={2024}, url={https://reference.wolfram.com/language/ref/NonThreadable.html}, note=[Accessed: 12-December-2024 ]}