monolish  0.17.1
MONOlithic LInear equation Solvers for Highly-parallel architecture
Public Member Functions | Private Attributes | List of all members
monolish::view1D< TYPE, Float > Class Template Reference

1D view class More...

#include <monolish_view1D.hpp>

Collaboration diagram for monolish::view1D< TYPE, Float >:
Collaboration graph

Public Member Functions

Float * begin ()
 returns begin iterator (include offset) More...
 
Float * begin () const
 returns begin iterator (include offset) More...
 
Float * data ()
 returns a direct pointer to the vector (dont include offset) More...
 
Float * data () const
 returns a direct pointer to the original vector (dont include offset) More...
 
Float * end ()
 returns a end iterator More...
 
Float * end () const
 returns a end iterator More...
 
void fill (Float value)
 fill vector elements with a scalar value More...
 
size_t get_device_mem_stat () const
 true: sended, false: not send More...
 
size_t get_first () const
 get first position More...
 
size_t get_last () const
 get end position More...
 
size_t get_nnz () const
 get view1D size (same as size()) More...
 
size_t get_offset () const
 get first position (same as get_first()) More...
 
Float & operator[] (const size_t i)
 reference to the element at position More...
 
void print_all (bool force_cpu=false) const
 print all elements to standart I/O More...
 
void resize (size_t N)
 change last postion More...
 
void set_first (size_t i)
 change first position More...
 
void set_last (size_t i)
 change last position More...
 
size_t size () const
 get view1D size (end-start) More...
 
 view1D (matrix::Dense< Float > &A, const size_t start, const size_t end)
 create view1D(start:end) from Dense matrix More...
 
 view1D (tensor::tensor_Dense< Float > &A, const size_t start, const size_t end)
 create view1D(start:end) from Dense tensor More...
 
 view1D (vector< Float > &x, const size_t start, const size_t end)
 create view1D(start:end) from vector More...
 
 view1D (view1D< matrix::Dense< Float >, Float > &x, const size_t start, const size_t end)
 create view1D(start:end) from monolish::matrix::Dense More...
 
 view1D (view1D< tensor::tensor_Dense< Float >, Float > &x, const size_t start, const size_t end)
 create view1D(start:end) from monolish::tensor::tensor_Dense More...
 
 view1D (view1D< vector< Float >, Float > &x, const size_t start, const size_t end)
 create view1D(start:end) from monolish::vector More...
 

Private Attributes

size_t first
 
size_t last
 
size_t range
 
TYPE & target
 
Float * target_data
 

Detailed Description

template<typename TYPE, typename Float>
class monolish::view1D< TYPE, Float >

1D view class

Note
  • Multi-threading: true
  • GPU acceleration: true

Definition at line 46 of file monolish_view1D.hpp.

Constructor & Destructor Documentation

◆ view1D() [1/6]

template<typename TYPE , typename Float >
monolish::view1D< TYPE, Float >::view1D ( vector< Float > &  x,
const size_t  start,
const size_t  end 
)
inline

create view1D(start:end) from vector

Parameters
xvector
startstart position
endend position
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 65 of file monolish_view1D.hpp.

Here is the call graph for this function:

◆ view1D() [2/6]

template<typename TYPE , typename Float >
monolish::view1D< TYPE, Float >::view1D ( matrix::Dense< Float > &  A,
const size_t  start,
const size_t  end 
)
inline

create view1D(start:end) from Dense matrix

Parameters
ADense matrix
startstart position
endend position
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 82 of file monolish_view1D.hpp.

Here is the call graph for this function:

◆ view1D() [3/6]

template<typename TYPE , typename Float >
monolish::view1D< TYPE, Float >::view1D ( tensor::tensor_Dense< Float > &  A,
const size_t  start,
const size_t  end 
)
inline

create view1D(start:end) from Dense tensor

Parameters
ADense matrix
startstart position
endend position
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 100 of file monolish_view1D.hpp.

Here is the call graph for this function:

◆ view1D() [4/6]

template<typename TYPE , typename Float >
monolish::view1D< TYPE, Float >::view1D ( view1D< vector< Float >, Float > &  x,
const size_t  start,
const size_t  end 
)
inline

create view1D(start:end) from monolish::vector

Parameters
xview1D create from monolish::vector
startstart position (x.first + start)
endend position (x.last + end)
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 118 of file monolish_view1D.hpp.

Here is the call graph for this function:

◆ view1D() [5/6]

template<typename TYPE , typename Float >
monolish::view1D< TYPE, Float >::view1D ( view1D< matrix::Dense< Float >, Float > &  x,
const size_t  start,
const size_t  end 
)
inline

create view1D(start:end) from monolish::matrix::Dense

Parameters
xview1D create from monolish::matrix::Dense
startstart position (x.first + start)
endend position (x.last + end)
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 136 of file monolish_view1D.hpp.

Here is the call graph for this function:

◆ view1D() [6/6]

template<typename TYPE , typename Float >
monolish::view1D< TYPE, Float >::view1D ( view1D< tensor::tensor_Dense< Float >, Float > &  x,
const size_t  start,
const size_t  end 
)
inline

create view1D(start:end) from monolish::tensor::tensor_Dense

Parameters
xview1D create from monolish::tensor::tensor_Dense
startstart position (x.first + start)
endend position (x.last + end)
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 155 of file monolish_view1D.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ begin() [1/2]

template<typename TYPE , typename Float >
Float* monolish::view1D< TYPE, Float >::begin ( )
inline

returns begin iterator (include offset)

Returns
A pointer to the first element
Note
  • # of computation: 1

Definition at line 264 of file monolish_view1D.hpp.

Here is the call graph for this function:

◆ begin() [2/2]

template<typename TYPE , typename Float >
Float* monolish::view1D< TYPE, Float >::begin ( ) const
inline

returns begin iterator (include offset)

Returns
A pointer to the first element
Note
  • # of computation: 1

Definition at line 256 of file monolish_view1D.hpp.

Here is the call graph for this function:

◆ data() [1/2]

template<typename TYPE , typename Float >
Float* monolish::view1D< TYPE, Float >::data ( )
inline

returns a direct pointer to the vector (dont include offset)

Returns
A pointer to the first element
Note
  • # of computation: 1

Definition at line 248 of file monolish_view1D.hpp.

◆ data() [2/2]

template<typename TYPE , typename Float >
Float* monolish::view1D< TYPE, Float >::data ( ) const
inline

returns a direct pointer to the original vector (dont include offset)

Returns
A pointer to the first element
Note
  • # of computation: 1

Definition at line 240 of file monolish_view1D.hpp.

◆ end() [1/2]

template<typename TYPE , typename Float >
Float* monolish::view1D< TYPE, Float >::end ( )
inline

returns a end iterator

Returns
end iterator
Note
  • # of computation: 1

Definition at line 280 of file monolish_view1D.hpp.

◆ end() [2/2]

template<typename TYPE , typename Float >
Float* monolish::view1D< TYPE, Float >::end ( ) const
inline

returns a end iterator

Returns
end iterator
Note
  • # of computation: 1

Definition at line 272 of file monolish_view1D.hpp.

Here is the caller graph for this function:

◆ fill()

template<typename TYPE , typename Float >
void monolish::view1D< TYPE, Float >::fill ( Float  value)

fill vector elements with a scalar value

Parameters
valuescalar value
Note
  • # of computation: N
  • Multi-threading: true
  • GPU acceleration: true

◆ get_device_mem_stat()

template<typename TYPE , typename Float >
size_t monolish::view1D< TYPE, Float >::get_device_mem_stat ( ) const
inline

true: sended, false: not send

Returns
gpu status
Note
  • # of data transfer: 0
  • Multi-threading: false
  • GPU acceleration: true

Definition at line 229 of file monolish_view1D.hpp.

◆ get_first()

template<typename TYPE , typename Float >
size_t monolish::view1D< TYPE, Float >::get_first ( ) const
inline

get first position

Returns
first position
Note
  • # of computation: 1

Definition at line 186 of file monolish_view1D.hpp.

◆ get_last()

template<typename TYPE , typename Float >
size_t monolish::view1D< TYPE, Float >::get_last ( ) const
inline

get end position

Returns
end position
Note
  • # of computation: 1

Definition at line 194 of file monolish_view1D.hpp.

◆ get_nnz()

template<typename TYPE , typename Float >
size_t monolish::view1D< TYPE, Float >::get_nnz ( ) const
inline

get view1D size (same as size())

Returns
view1D size
Note
  • # of computation: 1

Definition at line 178 of file monolish_view1D.hpp.

◆ get_offset()

template<typename TYPE , typename Float >
size_t monolish::view1D< TYPE, Float >::get_offset ( ) const
inline

get first position (same as get_first())

Returns
first position
Note
  • # of computation: 1

Definition at line 202 of file monolish_view1D.hpp.

Here is the caller graph for this function:

◆ operator[]()

template<typename TYPE , typename Float >
Float& monolish::view1D< TYPE, Float >::operator[] ( const size_t  i)
inline

reference to the element at position

Parameters
iPosition of an element in the vector
Returns
vector element (v[i])
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 316 of file monolish_view1D.hpp.

◆ print_all()

template<typename TYPE , typename Float >
void monolish::view1D< TYPE, Float >::print_all ( bool  force_cpu = false) const

print all elements to standart I/O

Parameters
force_cpuIgnore device status and output CPU data
Note
  • # of computation: end-start
  • Multi-threading: false
  • GPU acceleration: true (doesn't work in parallel)

◆ resize()

template<typename TYPE , typename Float >
void monolish::view1D< TYPE, Float >::resize ( size_t  N)
inline

change last postion

Parameters
Nvector length
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: true
Warning
Cannot be resized beyond the range of the referenced vector

Definition at line 302 of file monolish_view1D.hpp.

◆ set_first()

template<typename TYPE , typename Float >
void monolish::view1D< TYPE, Float >::set_first ( size_t  i)
inline

change first position

Note
  • # of computation: 1

Definition at line 209 of file monolish_view1D.hpp.

◆ set_last()

template<typename TYPE , typename Float >
void monolish::view1D< TYPE, Float >::set_last ( size_t  i)
inline

change last position

Note
  • # of computation: 1

Definition at line 216 of file monolish_view1D.hpp.

◆ size()

template<typename TYPE , typename Float >
size_t monolish::view1D< TYPE, Float >::size ( ) const
inline

get view1D size (end-start)

Returns
view1D size
Note
  • # of computation: 1

Definition at line 170 of file monolish_view1D.hpp.

Member Data Documentation

◆ first

template<typename TYPE , typename Float >
size_t monolish::view1D< TYPE, Float >::first
private

Definition at line 50 of file monolish_view1D.hpp.

◆ last

template<typename TYPE , typename Float >
size_t monolish::view1D< TYPE, Float >::last
private

Definition at line 51 of file monolish_view1D.hpp.

◆ range

template<typename TYPE , typename Float >
size_t monolish::view1D< TYPE, Float >::range
private

Definition at line 52 of file monolish_view1D.hpp.

◆ target

template<typename TYPE , typename Float >
TYPE& monolish::view1D< TYPE, Float >::target
private

Definition at line 48 of file monolish_view1D.hpp.

◆ target_data

template<typename TYPE , typename Float >
Float* monolish::view1D< TYPE, Float >::target_data
private

Definition at line 49 of file monolish_view1D.hpp.


The documentation for this class was generated from the following files: