mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
add Vector class
This commit is contained in:
parent
4237df8f0a
commit
cda08ecc19
@ -22,6 +22,7 @@ external-lib boost_serialization ;
|
||||
TargetPhrase.cpp
|
||||
TargetPhrases.cpp
|
||||
TranslationTask.cpp
|
||||
Vector.cpp
|
||||
Weights.cpp
|
||||
Word.cpp
|
||||
FF/Distortion.cpp
|
||||
|
9
contrib/other-builds/moses2/Vector.cpp
Normal file
9
contrib/other-builds/moses2/Vector.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Vector.cpp
|
||||
*
|
||||
* Created on: 7 Dec 2015
|
||||
* Author: hieu
|
||||
*/
|
||||
|
||||
#include "Vector.h"
|
||||
|
29
contrib/other-builds/moses2/Vector.h
Normal file
29
contrib/other-builds/moses2/Vector.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Vector.h
|
||||
*
|
||||
* Created on: 7 Dec 2015
|
||||
* Author: hieu
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "MemPool.h"
|
||||
|
||||
template <typename T>
|
||||
class Vector {
|
||||
public:
|
||||
Vector(MemPool &pool, size_t size)
|
||||
:m_size(size)
|
||||
{
|
||||
m_arr = pool.Allocate<T>(size);
|
||||
}
|
||||
|
||||
virtual ~Vector()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected:
|
||||
size_t m_size;
|
||||
T *m_arr;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user