/// <summary> /// Wraps a set of <see cref="DataColumn" />s into a readonly matrix so that the matrix columns corresponds to the <see cref="DataColumn" />s But the first column consists of elements with a numerical value of 1. The number of columns /// of the resulting matrix is therefore 1 greater than the number of data columns in the argument. /// </summary> /// <param name="collection">Collection of <see cref="DataColumn" />s.</param> /// <param name="selectedColumns">Set set of indices into the collection that are part of the matrix. You can subsequently change this parameter without affecting this wrapper.</param> /// <param name="selectedRows">The set of rows that are part of the matrix. This collection will be cloned here, i.e. you can subsequently change it without affecting this wrapper.</param> /// <returns>The wrapping read only matrix.</returns> /// <remarks>This type of wrapper is usefull for instance for fitting purposes, where an intercept is needed.</remarks> public static IROMatrix ToROColumnMatrixWithIntercept(Altaxo.Data.DataColumnCollection collection, Altaxo.Collections.IAscendingIntegerCollection selectedColumns, Altaxo.Collections.IAscendingIntegerCollection selectedRows) { return(new InterceptPlusDataColumnToColumnROMatrixWrapper(collection, selectedColumns, (IAscendingIntegerCollection)selectedRows.Clone())); }
/// <summary> /// Wrapps a set of <see cref="DataColumn" />s into a writeable matrix so that the matrix rows corresponds to the <see cref="DataColumn" />s. /// </summary> /// <param name="collection">DataColumnCollection from which to select the data columns that are part of the matrix by their indices.</param> /// <param name="selectedColumns">The indices of the data columns in the collection that are part of the matrix. You can subsequently change this parameter without affecting this wrapper.</param> /// <param name="selectedRows">Selected rows of the data table that participate in the matrix. Remember that this are the columns of the wrapped matrix. This collection will be cloned here, i.e. you can subsequently change it without affecting this wrapper.</param> public static IMatrix ToRowMatrix(Altaxo.Data.DataColumnCollection collection, Altaxo.Collections.IAscendingIntegerCollection selectedColumns, Altaxo.Collections.IAscendingIntegerCollection selectedRows) { return(new DataColumnToRowMatrixWrapper(collection, selectedColumns, (IAscendingIntegerCollection)selectedRows.Clone())); }
/// <summary> /// Wraps a set of <see cref="DataColumn" />s into a readonly matrix so that the matrix columns corresponds to the <see cref="DataColumn" />s. /// </summary> /// <param name="collection">Collection of <see cref="DataColumn" />s.</param> /// <param name="selectedColumns">Set set of indices into the collection that are part of the matrix. You can subsequently change this parameter without affecting this wrapper.</param> /// <param name="selectedRows">The set of rows that are part of the matrix. This collection will be cloned here, i.e. you can subsequently change it without affecting this wrapper.</param> /// <returns>The wrapping read only matrix.</returns> public static IROMatrix <double> ToROColumnMatrix(Altaxo.Data.INumericColumn[] collection, Altaxo.Collections.IAscendingIntegerCollection selectedColumns, Altaxo.Collections.IAscendingIntegerCollection selectedRows) { return(new DataColumnToColumnROMatrixWrapper(collection, selectedColumns, (IAscendingIntegerCollection)selectedRows.Clone())); }