mgcpp
A C++ Math Library Based on CUDA
include
mgcpp
matrix
column_view.hpp
Go to the documentation of this file.
1
2
// Copyright RedPortal, mujjingun 2017 - 2018.
3
// Distributed under the Boost Software License, Version 1.0.
4
// (See accompanying file LICENSE or copy at
5
// http://www.boost.org/LICENSE_1_0.txt)
6
7
#ifndef _MGCPP_MATRIX_COLUMN_VIEW_HPP_
8
#define _MGCPP_MATRIX_COLUMN_VIEW_HPP_
9
10
#include <
mgcpp/context/thread_context.hpp
>
11
#include <
mgcpp/matrix/dense_matrix.hpp
>
12
#include <
mgcpp/vector/dense_vector.hpp
>
13
14
#include <cstdlib>
15
#include <initializer_list>
16
17
namespace
mgcpp
{
18
template
<
typename
DenseMat,
typename
Type>
19
class
column_view
:
public
dense_vector
<column_view<DenseMat, Type>, Type> {
20
public
:
21
using
this_type
=
column_view<DenseMat, Type>
;
22
using
value_type
= Type;
23
using
result_type
=
this_type
;
24
using
allocator_type
=
typename
DenseMat::allocator_type;
25
26
private
:
27
DenseMat* _matrix;
28
size_t
_column_idx;
29
allocator_type
_allocator;
30
31
public
:
32
inline
column_view
() =
delete
;
33
34
inline
~column_view
() =
default
;
35
36
inline
column_view
(
dense_matrix<DenseMat, Type>
& mat,
size_t
i) noexcept;
37
38
inline
column_view
(
column_view<DenseMat, Type>
const
& other) =
delete
;
39
40
inline
column_view
(
column_view<DenseMat, Type>
&& other) noexcept;
41
42
inline
column_view<DenseMat, Type>
&
operator=
(
43
column_view<DenseMat, Type>
const
& other);
44
45
inline
column_view<DenseMat, Type>
&
operator=
(
46
column_view<DenseMat, Type>
&& other) noexcept;
47
48
inline
column_view<DenseMat, Type>
&
operator=
(
49
std::initializer_list<Type>
const
&
init
);
50
51
template
<
typename
DenseVec>
52
inline
column_view<DenseMat, Type>
&
operator=
(
53
dense_vector<DenseVec, Type>
const
& vec);
54
55
inline
void
copy_to_host
(Type* host_p)
const
;
56
57
inline
Type
check_value
(
size_t
i)
const
;
58
59
inline
Type
const
*
data
() const noexcept;
60
61
inline Type*
data_mutable
() noexcept;
62
63
inline
thread_context
*
context
() const noexcept;
64
65
inline
size_t
shape
() const noexcept;
66
};
67
}
// namespace mgcpp
68
69
#include <mgcpp/matrix/column_view.tpp>
70
#endif
mgcpp
Definition:
adapter_base.hpp:12
dense_vector.hpp
mgcpp::thread_context
Definition:
thread_context.hpp:20
mgcpp::column_view::check_value
Type check_value(size_t i) const
mgcpp::column_view::column_view
column_view()=delete
mgcpp::column_view::~column_view
~column_view()=default
mgcpp::column_view
Definition:
column_view.hpp:19
dense_matrix.hpp
mgcpp::dense_vector
Definition:
dense_vector.hpp:15
mgcpp::shape
Definition:
shape.hpp:10
mgcpp::column_view::this_type
column_view< DenseMat, Type > this_type
Definition:
column_view.hpp:21
mgcpp::column_view::context
thread_context * context() const noexcept
mgcpp::column_view::data
Type const * data() const noexcept
mgcpp::dense_matrix
Definition:
dense_matrix.hpp:15
mgcpp::column_view::value_type
Type value_type
Definition:
column_view.hpp:22
mgcpp::column_view::copy_to_host
void copy_to_host(Type *host_p) const
mgcpp::column_view::operator=
column_view< DenseMat, Type > & operator=(column_view< DenseMat, Type > const &other)
mgcpp::column_view::allocator_type
typename DenseMat::allocator_type allocator_type
Definition:
column_view.hpp:24
mgcpp::init
void init(bool print_system_info=true)
mgcpp::column_view::data_mutable
Type * data_mutable() noexcept
thread_context.hpp
Generated by
1.8.13