コード例 #1
0
        // COLUMN COPY

        internal override void CopySubColumnToUnchecked(VectorStorage <T> target, int columnIndex,
                                                        int sourceRowIndex, int targetRowIndex, int rowCount, ExistingData existingData)
        {
            if (existingData == ExistingData.Clear)
            {
                target.Clear(targetRowIndex, rowCount);
            }

            if (columnIndex >= sourceRowIndex && columnIndex < sourceRowIndex + rowCount && columnIndex < Data.Length)
            {
                target.At(columnIndex - sourceRowIndex + targetRowIndex, Data[columnIndex]);
            }
        }
コード例 #2
0
ファイル: SparseVectorStorage.cs プロジェクト: Xornent/simula
        // VECTOR COPY

        internal override void CopyToUnchecked(VectorStorage <T> target, ExistingData existingData)
        {
            if (target is SparseVectorStorage <T> sparseTarget)
            {
                CopyToUnchecked(sparseTarget);
                return;
            }

            // FALL BACK

            if (existingData == ExistingData.Clear)
            {
                target.Clear();
            }

            if (ValueCount != 0)
            {
                for (int i = 0; i < ValueCount; i++)
                {
                    target.At(Indices[i], Values[i]);
                }
            }
        }