⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qydirectedpath.h

📁 在GRAPH中找出K條最短路徑,並且輸出到SP.txt檔中
💻 H
字号:
// ____________________________________________________________________________
//
//  General Information:
//
//  File Name:      QYDirectedPath.h
//  Author:         Yan Qi
//  Project:        KShortestPath
//
//  Description:    Declaration of class(es) CQYDirectedPath
//
//  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//  Revision History:
//
//  11/21/2006   Yan   Initial Version
//  01/11/2008   Yan   Modified Version
//  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//  Copyright Notice:
//
//  Copyright (c) 2006 Your Company Inc.
//
//  Warning: This computer program is protected by copyright law and
//  international treaties.  Unauthorized reproduction or distribution
//  of this program, or any portion of it, may result in severe civil and
//  criminal penalties, and will be prosecuted to the maximum extent
//  possible under the law.
//
// ____________________________________________________________________________

#ifndef _QYDIRECTEDPATH_H_
#define _QYDIRECTEDPATH_H_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include<stdio.h>
#include<iostream>
#include<fstream>
using namespace std;

#include <vector>
#include <fstream>
#include <algorithm>

namespace asu_emit_qyan
{
    static int sou[200][20]={'\0'},cha[200][20]={'\0'};
    static int r=0;

	class CQYDirectedPath
	{
	public:
		CQYDirectedPath(){};
		CQYDirectedPath(int pId, double pCost, const std::vector<int>& pVertexList)
			:m_nId(pId), m_dCost(pCost)
		{
			m_vVertexList.assign( pVertexList.begin(),pVertexList.end());
		}

		virtual ~CQYDirectedPath(){};

		// Getter and Setter
		int GetId() const { return m_nId; }
		void SetId(int val) { m_nId = val; }

		double GetCost() const { return m_dCost; }
		void SetCost(double val) { m_dCost = val; }

		int GetLength() const { return m_vVertexList.size(); }

		std::vector<int> GetVertexList() const { return m_vVertexList; }

		void SetVertexList(std::vector<int> val) { m_vVertexList = val; }

		int GetSourceNodeId() const { return m_nSourceNodeId; }
		void SetSourceNodeId(int val) { m_nSourceNodeId = val; }

		int GetTerminalNodeId() const { return m_nTerminalNodeId; }
		void SetTerminalNodeId(int val) { m_nTerminalNodeId = val; }

		// display the content
		void PrintOut(std::ostream& out_stream) const
		{
           int i=0;
			//out_stream << "Cost: " << m_dCost << " Length: " << m_vVertexList.size() << std::endl;
			//std::copy( m_vVertexList.rbegin(),m_vVertexList.rend(), std::ostream_iterator<int>(out_stream, " "));

                while(i!=m_vVertexList.size() && r!=150){//i=0~隔畖

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -