Home
last modified time | relevance | path

Searched refs:Weight (Results 1 – 25 of 155) sorted by relevance

1234567

/external/openfst/src/test/
Dweight-tester.h34 template<class Weight, class WeightGenerator>
42 Weight w1 = weight_generator_();
43 Weight w2 = weight_generator_();
44 Weight w3 = weight_generator_();
46 VLOG(1) << "weight type = " << Weight::Type();
66 void TestSemiring(Weight w1, Weight w2, Weight w3) { in TestSemiring()
76 CHECK(Plus(w1, Weight::Zero()) == w1); in TestSemiring()
77 CHECK(Plus(Weight::Zero(), w1) == w1); in TestSemiring()
78 CHECK(Times(w1, Weight::One()) == w1); in TestSemiring()
79 CHECK(Times(Weight::One(), w1) == w1); in TestSemiring()
[all …]
/external/srec/tools/thirdparty/OpenFst/fst/lib/
Dprune.h31 typedef typename A::Weight Weight; typedef
34 Weight threshold;
39 vector<Weight> *idistance;
42 vector<Weight> *fdistance;
44 PruneOptions(const Weight& t, ArcFilter f, vector<Weight> *id = 0,
45 vector<Weight> *fd = 0)
58 typedef typename Arc::Weight Weight; in Prune() typedef
61 if ((Weight::Properties() & (kPath | kCommutative)) in Prune()
65 << Weight::Type(); in Prune()
70 vector<Weight> *idistance = opts.idistance; in Prune()
[all …]
Dshortest-path.h63 vector<typename Arc::Weight> *distance, in SingleShortestPath()
66 typedef typename Arc::Weight Weight; in SingleShortestPath() typedef
75 vector<Weight> rdistance; in SingleShortestPath()
82 Weight f_distance = Weight::Zero(); in SingleShortestPath()
90 if ((Weight::Properties() & (kPath | kRightSemiring)) in SingleShortestPath()
93 << " property and be right distributive: " << Weight::Type(); in SingleShortestPath()
96 distance->push_back(Weight::Zero()); in SingleShortestPath()
99 arc_parent.push_back(Arc(kNoLabel, kNoLabel, Weight::Zero(), kNoStateId)); in SingleShortestPath()
101 distance->push_back(Weight::One()); in SingleShortestPath()
103 arc_parent.push_back(Arc(kNoLabel, kNoLabel, Weight::Zero(), kNoStateId)); in SingleShortestPath()
[all …]
Drandom-weight.h39 typedef TropicalWeight Weight; typedef
46 Weight operator() () const { in operator()
49 return Weight::Zero(); in operator()
51 return Weight(static_cast<float>(n)); in operator()
66 typedef LogWeight Weight; typedef
73 Weight operator() () const { in operator()
76 return Weight::Zero(); in operator()
78 return Weight(static_cast<float>(n)); in operator()
94 typedef StringWeight<L, S> Weight; typedef
101 Weight operator() () const { in operator()
[all …]
Dshortest-distance.h58 typedef typename Arc::Weight Weight; typedef
62 vector<Weight> *distance, in ShortestDistanceState()
79 vector<Weight> *distance_;
85 vector<Weight> rdistance_; // Relaxation distance.
99 if (!(Weight::Properties() & kRightSemiring)) in ShortestDistance()
101 << Weight::Type(); in ShortestDistance()
115 distance_->push_back(Weight::Zero()); in ShortestDistance()
116 rdistance_.push_back(Weight::Zero()); in ShortestDistance()
124 (*distance_)[source] = Weight::One(); in ShortestDistance()
125 rdistance_[source] = Weight::One(); in ShortestDistance()
[all …]
Dreweight.h39 void Reweight(MutableFst<Arc> *fst, vector<typename Arc::Weight> potential, in Reweight()
41 typedef typename Arc::Weight Weight; in Reweight() typedef
46 potential.push_back(Weight::Zero()); in Reweight()
48 if (type == REWEIGHT_TO_FINAL && !(Weight::Properties() & kRightSemiring)) in Reweight()
51 << Weight::Type(); in Reweight()
53 if (type == REWEIGHT_TO_INITIAL && !(Weight::Properties() & kLeftSemiring)) in Reweight()
56 << Weight::Type(); in Reweight()
66 if ((potential[state] == Weight::Zero()) || in Reweight()
67 (potential[arc.nextstate] == Weight::Zero())) in Reweight()
70 && (potential[state] != Weight::Zero())) in Reweight()
[all …]
Darc.h32 typedef TropicalWeight Weight; typedef
35 StdArc(Label i, Label o, Weight w, StateId s) in StdArc()
47 Weight weight; // Transition weight
56 typedef LogWeight Weight; typedef
59 LogArc(Label i, Label o, Weight w, StateId s) in LogArc()
71 Weight weight; // Transition weight
81 typedef StringWeight<int, S> Weight; typedef
84 StringArc(Label i, Label o, Weight w, StateId s) in StringArc()
100 Weight weight; // Transition weight
112 typedef GallicWeight<Label, typename A::Weight, S> Weight; typedef
[all …]
Ddeterminize.h49 typedef W Weight; typedef
62 typedef StringWeight<L, S> Weight; typedef
64 Weight operator()(const Weight &w1, const Weight &w2) const { in operator()
72 return Weight::One(); in operator()
73 else if (w1 == Weight::Zero()) in operator()
74 return Weight(iter2.Value()); in operator()
75 else if (w2 == Weight::Zero()) in operator()
76 return Weight(iter1.Value()); in operator()
78 return Weight(iter1.Value()); in operator()
80 return Weight::One(); in operator()
[all …]
Drational.h53 typedef typename A::Weight Weight; typedef
71 rfst_.SetFinal(1, Weight::One()); in InitUnion()
75 rfst_.AddArc(0, A(0, -1, Weight::One(), 1)); in InitUnion()
76 rfst_.AddArc(0, A(0, -2, Weight::One(), 1)); in InitUnion()
94 rfst_.SetFinal(2, Weight::One()); in InitConcat()
98 rfst_.AddArc(0, A(0, -1, Weight::One(), 1)); in InitConcat()
99 rfst_.AddArc(1, A(0, -2, Weight::One(), 2)); in InitConcat()
115 rfst_.SetFinal(0, Weight::One()); in InitClosure()
116 rfst_.AddArc(0, A(0, -1, Weight::One(), 0)); in InitClosure()
121 rfst_.SetFinal(1, Weight::One()); in InitClosure()
[all …]
Dmap.h83 typedef typename A::Weight Weight; in Map() typedef
94 fst->SetFinal(superfinal, Weight::One()); in Map()
119 fst->SetFinal(superfinal, Weight::One()); in Map()
123 fst->SetFinal(s, Weight::Zero()); in Map()
134 final_arc.weight != Weight::Zero()) in Map()
137 fst->SetFinal(s, Weight::Zero()); in Map()
160 typedef typename A::Weight Weight; in Map() typedef
177 ofst->SetFinal(superfinal, B::Weight::One()); in Map()
201 ofst->SetFinal(superfinal, B::Weight::One()); in Map()
205 ofst->SetFinal(s, B::Weight::Zero()); in Map()
[all …]
/external/openfst/src/include/fst/
Dprune.h37 typedef typename A::Weight Weight; typedef
41 Weight weight_threshold;
47 const vector<Weight> *distance;
52 explicit PruneOptions(const Weight& w, StateId s, ArcFilter f,
53 vector<Weight> *d = 0, float e = kDelta)
68 typedef W Weight; typedef
70 PruneCompare(const vector<Weight> &idistance, in PruneCompare()
71 const vector<Weight> &fdistance) in PruneCompare()
75 Weight wx = Times(x < idistance_.size() ? idistance_[x] : Weight::Zero(), in operator()
76 x < fdistance_.size() ? fdistance_[x] : Weight::Zero()); in operator()
[all …]
Drandom-weight.h50 typedef TropicalWeightTpl<T> Weight; typedef
57 Weight operator() () const { in operator()
60 return Weight::Zero(); in operator()
62 return Weight(static_cast<T>(n)); in operator()
82 typedef LogWeightTpl<T> Weight; typedef
89 Weight operator() () const { in operator()
92 return Weight::Zero(); in operator()
94 return Weight(static_cast<T>(n)); in operator()
115 typedef MinMaxWeightTpl<T> Weight; typedef
122 Weight operator() () const { in operator()
[all …]
Dshortest-path.h43 typedef typename Arc::Weight Weight; typedef
53 Weight weight_threshold; // pruning weight threshold.
58 bool fp = false, Weight w = Weight::Zero(),
80 vector<typename Arc::Weight> *distance, in SingleShortestPath()
83 typedef typename Arc::Weight Weight; in SingleShortestPath() typedef
100 Weight f_distance = Weight::Zero(); in SingleShortestPath()
111 if (opts.weight_threshold != Weight::Zero() || in SingleShortestPath()
118 if ((Weight::Properties() & (kPath | kRightSemiring)) in SingleShortestPath()
121 << " property and be right distributive: " << Weight::Type(); in SingleShortestPath()
126 distance->push_back(Weight::Zero()); in SingleShortestPath()
[all …]
Dshortest-distance.h75 typedef typename Arc::Weight Weight; typedef
79 vector<Weight> *distance, in ShortestDistanceState()
97 vector<Weight> *distance_;
104 vector<Weight> rdistance_; // Relaxation distance.
123 if (!(Weight::Properties() & kRightSemiring)) { in ShortestDistance()
125 << Weight::Type(); in ShortestDistance()
130 if (first_path_ && !(Weight::Properties() & kPath)) { in ShortestDistance()
133 << Weight::Type(); in ShortestDistance()
150 distance_->push_back(Weight::Zero()); in ShortestDistance()
151 rdistance_.push_back(Weight::Zero()); in ShortestDistance()
[all …]
Darc.h46 typedef W Weight; typedef
50 ArcTpl(Label i, Label o, const Weight& w, StateId s) in ArcTpl()
57 (Weight::Type() == "tropical") ? "standard" : Weight::Type(); in Type()
63 Weight weight;
80 typedef StringWeight<int, S> Weight; typedef
83 StringArc(Label i, Label o, Weight w, StateId s) in StringArc()
99 Weight weight; // Transition weight
111 typedef GallicWeight<Label, typename A::Weight, S> Weight; typedef
115 GallicArc(Label i, Label o, Weight w, StateId s) in GallicArc()
133 Weight weight; // Transition weight
[all …]
Daccumulator.h46 typedef typename A::Weight Weight; typedef
56 Weight Sum(Weight w, Weight v) { in Sum()
61 Weight Sum(Weight w, ArcIterator *aiter, ssize_t begin, in Sum()
63 Weight sum = w; in Sum()
85 typedef typename A::Weight Weight; typedef
95 Weight Sum(Weight w, Weight v) { in Sum()
100 Weight Sum(Weight w, ArcIterator *aiter, ssize_t begin, in Sum()
102 Weight sum = w; in Sum()
114 Weight LogPlus(Weight w, Weight v) { in LogPlus()
123 WeightConvert<Weight, Log64Weight> to_log_weight_;
[all …]
Dreweight.h45 const vector<typename Arc::Weight> &potential, in Reweight()
47 typedef typename Arc::Weight Weight; in Reweight() typedef
52 if (type == REWEIGHT_TO_FINAL && !(Weight::Properties() & kRightSemiring)) { in Reweight()
55 << Weight::Type(); in Reweight()
60 if (type == REWEIGHT_TO_INITIAL && !(Weight::Properties() & kLeftSemiring)) { in Reweight()
63 << Weight::Type(); in Reweight()
73 typename Arc::Weight weight = potential[state]; in Reweight()
74 if (weight != Weight::Zero()) { in Reweight()
81 typename Arc::Weight nextweight = potential[arc.nextstate]; in Reweight()
82 if (nextweight == Weight::Zero()) in Reweight()
[all …]
Ddeterminize.h57 typedef W Weight; typedef
70 typedef StringWeight<L, S> Weight; typedef
72 Weight operator()(const Weight &w1, const Weight &w2) const { in operator()
78 return Weight::NoWeight(); in operator()
80 return Weight::One(); in operator()
81 } else if (w1 == Weight::Zero()) { in operator()
82 return Weight(iter2.Value()); in operator()
83 } else if (w2 == Weight::Zero()) { in operator()
84 return Weight(iter1.Value()); in operator()
86 return Weight(iter1.Value()); in operator()
[all …]
Dpush.h44 typename Arc::Weight ComputeTotalWeight( in ComputeTotalWeight()
46 const vector<typename Arc::Weight> &distance, in ComputeTotalWeight()
50 distance[fst.Start()] : Arc::Weight::Zero(); in ComputeTotalWeight()
52 typename Arc::Weight sum = Arc::Weight::Zero(); in ComputeTotalWeight()
62 void RemoveWeight(MutableFst<Arc> *fst, typename Arc::Weight w, bool at_final) { in RemoveWeight()
63 if ((w == Arc::Weight::One()) || (w == Arc::Weight::Zero())) in RemoveWeight()
102 vector<typename Arc::Weight> distance;
104 typename Arc::Weight total_weight = Arc::Weight::One();
136 vector<typename GallicArc<Arc, stype>::Weight> gdistance;
148 typename GallicArc<Arc, stype>::Weight total_weight =
[all …]
Darc-map.h114 typedef typename A::Weight Weight; in ArcMap() typedef
131 fst->SetFinal(superfinal, Weight::One()); in ArcMap()
160 fst->SetFinal(superfinal, Weight::One()); in ArcMap()
164 fst->SetFinal(s, Weight::Zero()); in ArcMap()
175 final_arc.weight != Weight::Zero()) in ArcMap()
178 fst->SetFinal(s, Weight::Zero()); in ArcMap()
202 typedef typename A::Weight Weight; in ArcMap() typedef
236 ofst->SetFinal(superfinal, B::Weight::One()); in ArcMap()
264 ofst->SetFinal(superfinal, B::Weight::One()); in ArcMap()
268 ofst->SetFinal(s, B::Weight::Zero()); in ArcMap()
[all …]
Drandgen.h50 typedef typename A::Weight Weight; typedef
57 if (fst.Final(s) != Weight::Zero()) in operator()
73 typedef typename A::Weight Weight; typedef
100 WeightConvert<Weight, Log64Weight> to_log_weight_;
114 typedef typename A::Weight Weight; typedef
135 WeightConvert<Weight, Log64Weight> to_log_weight_;
165 typedef typename A::Weight Weight; typedef
192 fst_.Final(rstate.state_id) == Weight::Zero()) || in Sample()
241 typedef typename A::Weight Weight; typedef
271 fst_.Final(rstate.state_id) == Weight::Zero()) || in Sample()
[all …]
Dqueue.h279 typedef typename L::Weight Weight; typedef
282 StateWeightCompare(const vector<Weight>& weights, const L &less) in StateWeightCompare()
290 const vector<Weight>& weights_;
543 AutoQueue(const Fst<Arc> &fst, const vector<typename Arc::Weight> *distance, in AutoQueue()
545 typedef typename Arc::Weight Weight; in AutoQueue() typedef
546 typedef StateWeightCompare< StateId, NaturalLess<Weight> > Compare; in AutoQueue()
557 } else if ((props & kUnweighted) && (Weight::Properties() & kIdempotent)) { in AutoQueue()
567 NaturalLess<Weight> *less = 0; in AutoQueue()
569 if (distance && (Weight::Properties() & kPath)) { in AutoQueue()
570 less = new NaturalLess<Weight>; in AutoQueue()
[all …]
/external/openfst/src/include/fst/extensions/pdt/
Dexpand.h80 typedef typename A::Weight Weight; typedef
137 Weight Final(StateId s) { in Final()
140 Weight w = fst_->Final(tuple.state_id); in Final()
141 if (w != Weight::Zero() && tuple.stack_id == 0) in Final()
144 SetFinal(s, Weight::Zero()); in Final()
232 typedef typename A::Weight Weight; typedef
340 typedef typename A::Weight Weight; typedef
380 void Expand(MutableFst<A> *ofst, const Weight &threshold);
395 const vector<Weight> &d, const vector<Weight> &fd) in StackCompare()
408 Weight w1 = (s1 < distance_.size()) && (s1 < fdistance_.size()) ? in operator()
[all …]
/external/openfst/src/include/fst/script/
Dprune.h56 typedef typename A::Weight Weight; in ConvertPruneOptions() typedef
59 Weight weight_threshold = *(opts.weight_threshold.GetWeight<Weight>()); in ConvertPruneOptions()
61 vector<Weight> *distance = 0; in ConvertPruneOptions()
64 distance = new vector<Weight>(opts.distance->size()); in ConvertPruneOptions()
66 (*distance)[i] = *((*opts.distance)[i].GetWeight<Weight>()); in ConvertPruneOptions()
82 typedef typename Arc::Weight Weight; in Prune() typedef
115 typename Arc::Weight w = *(args->arg3.GetWeight<typename Arc::Weight>()); in Prune()
126 typename Arc::Weight w = *(args->arg2.GetWeight<typename Arc::Weight>()); in Prune()
/external/llvm/lib/CodeGen/
DMachineBranchProbabilityInfo.cpp41 uint32_t Weight = getEdgeWeight(MBB, I); in getSumForBlock() local
42 Sum += Weight; in getSumForBlock()
56 uint32_t Weight = getEdgeWeight(MBB, I); in getSumForBlock() local
57 Sum += Weight / Scale; in getSumForBlock()
66 uint32_t Weight = Src->getSuccWeight(Dst); in getEdgeWeight() local
67 if (!Weight) in getEdgeWeight()
69 return Weight; in getEdgeWeight()
93 uint32_t Weight = getEdgeWeight(MBB, I); in getHotSucc() local
94 if (Weight > MaxWeight) { in getHotSucc()
95 MaxWeight = Weight; in getHotSucc()

1234567