monolish  0.14.0
MONOlithic LIner 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_coo.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)
 refetrence to the element at position More...
 
void print_all (bool force_cpu) const
 
void print_all (bool force_cpu) const
 
void print_all (bool force_cpu) const
 
void print_all (bool force_cpu) const
 
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 (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< 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 26 of file monolish_coo.hpp.

Constructor & Destructor Documentation

◆ view1D() [1/4]

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 61 of file monolish_view1D.hpp.

Here is the call graph for this function:

◆ view1D() [2/4]

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 78 of file monolish_view1D.hpp.

Here is the call graph for this function:

◆ view1D() [3/4]

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 96 of file monolish_view1D.hpp.

Here is the call graph for this function:

◆ view1D() [4/4]

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 114 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 221 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 213 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 205 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 197 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 237 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 229 of file monolish_view1D.hpp.

Here is the caller graph for this function:

◆ fill()

template<typename TYPE , typename Float >
template 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

Definition at line 9 of file fill_view1D.cpp.

Here is the call graph for this function:

◆ 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 188 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 145 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 153 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 137 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 161 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

refetrence 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 273 of file monolish_view1D.hpp.

◆ print_all() [1/5]

void monolish::view1D< monolish::vector< double >, double >::print_all ( bool  force_cpu) const

Definition at line 15 of file IO_view1D.cpp.

Here is the call graph for this function:

◆ print_all() [2/5]

void monolish::view1D< monolish::matrix::Dense< double >, double >::print_all ( bool  force_cpu) const

Definition at line 39 of file IO_view1D.cpp.

Here is the call graph for this function:

◆ print_all() [3/5]

void monolish::view1D< monolish::vector< float >, float >::print_all ( bool  force_cpu) const

Definition at line 64 of file IO_view1D.cpp.

Here is the call graph for this function:

◆ print_all() [4/5]

void monolish::view1D< monolish::matrix::Dense< float >, float >::print_all ( bool  force_cpu) const

Definition at line 88 of file IO_view1D.cpp.

Here is the call graph for this function:

◆ print_all() [5/5]

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 259 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 168 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 175 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 129 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 46 of file monolish_view1D.hpp.

◆ last

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

Definition at line 47 of file monolish_view1D.hpp.

◆ range

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

Definition at line 48 of file monolish_view1D.hpp.

◆ target

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

Definition at line 44 of file monolish_view1D.hpp.

◆ target_data

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

Definition at line 45 of file monolish_view1D.hpp.


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