PineForge v0.13.1-379-g9b50973
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pineforge::GenericMatrix< T > Class Template Reference

#include <generic_matrix.hpp>

Data Structures

class  Snapshot
 

Public Member Functions

 GenericMatrix () noexcept=default
 
 GenericMatrix (const GenericMatrix &) noexcept=default
 
GenericMatrixoperator= (const GenericMatrix &) noexcept=default
 
 GenericMatrix (GenericMatrix &&other) noexcept
 
GenericMatrixoperator= (GenericMatrix &&other) noexcept
 
 ~GenericMatrix ()=default
 
get (int row, int col) const
 
void set (int row, int col, T val)
 
void fill (T val)
 
int rows () const
 
int columns () const
 
std::vector< T > row (int idx) const
 
std::vector< T > col (int idx) const
 
template<typename U = T, typename = std::enable_if_t<!std::is_same_v<U, bool>>>
const std::vector< T > & row_ref (int idx) const
 
void add_row (int idx, const std::vector< T > &values)
 
void add_col (int idx, const std::vector< T > &values)
 
void remove_row (int idx)
 
void remove_col (int idx)
 
void swap_rows (int i, int j)
 
void swap_columns (int i, int j)
 
GenericMatrix copy () const
 
GenericMatrix submatrix (int from_row, int to_row, int from_col, int to_col) const
 
GenericMatrix transpose () const
 
GenericMatrix concat (const GenericMatrix &other, bool horizontal) const
 
void reshape (int new_rows, int new_cols)
 
void reverse ()
 
void sort (int column, bool ascending=true)
 
int elements_count () const
 
bool is_na () const noexcept
 
Snapshot snapshot () const
 
void restore (const Snapshot &snapshot)
 

Static Public Member Functions

static GenericMatrix new_ (int rows, int cols, T init)
 
static GenericMatrix new_ (int rows, int cols)
 

Detailed Description

template<typename T>
class pineforge::GenericMatrix< T >

Definition at line 130 of file generic_matrix.hpp.

Constructor & Destructor Documentation

◆ GenericMatrix() [1/3]

◆ GenericMatrix() [2/3]

template<typename T>
pineforge::GenericMatrix< T >::GenericMatrix ( const GenericMatrix< T > & )
defaultnoexcept

◆ GenericMatrix() [3/3]

template<typename T>
pineforge::GenericMatrix< T >::GenericMatrix ( GenericMatrix< T > && other)
inlinenoexcept

Definition at line 172 of file generic_matrix.hpp.

◆ ~GenericMatrix()

template<typename T>
pineforge::GenericMatrix< T >::~GenericMatrix ( )
default

Member Function Documentation

◆ operator=() [1/2]

template<typename T>
GenericMatrix & pineforge::GenericMatrix< T >::operator= ( const GenericMatrix< T > & )
defaultnoexcept

◆ operator=() [2/2]

template<typename T>
GenericMatrix & pineforge::GenericMatrix< T >::operator= ( GenericMatrix< T > && other)
inlinenoexcept

Definition at line 174 of file generic_matrix.hpp.

◆ new_() [1/2]

template<typename T>
static GenericMatrix pineforge::GenericMatrix< T >::new_ ( int rows,
int cols,
T init )
inlinestaticnodiscard

Definition at line 200 of file generic_matrix.hpp.

References GenericMatrix(), and rows().

Referenced by pineforge::GenericMatrix< bool >::new_().

◆ new_() [2/2]

template<typename T>
static GenericMatrix pineforge::GenericMatrix< T >::new_ ( int rows,
int cols )
inlinestaticnodiscard

Definition at line 208 of file generic_matrix.hpp.

References GenericMatrix(), and rows().

◆ get()

template<typename T>
T pineforge::GenericMatrix< T >::get ( int row,
int col ) const
inline

Definition at line 218 of file generic_matrix.hpp.

References col(), columns(), row(), and rows().

◆ set()

template<typename T>
void pineforge::GenericMatrix< T >::set ( int row,
int col,
T val )
inline

Definition at line 227 of file generic_matrix.hpp.

References col(), columns(), row(), and rows().

◆ fill()

template<typename T>
void pineforge::GenericMatrix< T >::fill ( T val)
inline

Definition at line 236 of file generic_matrix.hpp.

◆ rows()

◆ columns()

◆ row()

template<typename T>
std::vector< T > pineforge::GenericMatrix< T >::row ( int idx) const
inline

◆ col()

template<typename T>
std::vector< T > pineforge::GenericMatrix< T >::col ( int idx) const
inline

◆ row_ref()

template<typename T>
template<typename U = T, typename = std::enable_if_t<!std::is_same_v<U, bool>>>
const std::vector< T > & pineforge::GenericMatrix< T >::row_ref ( int idx) const
inline

Definition at line 267 of file generic_matrix.hpp.

References rows().

◆ add_row()

template<typename T>
void pineforge::GenericMatrix< T >::add_row ( int idx,
const std::vector< T > & values )
inline

Definition at line 274 of file generic_matrix.hpp.

References columns(), and rows().

◆ add_col()

template<typename T>
void pineforge::GenericMatrix< T >::add_col ( int idx,
const std::vector< T > & values )
inline

Definition at line 284 of file generic_matrix.hpp.

References columns(), and row().

◆ remove_row()

template<typename T>
void pineforge::GenericMatrix< T >::remove_row ( int idx)
inline

Definition at line 303 of file generic_matrix.hpp.

References pineforge::detail::erase_row(), and rows().

◆ remove_col()

template<typename T>
void pineforge::GenericMatrix< T >::remove_col ( int idx)
inline

Definition at line 310 of file generic_matrix.hpp.

References columns(), and pineforge::detail::erase_col().

◆ swap_rows()

template<typename T>
void pineforge::GenericMatrix< T >::swap_rows ( int i,
int j )
inline

Definition at line 317 of file generic_matrix.hpp.

References rows(), and pineforge::detail::swap_rows_impl().

◆ swap_columns()

template<typename T>
void pineforge::GenericMatrix< T >::swap_columns ( int i,
int j )
inline

Definition at line 324 of file generic_matrix.hpp.

References columns(), and pineforge::detail::swap_cols_impl().

◆ copy()

template<typename T>
GenericMatrix pineforge::GenericMatrix< T >::copy ( ) const
inlinenodiscard

Definition at line 331 of file generic_matrix.hpp.

References GenericMatrix().

Referenced by concat(), and pineforge::GenericMatrix< bool >::concat().

◆ submatrix()

template<typename T>
GenericMatrix pineforge::GenericMatrix< T >::submatrix ( int from_row,
int to_row,
int from_col,
int to_col ) const
inlinenodiscard

◆ transpose()

template<typename T>
GenericMatrix pineforge::GenericMatrix< T >::transpose ( ) const
inlinenodiscard

◆ concat()

template<typename T>
GenericMatrix pineforge::GenericMatrix< T >::concat ( const GenericMatrix< T > & other,
bool horizontal ) const
inlinenodiscard

Definition at line 358 of file generic_matrix.hpp.

References columns(), pineforge::detail::concat_impl(), copy(), and rows().

◆ reshape()

template<typename T>
void pineforge::GenericMatrix< T >::reshape ( int new_rows,
int new_cols )
inline

Definition at line 373 of file generic_matrix.hpp.

References pineforge::detail::reshape_impl().

◆ reverse()

template<typename T>
void pineforge::GenericMatrix< T >::reverse ( )
inline

Definition at line 379 of file generic_matrix.hpp.

◆ sort()

template<typename T>
void pineforge::GenericMatrix< T >::sort ( int column,
bool ascending = true )
inline

Definition at line 384 of file generic_matrix.hpp.

References pineforge::detail::sort_impl().

◆ elements_count()

template<typename T>
int pineforge::GenericMatrix< T >::elements_count ( ) const
inline

Definition at line 392 of file generic_matrix.hpp.

References pineforge::detail::elements_count_impl().

◆ is_na()

template<typename T>
bool pineforge::GenericMatrix< T >::is_na ( ) const
inlinenodiscardnoexcept

Definition at line 396 of file generic_matrix.hpp.

◆ snapshot()

template<typename T>
Snapshot pineforge::GenericMatrix< T >::snapshot ( ) const
inlinenodiscard

Definition at line 398 of file generic_matrix.hpp.

Referenced by restore().

◆ restore()

template<typename T>
void pineforge::GenericMatrix< T >::restore ( const Snapshot & snapshot)
inline

Definition at line 403 of file generic_matrix.hpp.

References snapshot().


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