sequencetools.Matrix

Inheritance diagram of abjad.tools.sequencetools.Matrix.Matrix.Matrix

class abjad.tools.sequencetools.Matrix.Matrix.Matrix(*args, **kwargs)[source]

New in version 2.0.

Abjad model of matrix.

Initialize from rows:

abjad> from abjad.tools import sequencetools
abjad> matrix = sequencetools.Matrix([[0, 1, 2, 3], [10, 11, 12, 13], [20, 21, 22, 23]])
abjad> matrix
Matrix(3x4)
abjad> matrix[:]
((0, 1, 2, 3), (10, 11, 12, 13), (20, 21, 22, 23))
abjad> matrix[2]
(20, 21, 22, 23)
abjad> matrix[2][0]
20

Initialize from columns:

abjad> matrix = sequencetools.Matrix(columns = [[0, 10, 20], [1, 11, 21], [2, 12, 22], [3, 13, 23]])
abjad> matrix
Matrix(3x4)
abjad> matrix[:]
((0, 1, 2, 3), (10, 11, 12, 13), (20, 21, 22, 23))
abjad> matrix[2]
(20, 21, 22, 23)
abjad> matrix[2][0]
20

Matrix implements only item retrieval in this revision.

Concatenation and division remain to be implemented.

Standard transforms of linear algebra remain to be implemented.

Read-only Properties

Matrix.columns[source]

Read-only columns:

abjad> matrix = sequencetools.Matrix([[0, 1, 2, 3], [10, 11, 12, 13], [20, 21, 22, 23]])
abjad> matrix.columns
((0, 10, 20), (1, 11, 21), (2, 12, 22), (3, 13, 23))

Return tuple.

Matrix.rows[source]

Read-only rows:

abjad> matrix = sequencetools.Matrix([[0, 1, 2, 3], [10, 11, 12, 13], [20, 21, 22, 23]])
abjad> matrix.rows
((0, 1, 2, 3), (10, 11, 12, 13), (20, 21, 22, 23))

Return tuple.

Special Methods

Matrix.__delattr__()

x.__delattr__(‘name’) <==> del x.name

Note

Inherited from __builtin__.object

Matrix.__eq__(arg)

True when id(self) equals id(arg).

Return boolean.

Note

Inherited from abctools.AbjadObject

Matrix.__ge__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

Matrix.__getitem__(expr)[source]
Matrix.__gt__(arg)

Abjad objects by default do not implement this method.

Raise exception

Note

Inherited from abctools.AbjadObject

Matrix.__hash__() <==> hash(x)

Note

Inherited from __builtin__.object

Matrix.__le__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

Matrix.__lt__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

Matrix.__ne__(arg)

True when id(self) does not equal id(arg).

Return boolean.

Note

Inherited from abctools.AbjadObject

Matrix.__repr__()[source]
Matrix.__setattr__()

x.__setattr__(‘name’, value) <==> x.name = value

Note

Inherited from __builtin__.object

Matrix.__str__() <==> str(x)

Note

Inherited from __builtin__.object

Table Of Contents

This Page