Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Zeroes.cs
5
7{
12 {
21 public Zeroes(ScriptNode Rows, ScriptNode Columns, int Start, int Length, Expression Expression)
22 : base(Rows, Columns, Start, Length, Expression)
23 {
24 }
25
29 public override string FunctionName => nameof(Zeroes);
30
34 public override string[] DefaultArgumentNames => new string[] { "Rows", "Columns" };
35
39 public override bool UpgradeScalarsToSameSet => true;
40
49 {
50 int Rows = (int)Argument1;
51 if (Rows != Argument1 || Rows <= 0)
52 throw new ScriptRuntimeException("Rows must be a positive integer.", this);
53
54 int Columns = (int)Argument2;
55 if (Columns != Argument2 || Columns <= 0)
56 throw new ScriptRuntimeException("Columns must be a positive integer.", this);
57
58 double[,] E = new double[Rows, Columns];
59
60 return new DoubleMatrix(E);
61 }
62 }
63}
Class managing a script expression.
Definition: Expression.cs:41
Creates a matrix containing only zeroes.
Definition: Zeroes.cs:12
override string[] DefaultArgumentNames
Default Argument names
Definition: Zeroes.cs:34
Zeroes(ScriptNode Rows, ScriptNode Columns, int Start, int Length, Expression Expression)
Creates a matrix containing only zeroes.
Definition: Zeroes.cs:21
override bool UpgradeScalarsToSameSet
If scalars should be upgraded to the same set before evaluation.
Definition: Zeroes.cs:39
override string FunctionName
Name of the function
Definition: Zeroes.cs:29
override IElement EvaluateScalar(double Argument1, double Argument2, Variables Variables)
Evaluates the function on two scalar arguments.
Definition: Zeroes.cs:48
Base class for funcions of two scalar variables.
ScriptNode Argument2
Function argument 2.
ScriptNode Argument1
Function argument 1.
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:21