Documentation 6b54b78464
Loading...
Searching...
No Matches
CPyWrapperMatrixView Class Reference

This class wraps su2activematrix for the python wrapper matrix interface. It is generaly used to wrap access to solver variables defined for the entire volume. More...

#include <CPyWrapperMatrixView.hpp>

Public Member Functions

 CPyWrapperMatrixView ()=default
 
 CPyWrapperMatrixView (su2activematrix &mat, const std::string &name, bool read_only)
 Construct the view of the matrix.
 
std::pair< unsigned long, unsigned long > Shape () const
 Returns the shape of the matrix.
 
bool IsReadOnly () const
 Returns whether the data is read-only [true] or if it can be modified [false].
 
passivedouble operator() (unsigned long row, unsigned long col) const
 Gets the value for a (row, column) pair.
 
std::vector< passivedouble > operator() (unsigned long row) const
 Gets the values for a row of the matrix.
 
passivedouble Get (unsigned long row, unsigned long col) const
 Gets the value for a (row, column) pair.
 
std::vector< passivedouble > Get (unsigned long row) const
 Gets the values for a row of the matrix.
 
void Set (unsigned long row, unsigned long col, passivedouble val)
 Sets the value for a (row, column) pair. This clears derivative information.
 
void Set (unsigned long row, std::vector< passivedouble > vals)
 Sets the values for a row of the matrix.
 

Protected Member Functions

const su2double & Access (unsigned long row, unsigned long col) const
 
su2double & Access (unsigned long row, unsigned long col)
 

Protected Attributes

su2double * data_ = nullptr
 
unsigned long rows_ = 0
 
unsigned long cols_ = 0
 
std::string name_
 
bool read_only_ = false
 

Detailed Description

This class wraps su2activematrix for the python wrapper matrix interface. It is generaly used to wrap access to solver variables defined for the entire volume.

Constructor & Destructor Documentation

◆ CPyWrapperMatrixView() [1/2]

CPyWrapperMatrixView::CPyWrapperMatrixView ( )
default

◆ CPyWrapperMatrixView() [2/2]

CPyWrapperMatrixView::CPyWrapperMatrixView ( su2activematrix &  mat,
const std::string &  name,
bool  read_only 
)
inline

Construct the view of the matrix.

Note
"name" should be set to the variable name being returned to give better information to users.
"read_only" can be set to true to prevent the data from being modified.

Member Function Documentation

◆ Access() [1/2]

su2double & CPyWrapperMatrixView::Access ( unsigned long  row,
unsigned long  col 
)
inlineprotected

◆ Access() [2/2]

const su2double & CPyWrapperMatrixView::Access ( unsigned long  row,
unsigned long  col 
) const
inlineprotected

◆ Get() [1/2]

std::vector< passivedouble > CPyWrapperMatrixView::Get ( unsigned long  row) const
inline

Gets the values for a row of the matrix.

◆ Get() [2/2]

passivedouble CPyWrapperMatrixView::Get ( unsigned long  row,
unsigned long  col 
) const
inline

Gets the value for a (row, column) pair.

◆ IsReadOnly()

bool CPyWrapperMatrixView::IsReadOnly ( ) const
inline

Returns whether the data is read-only [true] or if it can be modified [false].

◆ operator()() [1/2]

std::vector< passivedouble > CPyWrapperMatrixView::operator() ( unsigned long  row) const
inline

Gets the values for a row of the matrix.

◆ operator()() [2/2]

passivedouble CPyWrapperMatrixView::operator() ( unsigned long  row,
unsigned long  col 
) const
inline

Gets the value for a (row, column) pair.

◆ Set() [1/2]

void CPyWrapperMatrixView::Set ( unsigned long  row,
std::vector< passivedouble >  vals 
)
inline

Sets the values for a row of the matrix.

◆ Set() [2/2]

void CPyWrapperMatrixView::Set ( unsigned long  row,
unsigned long  col,
passivedouble  val 
)
inline

Sets the value for a (row, column) pair. This clears derivative information.

◆ Shape()

std::pair< unsigned long, unsigned long > CPyWrapperMatrixView::Shape ( ) const
inline

Returns the shape of the matrix.

Member Data Documentation

◆ cols_

unsigned long CPyWrapperMatrixView::cols_ = 0
protected

◆ data_

su2double* CPyWrapperMatrixView::data_ = nullptr
protected

◆ name_

std::string CPyWrapperMatrixView::name_
protected

◆ read_only_

bool CPyWrapperMatrixView::read_only_ = false
protected

◆ rows_

unsigned long CPyWrapperMatrixView::rows_ = 0
protected

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