mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Replace xtensor with internal Tensor/View classes (#3805)
Co-authored-by: John Tramm <jtramm@gmail.com>
This commit is contained in:
parent
c6ef84d1d5
commit
977ade79a1
73 changed files with 3111 additions and 908 deletions
|
|
@ -5,9 +5,8 @@
|
|||
#include <sstream> // for stringstream
|
||||
#include <string>
|
||||
|
||||
#include "openmc/tensor.h"
|
||||
#include "pugixml.hpp"
|
||||
#include "xtensor/xadapt.hpp"
|
||||
#include "xtensor/xarray.hpp"
|
||||
|
||||
#include "openmc/position.h"
|
||||
#include "openmc/vector.h"
|
||||
|
|
@ -42,12 +41,11 @@ vector<T> get_node_array(
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
xt::xarray<T> get_node_xarray(
|
||||
tensor::Tensor<T> get_node_tensor(
|
||||
pugi::xml_node node, const char* name, bool lowercase = false)
|
||||
{
|
||||
vector<T> v = get_node_array<T>(node, name, lowercase);
|
||||
vector<std::size_t> shape = {v.size()};
|
||||
return xt::adapt(v, shape);
|
||||
return tensor::Tensor<T>(v.data(), v.size());
|
||||
}
|
||||
|
||||
std::vector<Position> get_node_position_array(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue