Skip to content

Commit

Permalink
Run clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfengHKU committed Feb 17, 2025
1 parent 990b980 commit 1484a9d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
26 changes: 15 additions & 11 deletions src/function/gds/awsp_paths.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "function/gds/gds_function_collection.h"
#include "function/gds/rec_joins.h"
#include "binder/expression/node_expression.h"
#include "common/exception/interrupt.h"
#include "function/gds/auxiliary_state/path_auxiliary_state.h"
#include "function/gds/gds_function_collection.h"
#include "function/gds/rec_joins.h"
#include "main/client_context.h"
#include "processor/execution_context.h"
#include "wsp_utils.h"
#include "common/exception/interrupt.h"

using namespace kuzu::binder;
using namespace kuzu::common;
Expand All @@ -20,7 +20,8 @@ class AWSPPathsEdgeCompute : public EdgeCompute {
block = bfsGraph.addNewBlock();
}

std::vector<nodeID_t> edgeCompute(nodeID_t boundNodeID, graph::NbrScanState::Chunk &chunk, bool fwdEdge) override {
std::vector<nodeID_t> edgeCompute(nodeID_t boundNodeID, graph::NbrScanState::Chunk& chunk,
bool fwdEdge) override {
std::vector<nodeID_t> result;
chunk.forEach<T>([&](auto nbrNodeID, auto edgeID, auto weight) {
if (!block->hasSpace()) {
Expand All @@ -45,8 +46,9 @@ class AWSPPathsEdgeCompute : public EdgeCompute {

class AWSPPathsOutputWriter : public PathsOutputWriter {
public:
AWSPPathsOutputWriter(main::ClientContext* context, processor::NodeOffsetMaskMap* outputNodeMask,
common::nodeID_t sourceNodeID, PathsOutputWriterInfo info, BFSGraph& bfsGraph)
AWSPPathsOutputWriter(main::ClientContext* context,
processor::NodeOffsetMaskMap* outputNodeMask, common::nodeID_t sourceNodeID,
PathsOutputWriterInfo info, BFSGraph& bfsGraph)
: PathsOutputWriter{context, outputNodeMask, sourceNodeID, info, bfsGraph} {
costVector = createVector(LogicalType::DOUBLE(), context->getMemoryManager());
}
Expand All @@ -65,7 +67,7 @@ class AWSPPathsOutputWriter : public PathsOutputWriter {
throw InterruptException{};
}
if (curPath[curPath.size() - 1]->getCost() == 0) { // Find source. Start writing path.
curPath.pop_back(); // avoid writing source node.
curPath.pop_back(); // avoid writing source node.
writePath(curPath);
fTable.append(vectors);
if (updateCounterAndTerminate(counter)) {
Expand Down Expand Up @@ -116,7 +118,8 @@ class AllWeightedSPPathsAlgorithm : public RJAlgorithm {
AllWeightedSPPathsAlgorithm(const AllWeightedSPPathsAlgorithm& other) : RJAlgorithm{other} {}

// return srcNodeID, dstNodeID, length, [direction], pathNodeIDs, pathEdgeIDs, weight
binder::expression_vector getResultColumns(const function::GDSBindInput &bindInput) const override {
binder::expression_vector getResultColumns(
const function::GDSBindInput& bindInput) const override {
auto rjBindData = bindData->ptrCast<RJBindData>();
expression_vector columns;
columns.push_back(bindData->getNodeInput()->constCast<NodeExpression>().getInternalID());
Expand All @@ -136,7 +139,8 @@ class AllWeightedSPPathsAlgorithm : public RJAlgorithm {
}

private:
RJCompState getRJCompState(processor::ExecutionContext *context, nodeID_t sourceNodeID) override {
RJCompState getRJCompState(processor::ExecutionContext* context,
nodeID_t sourceNodeID) override {
auto clientContext = context->clientContext;
auto numNodes = sharedState->graph->getNumNodesMap(clientContext->getTransaction());
auto curFrontier = getPathLengthsFrontier(context, PathLengths::UNVISITED);
Expand Down Expand Up @@ -172,5 +176,5 @@ GDSFunction AllWeightedSPPathsFunction::getFunction() {
return GDSFunction(name, std::move(params), std::move(algo));
}

}
}
} // namespace function
} // namespace kuzu
6 changes: 3 additions & 3 deletions src/function/gds/wsp_destinations.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "binder/expression/node_expression.h"
#include "function/gds/gds_function_collection.h"
#include "function/gds/rec_joins.h"
#include "processor/execution_context.h"
#include "binder/expression/node_expression.h"
#include "wsp_utils.h"

using namespace kuzu::binder;
Expand Down Expand Up @@ -182,5 +182,5 @@ GDSFunction WeightedSPDestinationsFunction::getFunction() {
return GDSFunction(name, std::move(params), std::move(algo));
}

}
}
} // namespace function
} // namespace kuzu
2 changes: 1 addition & 1 deletion src/function/gds/wsp_paths.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "binder/binder.h"
#include "function/gds/auxiliary_state/path_auxiliary_state.h"
#include "function/gds/gds_function_collection.h"
#include "function/gds/rec_joins.h"
#include "function/gds_function.h"
#include "main/client_context.h"
#include "processor/execution_context.h"
#include "function/gds/auxiliary_state/path_auxiliary_state.h"
#include "wsp_utils.h"

using namespace kuzu::common;
Expand Down
7 changes: 3 additions & 4 deletions src/function/gds/wsp_utils.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "common/types/types.h"
#include "common/exception/runtime.h"
#include "common/string_utils.h"
#include "common/type_utils.h"
#include "common/types/types.h"

namespace kuzu {
namespace function {
Expand Down Expand Up @@ -41,6 +41,5 @@ static auto visit(const common::LogicalType& dataType, Fs... funcs) {
// LCOV_EXCL_STOP
}


}
}
} // namespace function
} // namespace kuzu
7 changes: 3 additions & 4 deletions src/include/common/enums/query_rel_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ enum class QueryRelType : uint8_t {
};

struct QueryRelTypeUtils {
static bool isRecursive(QueryRelType type) {
return type != QueryRelType::NON_RECURSIVE;
}
static bool isRecursive(QueryRelType type) { return type != QueryRelType::NON_RECURSIVE; }

static bool isWeighted(QueryRelType type) {
return type == QueryRelType::WEIGHTED_SHORTEST || type == QueryRelType::ALL_WEIGHTED_SHORTEST;
return type == QueryRelType::WEIGHTED_SHORTEST ||
type == QueryRelType::ALL_WEIGHTED_SHORTEST;
}

static PathSemantic getPathSemantic(QueryRelType queryRelType);
Expand Down
6 changes: 2 additions & 4 deletions src/include/function/gds/bfs_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ class BFSGraph {
// Used to track path for single weighted shortest path. Assume each offset has at most one
// parent.
bool tryAddSingleParentWithWeight(common::nodeID_t boundNodeID, common::relID_t edgeID,
common::nodeID_t nbrNodeID, bool fwdEdge, double weight,
ObjectBlock<ParentList>* block);
common::nodeID_t nbrNodeID, bool fwdEdge, double weight, ObjectBlock<ParentList>* block);
// Used to track path for all weighted shortest path.
bool tryAddParentWithWeight(common::nodeID_t boundNodeID, common::relID_t edgeID,
common::nodeID_t nbrNodeID, bool fwdEdge, double weight,
ObjectBlock<ParentList>* block);
common::nodeID_t nbrNodeID, bool fwdEdge, double weight, ObjectBlock<ParentList>* block);

void pinTableID(common::table_id_t tableID) { currParentPtrs = parentArray.getData(tableID); }

Expand Down

0 comments on commit 1484a9d

Please sign in to comment.