public static void LoadImageDataset <T>(string path, out IEnumerable <Matrix <T> > images, out IEnumerable <IEnumerable <MModRect> > boxes)
            where T : struct
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }
            if (!File.Exists(path))
            {
                throw new FileNotFoundException("", path);
            }

            var str = Encoding.UTF8.GetBytes(path);

            using (var matrix = new Matrix <T>())
                using (var retImages = new VectorOfMatrix <T>())
                    using (var retBoxes = new VectorOfVectorMModRect())
                    {
                        var type = matrix.MatrixElementType.ToNativeMatrixElementType();
                        var ret  = Native.load_image_dataset(type, retImages.NativePtr, retBoxes.NativePtr, str);
                        if (ret == Native.ErrorType.ElementTypeNotSupport)
                        {
                            throw new ArgumentException($"{type} is not supported.");
                        }

                        images = retImages.ToArray();
                        boxes  = retBoxes.ToArray().Select(box => box.ToArray()).ToList();
                    }
        }
        public void CreateWithSize()
        {
            const int size   = 10;
            var       vector = new VectorOfMatrix <int>(size);

            this.DisposeAndCheckDisposedState(vector);
        }
        public void CreateWithCollection()
        {
            const int size   = 10;
            var       source = Enumerable.Range(0, size).Select(i => new Matrix <int>(i, i));
            var       vector = new VectorOfMatrix <int>(source);

            Assert.AreEqual(vector.Size, size);
            var ret = vector.ToArray();

            for (var i = 0; i < size; i++)
            {
                Assert.AreEqual(ret[i].Rows, i);
                Assert.AreEqual(ret[i].Columns, i);
            }
            this.DisposeAndCheckDisposedState(vector);
        }
        public void Create()
        {
            var vector = new VectorOfMatrix <int>();

            this.DisposeAndCheckDisposedState(vector);
        }