Template Numerical Library: TNL::Containers::HypreVector Class Reference

Template Numerical Library version\ main:be7e16d88

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
TNL::Containers::HypreVector Class Reference
Wrappers for the Hypre library

Wrapper for Hypre's sequential vector. More...

`#include <TNL/Containers/HypreVector.h>`

## Public Types
using | ConstViewType = VectorType::ConstViewType
using | DeviceType = HYPRE_Device
using | IndexType = HYPRE_Int
using | RealType = HYPRE_Real
using | ValueType = RealType
using | VectorType = Containers::Vector< RealType, DeviceType, IndexType >
using | ViewType = VectorType::ViewType

## Public Member Functions
| HypreVector (const HypreVector &other)=delete
| HypreVector (hypre_Vector *handle, bool take_ownership=true)
| Convert Hypre's format to HypreVector.
| HypreVector (HypreVector &&other) noexcept
| HypreVector (RealType *data, IndexType size)
| HypreVector (ViewType view)
void | bind (hypre_Vector *handle, bool take_ownership=true)
| Convert Hypre's format to HypreSeqVector.
void | bind (HypreVector &vector)
void | bind (RealType *data, IndexType size)
| Drop previously set data (deallocate if the vector was the owner) and bind to the given data (i.e., the vector does not become the owner).
void | bind (VectorType &vector)
void | bind (ViewType view)
ConstViewType | getConstView () const
const RealType * | getData () const noexcept
RealType * | getData () noexcept
IndexType | getSize () const
ViewType | getView ()
| operator const hypre_Vector * () const noexcept
| operator HYPRE_Vector () const noexcept
| operator hypre_Vector * () noexcept
HypreVector & | operator= (const HypreVector &other)=delete
HypreVector & | operator= (HypreVector &&other) noexcept
void | reset ()
| Reset the vector to empty state.
void | resize (IndexType size)
| Equivalent to setSize.
void | resize (IndexType size, RealType value)
| Equivalent to setSize followed by setValue.
void | setSize (IndexType size)
| Set the new vector size.
void | setValue (RealType value)
| Set all elements of the vector to value.

## Protected Attributes
bool | owns_handle = true
hypre_Vector * | v = nullptr

## Detailed Description

Wrapper for Hypre's sequential vector.

Links to upstream sources:

- https://github.com/hypre-space/hypre/blob/master/src/seq_mv/vector.h
- https://github.com/hypre-space/hypre/blob/master/src/seq_mv/vector.c
- https://github.com/hypre-space/hypre/blob/master/src/seq_mv/seq_mv.h (catch-all interface)

## Constructor & Destructor Documentation

## ◆ HypreVector()

TNL::Containers::HypreVector::HypreVector | ( | hypre_Vector * | handle,
|  | bool | take_ownership = true )
| inlineexplicit

Convert Hypre's format to HypreVector.

Parameters

  handle | is the Hypre vector handle.
  take_ownership | indicates if the vector should take ownership of the handle, i.e. whether to call hypre_VectorDestroy when it does not need it anymore.

## Member Function Documentation

## ◆ bind()

void TNL::Containers::HypreVector::bind | ( | hypre_Vector * | handle,
|  | bool | take_ownership = true )
| inline

Convert Hypre's format to HypreSeqVector.

Parameters

  handle | is the Hypre vector handle.
  take_ownership | indicates if the vector should take ownership of the handle, i.e. whether to call hypre_VectorDestroy when it does not need it anymore.

## ◆ setSize()

void TNL::Containers::HypreVector::setSize | ( | IndexType | size | ) |
| inline

Set the new vector size.

- if the vector previously owned data, they are deallocated
- new size is set
- the vector is initialized with hypre_SeqVectorInitialize (i.e., data are allocated)

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

- src/TNL/Containers/HypreVector.h