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.Arrays;
40 import java.util.List;
41 import java.util.stream.Collectors;
78 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return )
80 final List<ITerm> l_arguments =
CCommon.
flatten( p_argument ).collect( Collectors.toList() );
84 && (
EType.
exists( l_arguments.get( l_arguments.size() - 1 ).<String>raw() ) ) )
86 l_type =
EType.
from( l_arguments.get( l_arguments.size() - 1 ).<String>raw() );
87 l_limit = l_arguments.size() - 1;
92 l_limit = l_arguments.size();
102 .map(
ITerm::<String>raw )
104 .map( DenseDoubleMatrix1D::new )
106 .forEach( p_return::add );
113 .map(
ITerm::<String>raw )
115 .map( SparseDoubleMatrix1D::new )
117 .forEach( p_return::add );
134 private static double[]
parse( @Nonnull
final String p_string )
136 return Arrays.stream( p_string.split(
";|,|\\s" ) )
138 .filter( i -> !i.isEmpty() )
139 .mapToDouble( Double::parseDouble )
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 final long serialVersionUID
serial id
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
common structure for execution definition
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
final int minimalArgumentNumber()
minimum number of arguments
static Stream< ITerm > flatten( @Nonnull final Collection<? extends ITerm > p_terms)
flat term-in-term collection into a straight term list
creates a dense- or sparse-vector from as string.
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
static double [] parse( @Nonnull final String p_string)
parses the string
term structure for simple datatypes