예제 #1
0
 vector_slice<VectorType> project(VectorType & vec, viennacl::slice const & s1)
 {
   assert(s1.size() <= vec.size() && bool("Size of slice larger than vector size!"));
   return vector_slice<VectorType>(vec, s1);
 }
예제 #2
0
 vector_slice<VectorType> project(viennacl::vector_range<VectorType> & vec, viennacl::slice const & s1)
 {
   assert(s1.size() <= vec.size() && bool("Size of slice larger than vector proxy!"));
   return vector_slice<VectorType>(vec, viennacl::range(vec.start() + s1.start(), s1.stride(), s1.size()));
 }
예제 #3
0
matrix_slice<MatrixType> project(matrix_slice<MatrixType> const & A, viennacl::slice const & r1, viennacl::slice const & r2)
{
  assert(r1.size() <= A.size1() && r2.size() <= A.size2() && bool("Size of slice invalid!"));

  return matrix_slice<MatrixType>(A, r1, r2);
}