コード例 #1
0
ファイル: tensor.hpp プロジェクト: boostorg/ublas
	/** @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_);
		}
	}
コード例 #2
0
ファイル: vector_map.hpp プロジェクト: Cultrarius/libosmium
 void dump_as_list(const int fd) final {
     osmium::io::detail::reliable_write(fd, reinterpret_cast<const char*>(m_vector.data()), byte_size());
 }
コード例 #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; 
 }
コード例 #4
0
 static int stride (vector_type& vr) {
   return vector_traits<v_type>::stride (vr.data()); 
 }
コード例 #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()); 
 }
コード例 #6
0
 static pointer storage (vector_type& v) { return v.data(); }
コード例 #7
0
 static int stride (vector_type& vs) {
   return vs.stride() * vector_traits<v_type>::stride (vs.data()); 
 }
コード例 #8
0
ファイル: ublas_vector.hpp プロジェクト: SemiSQ/OpenModelica
 static std::ptrdiff_t stride (vector_type& vr) {
   return vector_traits<v_type>::stride (vr.data()); 
 }
コード例 #9
0
ファイル: ublas_vector.hpp プロジェクト: SemiSQ/OpenModelica
 static std::ptrdiff_t stride (vector_type& vs) {
   return vs.stride() * vector_traits<v_type>::stride (vs.data()); 
 }