public class JNvgraph extends Object
Modifier and Type | Method and Description |
---|---|
static void |
initialize()
Initializes the native library.
|
static int |
nvgraphAllocateEdgeData(nvgraphHandle handle,
nvgraphGraphDescr descrG,
long numsets,
Pointer settypes)
Allocate numsets vectors of size E reprensenting Edge Data and attached them the graph.
|
static int |
nvgraphAllocateVertexData(nvgraphHandle handle,
nvgraphGraphDescr descrG,
long numsets,
Pointer settypes)
Allocate numsets vectors of size V reprensenting Vertex Data and attached them the graph.
|
static int |
nvgraphAnalyzeClustering(nvgraphHandle handle,
nvgraphGraphDescr graph_descr,
long weight_index,
int n_clusters,
Pointer clustering,
int metric,
Pointer score)
nvGRAPH analyze clustering
Given a graph, a clustering, and a metric
compute the score that measures the clustering quality according to the metric.
|
static int |
nvgraphContractGraph(nvgraphHandle handle,
nvgraphGraphDescr descrG,
nvgraphGraphDescr contrdescrG,
Pointer aggregates,
long numaggregates,
int VertexCombineOp,
int VertexReduceOp,
int EdgeCombineOp,
int EdgeReduceOp,
int flag)
nvGRAPH contraction
given array of agregates contract graph with
given (Combine, Reduce) operators for Vertex Set
and Edge Set;
|
static int |
nvgraphConvertGraph(nvgraphHandle handle,
nvgraphGraphDescr srcDescrG,
nvgraphGraphDescr dstDescrG,
int dstTType)
Convert graph to another structure
|
static int |
nvgraphConvertTopology(nvgraphHandle handle,
int srcTType,
Object srcTopology,
Pointer srcEdgeData,
Pointer dataType,
int dstTType,
Object dstTopology,
Pointer dstEdgeData)
Convert the edge data to another topology
|
static int |
nvgraphCreate(nvgraphHandle handle)
Open the library and create the handle
|
static int |
nvgraphCreateGraphDescr(nvgraphHandle handle,
nvgraphGraphDescr descrG)
Create an empty graph descriptor
|
static int |
nvgraphDestroy(nvgraphHandle handle)
Close the library and destroy the handle
|
static int |
nvgraphDestroyGraphDescr(nvgraphHandle handle,
nvgraphGraphDescr descrG)
Destroy a graph descriptor
|
static int |
nvgraphExtractSubgraphByEdge(nvgraphHandle handle,
nvgraphGraphDescr descrG,
nvgraphGraphDescr subdescrG,
Pointer subedges,
long numedges)
create a new graph by extracting a subgraph given a list of edges
|
static int |
nvgraphExtractSubgraphByVertex(nvgraphHandle handle,
nvgraphGraphDescr descrG,
nvgraphGraphDescr subdescrG,
Pointer subvertices,
long numvertices)
create a new graph by extracting a subgraph given a list of vertices
|
static int |
nvgraphGetEdgeData(nvgraphHandle handle,
nvgraphGraphDescr descrG,
Pointer edgeData,
long setnum)
Copy the edge set #setnum in *edgeData, sets have 0-based index
|
static int |
nvgraphGetGraphStructure(nvgraphHandle handle,
nvgraphGraphDescr descrG,
Object topologyData,
int[] TType)
Query size and topology information from the graph descriptor
|
static int |
nvgraphGetProperty(int type,
int[] value)
Return properties values for the nvGraph library, such as library version
|
static int |
nvgraphGetVertexData(nvgraphHandle handle,
nvgraphGraphDescr descrG,
Pointer vertexData,
long setnum)
Copy the edge set #setnum in *edgeData, sets have 0-based index
Conversions are not sopported so nvgraphTopologyType_t should match the graph structure
|
static int |
nvgraphPagerank(nvgraphHandle handle,
nvgraphGraphDescr descrG,
long weight_index,
Pointer alpha,
long bookmark_index,
int has_guess,
long pagerank_index,
float tolerance,
int max_iter)
nvGRAPH PageRank
Find PageRank for each vertex of a graph with a given transition probabilities, a bookmark vector of dangling vertices, and the damping factor.
|
static int |
nvgraphSetEdgeData(nvgraphHandle handle,
nvgraphGraphDescr descrG,
Pointer edgeData,
long setnum)
Update the edge set #setnum with the data in *edgeData, sets have 0-based index
|
static int |
nvgraphSetGraphStructure(nvgraphHandle handle,
nvgraphGraphDescr descrG,
Object topologyData,
int TType)
Set size, topology data in the graph descriptor
|
static int |
nvgraphSetVertexData(nvgraphHandle handle,
nvgraphGraphDescr descrG,
Pointer vertexData,
long setnum)
Update the vertex set #setnum with the data in *vertexData, sets have 0-based index
Conversions are not sopported so nvgraphTopologyType_t should match the graph structure
|
static int |
nvgraphSpectralClustering(nvgraphHandle handle,
nvgraphGraphDescr graph_descr,
long weight_index,
SpectralClusteringParameter params,
Pointer clustering,
Pointer eig_vals,
Pointer eig_vects)
nvGRAPH spectral clustering
given a graph and solver parameters of struct SpectralClusteringParameter,
assign vertices to groups such as
intra-group connections are strong and/or inter-groups connections are weak
using spectral technique.
|
static int |
nvgraphSrSpmv(nvgraphHandle handle,
nvgraphGraphDescr descrG,
long weight_index,
Pointer alpha,
long x_index,
Pointer beta,
long y_index,
int SR)
nvGRAPH Semi-ring sparse matrix vector multiplication
|
static int |
nvgraphSssp(nvgraphHandle handle,
nvgraphGraphDescr descrG,
long weight_index,
Pointer source_vert,
long sssp_index)
nvGRAPH Single Source Shortest Path (SSSP)
Calculate the shortest path distance from a single vertex in the graph to all other vertices.
|
static String |
nvgraphStatusGetString(int status) |
static int |
nvgraphTraversal(nvgraphHandle handle,
nvgraphGraphDescr descrG,
int traversalT,
Pointer source_vert,
nvgraphTraversalParameter params) |
static int |
nvgraphTraversalGetAlpha(nvgraphTraversalParameter param,
long[] value) |
static int |
nvgraphTraversalGetBeta(nvgraphTraversalParameter param,
long[] value) |
static int |
nvgraphTraversalGetDistancesIndex(nvgraphTraversalParameter param,
long[] value) |
static int |
nvgraphTraversalGetEdgeMaskIndex(nvgraphTraversalParameter param,
long[] value) |
static int |
nvgraphTraversalGetPredecessorsIndex(nvgraphTraversalParameter param,
long[] value) |
static int |
nvgraphTraversalGetUndirectedFlag(nvgraphTraversalParameter param,
long[] value) |
static int |
nvgraphTraversalParameterInit(nvgraphTraversalParameter param) |
static int |
nvgraphTraversalSetAlpha(nvgraphTraversalParameter param,
long value) |
static int |
nvgraphTraversalSetBeta(nvgraphTraversalParameter param,
long value) |
static int |
nvgraphTraversalSetDistancesIndex(nvgraphTraversalParameter param,
long value) |
static int |
nvgraphTraversalSetEdgeMaskIndex(nvgraphTraversalParameter param,
long value) |
static int |
nvgraphTraversalSetPredecessorsIndex(nvgraphTraversalParameter param,
long value) |
static int |
nvgraphTraversalSetUndirectedFlag(nvgraphTraversalParameter param,
long value) |
static int |
nvgraphTriangleCount(nvgraphHandle handle,
nvgraphGraphDescr graph_descr,
long[] result)
nvGRAPH Triangles counting
count number of triangles (cycles of size 3) formed by graph edges
|
static int |
nvgraphWidestPath(nvgraphHandle handle,
nvgraphGraphDescr descrG,
long weight_index,
Pointer source_vert,
long widest_path_index)
nvGRAPH WidestPath
Find widest path potential from source_index to every other vertices.
|
static void |
setExceptionsEnabled(boolean enabled)
Enables or disables exceptions.
|
static void |
setLogLevel(LogLevel logLevel)
Set the specified log level for the JNvgraph library.
|
public static void initialize()
public static void setExceptionsEnabled(boolean enabled)
cudnnStatus
from the native methods.
If exceptions are enabled, a CudaException with a detailed error
message will be thrown if a method is about to set a result code
that is not nvgraphStatus.NVGRAPH_STATUS_SUCCESSenabled
- Whether exceptions are enabledpublic static void setLogLevel(LogLevel logLevel)
logLevel
- The log level to use.public static String nvgraphStatusGetString(int status)
public static int nvgraphGetProperty(int type, int[] value)
public static int nvgraphCreate(nvgraphHandle handle)
public static int nvgraphDestroy(nvgraphHandle handle)
public static int nvgraphCreateGraphDescr(nvgraphHandle handle, nvgraphGraphDescr descrG)
public static int nvgraphDestroyGraphDescr(nvgraphHandle handle, nvgraphGraphDescr descrG)
public static int nvgraphSetGraphStructure(nvgraphHandle handle, nvgraphGraphDescr descrG, Object topologyData, int TType)
public static int nvgraphGetGraphStructure(nvgraphHandle handle, nvgraphGraphDescr descrG, Object topologyData, int[] TType)
public static int nvgraphAllocateVertexData(nvgraphHandle handle, nvgraphGraphDescr descrG, long numsets, Pointer settypes)
public static int nvgraphAllocateEdgeData(nvgraphHandle handle, nvgraphGraphDescr descrG, long numsets, Pointer settypes)
public static int nvgraphSetVertexData(nvgraphHandle handle, nvgraphGraphDescr descrG, Pointer vertexData, long setnum)
public static int nvgraphGetVertexData(nvgraphHandle handle, nvgraphGraphDescr descrG, Pointer vertexData, long setnum)
public static int nvgraphConvertTopology(nvgraphHandle handle, int srcTType, Object srcTopology, Pointer srcEdgeData, Pointer dataType, int dstTType, Object dstTopology, Pointer dstEdgeData)
public static int nvgraphConvertGraph(nvgraphHandle handle, nvgraphGraphDescr srcDescrG, nvgraphGraphDescr dstDescrG, int dstTType)
public static int nvgraphSetEdgeData(nvgraphHandle handle, nvgraphGraphDescr descrG, Pointer edgeData, long setnum)
public static int nvgraphGetEdgeData(nvgraphHandle handle, nvgraphGraphDescr descrG, Pointer edgeData, long setnum)
public static int nvgraphExtractSubgraphByVertex(nvgraphHandle handle, nvgraphGraphDescr descrG, nvgraphGraphDescr subdescrG, Pointer subvertices, long numvertices)
public static int nvgraphExtractSubgraphByEdge(nvgraphHandle handle, nvgraphGraphDescr descrG, nvgraphGraphDescr subdescrG, Pointer subedges, long numedges)
public static int nvgraphSrSpmv(nvgraphHandle handle, nvgraphGraphDescr descrG, long weight_index, Pointer alpha, long x_index, Pointer beta, long y_index, int SR)
public static int nvgraphTraversalParameterInit(nvgraphTraversalParameter param)
public static int nvgraphTraversalSetDistancesIndex(nvgraphTraversalParameter param, long value)
public static int nvgraphTraversalGetDistancesIndex(nvgraphTraversalParameter param, long[] value)
public static int nvgraphTraversalSetPredecessorsIndex(nvgraphTraversalParameter param, long value)
public static int nvgraphTraversalGetPredecessorsIndex(nvgraphTraversalParameter param, long[] value)
public static int nvgraphTraversalSetEdgeMaskIndex(nvgraphTraversalParameter param, long value)
public static int nvgraphTraversalGetEdgeMaskIndex(nvgraphTraversalParameter param, long[] value)
public static int nvgraphTraversalSetUndirectedFlag(nvgraphTraversalParameter param, long value)
public static int nvgraphTraversalGetUndirectedFlag(nvgraphTraversalParameter param, long[] value)
public static int nvgraphTraversalSetAlpha(nvgraphTraversalParameter param, long value)
public static int nvgraphTraversalGetAlpha(nvgraphTraversalParameter param, long[] value)
public static int nvgraphTraversalSetBeta(nvgraphTraversalParameter param, long value)
public static int nvgraphTraversalGetBeta(nvgraphTraversalParameter param, long[] value)
public static int nvgraphTraversal(nvgraphHandle handle, nvgraphGraphDescr descrG, int traversalT, Pointer source_vert, nvgraphTraversalParameter params)
public static int nvgraphSssp(nvgraphHandle handle, nvgraphGraphDescr descrG, long weight_index, Pointer source_vert, long sssp_index)
public static int nvgraphWidestPath(nvgraphHandle handle, nvgraphGraphDescr descrG, long weight_index, Pointer source_vert, long widest_path_index)
public static int nvgraphPagerank(nvgraphHandle handle, nvgraphGraphDescr descrG, long weight_index, Pointer alpha, long bookmark_index, int has_guess, long pagerank_index, float tolerance, int max_iter)
public static int nvgraphContractGraph(nvgraphHandle handle, nvgraphGraphDescr descrG, nvgraphGraphDescr contrdescrG, Pointer aggregates, long numaggregates, int VertexCombineOp, int VertexReduceOp, int EdgeCombineOp, int EdgeReduceOp, int flag)
nvGRAPH contraction given array of agregates contract graph with given (Combine, Reduce) operators for Vertex Set and Edge Set;
public static int nvgraphSpectralClustering(nvgraphHandle handle, nvgraphGraphDescr graph_descr, long weight_index, SpectralClusteringParameter params, Pointer clustering, Pointer eig_vals, Pointer eig_vects)
nvGRAPH spectral clustering given a graph and solver parameters of struct SpectralClusteringParameter, assign vertices to groups such as intra-group connections are strong and/or inter-groups connections are weak using spectral technique.
public static int nvgraphAnalyzeClustering(nvgraphHandle handle, nvgraphGraphDescr graph_descr, long weight_index, int n_clusters, Pointer clustering, int metric, Pointer score)
nvGRAPH analyze clustering Given a graph, a clustering, and a metric compute the score that measures the clustering quality according to the metric.
public static int nvgraphTriangleCount(nvgraphHandle handle, nvgraphGraphDescr graph_descr, long[] result)
Copyright © 2019. All rights reserved.