-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOutside.H
37 lines (33 loc) · 1.05 KB
/
Outside.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/****************************************************************
Outside.H
Copyright (C)2013 William H. Majoros ([email protected]).
This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
License (GPL) version 3, as described at www.opensource.org.
****************************************************************/
#ifndef INCL_Outside_H
#define INCL_Outside_H
#include <iostream>
#include "BOOM/TriangMatrix.H"
#include "BOOM/Sequence.H"
#include "Inside.H"
using namespace std;
using namespace BOOM;
typedef Array1D<float> Cell; // indexed by nonterminal ID
class Outside {
Inside α
TriangMatrix<Cell> B;
Sequence &S;
BinaryProductions &productions;
int numNonterminals;
int numProds;
int L;
void initCorner();
void fillMatrix();
void sumRight(Array1D< Vector<float> > &logProbs,int i,int k,int j);
void sumLeft(Array1D< Vector<float> > &logProbs,int i,int k,int j);
public:
Outside(Sequence &,BinaryProductions &,Inside &);
float likelihood() const;
float operator()(int i,int j,int nonterminal) const;
};
#endif