本文整理汇总了C#中DotNetMatrix.GeneralMatrix.SubtractEquals方法的典型用法代码示例。如果您正苦于以下问题:C# GeneralMatrix.SubtractEquals方法的具体用法?C# GeneralMatrix.SubtractEquals怎么用?C# GeneralMatrix.SubtractEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetMatrix.GeneralMatrix
的用法示例。
在下文中一共展示了GeneralMatrix.SubtractEquals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//.........这里部分代码省略.........
/// ArrayLeftDivide
/// ArrayLeftDivideEquals
/// ArrayRightDivide
/// ArrayRightDivideEquals
/// arrayTimes
/// ArrayMultiplyEquals
/// uminus
///
/// </summary>
print("\nTesting array-like methods...\n");
S = new GeneralMatrix(columnwise, nonconformld);
R = GeneralMatrix.Random(A.RowDimension, A.ColumnDimension);
A = R;
try
{
S = A.Subtract(S);
errorCount = try_failure(errorCount, "Subtract conformance check... ", "nonconformance not raised");
}
catch (System.ArgumentException e)
{
try_success("Subtract conformance check... ", "");
System.Console.Out.WriteLine(e.Message);
}
if (A.Subtract(R).Norm1() != 0.0)
{
errorCount = try_failure(errorCount, "Subtract... ", "(difference of identical Matrices is nonzero,\nSubsequent use of Subtract should be suspect)");
}
else
{
try_success("Subtract... ", "");
}
A = R.Copy();
A.SubtractEquals(R);
Z = new GeneralMatrix(A.RowDimension, A.ColumnDimension);
try
{
A.SubtractEquals(S);
errorCount = try_failure(errorCount, "SubtractEquals conformance check... ", "nonconformance not raised");
}
catch (System.ArgumentException e)
{
try_success("SubtractEquals conformance check... ", "");
System.Console.Out.WriteLine(e.Message);
}
if (A.Subtract(Z).Norm1() != 0.0)
{
errorCount = try_failure(errorCount, "SubtractEquals... ", "(difference of identical Matrices is nonzero,\nSubsequent use of Subtract should be suspect)");
}
else
{
try_success("SubtractEquals... ", "");
}
A = R.Copy();
B = GeneralMatrix.Random(A.RowDimension, A.ColumnDimension);
C = A.Subtract(B);
try
{
S = A.Add(S);
errorCount = try_failure(errorCount, "Add conformance check... ", "nonconformance not raised");
}
catch (System.ArgumentException e)
{
try_success("Add conformance check... ", "");
System.Console.Out.WriteLine(e.Message);
示例2: SubstractEquals
public void SubstractEquals()
{
A = R.Copy();
Assert.IsFalse(A.Norm1()==0.0);
A.SubtractEquals(R);
Assert.IsTrue(A.Norm1() == 0.0);
}