public void ShouldThrowOutOfRange()
        {
            var acceleratedArray = new HarewareAcceleratedArray <float>(tenFloats);

            float x;

            Assert.Throws <ArgumentOutOfRangeException>(() => x = acceleratedArray[-1]);
            Assert.Throws <ArgumentOutOfRangeException>(() => x = acceleratedArray[10]);
        }
        public void ShouldConstructWithSixInputFloats()
        {
            var acceleratedArray = new HarewareAcceleratedArray <float>(sixFloats);

            Assert.AreEqual(sixFloats[0], acceleratedArray[0]);
            Assert.AreEqual(sixFloats[1], acceleratedArray[1]);
            Assert.AreEqual(sixFloats[2], acceleratedArray[2]);
            Assert.AreEqual(sixFloats[3], acceleratedArray[3]);
            Assert.AreEqual(sixFloats[4], acceleratedArray[4]);
            Assert.AreEqual(sixFloats[5], acceleratedArray[5]);
        }
        public void ShouldConstructWithTenInputFloats()
        {
            var acceleratedArray = new HarewareAcceleratedArray <float>(tenFloats);

            Assert.AreEqual(tenFloats[0], acceleratedArray[0]);
            Assert.AreEqual(tenFloats[1], acceleratedArray[1]);
            Assert.AreEqual(tenFloats[2], acceleratedArray[2]);
            Assert.AreEqual(tenFloats[3], acceleratedArray[3]);
            Assert.AreEqual(tenFloats[4], acceleratedArray[4]);
            Assert.AreEqual(tenFloats[5], acceleratedArray[5]);
            Assert.AreEqual(tenFloats[6], acceleratedArray[6]);
            Assert.AreEqual(tenFloats[7], acceleratedArray[7]);
            Assert.AreEqual(tenFloats[8], acceleratedArray[8]);
            Assert.AreEqual(tenFloats[9], acceleratedArray[9]);
        }
        public static HarewareAcceleratedArray <T> operator +(HarewareAcceleratedArray <T> left, HarewareAcceleratedArray <T> right)
        {
            var sumArray = new HarewareAcceleratedArray <T>(left.values.Length, left.Count);
            var j        = 0;

            for (var i = 0; i < left.values.Length; i++)
            {
                sumArray.values[j++] = left.values[i] + right.values[i];
            }
//            var enumerable = left.values.Zip(right.values, (l, r) => l + r);
//            foreach (var vector in enumerable) {
//                sumArray.values.Add(vector);
//            }
            return(sumArray);
        }
        public void ShouldAddArrays()
        {
            var one = new HarewareAcceleratedArray <float>(tenFloats);
            var two = new HarewareAcceleratedArray <float>(tenFloats);

            var three = one + two;

            Assert.AreEqual(tenFloats[0] + tenFloats[0], three[0]);
            Assert.AreEqual(tenFloats[1] + tenFloats[1], three[1]);
            Assert.AreEqual(tenFloats[2] + tenFloats[2], three[2]);
            Assert.AreEqual(tenFloats[3] + tenFloats[3], three[3]);
            Assert.AreEqual(tenFloats[4] + tenFloats[4], three[4]);
            Assert.AreEqual(tenFloats[5] + tenFloats[5], three[5]);
            Assert.AreEqual(tenFloats[6] + tenFloats[6], three[6]);
            Assert.AreEqual(tenFloats[7] + tenFloats[7], three[7]);
            Assert.AreEqual(tenFloats[8] + tenFloats[8], three[8]);
            Assert.AreEqual(tenFloats[9] + tenFloats[9], three[9]);
        }