using System; using GP = Science.Physics.GeneralPhysics; namespace ScienceTest.PhysicsTest.GeneralPhysicsTest { /// /// TensorTest /// public class TensorTest { private string result; public string Result { get{return result;} } public TensorTest() { } public void Compute() { double[,] a = new double[3,3]{ {1.2,1.4,2.3}, {2.3,3.4,2.4}, {1.2,4.5,2.4}}; GP.Tensor t = new GP.Tensor(); t.XX = a[0, 0]; t.XY = a[0, 1]; t.XZ = a[0, 2]; t.YX = a[1, 0]; t.YY = a[1, 1]; t.YZ = a[1, 2]; t.ZX = a[2, 0]; t.ZY = a[2, 1]; t.ZZ = a[2, 2]; GP.Tensor i = t.Inverse; GP.Tensor r = t*i; result+=r.ToString(); } } } /* 1 +/- 0 +2.22044604925031E-16 +/- 0 +0 +/- 0 0 +/- 0 +1 +/- 0 -5.55111512312578E-17 +/- 0 -2.22044604925031E-16 +/- 0 +2.22044604925031E-16 +/- 0 +1 +/- 0 */