Ejemplo n.º 1
0
        public FVec GetChannel(uint channel)
        {
            ThrowIfDisposed();

            using (var output = new FVec(Length))
            {
                NativeMethods.fmat_get_channel(this, channel, output);

                var target = new FVec(output.Length);

                output.Copy(target);

                return(target);
            }
        }
Ejemplo n.º 2
0
        public void Copy([NotNull] FVec target)
        {
            ThrowIfDisposed();

            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            if (target.Length != Length)
            {
                throw new ArgumentOutOfRangeException(nameof(target));
            }

            NativeMethods.fvec_copy(this, target);
        }
Ejemplo n.º 3
0
        public void WeightedCopy([NotNull] FVec weight, [NotNull] FVec target)
        {
            ThrowIfDisposed();

            if (weight == null)
            {
                throw new ArgumentNullException(nameof(weight));
            }

            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            NativeMethods.fvec_weighted_copy(this, weight, target);
        }
Ejemplo n.º 4
0
        public FVec VecMul([NotNull] FVec scale)
        {
            ThrowIfDisposed();

            if (scale == null)
            {
                throw new ArgumentNullException(nameof(scale));
            }

            if (scale.Length != Length)
            {
                throw new ArgumentOutOfRangeException(nameof(scale));
            }

            var output = new FVec(Height);

            NativeMethods.fmat_vecmul(this, scale, output);

            return(output);
        }