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;
77 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return )
82 && (
EType.
exists( p_argument.get( p_argument.size() - 1 ).<String>raw() ) ) )
84 l_type =
EType.
from( p_argument.get( p_argument.size() - 1 ).<String>raw() );
85 l_limit = p_argument.size() - 1;
90 l_limit = p_argument.size();
97 .map(
ITerm::<List<Number>>raw )
98 .map( i -> i.stream().mapToDouble( Number::doubleValue ).toArray() )
104 return new SparseDoubleMatrix1D( i );
106 return new DenseDoubleMatrix1D( i );
110 .forEach( p_return::add );
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 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
common structure for execution definition
execution context with local data
static final long serialVersionUID
serial id
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
final int minimalArgumentNumber()
minimum number of arguments
creates a dense- or sparse-vector from a list.
term structure for simple datatypes