GPUdb C++ API  Version 7.2.2.4
solve_graph.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the Kinetica schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __SOLVE_GRAPH_H__
7 #define __SOLVE_GRAPH_H__
8 
9 namespace gpudb
10 {
27  {
32  graphName(std::string()),
33  weightsOnEdges(std::vector<std::string>()),
34  restrictions(std::vector<std::string>()),
35  solverType(std::string()),
36  sourceNodes(std::vector<std::string>()),
37  destinationNodes(std::vector<std::string>()),
38  solutionTable(std::string()),
39  options(std::map<std::string, std::string>())
40  {
41  }
42 
438  SolveGraphRequest(const std::string& graphName_, const std::vector<std::string>& weightsOnEdges_, const std::vector<std::string>& restrictions_, const std::string& solverType_, const std::vector<std::string>& sourceNodes_, const std::vector<std::string>& destinationNodes_, const std::string& solutionTable_, const std::map<std::string, std::string>& options_):
439  graphName( graphName_ ),
440  weightsOnEdges( weightsOnEdges_ ),
441  restrictions( restrictions_ ),
442  solverType( solverType_ ),
443  sourceNodes( sourceNodes_ ),
444  destinationNodes( destinationNodes_ ),
445  solutionTable( solutionTable_ ),
446  options( options_ )
447  {
448  }
449 
453  std::string graphName;
454 
472  std::vector<std::string> weightsOnEdges;
473 
492  std::vector<std::string> restrictions;
493 
548  std::string solverType;
549 
556  std::vector<std::string> sourceNodes;
557 
564  std::vector<std::string> destinationNodes;
565 
573  std::string solutionTable;
574 
746  std::map<std::string, std::string> options;
747  };
748 } // end namespace gpudb
749 
750 namespace avro
751 {
752  template<> struct codec_traits<gpudb::SolveGraphRequest>
753  {
754  static void encode(Encoder& e, const gpudb::SolveGraphRequest& v)
755  {
756  ::avro::encode(e, v.graphName);
757  ::avro::encode(e, v.weightsOnEdges);
758  ::avro::encode(e, v.restrictions);
759  ::avro::encode(e, v.solverType);
760  ::avro::encode(e, v.sourceNodes);
761  ::avro::encode(e, v.destinationNodes);
762  ::avro::encode(e, v.solutionTable);
763  ::avro::encode(e, v.options);
764  }
765 
766  static void decode(Decoder& d, gpudb::SolveGraphRequest& v)
767  {
768  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
769  {
770  const std::vector<size_t> fo = rd->fieldOrder();
771 
772  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
773  {
774  switch (*it)
775  {
776  case 0:
777  ::avro::decode(d, v.graphName);
778  break;
779 
780  case 1:
781  ::avro::decode(d, v.weightsOnEdges);
782  break;
783 
784  case 2:
785  ::avro::decode(d, v.restrictions);
786  break;
787 
788  case 3:
789  ::avro::decode(d, v.solverType);
790  break;
791 
792  case 4:
793  ::avro::decode(d, v.sourceNodes);
794  break;
795 
796  case 5:
797  ::avro::decode(d, v.destinationNodes);
798  break;
799 
800  case 6:
801  ::avro::decode(d, v.solutionTable);
802  break;
803 
804  case 7:
805  ::avro::decode(d, v.options);
806  break;
807 
808  default:
809  break;
810  }
811  }
812  }
813  else
814  {
815  ::avro::decode(d, v.graphName);
816  ::avro::decode(d, v.weightsOnEdges);
817  ::avro::decode(d, v.restrictions);
818  ::avro::decode(d, v.solverType);
819  ::avro::decode(d, v.sourceNodes);
820  ::avro::decode(d, v.destinationNodes);
821  ::avro::decode(d, v.solutionTable);
822  ::avro::decode(d, v.options);
823  }
824  }
825  };
826 } // end namespace avro
827 
828 namespace gpudb
829 {
835  {
840  result(bool()),
841  resultPerDestinationNode(std::vector<float>()),
842  info(std::map<std::string, std::string>())
843  {
844  }
845 
849  bool result;
850 
856  std::vector<float> resultPerDestinationNode;
857 
861  std::map<std::string, std::string> info;
862  };
863 } // end namespace gpudb
864 
865 namespace avro
866 {
867  template<> struct codec_traits<gpudb::SolveGraphResponse>
868  {
869  static void encode(Encoder& e, const gpudb::SolveGraphResponse& v)
870  {
871  ::avro::encode(e, v.result);
872  ::avro::encode(e, v.resultPerDestinationNode);
873  ::avro::encode(e, v.info);
874  }
875 
876  static void decode(Decoder& d, gpudb::SolveGraphResponse& v)
877  {
878  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
879  {
880  const std::vector<size_t> fo = rd->fieldOrder();
881 
882  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
883  {
884  switch (*it)
885  {
886  case 0:
887  ::avro::decode(d, v.result);
888  break;
889 
890  case 1:
891  ::avro::decode(d, v.resultPerDestinationNode);
892  break;
893 
894  case 2:
895  ::avro::decode(d, v.info);
896  break;
897 
898  default:
899  break;
900  }
901  }
902  }
903  else
904  {
905  ::avro::decode(d, v.result);
906  ::avro::decode(d, v.resultPerDestinationNode);
907  ::avro::decode(d, v.info);
908  }
909  }
910  };
911 } // end namespace avro
912 
913 #endif // __SOLVE_GRAPH_H__
std::vector< std::string > weightsOnEdges
Additional weights to apply to the edges of an existing graph.
Definition: solve_graph.h:472
SolveGraphRequest()
Constructs a SolveGraphRequest object with default parameters.
Definition: solve_graph.h:31
std::map< std::string, std::string > info
Additional information.
Definition: solve_graph.h:861
std::string solutionTable
Name of the table to store the solution, in [ schema_name.
Definition: solve_graph.h:573
A set of parameters for GPUdb::solveGraph.
Definition: solve_graph.h:26
std::string graphName
Name of the graph resource to solve.
Definition: solve_graph.h:453
std::map< std::string, std::string > options
Additional parameters.
Definition: solve_graph.h:746
bool result
Indicates a successful solution on all servers.
Definition: solve_graph.h:849
std::vector< float > resultPerDestinationNode
Cost or Pagerank (based on solver type) for each destination node requested.
Definition: solve_graph.h:856
std::string solverType
The type of solver to use for the graph.
Definition: solve_graph.h:548
SolveGraphResponse()
Constructs a SolveGraphResponse object with default parameters.
Definition: solve_graph.h:839
std::vector< std::string > restrictions
Additional restrictions to apply to the nodes/edges of an existing graph.
Definition: solve_graph.h:492
SolveGraphRequest(const std::string &graphName_, const std::vector< std::string > &weightsOnEdges_, const std::vector< std::string > &restrictions_, const std::string &solverType_, const std::vector< std::string > &sourceNodes_, const std::vector< std::string > &destinationNodes_, const std::string &solutionTable_, const std::map< std::string, std::string > &options_)
Constructs a SolveGraphRequest object with the specified parameters.
Definition: solve_graph.h:438
std::vector< std::string > destinationNodes
It can be one of the nodal identifiers - e.g: 'NODE_WKTPOINT' for destination (target) nodes.
Definition: solve_graph.h:564
std::vector< std::string > sourceNodes
It can be one of the nodal identifiers - e.g: 'NODE_WKTPOINT' for source nodes.
Definition: solve_graph.h:556
A set of results returned by GPUdb::solveGraph.
Definition: solve_graph.h:834