DHART
|
Functions | |
C_INTERFACE | GetAllNodesFromGraph (const HF::SpatialStructures::Graph *graph, std::vector< HF::SpatialStructures::Node > **out_vector_ptr, HF::SpatialStructures::Node **out_data_ptr) |
Get a vector of every node in the given graph pointer. More... | |
C_INTERFACE | GetEdgesForNode (const HF::SpatialStructures::Graph *graph, const HF::SpatialStructures::Node *Node, std::vector< HF::SpatialStructures::Edge > **out_vector_ptr, HF::SpatialStructures::Edge **out_edge_list_ptr, int *out_edge_list_size) |
Get a vector of edges every node in the given graph pointer. More... | |
C_INTERFACE | GetSizeOfNodeVector (const std::vector< HF::SpatialStructures::Node > *node_list, int *out_size) |
Get the size of a node vector. More... | |
C_INTERFACE | GetSizeOfEdgeVector (const std::vector< HF::SpatialStructures::Edge > *edge_list, int *out_size) |
Get the size of an edge vector. More... | |
C_INTERFACE | GetEdgeCost (const HF::SpatialStructures::Graph *g, int parent, int child, const char *cost_type, float *out_float) |
Get the cost of traversing from parent to child More... | |
C_INTERFACE | AggregateCosts (const HF::SpatialStructures::Graph *graph, int agg, bool directed, const char *cost_type, std::vector< float > **out_vector_ptr, float **out_data_ptr) |
Get an ordered array of costs for each node aggregated by the desired function. More... | |
C_INTERFACE | CreateGraph (const float *nodes, int num_nodes, HF::SpatialStructures::Graph **out_graph) |
Create a new empty graph. More... | |
C_INTERFACE | AddEdgeFromNodes (HF::SpatialStructures::Graph *graph, const float *parent, const float *child, float score, const char *cost_type) |
Add an edge between parent and child. If parent or child does not already exist in the graph, they will be added and automatically assigned new IDs. More... | |
C_INTERFACE | AddEdgeFromNodeIDs (HF::SpatialStructures::Graph *graph, int parent_id, int child_id, float score, const char *cost_type) |
Create a new edge between parent_id and child_id. If these IDs do not exist in the graph, they will be added. More... | |
C_INTERFACE | GetCSRPointers (HF::SpatialStructures::Graph *graph, int *out_nnz, int *out_num_rows, int *out_num_cols, float **out_data_ptr, int **out_inner_indices_ptr, int **out_outer_indices_ptr, const char *cost_type) |
Retrieve all information for a graph's CSR representation. This will compress the graph if it was not already compressed. More... | |
C_INTERFACE | GetNodeID (HF::SpatialStructures::Graph *graph, const float *point, int *out_id) |
Get the ID of the given node in the graph. If the node does not exist, out_id will be set to -1. More... | |
C_INTERFACE | Compress (HF::SpatialStructures::Graph *graph) |
Compress the given graph into a CSR representation. More... | |
C_INTERFACE | ClearGraph (HF::SpatialStructures::Graph *graph, const char *cost_type) |
Clear the nodes/edges for the given graph, or clear a specific cost type. More... | |
C_INTERFACE | DestroyNodes (std::vector< HF::SpatialStructures::Node > *nodelist_to_destroy) |
Delete the vector of nodes at the given pointer. More... | |
C_INTERFACE | DestroyEdges (std::vector< HF::SpatialStructures::Edge > *edgelist_to_destroy) |
Delete the vector of edges at the given pointer. More... | |
C_INTERFACE | DestroyGraph (HF::SpatialStructures::Graph *graph_to_destroy) |
Delete a graph. More... | |
C_INTERFACE | CalculateAndStoreCrossSlope (HF::SpatialStructures::Graph *g) |
Calculates cross slope for all subgraphs in *g. More... | |
C_INTERFACE | CalculateAndStoreEnergyExpenditure (HF::SpatialStructures::Graph *g) |
Calculates energy expenditure for all subgraphs in *g and stores them in the graph at AlgorithmCostTitle(ALG_COST_KEY::EnergyExpenditure) More... | |
C_INTERFACE | AddNodeAttributes (HF::SpatialStructures::Graph *g, const int *ids, const char *attribute, const char **scores, int num_nodes) |
Add a new node attribute in the graph for the nodes at ids. More... | |
C_INTERFACE | GetNodeAttributes (const HF::SpatialStructures::Graph *g, const char *attribute, char **out_scores, int *out_score_size) |
Retrieve node attribute values from *g. More... | |
C_INTERFACE | DeleteScoreArray (char **scores_to_delete, int num_char_arrays) |
Free the memory of every (char *) in scores_to_delete. More... | |
C_INTERFACE | ClearAttributeType (HF::SpatialStructures::Graph *g, const char *s) |
Deletes the node attribute values of the type denoted by s, from graph *g. More... | |
C_INTERFACE | GetSizeOfGraph (const HF::SpatialStructures::Graph *g, int *out_size) |
Get the number of nodes in a graph. More... | |
C_INTERFACE | GraphAttrsToCosts (HF::SpatialStructures::Graph *graph_ptr, const char *attr_key, const char *cost_string, HF::SpatialStructures::Direction dir) |
Create a cost in the graph based on a set of node parameters. More... | |
Contains the Graph and Node data types.
Although graphs can be generated (see Graph generation),
they can also be created by objects instantiated or obtained by the user.
Call CreateGraph :
Call AddEdgeFromNodes :
Call AddEdgeFromNodeIds :
Call GetCSRPointers :
When you are finished with a graph, be sure to destroy it.
(see Destroy graph)
Graph operations deal in std::vector<HF::SpatialStructures::Node> *
and std::vector<HF::SpatialStructures::Edge> *.
Call DestroyNodes :
Call DestroyEdges :
C_INTERFACE AddEdgeFromNodeIDs | ( | HF::SpatialStructures::Graph * | graph, |
int | parent_id, | ||
int | child_id, | ||
float | score, | ||
const char * | cost_type | ||
) |
#include <Cinterface/spatialstructures_C.h>
Create a new edge between parent_id and child_id. If these IDs do not exist in the graph, they will be added.
graph | Graph to create the new edge in |
parent | The parent's ID in the graph |
child | The child's ID in the graph |
score | The cost from parent to child. |
cost_type | The type of cost to add this edge to. |
Definition at line 170 of file spatialstructures_C.cpp.
References HF::SpatialStructures::Graph::addEdge(), HF::Exceptions::NO_COST, HF::Exceptions::NOT_COMPRESSED, HF::Exceptions::OK, HF::Exceptions::OUT_OF_RANGE, and parse_string().
C_INTERFACE AddEdgeFromNodes | ( | HF::SpatialStructures::Graph * | graph, |
const float * | parent, | ||
const float * | child, | ||
float | score, | ||
const char * | cost_type | ||
) |
#include <Cinterface/spatialstructures_C.h>
Add an edge between parent and child. If parent or child does not already exist in the graph, they will be added and automatically assigned new IDs.
graph | Graph to add the new edge to |
parent | A three-element array of float containing the x, y, and z coordinates of the parent node |
child | A three-element array of float containing the x, y, and z coordinates of the child node. |
score | The edge cost from parent to child |
cost_type | Edge cost type |
Definition at line 135 of file spatialstructures_C.cpp.
References HF::SpatialStructures::Graph::addEdge(), HF::Exceptions::INVALID_PTR, HF::Exceptions::NO_COST, HF::Exceptions::NOT_COMPRESSED, HF::Exceptions::OK, HF::Exceptions::OUT_OF_RANGE, and parse_string().
C_INTERFACE AddNodeAttributes | ( | HF::SpatialStructures::Graph * | g, |
const int * | ids, | ||
const char * | attribute, | ||
const char ** | scores, | ||
int | num_nodes | ||
) |
#include <Cinterface/spatialstructures_C.h>
Add a new node attribute in the graph for the nodes at ids.
g | Graph to add attributes to |
ids | IDs of nodes to add attributes to |
attribute | The name of the attribute to add the scores to. |
scores | An ordered array of null terminated char arrays that correspond to the score of the ID in ids at the same index. |
num_nodes | Length of both the ids and scores arrays |
For any id in ids, if said ID doesn't already exist in the graph, then it and its cost will silently be ignored without error.
Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Be sure to compress the graph (Compressing the graph) every time you add/remove edges.
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
Definition at line 290 of file spatialstructures_C.cpp.
References HF::SpatialStructures::Graph::AddNodeAttributes(), and HF::Exceptions::OK.
C_INTERFACE AggregateCosts | ( | const HF::SpatialStructures::Graph * | graph, |
int | agg, | ||
bool | directed, | ||
const char * | cost_type, | ||
std::vector< float > ** | out_vector_ptr, | ||
float ** | out_data_ptr | ||
) |
#include <Cinterface/spatialstructures_C.h>
Get an ordered array of costs for each node aggregated by the desired function.
graph | Graph to aggregate edges from |
agg | Aggregation type to use |
directed | If true, only consider edges for a node – otherwise, consider both outgoing and incoming edges. |
cost_type | Node cost type string; type of cost to use for the graph |
out_vector_ptr | Output parameter for the vector |
out_data_ptr | Output parameter for the vector's internal buffer |
Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Be sure to compress the graph (Compressing the graph) every time you add/remove edges.
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
Definition at line 94 of file spatialstructures_C.cpp.
References HF::SpatialStructures::Graph::AggregateGraph(), HF::Exceptions::GENERIC_ERROR, HF::Exceptions::NO_COST, HF::Exceptions::NOT_COMPRESSED, HF::Exceptions::OK, and parse_string().
C_INTERFACE CalculateAndStoreCrossSlope | ( | HF::SpatialStructures::Graph * | g | ) |
#include <Cinterface/spatialstructures_C.h>
Calculates cross slope for all subgraphs in *g.
g | The graph to calculate cross slope on |
Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Be sure to compress the graph (Compressing the graph) every time you add/remove edges.
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
Definition at line 381 of file spatialstructures_C.cpp.
References HF::SpatialStructures::Graph::AddEdges(), AlgorithmCostTitle(), HF::SpatialStructures::CostAlgorithms::CalculateCrossSlope(), CROSS_SLOPE, and HF::Exceptions::OK.
C_INTERFACE CalculateAndStoreEnergyExpenditure | ( | HF::SpatialStructures::Graph * | g | ) |
#include <Cinterface/spatialstructures_C.h>
Calculates energy expenditure for all subgraphs in *g and stores them in the graph at AlgorithmCostTitle(ALG_COST_KEY::EnergyExpenditure)
g | The address of a Graph |
Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Be sure to compress the graph (Compressing the graph) every time you add/remove edges.
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
Definition at line 273 of file spatialstructures_C.cpp.
References HF::SpatialStructures::Graph::AddEdges(), AlgorithmCostTitle(), HF::SpatialStructures::CostAlgorithms::CalculateEnergyExpenditure(), ENERGY_EXPENDITURE, and HF::Exceptions::OK.
C_INTERFACE ClearAttributeType | ( | HF::SpatialStructures::Graph * | g, |
const char * | s | ||
) |
#include <Cinterface/spatialstructures_C.h>
Deletes the node attribute values of the type denoted by s, from graph *g.
g | The graph from which attributes of type s will be deleted |
s | The attribute value type to be cleared from within g |
Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Be sure to compress the graph (Compressing the graph) every time you add/remove edges.
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
Definition at line 368 of file spatialstructures_C.cpp.
References HF::SpatialStructures::Graph::ClearNodeAttributes(), HF::Exceptions::INVALID_PTR, and HF::Exceptions::OK.
C_INTERFACE ClearGraph | ( | HF::SpatialStructures::Graph * | graph, |
const char * | cost_type | ||
) |
#include <Cinterface/spatialstructures_C.h>
Clear the nodes/edges for the given graph, or clear a specific cost type.
graph | Graph to clear nodes from |
cost_type | Edge cost type string (if clearing a specific cost type). |
cost_type | If blank, delete the graph, otherwise only clear the cost at this type. |
Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
Definition at line 234 of file spatialstructures_C.cpp.
References HF::SpatialStructures::Graph::Clear(), HF::SpatialStructures::Graph::ClearCostArrays(), HF::Exceptions::NO_COST, and HF::Exceptions::OK.
C_INTERFACE Compress | ( | HF::SpatialStructures::Graph * | graph | ) |
#include <Cinterface/spatialstructures_C.h>
Compress the given graph into a CSR representation.
graph | The graph to compress into a CSR. |
Definition at line 228 of file spatialstructures_C.cpp.
References HF::SpatialStructures::Graph::Compress(), and HF::Exceptions::OK.
C_INTERFACE CreateGraph | ( | const float * | nodes, |
int | num_nodes, | ||
HF::SpatialStructures::Graph ** | out_graph | ||
) |
#include <Cinterface/spatialstructures_C.h>
Create a new empty graph.
nodes | (unused parameter) The node IDs to create nodes from |
num_nodes | (unused parameter) Size of nodes array |
out_graph | Output parameter to store the graph in |
Definition at line 124 of file spatialstructures_C.cpp.
References HF::Exceptions::OK.
C_INTERFACE DeleteScoreArray | ( | char ** | scores_to_delete, |
int | num_char_arrays | ||
) |
#include <Cinterface/spatialstructures_C.h>
Free the memory of every (char *) in scores_to_delete.
scores_to_delete | Pointer to array of (char *), allocate by the caller |
num_char_arrays | Block count of scores_to_delete |
Definition at line 354 of file spatialstructures_C.cpp.
References HF::Exceptions::OK.
C_INTERFACE DestroyEdges | ( | std::vector< HF::SpatialStructures::Edge > * | edgelist_to_destroy | ) |
#include <Cinterface/spatialstructures_C.h>
Delete the vector of edges at the given pointer.
edgelist_to_destroy | Vector of nodes to destroy |
Definition at line 75 of file CInterface.cpp.
References HF::Exceptions::OK.
C_INTERFACE DestroyGraph | ( | HF::SpatialStructures::Graph * | graph_to_destroy | ) |
#include <Cinterface/spatialstructures_C.h>
Delete a graph.
graph_to_destroy | Graph to delete |
Definition at line 80 of file CInterface.cpp.
References HF::Exceptions::OK.
C_INTERFACE DestroyNodes | ( | std::vector< HF::SpatialStructures::Node > * | nodelist_to_destroy | ) |
#include <Cinterface/spatialstructures_C.h>
Delete the vector of nodes at the given pointer.
nodelist_to_destroy | Vector of nodes to destroy |
Definition at line 70 of file CInterface.cpp.
References HF::Exceptions::OK.
C_INTERFACE GetAllNodesFromGraph | ( | const HF::SpatialStructures::Graph * | graph, |
std::vector< HF::SpatialStructures::Node > ** | out_vector_ptr, | ||
HF::SpatialStructures::Node ** | out_data_ptr | ||
) |
#include <Cinterface/spatialstructures_C.h>
Get a vector of every node in the given graph pointer.
graph | Graph to retrieve nodes from |
out_vector_ptr | Output parameter for the new vector |
out_data_ptr | Output parameter for the vector's data |
Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Be sure to compress the graph (Compressing the graph) every time you add/remove edges.
When you are finished with the node vector,
it must be destroyed. (Destroying a vector of node)
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
Definition at line 32 of file spatialstructures_C.cpp.
References HF::Exceptions::GENERIC_ERROR, HF::SpatialStructures::Graph::Nodes(), and HF::Exceptions::OK.
C_INTERFACE GetCSRPointers | ( | HF::SpatialStructures::Graph * | graph, |
int * | out_nnz, | ||
int * | out_num_rows, | ||
int * | out_num_cols, | ||
float ** | out_data_ptr, | ||
int ** | out_inner_indices_ptr, | ||
int ** | out_outer_indices_ptr, | ||
const char * | cost_type | ||
) |
#include <Cinterface/spatialstructures_C.h>
Retrieve all information for a graph's CSR representation. This will compress the graph if it was not already compressed.
out_nnz | Number of non-zero values contained within the CSR |
out_num_rows | Number of rows contained within the CSR |
out_num_cols | Number of columns contained within the CSR |
out_data_ptr | Pointer to the CSR's data array |
out_inner_indices_ptr | Pointer to the graph's inner indices array (columns) |
out_outer_indices_ptr | Pointer to the graph's outer indices array (rpws) |
cost_type | Cost type to compress the CSR with. |
Definition at line 187 of file spatialstructures_C.cpp.
References HF::Exceptions::GENERIC_ERROR, HF::SpatialStructures::Graph::GetCSRPointers(), HF::SpatialStructures::CSRPtrs::nnz, HF::Exceptions::NO_COST, and HF::Exceptions::OK.
C_INTERFACE GetEdgeCost | ( | const HF::SpatialStructures::Graph * | g, |
int | parent, | ||
int | child, | ||
const char * | cost_type, | ||
float * | out_float | ||
) |
#include <Cinterface/spatialstructures_C.h>
Get the cost of traversing from parent
to child
g | The graph to traverse |
parent | ID of the node being traversed from |
child | ID of the node being traversed to |
cost_type | name of the cost type to get the cost from |
out_float | Output parameter for the cost of traversing from parent to child |
out_float
is updated with the cost of traversing from parent to child. If no edge exists between parent and child, -1 will be inserted into out_float.Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Be sure to compress the graph (Compressing the graph) every time you add/remove edges.
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
Definition at line 66 of file spatialstructures_C.cpp.
References HF::Exceptions::GENERIC_ERROR, HF::SpatialStructures::Graph::GetCost(), HF::Exceptions::NO_COST, HF::Exceptions::NOT_COMPRESSED, and HF::Exceptions::OK.
C_INTERFACE GetEdgesForNode | ( | const HF::SpatialStructures::Graph * | graph, |
const HF::SpatialStructures::Node * | Node, | ||
std::vector< HF::SpatialStructures::Edge > ** | out_vector_ptr, | ||
HF::SpatialStructures::Edge ** | out_edge_list_ptr, | ||
int * | out_edge_list_size | ||
) |
#include <Cinterface/spatialstructures_C.h>
Get a vector of edges every node in the given graph pointer.
graph | Graph to retrieve edges from |
node | Node within graph to retrieve edges for |
out_vector_ptr | Output parameter for retrieved edges |
out_edge_list_ptr | Address of pointer to *out_vector_ptr's internal buffer |
out_edge_list_size | Will store out_vector_ptr->size() |
Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Be sure to compress the graph (Compressing the graph) every time you add/remove edges.
When you are finished with the edge vector,
it must be destroyed. (Destroying a vector of edge)
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
C_INTERFACE GetNodeAttributes | ( | const HF::SpatialStructures::Graph * | g, |
const char * | attribute, | ||
char ** | out_scores, | ||
int * | out_score_size | ||
) |
#include <Cinterface/spatialstructures_C.h>
Retrieve node attribute values from *g.
g | The graph that will be used to retrieve node attribute values from |
attribute | The node attribute type to retrieve from *g |
out_scores | Pointer to array of (char *), allocated by the caller |
out_score_size | Keeps track of the size of out_scores buffer, updated as required |
Memory shall be allocated in *out_scores to hold the char arrays. out_scores is a pointer to an array of (char *), which will be allocated by the caller. The caller must call DeleteScores to deallocate the memory addressed by each pointer in out_scores.
Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Be sure to compress the graph (Compressing the graph) every time you add/remove edges.
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
Definition at line 322 of file spatialstructures_C.cpp.
References HF::SpatialStructures::Graph::GetNodeAttributes(), and HF::Exceptions::OK.
C_INTERFACE GetNodeID | ( | HF::SpatialStructures::Graph * | graph, |
const float * | point, | ||
int * | out_id | ||
) |
#include <Cinterface/spatialstructures_C.h>
Get the ID of the given node in the graph. If the node does not exist, out_id will be set to -1.
graph | The graph to get the ID from |
point | A three-element array of float containing the x, y, and z coordinates of the point to get the ID for. |
out_id | Output parameter for the ID. Set to -1 if point could not be found in graph . |
Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
Definition at line 217 of file spatialstructures_C.cpp.
References HF::SpatialStructures::Graph::getID(), and HF::Exceptions::OK.
C_INTERFACE GetSizeOfEdgeVector | ( | const std::vector< HF::SpatialStructures::Edge > * | edge_list, |
int * | out_size | ||
) |
#include <Cinterface/spatialstructures_C.h>
Get the size of an edge vector.
edge_list | Edge vector to get the size from |
out_size | Size of the vector will be written to *out_size |
Definition at line 65 of file CInterface.cpp.
References HF::Exceptions::OK.
C_INTERFACE GetSizeOfGraph | ( | const HF::SpatialStructures::Graph * | g, |
int * | out_size | ||
) |
#include <Cinterface/spatialstructures_C.h>
Get the number of nodes in a graph.
g | Pointer to the graph to get the size of |
out_size | Location where the size of the graph will be written |
Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Be sure to compress the graph (Compressing the graph) every time you add/remove edges.
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
Definition at line 400 of file spatialstructures_C.cpp.
References HF::Exceptions::OK, and HF::SpatialStructures::Graph::size().
C_INTERFACE GetSizeOfNodeVector | ( | const std::vector< HF::SpatialStructures::Node > * | node_list, |
int * | out_size | ||
) |
#include <Cinterface/spatialstructures_C.h>
Get the size of a node vector.
node_list | Node vector to get the size from |
out_size | Size of the vector will be written to *out_size |
Begin by reviewing the example at Graph setup to create a graph.
You may add edges to the graph using nodes (Adding edges from nodes)
or alternative, you may provide node IDs (graph_add_edge_from_node_IDs).
Be sure to compress the graph (Compressing the graph) every time you add/remove edges.
When you are finished with the node vector,
it must be destroyed. (Destroying a vector of node)
Finally, when you are finished with the graph,
it must be destroyed. (Destroy graph)
Definition at line 60 of file CInterface.cpp.
References HF::Exceptions::OK.
C_INTERFACE GraphAttrsToCosts | ( | HF::SpatialStructures::Graph * | graph_ptr, |
const char * | attr_key, | ||
const char * | cost_string, | ||
HF::SpatialStructures::Direction | dir | ||
) |
#include <Cinterface/spatialstructures_C.h>
Create a cost in the graph based on a set of node parameters.
graph_ptr | Graph to perform this operation on |
attr_key | Attribute to create a new cost set from. |
cost_string | Name of the new cost set. |
dir | Direction that the cost of the edge should be calculated in. For example INCOMING will use the cost of the node being traveled to by the edge. |
HF_STATUS::OK
If the cost was successfully added to the graph HF_STATUS::NOT_FOUND
If attr_key
is not the key of an already existing node parameter. Definition at line 405 of file spatialstructures_C.cpp.
References HF::SpatialStructures::Graph::AttrToCost(), HF::Exceptions::NOT_FOUND, and HF::Exceptions::OK.