Example #1
0
	/** @brief Constructs a tensor using a \c vector
	 *
	 * @note It is assumed that vector is column vector
	 * @note Initially the tensor will be one-dimensional.
	 *
	 *  @param v vector to be copied.
	 */
	BOOST_UBLAS_INLINE
	tensor (const vector_type &v)
		: tensor_expression_type<self_type>()
		, extents_ ()
		, strides_ ()
		, data_    (v.data())
	{
		if(!data_.empty()){
			extents_ = extents_type{data_.size(),1};
			strides_ = strides_type(extents_);
		}
	}
Example #2
0
 void dump_as_list(const int fd) final {
     osmium::io::detail::reliable_write(fd, reinterpret_cast<const char*>(m_vector.data()), byte_size());
 }
Example #3
0
 static pointer storage (vector_type& vr) {
   pointer ptr = vector_traits<v_type>::storage (vr.data()); 
   ptr += vr.start() * vector_traits<v_type>::stride (vr.data());
   return ptr; 
 }
Example #4
0
 static int stride (vector_type& vr) {
   return vector_traits<v_type>::stride (vr.data()); 
 }
Example #5
0
 static pointer storage (vector_type& v) {
   typedef typename detail::generate_const<V,ArrT>::type array_type ;
   return vector_traits<array_type>::storage (v.data()); 
 }
Example #6
0
 static pointer storage (vector_type& v) { return v.data(); }
Example #7
0
 static int stride (vector_type& vs) {
   return vs.stride() * vector_traits<v_type>::stride (vs.data()); 
 }
Example #8
0
 static std::ptrdiff_t stride (vector_type& vr) {
   return vector_traits<v_type>::stride (vr.data()); 
 }
Example #9
0
 static std::ptrdiff_t stride (vector_type& vs) {
   return vs.stride() * vector_traits<v_type>::stride (vs.data()); 
 }