public void SetColumn() { var m1 = new ColumnWiseMatrix(10, 5, 1.2345f); m1.Print(); DeviceManager.CheckDeviceSanity(); var _m1 = m1.Get <float>(); var v1 = new Vector(10, 2.3456f); v1.Print(); DeviceManager.CheckDeviceSanity(); var _v1 = v1.Get <float>(); m1.Set(v1, 3); for (int j = 0; j < m1.nCols; ++j) { var col = m1.Get <float>(j); DeviceManager.CheckDeviceSanity(); Assert.AreEqual(col.Count, m1.nRows); if (j != 3) { for (int i = 0; i < m1.nRows; ++i) { Assert.IsTrue(Math.Abs(col[i] - _m1[i + m1.nRows * j]) <= 1e-7); } } else { for (int i = 0; i < m1.nRows; ++i) { Assert.IsTrue(Math.Abs(col[i] - _v1[i]) <= 1e-7); } } } }