libqe 0.2.6-dev.9001
QE C++ library
Loading...
Searching...
No Matches
cxxwrap.hpp File Reference

Armadillo ↔ Julia conversion helpers for CxxWrap.jl bindings. More...

#include <jlcxx/jlcxx.hpp>
#include <jlcxx/array.hpp>
#include <armadillo>
#include <cstdint>
#include <stdexcept>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  qe
 
namespace  qe::bind
 
namespace  qe::bind::jl
 

Functions

arma::mat qe::bind::jl::view_mat (jlcxx::ArrayRef< double > data, int rows, int cols)
 
std::vector< double > qe::bind::jl::pack (const arma::mat &m)
 
std::vector< double > qe::bind::jl::pack (const arma::rowvec &v)
 
arma::imat qe::bind::jl::copy_imat (jlcxx::ArrayRef< int32_t > data, int rows, int cols)
 
arma::vec qe::bind::jl::unpack_jl_vec (jl_value_t *val)
 

Detailed Description

Armadillo ↔ Julia conversion helpers for CxxWrap.jl bindings.

Julia matrices are column-major, the same as Armadillo, so input matrices can be zero-copy views. Results are copied out to std::vector<double> (column-major), which the Julia side reshape()s without another copy.

Requires CxxWrap (jlcxx); never included by libqe.hpp. Bindings typically using namespace qe::bind::jl;.