extract
template<class G> inline typename extractArray< Vector<G> >::self extract( Vector<G> &X)
template<class G> inline typename extractArray< Matrix<G> >::self extract( Matrix<G> &X)
template<class G> inline typename extractArray<const Vector<G> >::self extract(const Vector<G> &X)
template<class G> inline typename extractArray<const Matrix<G> >::self extract(const Matrix<G> &X)
template<class G> inline typename extractArray< Vector<G> >::self extract( Vector<G> &X, const typename Vector<G>::index_type &p)
template<class G> inline typename extractArray< Matrix<G> >::self extract( Matrix<G> &X, const typename Matrix<G>::index_type &p)
template<class G> inline typename extractArray<const Vector<G> >::self extract(const Vector<G> &X, const typename Vector<G>::index_type &p)
template<class G> inline typename extractArray<const Matrix<G> >::self extract(const Matrix<G> &X, const typename Matrix<G>::index_type &p)
template<class G> inline typename extractArray< Vector<G> >::self extract( Vector<G> &X, const typename Vector<G>::index_type &p, const typename Vector<G>::size_type &s)
template<class G> inline typename extractArray< Matrix<G> >::self extract( Matrix<G> &X, const typename Matrix<G>::index_type &p, const typename Matrix<G>::size_type &s)
template<class G> inline typename extractArray<const Vector<G> >::self extract(const Vector<G> &X, const typename Vector<G>::index_type &p, const typename Vector<G>::size_type &s)
template<class G> inline typename extractArray<const Matrix<G> >::self extract(const Matrix<G> &X, const typename Matrix<G>::index_type &p, const typename Matrix<G>::size_type &s)
template<class G> inline typename extractArray< Matrix<G> >::self extract( Matrix<G> &X, typename Matrix<G>::int_type pi, typename Matrix<G>::int_type pj)
template<class G> inline typename extractArray<const Matrix<G> >::self extract(const Matrix<G> &X, typename Matrix<G>::int_type pi, typename Matrix<G>::int_type pj)
template<class G> inline typename extractArray< Matrix<G> >::self extract( Matrix<G> &X, typename Matrix<G>::int_type pi, typename Matrix<G>::int_type pj, typename Matrix<G>::size_type s)
template<class G> inline typename extractArray<const Matrix<G> >::self extract(const Matrix<G> &X, typename Matrix<G>::int_type pi, typename Matrix<G>::int_type pj, typename Matrix<G>::size_type s)
template<class G> inline typename extractArray< Matrix<G> >::self extract( Matrix<G> &X, typename Matrix<G>::int_type pi, typename Matrix<G>::int_type pj, typename Matrix<G>::int_type si, typename Matrix<G>::int_type sj)
template<class G> inline typename extractArray<const Matrix<G> >::self extract(const Matrix<G> &X, typename Matrix<G>::int_type pi, typename Matrix<G>::int_type pj, typename Matrix<G>::int_type si, typename Matrix<G>::int_type sj)
Gives a part of an array
Parameters
p | Start position of the part |
s | Size of the part |
X | The array to cut out |
pi | Vertical start position of the part |
pj | Horizontal start position of the part |
si | Height of the part |
sj | Width of the part |
Returns
An array representing the part.
Remarks
This function differs from the function sub, so that each element of the extracted array has the same index position of its origin array. Because of this, the extracted array has to be handled carefully. In some cases the use of extract can be quicker than sub, because the library does not recalculate the indexes.
Example
DenseVector<int>::self X(5,"1 2 3 4 5"); extract(X,2,3)[2] = 0; // X=[1 2 0 4 5];
See Also