Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Zeroes.cs
1using System;
6
8{
13 {
21 public Zeroes(ScriptNode Dimension, int Start, int Length, Expression Expression)
22 : base(Dimension, Start, Length, Expression)
23 {
24 }
25
29 public override string FunctionName
30 {
31 get
32 {
33 return "Zeroes";
34 }
35 }
36
44 {
45 int N = (int)Argument;
46
47 if (N != Argument || N < 0)
48 throw new ScriptRuntimeException("Dimension must be a non-negative integer.", this);
49
50 double[] E = new double[N];
51
52 return new DoubleVector(E);
53 }
54 }
55}
Class managing a script expression.
Definition: Expression.cs:39
Creates a vector containing only ones.
Definition: Zeroes.cs:13
override IElement EvaluateScalar(double Argument, Variables Variables)
Evaluates the function on a scalar argument.
Definition: Zeroes.cs:43
Zeroes(ScriptNode Dimension, int Start, int Length, Expression Expression)
Creates a vector containing only ones.
Definition: Zeroes.cs:21
override string FunctionName
Name of the function
Definition: Zeroes.cs:30
Base class for funcions of one scalar variable.
ScriptNode Argument
Function argument.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:20