C++
C#
VB
JScript
All

External Function shift


Copyright (C) 2005 IENT-RWTH Aachen

template<class G> inline typename shiftArray<      Vector<G> >::self shift(      Vector<G> &X, const typename Vector<G>::index_type &p)
template<class G> inline typename shiftArray<const Vector<G> >::self shift(const Vector<G> &X, const typename Vector<G>::index_type &p)
template<class G> inline typename shiftArray<      Matrix<G> >::self shift(      Matrix<G> &X, const typename Matrix<G>::index_type &p)
template<class G> inline typename shiftArray<const Matrix<G> >::self shift(const Matrix<G> &X, const typename Matrix<G>::index_type &p)
template<class G> inline typename shiftArray<      Matrix<G> >::self shift(      Matrix<G> &X, const typename Matrix<G>::int_type   &i)
template<class G> inline typename shiftArray<const Matrix<G> >::self shift(const Matrix<G> &X, const typename Matrix<G>::int_type   &i)
template<class G> inline typename shiftArray<      Matrix<G> >::self shift(      Matrix<G> &X, const typename Matrix<G>::int_type   &i, const typename Matrix<G>::int_type   &j)
template<class G> inline typename shiftArray<const Matrix<G> >::self shift(const Matrix<G> &X, const typename Matrix<G>::int_type   &i, const typename Matrix<G>::int_type   &j)

Shifts the indexes

Parameters

p

The offset to use

X

The array to shift

i

The vertical offset to use

j

The horizontal offset to use

Returns

An array representing the shifted array

Example

DenseVector<int>::self X(4, "0 1 2 3");
cout << shift(X,-1)[-1] << endl; // 0
cout << shift(X,-1)[ 0] << endl; // 1
DenseMatrix<int>::self X(4,4, "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15");
cout << shift(X,-1,-1)(-1,-1) << endl; // 0
cout << shift(X,-1,-1)( 0, 0) << endl; // 5

See Also

middle_shift, no_shift