17 class PsudoUniTensor {
20 std::vector<std::string> labels;
21 std::vector<cytnx_uint64> shape;
24 PsudoUniTensor *right;
32 : is_assigned(false), left(nullptr), right(nullptr), root(nullptr), cost(0), ID(0){};
33 PsudoUniTensor(
const PsudoUniTensor &rhs) {
34 this->left = rhs.left;
35 this->right = rhs.right;
36 this->root = rhs.root;
37 this->labels = rhs.labels;
38 this->shape = rhs.shape;
39 this->is_assigned = rhs.is_assigned;
40 this->cost = rhs.cost;
41 this->accu_str = rhs.accu_str;
44 PsudoUniTensor &
operator==(
const PsudoUniTensor &rhs) {
45 this->left = rhs.left;
46 this->right = rhs.right;
47 this->root = rhs.root;
48 this->labels = rhs.labels;
49 this->shape = rhs.shape;
50 this->is_assigned = rhs.is_assigned;
51 this->cost = rhs.cost;
52 this->accu_str = rhs.accu_str;
56 void from_utensor(
const UniTensor &in_uten) {
57 this->labels = in_uten.labels();
58 this->shape = in_uten.shape();
59 this->is_assigned =
true;
61 void clear_utensor() {
62 this->is_assigned =
false;
69 void set_ID(
const cytnx_int64 &ID) { this->ID = ID; }
74 std::vector<std::vector<PsudoUniTensor>> nodes_container;
76 std::vector<PsudoUniTensor> base_nodes;
79 SearchTree(
const SearchTree &rhs) {
80 this->nodes_container = rhs.nodes_container;
81 this->base_nodes = rhs.base_nodes;
83 SearchTree &
operator==(
const SearchTree &rhs) {
84 this->nodes_container = rhs.nodes_container;
85 this->base_nodes = rhs.base_nodes;
91 nodes_container.clear();
97 void reset_search_order() { nodes_container.clear(); }
Helper function to print vector with ODT:
Definition Accessor.hpp:12
float cytnx_float
Definition Type.hpp:54
Tensor operator==(const Tensor &Lt, const Tensor &Rt)
The comparison operator for Tensor.
uint64_t cytnx_uint64
Definition Type.hpp:55