/// <summary>
        /// <para>�w�肳�ꂽ1�����z���C�w�肳�ꂽ�s��`���ŃR�s�[����D</para>
        /// <para>�z��̃T�C�Y�ƁurowSize * columnSize�v�͈�v���Ȃ���΂Ȃ�Ȃ��D</para>
        /// </summary>
        /// <param name="body">�R�s�[�����z��</param>
        /// <param name="rowcolSize">�s��=��</param>
        /// <param name="subdiaSize">subdiagonal�̃T�C�Y</param>
        /// <param name="superdiaSize">superdiagonal�̃T�C�Y</param>
        /// <returns>�R�s�[��̎��g�ւ̎Q��</returns>
        internal virtual MyComplexBandMatrix CopyFrom(Complex[] body, int rowcolSize, int subdiaSize, int superdiaSize)
        {
            int rsize = subdiaSize * 2 + superdiaSize + 1;
            int csize = rowcolSize;

            // ���͂̌���
            System.Diagnostics.Debug.Assert(body.Length == rsize * csize);
            if (body.Length != rsize * csize)
            {
                return this;
            }

            // �o�b�t�@�m��
            if (this._rsize == rsize && this._csize == csize)
            {
            }
            else if (this._body != null && this._body.Length == rsize * csize)
            {
                this._rsize = rsize;
                this._csize = csize;
            }
            else
            {
                base.Resize(rsize, csize);
            }
            this._rowcolSize = rowcolSize;
            this._subdiaSize = subdiaSize;
            this._superdiaSize = superdiaSize;

            // �R�s�[
            body.CopyTo(this._body, 0);
            return this;
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the Vector class that contains elements
        /// copied from the specified array.
        /// </summary>
        /// <param name="type">The vector type</param>
        /// <param name="data">The array whose elements are copied to the vector.</param>
        public ComplexVector(VectorType type, Complex[] data)
        {
            if (data.Length < 1) throw new System.ArgumentException("data.Length < 1");
            this._Type = type;
            this._Data = new Complex[data.Length];

            data.CopyTo(this._Data, 0);

            //for (int i = 0; i < data.Length; i++)
            //{
            //    this.MeData[i] = data[i];
            //}
        }
        /// <summary>
        /// <para>�w�肳�ꂽ1�����z���C�w�肳�ꂽ�s��`���ŃR�s�[����D</para>
        /// <para>�z��̃T�C�Y�ƁurowSize * columnSize�v�͈�v���Ȃ���΂Ȃ�Ȃ��D</para>
        /// </summary>
        /// <param name="body">�R�s�[�����z��</param>
        /// <param name="rowSize">�s��</param>
        /// <param name="columnSize">��</param>
        /// <returns>�R�s�[��̎��g�ւ̎Q��</returns>
        internal virtual MyComplexMatrix CopyFrom(Complex[] body, int rowSize, int columnSize)
        {
            // ���͂̌���
            System.Diagnostics.Debug.Assert(body.Length == rowSize * columnSize);
            if (body.Length != rowSize * columnSize)
            {
                return this;
            }

            // �o�b�t�@�m��
            if (this._rsize == rowSize && this._csize == columnSize)
            {
                // ������Ȃ�
            }
            else if (this._body != null && this._body.Length == rowSize * columnSize)
            {
                this._rsize = rowSize;
                this._csize = columnSize;
            }
            else
            {
                Resize(rowSize, columnSize);
            }

            // �R�s�[
            body.CopyTo(this._body, 0);
            return this;
        }
        private static void VerifyMatchesNaiveComplex(
            Complex[] samples,
            double maximumError,
            Func<Complex[], Complex[]> naive,
            Action<Complex[]> fast)
        {
            var spectrumNaive = naive(samples);

            var spectrumFast = new Complex[samples.Length];
            samples.CopyTo(spectrumFast, 0);
            fast(spectrumFast);

            AssertHelpers.AlmostEqualList(spectrumNaive, spectrumFast, maximumError);
        }