24 package org.lightjason.agentspeak.action.builtin.math.blas.vector;
26 import cern.colt.matrix.tdouble.impl.DenseDoubleMatrix1D;
27 import cern.colt.matrix.tdouble.impl.SparseDoubleMatrix1D;
37 import javax.annotation.Nonnegative;
38 import javax.annotation.Nonnull;
39 import java.util.List;
40 import java.util.stream.Collectors;
76 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return )
78 final List<ITerm> l_arguments =
CCommon.
flatten( p_argument ).collect( Collectors.toList() );
82 && (
EType.
exists( l_arguments.get( l_arguments.size() - 1 ).<String>raw() ) ) )
84 l_type =
EType.
from( l_arguments.get( l_arguments.size() - 1 ).<String>raw() );
85 l_limit = l_arguments.size() - 1;
90 l_limit = l_arguments.size();
100 .map(
ITerm::<Number>raw )
101 .mapToInt( Number::intValue )
103 .map( DenseDoubleMatrix1D::new )
105 .forEach( p_return::add );
113 .map(
ITerm::<Number>raw )
114 .mapToInt( Number::intValue )
116 .map( SparseDoubleMatrix1D::new )
118 .forEach( p_return::add );
final int minimalArgumentNumber()
minimum number of arguments
static final long serialVersionUID
serial id
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
common structure for execution definition
creates a dense- or sparse-vector.
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
execution context with local data
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