其中EngTDT是我程序名字
出现错误的函数如下:刚开始调用就出现这个错误
void CTrackBasedDetec::TrackDetection()
{
CEngDetection m_Dec;
CDetection m_Detection;
map<CString,float> AllStoryDF[15864]
map<CString,float> StoryTFIDF;
StaWordsTFIDF(AllStoryDF/*,AllStoryTFIDF*/);
for (int StoryID=1; StoryID<15864;StoryID++)
{
StoryTFIDF=GetStoryTFIDF(StoryID);
int WordNumber=StaNewWords(StoryID,AllStoryDF);
if (WordNumber>NewWordsNumber)
{
ClusterNumber++;
m_Dec.WriteResult(StoryID,ClusterNumber);
StaCentroid(ClusterNumber,StoryID,StoryTFIDF);
}
else
{
float HighestSim=0.0;
int SimCluster=0;
for (int i=1;i<ClusterNumber+1;i++)
{//计算相似度,找出最大值
float sim=m_Detection.Sim(ClusterCentroid[i],StoryTFIDF);
if (sim>=HighestSim)
{
SimCluster=i;
HighestSim=sim;
}
}
if (HighestSim>Threshold) m_Dec.WriteResult(StoryID,SimCluster);
else
{//新成立一组
ClusterNumber++;
m_Dec.WriteResult(StoryID,ClusterNumber);
StaCentroid(ClusterNumber,StoryID,StoryTFIDF);//统计中心向量
}
}
}
}
出现错误的函数如下:刚开始调用就出现这个错误
void CTrackBasedDetec::TrackDetection()
{
CEngDetection m_Dec;
CDetection m_Detection;
map<CString,float> AllStoryDF[15864]
map<CString,float> StoryTFIDF;
StaWordsTFIDF(AllStoryDF/*,AllStoryTFIDF*/);
for (int StoryID=1; StoryID<15864;StoryID++)
{
StoryTFIDF=GetStoryTFIDF(StoryID);
int WordNumber=StaNewWords(StoryID,AllStoryDF);
if (WordNumber>NewWordsNumber)
{
ClusterNumber++;
m_Dec.WriteResult(StoryID,ClusterNumber);
StaCentroid(ClusterNumber,StoryID,StoryTFIDF);
}
else
{
float HighestSim=0.0;
int SimCluster=0;
for (int i=1;i<ClusterNumber+1;i++)
{//计算相似度,找出最大值
float sim=m_Detection.Sim(ClusterCentroid[i],StoryTFIDF);
if (sim>=HighestSim)
{
SimCluster=i;
HighestSim=sim;
}
}
if (HighestSim>Threshold) m_Dec.WriteResult(StoryID,SimCluster);
else
{//新成立一组
ClusterNumber++;
m_Dec.WriteResult(StoryID,ClusterNumber);
StaCentroid(ClusterNumber,StoryID,StoryTFIDF);//统计中心向量
}
}
}
}
解决方法1:把一些变量申请在堆上(指针,用new申请)
解决方法2:把默认的栈改大一点,在link选项选catalog的output,指定栈的大小
link
下面加上/stack:0x100000
后面的数字是16进制,自己调一下大小