00001 #include "PChart.h"
00002
00003 #include "moses/FactorCollection.h"
00004
00005 namespace Moses
00006 {
00007 namespace Syntax
00008 {
00009 namespace S2T
00010 {
00011
00012 PChart::PChart(std::size_t width, bool maintainCompressedChart)
00013 {
00014 m_cells.resize(width);
00015 for (std::size_t i = 0; i < width; ++i) {
00016 m_cells[i].resize(width);
00017 }
00018 if (maintainCompressedChart) {
00019 m_compressedChart = new CompressedChart(width);
00020 for (CompressedChart::iterator p = m_compressedChart->begin();
00021 p != m_compressedChart->end(); ++p) {
00022 p->resize(FactorCollection::Instance().GetNumNonTerminals());
00023 }
00024 }
00025 }
00026
00027 PChart::~PChart()
00028 {
00029 delete m_compressedChart;
00030 }
00031
00032 }
00033 }
00034 }