ptolemy.domains.sdf.lib
Class MatrixSplit
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.domains.sdf.lib.SDFTransformer
ptolemy.domains.sdf.lib.MatrixSplit
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, SequenceActor, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
public class MatrixSplit
- extends SDFTransformer
This actor splits an input matrix into a sequence of matrices.
This actor reads 1 input matrix and produces N*M output matrices,
where N is the size of the rowSplit array, and M is
the size of the columnSplit parameter. The matrices
are produced from submatrices extracted left-to-right,
top-to-bottom, in a raster scan pattern.
For example, if rowSplit = {1, 2},
columnSplit = {2, 1}, and the input matrix is
as follows:
1 2 3
4 5 6
7 8 9
then the first matrix out is a column vector:
1
4
The second matrix out is
2 3
5 6
The third is
7
(a 1x1 matrix) and the fourth is
8 9
a row vector.
If the input does not have enough elements to fill the specified
output matrices, then zeros (of the same type as the input elements)
are used. If the input is larger than is required to fill the specified
output, then the additional values are discarded.
- Since:
- Ptolemy II 6.1
- Version:
- $Id: MatrixSplit.java 57040 2010-01-27 20:52:32Z cxh $
- Author:
- Edward Lee
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Constructor Summary |
MatrixSplit(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name. |
Method Summary |
void |
fire()
Consume the input matrix and produce the output matrices. |
Methods inherited from class ptolemy.actor.AtomicActor |
_actorFiring, _actorFiring, addActorFiringListener, addInitializable, clone, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, initialize, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup |
Methods inherited from class ptolemy.kernel.ComponentEntity |
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.Entity |
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName |
Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
columnSplit
public Parameter columnSplit
- An array specifying the number of columns in the output matrices.
This is an array of integers, with default {1}.
rowSplit
public Parameter rowSplit
- An array specifying the number of rows in the output matrices.
This is an array of integers, with default {1}.
MatrixSplit
public MatrixSplit(CompositeEntity container,
java.lang.String name)
throws NameDuplicationException,
IllegalActionException
- Construct an actor with the given container and name.
- Parameters:
container
- The container.name
- The name of this actor.
- Throws:
IllegalActionException
- If the actor cannot be contained
by the proposed container.
NameDuplicationException
- If the container already has an
actor with this name.
fire
public void fire()
throws IllegalActionException
- Consume the input matrix and produce the output matrices.
- Specified by:
fire
in interface Executable
- Overrides:
fire
in class AtomicActor
- Throws:
IllegalActionException
- If there is an error reading the inputs
or parameters.