Class MatrixListProcessor
java.lang.Object
com.singularsys.extensions.lambda.StandardListProcessor
com.singularsys.extensions.lambda.MatrixListProcessor
- All Implemented Interfaces:
ListProcessor,JepComponent,Serializable
A list processor which accepts and produces
VectorI arguments.
All elements in the list are assumed to be the same length.
Two nested types MatrixListProcessor.MatrixRowsIterable and MatrixListProcessor.MatrixColsIterable
return iterable views of the rows and columns of a matrix.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an Iterable over the input arguments.fromCollection(Collection<Object> tree) Convert a general collection into a type used the Jep environment.Convert a list produced byListProcessor.makeList()to the type used by Jep environment.Gets a light-weight instance suitable for using in multiple threads.voidInitialize the component.makeList()Get an empty list which elements can be added.
-
Field Details
-
mf
-
field
-
-
Constructor Details
-
MatrixListProcessor
-
-
Method Details
-
init
Description copied from interface:JepComponentInitialize the component. This method is called whenever a component is added to Jep. Hence, it allows components to keep track of the other components they may rely on.- Specified by:
initin interfaceJepComponent- Overrides:
initin classStandardListProcessor- Parameters:
jep- the current Jep instance
-
getLightWeightInstance
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Overrides:
getLightWeightInstancein classStandardListProcessor- Returns:
- either a new instance, null or 'this'.
-
fromArgs
Returns an Iterable over the input arguments.- Specified by:
fromArgsin interfaceListProcessor- Overrides:
fromArgsin classStandardListProcessor- Parameters:
arg- an input to the function. Expects an argument of typeVectorIorMatrixI.- Returns:
- a
PaddingListProcessor.VectorIterableorMatrixListProcessor.MatrixRowsIterable - Throws:
EvaluationException- if argument is not of type VectorI or MatrixI
-
makeList
Description copied from interface:ListProcessorGet an empty list which elements can be added.- Specified by:
makeListin interfaceListProcessor- Overrides:
makeListin classStandardListProcessor- Returns:
- an empty list
-
fromList
Description copied from interface:ListProcessorConvert a list produced byListProcessor.makeList()to the type used by Jep environment. Some implementations just return the input.- Specified by:
fromListin interfaceListProcessor- Overrides:
fromListin classStandardListProcessor- Parameters:
list- a list- Returns:
- a type suitable for use by Jep.
- Throws:
EvaluationException- on error
-
fromCollection
Description copied from interface:ListProcessorConvert a general collection into a type used the Jep environment.- Specified by:
fromCollectionin interfaceListProcessor- Overrides:
fromCollectionin classStandardListProcessor- Parameters:
tree- input collection- Returns:
- a type suitable for use by Jep
- Throws:
EvaluationException- on error
-