本文整理汇总了C#中YAMP.ScalarValue.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# ScalarValue.Clone方法的具体用法?C# ScalarValue.Clone怎么用?C# ScalarValue.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YAMP.ScalarValue
的用法示例。
在下文中一共展示了ScalarValue.Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Plot
Plot2DValue Plot(IFunction f, Double minx, Double maxx, Double precision)
{
var cp = new Plot2DValue();
var N = (Int32)((maxx - minx) / precision) + 1;
var M = new MatrixValue(N, 2);
var x = new ScalarValue(minx);
for (var i = 0; i < N; i++)
{
var row = i + 1;
var y = f.Perform(Context, x);
M[row, 1] = x.Clone();
if (y is ScalarValue)
{
M[row, 2] = (ScalarValue)y;
}
else if (y is MatrixValue)
{
var Y = (MatrixValue)y;
for (var j = 1; j <= Y.Length; j++)
{
M[row, j + 1] = Y[j];
}
}
x.Re += precision;
}
cp.AddPoints(M);
return cp;
}
示例2: MatrixValue
/// <summary>
/// Constructs a new matrix with the given dimension and sets each entry to the given value.
/// </summary>
/// <param name="rows"></param>
/// <param name="cols"></param>
/// <param name="filling"></param>
public MatrixValue(Int32 rows, Int32 cols, ScalarValue filling)
: this(rows, cols)
{
for (var i = 1; i <= _dimX; i++)
{
for (var j = 1; j <= _dimY; j++)
{
this[j, i] = filling.Clone();
}
}
}