tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
wrap_shared_ptr.hpp
Go to the documentation of this file.
1#ifndef TATAMI_WRAP_SHARED_PTR_HPP
2#define TATAMI_WRAP_SHARED_PTR_HPP
3
4#include <memory>
5#include "../base/Matrix.hpp"
6
13namespace tatami {
14
27template<typename Value_, typename Index_>
28std::shared_ptr<const Matrix<Value_, Index_> > wrap_shared_ptr(const Matrix<Value_, Index_>* ptr) {
29 // Using an aliasing constructor, see https://stackoverflow.com/a/36691828
30 return std::shared_ptr<const Matrix<Value_, Index_> >(std::shared_ptr<const Matrix<Value_, Index_> >{}, ptr);
31}
32
33}
34
35#endif
Virtual class for a matrix of some numeric type.
Virtual class for a matrix.
Definition Matrix.hpp:59
Flexible representations for matrix data.
Definition Extractor.hpp:15
std::shared_ptr< const Matrix< Value_, Index_ > > wrap_shared_ptr(const Matrix< Value_, Index_ > *ptr)
Definition wrap_shared_ptr.hpp:28