/// Copy a column into a GSLVector /// @param i :: A column index. GSLVector GSLMatrix::copyColumn(size_t i) const { if (i >= size2()) { throw std::out_of_range("GSLMatrix column index is out of range."); } auto columnView = gsl_matrix_const_column(gsl(), i); return GSLVector(&columnView.vector); }
/// Copy a row into a GSLVector /// @param i :: A row index. GSLVector GSLMatrix::copyRow(size_t i) const { if (i >= size1()) { throw std::out_of_range("GSLMatrix row index is out of range."); } auto rowView = gsl_matrix_const_row(gsl(), i); return GSLVector(&rowView.vector); }
/// Create a new GSLVector and move all data to it. Destroys this vector. GSLVector GSLVector::move() { return GSLVector(std::move(m_data)); }