NAME

Conformability - OADL array conformability rules

APPLIES TO

All array-valued expressions

DESCRIPTION

Only values with conformable shapes can be used together in arithmetic statements. The rules regarding conformability are simple:

Note that an Enclosure is considered to be a scalar.

EXAMPLE

    a = [1,2,3]
    b = [4,5,6]
    a + b
5 7 9

    a + 1
2 3 4

    b = {4,{5,6},7}
    a + b
5 +---+ 10
  |7 8|
  +---+

    b = [7,8].enclose()
    a + b
+---+ +----+ +-----+
|8 9| |9 10| |10 11|
+---+ +----+ +-----+

SEE ALSO

shape
rank
reshape
enclose
ravel