public void TestAlpha() { var a = new double[, ] { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; var b = new double[, ] { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } }; var c = new double[, ] { { 1, double.NaN, 2 }, { 1, double.NaN, 2 }, { 1, double.NaN, 2 } }; LinearSpace <double> .op_Addition(a, b).Deco().Says("a + b"); LinearSpace <double> .op_Division(a, b).Deco().Says("a / b"); LinearSpace <double> .op_Multiply(a, c).Deco().Says("a * c"); LinearSpace <double> .op_Division(a, c).Deco().Says("a / c"); }
public void VectorToVectorTest() { var a = new double[] { 1, 2, 3 }; var b = new double[] { 10, 20, 30 }; var z = LinearSpace <double> .op_Multiply(a, b); z.Deco().Says("vector-to-vector"); }
public void VectorToPointTest() { var a = new double[] { 1, 2, 3 }; var b = 2D; var z = LinearSpace <double> .op_Multiply(a, b); z.Deco().Says("vector-to-point"); }
public void MatrixToMatrixTest() { var a = new double[, ] { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; var b = new double[, ] { { 10, 0, 0 }, { 0, 20, 0 }, { 0, 0, 30 } }; var z = LinearSpace <double> .op_Multiply(a, b); z.Deco().Says("matrix-to-matrix"); }