Skip to content

Commit

Permalink
[chg] change optimizer file name
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunelFeng committed Apr 7, 2024
1 parent 589ca54 commit d7b3cb8
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/GraphCtrl/GraphElement/GElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ class GElement : public GElementObject,
friend class GDynamicEngine;
friend class GTopoEngine;
friend class GAspectObject;
friend class GOptimizerObject;
friend class GOptimizer;
friend class GMaxParaOptimizer;
friend class GSeparateOptimizer;
friend class GElementRepository;
Expand Down
4 changes: 2 additions & 2 deletions src/GraphCtrl/GraphElement/_GEngine/GEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#ifndef CGRAPH_GENGINE_H
#define CGRAPH_GENGINE_H

#include "GEngineObject.h"
#include "GEngineDefine.h"
#include "../GElementObject.h"
#include "../GElementSorter.h"

CGRAPH_NAMESPACE_BEGIN

class GEngine : public GEngineObject {
class GEngine : public GElementObject {
protected:
explicit GEngine() = default;

Expand Down
2 changes: 2 additions & 0 deletions src/GraphCtrl/GraphElement/_GEngine/GEngineDefine.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef CGRAPH_GENGINEDEFINE_H
#define CGRAPH_GENGINEDEFINE_H

#include "../GElementDefine.h"

CGRAPH_NAMESPACE_BEGIN

enum class GEngineType {
Expand Down
21 changes: 0 additions & 21 deletions src/GraphCtrl/GraphElement/_GEngine/GEngineObject.h

This file was deleted.

6 changes: 3 additions & 3 deletions src/GraphCtrl/GraphElement/_GOptimizer/GMaxParaOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#include <algorithm>
#include <vector>

#include "GOptimzerObject.h"
#include "GOptimizer.h"

CGRAPH_NAMESPACE_BEGIN

class GMaxParaOptimizer : public GOptimizerObject {
class GMaxParaOptimizer : public GOptimizer {
protected:
/**
* 判定是否match计算条件
Expand All @@ -42,7 +42,7 @@ class GMaxParaOptimizer : public GOptimizerObject {
* 3. 计算补图的最大团中元素个数(maxCliqueSize),即为当前dag的最大并行度
*/
const CSize size = elements.size();
const auto& paths = GOptimizerObject::collectPaths(elements); // 根据传入的elements 的关系,分析出所有完整路径信息
const auto& paths = GOptimizer::collectPaths(elements); // 根据传入的elements 的关系,分析出所有完整路径信息

std::vector<std::vector<int>> reGraph(size, std::vector<int>(size, 1));
buildReverseGraph(elements, paths, reGraph); // 根据路径信息,求出全连接图的补图
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/***************************
@Author: Chunel
@Contact: [email protected]
@File: GOptimzerObject.h
@Time: 2023/5/14 14:28
@File: GOptimizer.h
@Time: 2024/4/7 21:27
@Desc:
***************************/

#ifndef CGRAPH_GOPTIMZEROBJECT_H
#define CGRAPH_GOPTIMZEROBJECT_H
#ifndef CGRAPH_GOPTIMIZER_H
#define CGRAPH_GOPTIMIZER_H

#include "../GElementObject.h"

CGRAPH_NAMESPACE_BEGIN

class GOptimizerObject : public GElementObject {
class GOptimizer : public GElementObject {
protected:
/**
* 记录 path 信息
Expand Down Expand Up @@ -57,5 +57,4 @@ class GOptimizerObject : public GElementObject {

CGRAPH_NAMESPACE_END


#endif //CGRAPH_GOPTIMZEROBJECT_H
#endif //CGRAPH_GOPTIMIZER_H
1 change: 1 addition & 0 deletions src/GraphCtrl/GraphElement/_GOptimizer/GOptimizerInclude.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#ifndef CGRAPH_GOPTIMIZERINCLUDE_H
#define CGRAPH_GOPTIMIZERINCLUDE_H

#include "GOptimizer.h"
#include "GMaxParaOptimizer.h"
#include "GSeparateOptimizer.h"

Expand Down
6 changes: 3 additions & 3 deletions src/GraphCtrl/GraphElement/_GOptimizer/GSeparateOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

#include <algorithm>

#include "GOptimzerObject.h"
#include "GOptimizer.h"

CGRAPH_NAMESPACE_BEGIN

class GSeparateOptimizer : public GOptimizerObject {
class GSeparateOptimizer : public GOptimizer {
protected:
/**
* 判断两个 element 是否是独立运行的
Expand All @@ -27,7 +27,7 @@ class GSeparateOptimizer : public GOptimizerObject {
static CBool checkSeparate(const GSortedGElementPtrSet& elements,
GElementCPtr fst, GElementCPtr snd) {
CBool result = false;
const auto& paths = GOptimizerObject::collectPaths(elements);
const auto& paths = GOptimizer::collectPaths(elements);
for (const auto& path : paths) {
if (std::find(path.begin(), path.end(), fst) != path.end()
&& std::find(path.begin(), path.end(), snd) != path.end()) {
Expand Down

0 comments on commit d7b3cb8

Please sign in to comment.