载入中...
搜索中...
未找到
GraphStorage.cpp
浏览该文件的文档.
1#include "common/Exception.h"
2#include "tensor/Graph.h"
3
4namespace eve::tensor {
5int Graph::product(const int* dims, int rank) {
6 int n = 1;
7 for (int i = 0; i < rank; ++i) {
8 if (dims[i] <= 0) throw eve::Exception("Graph: dims must be > 0");
9 n *= dims[i];
10 }
11 return n;
12}
13
15 if (node.rank > 0 && node.size <= 0) node.size = product(node.dims, node.rank);
16 nodes_.push_back(std::move(node));
17 return int(nodes_.size()) - 1;
18}
19} // namespace eve::tensor
glm::vec3 n
Definition Grass.cpp:63
const RoadNode * node
EVENGINE_API_FOUNDATION public API.
Definition Exception.h:13
int addNode(GraphNode node)
Adds node.
static int product(const int *dims, int rank)
Product.
GraphNode public API.
Definition Graph.h:80