24 package org.lightjason.agentspeak.action.builtin.math.blas.matrix;
26 import cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D;
27 import cern.colt.matrix.tdouble.impl.SparseDoubleMatrix2D;
28 import com.codepoetics.protonpack.StreamUtils;
38 import javax.annotation.Nonnegative;
39 import javax.annotation.Nonnull;
40 import java.util.List;
41 import java.util.stream.Collectors;
77 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return )
79 final List<ITerm> l_arguments =
CCommon.
flatten( p_argument ).collect( Collectors.toList() );
83 && (
EType.
exists( l_arguments.get( l_arguments.size() - 1 ).<String>raw() ) ) )
85 l_type =
EType.
from( l_arguments.get( l_arguments.size() - 1 ).<String>raw() );
86 l_limit = l_arguments.size() - 1;
91 l_limit = l_arguments.size();
102 .map(
ITerm::<Number>raw )
103 .mapToInt( Number::intValue )
107 .map( i ->
new DenseDoubleMatrix2D( i.get( 0 ), i.get( 1 ) ) )
109 .forEach( p_return::add );
115 StreamUtils.windowed(
118 .map(
ITerm::<Number>raw )
119 .mapToInt( Number::intValue )
123 .map( i ->
new SparseDoubleMatrix2D( i.get( 0 ), i.get( 1 ) ) )
125 .forEach( p_return::add );
static final long serialVersionUID
serial id
creates a dense- or sparse-matrix.
base class of build-in actions for setting name by package/classname (without prefix character) ...
static boolean exists(final String p_name)
check method to check if a enum value with a name exists
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
final int minimalArgumentNumber()
minimum number of arguments
common structure for execution definition
execution context with local data
final IFuzzyValue< Boolean > execute(final boolean p_parallel, @Nonnull final IContext p_context, @Nonnull final List< ITerm > p_argument, @Nonnull final List< ITerm > p_return)
defines a plan-body operation
static Stream< ITerm > flatten( @Nonnull final Collection<? extends ITerm > p_terms)
flat term-in-term collection into a straight term list
static< T > boolean rawvalueAssignableTo( @Nonnull final T p_value, @Nonnull final Class<?>... p_class)
checks a term value for assignable class
result for an immutable fuzzy value
static EType from(final String p_name)
additional factory
static< N > CRawTerm< N > from(final N p_value)
factory for a raw term
term structure for simple datatypes