#include "lasp_mathtypes.h"
#include <cstring>
#include <pybind11/numpy.h>
#include <type_traits>
Go to the source code of this file.
|  | 
| template<typename T > | 
| py::array_t< T > | ColToNpy (const arma::Col< T > &data) | 
|  | Convert Armadillo column vector to Numpy 1D array. 
 | 
|  | 
| template<typename T > | 
| py::array_t< T > | MatToNpy (const arma::Mat< T > &data) | 
|  | Convert Armadillo 2D array Numpy 2D array. 
 | 
|  | 
| template<typename T > | 
| py::array_t< T > | CubeToNpy (const arma::Cube< T > &data) | 
|  | Convert Armadillo Cube to Numpy 3D array. 
 | 
|  | 
| template<typename T , bool copy = true> | 
| arma::Mat< T > | NpyToMat (pyarray< T > data) | 
|  | BACK converters. 
 | 
|  | 
| template<typename T , bool copy = true> | 
| arma::Mat< T > | NpyToCol (pyarray< T > data) | 
|  | Wrap Numpy array to 1D Armadillo column vector. 
 | 
|  | 
◆ cpyarray
◆ dpyarray
◆ pyarray
template<typename T > 
      
        
          | using pyarray =  py::array_t<T, py::array::f_style | py::array::forcecast> | 
      
 
 
◆ ColToNpy()
template<typename T > 
      
        
          | py::array_t< T > ColToNpy | ( | const arma::Col< T > & | data | ) |  | 
      
 
Convert Armadillo column vector to Numpy 1D array. 
- Template Parameters
- 
  
    | T | Type (double, d, c, etc) |  
 
- Parameters
- 
  
    | data | Input Armadillo array |  
 
- Returns
- Numpy array with copied data 
Definition at line 23 of file arma_npy.h.
 
 
◆ CubeToNpy()
template<typename T > 
      
        
          | py::array_t< T > CubeToNpy | ( | const arma::Cube< T > & | data | ) |  | 
      
 
Convert Armadillo Cube to Numpy 3D array. 
- Template Parameters
- 
  
    | T | Type (double, d, c, etc) |  
 
- Parameters
- 
  
    | data | Input Armadillo Array |  
 
- Returns
- Numpy array with copied data 
Definition at line 76 of file arma_npy.h.
 
 
◆ MatToNpy()
template<typename T > 
      
        
          | py::array_t< T > MatToNpy | ( | const arma::Mat< T > & | data | ) |  | 
      
 
Convert Armadillo 2D array Numpy 2D array. 
- Template Parameters
- 
  
    | T | Type (double, d, c, etc) |  
 
- Parameters
- 
  
    | data | Input Armadillo array |  
 
- Returns
- Numpy array with copied data 
Definition at line 49 of file arma_npy.h.
 
 
◆ NpyToCol()
template<typename T , bool copy = true> 
      
        
          | arma::Mat< T > NpyToCol | ( | pyarray< T > | data | ) |  | 
      
 
Wrap Numpy array to 1D Armadillo column vector. 
- Template Parameters
- 
  
    | T | Type |  | copy | Whether to copy the data. If true, creates a copy |  
 
- Parameters
- 
  
    | data | The Numpy array to convert |  
 
- Returns
- Armadillo column instance 
Definition at line 127 of file arma_npy.h.
 
 
◆ NpyToMat()
template<typename T , bool copy = true> 
      
        
          | arma::Mat< T > NpyToMat | ( | pyarray< T > | data | ) |  | 
      
 
BACK converters. 
Wrap Numpy array to 2D Armadillo Mat
- Template Parameters
- 
  
    | T | Type |  | copy | Whether to copy the data. If true, creates a copy |  
 
- Parameters
- 
  
    | data | The Numpy array to convert |  
 
- Returns
- Mat instance 
Definition at line 110 of file arma_npy.h.