Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mtp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SPARSA ROYCHOWDHURY
mtp
Commits
8a8fb4bc
Commit
8a8fb4bc
authored
Jul 06, 2017
by
SPARSA ROYCHOWDHURY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
7/7/2017
NOrmal Commit
parent
3b55dd85
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
45 deletions
+48
-45
nbproject/private/private.xml
nbproject/private/private.xml
+1
-0
src/tpdaZone.cpp
src/tpdaZone.cpp
+47
-45
No files found.
nbproject/private/private.xml
View file @
8a8fb4bc
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
<open-files
xmlns=
"http://www.netbeans.org/ns/projectui-open-files/2"
>
<open-files
xmlns=
"http://www.netbeans.org/ns/projectui-open-files/2"
>
<group>
<group>
<file>
file:/home/sparsa/Programming/mtp/src/tpdaZone.cpp
</file>
<file>
file:/home/sparsa/Programming/mtp/src/tpdaZone.cpp
</file>
<file>
file:/home/sparsa/Programming/mtp/include/timePushDown.h
</file>
<file>
file:/home/sparsa/Programming/mtp/src/tpdaCGPP.cpp
</file>
<file>
file:/home/sparsa/Programming/mtp/src/tpdaCGPP.cpp
</file>
<file>
file:/home/sparsa/Programming/mtp/include/tpdaZone.h
</file>
<file>
file:/home/sparsa/Programming/mtp/include/tpdaZone.h
</file>
</group>
</group>
...
...
src/tpdaZone.cpp
View file @
8a8fb4bc
...
@@ -133,7 +133,7 @@ stateZone* stateZone::reduceShuffle(stateZone* s2) {
...
@@ -133,7 +133,7 @@ stateZone* stateZone::reduceShuffle(stateZone* s2) {
// take union of resets for points between s2->L+1(including) and s2->P(including)
// take union of resets for points between s2->L+1(including) and s2->P(including)
curReset
=
0
;
curReset
=
0
;
for
(
i
=
L2
;
i
<
P2
;
i
++
)
for
(
i
=
L2
;
i
<
P2
;
i
++
)
curReset
|=
(
transitions
[
del2
[
i
]
].
reset
);
curReset
|=
(
transitions
[
del2
[
i
]
].
reset
);
//this contain union of the resets in the second state
tempReset
=
curReset
;
// store this value for later use
tempReset
=
curReset
;
// store this value for later use
...
@@ -142,7 +142,7 @@ stateZone* stateZone::reduceShuffle(stateZone* s2) {
...
@@ -142,7 +142,7 @@ stateZone* stateZone::reduceShuffle(stateZone* s2) {
// there is a bit '1' of 'reset' but '0' of 'curReset' at same position => there is a clock
// there is a bit '1' of 'reset' but '0' of 'curReset' at same position => there is a clock
//reset at (i+1) point of 1st state which has not reset to any of its right points for both state
//reset at (i+1) point of 1st state which has not reset to any of its right points for both state
if
(
reset
&
(
~
curReset
)
&
(
~
1
)
)
{
// (~) : ignore the 0-th bit, used for stack operation
if
(
reset
&
(
~
curReset
)
&
(
~
1
)
)
{
// (~
1
) : ignore the 0-th bit, used for stack operation
count
++
;
// this point should be in new state, so increase the counter
count
++
;
// this point should be in new state, so increase the counter
curReset
|=
reset
;
// union reset set at this point with earlier set
curReset
|=
reset
;
// union reset set at this point with earlier set
}
}
...
@@ -158,9 +158,9 @@ stateZone* stateZone::reduceShuffle(stateZone* s2) {
...
@@ -158,9 +158,9 @@ stateZone* stateZone::reduceShuffle(stateZone* s2) {
vs
->
w
=
new
char
[
count
*
(
count
-
1
)];
//this will hold the matrix without the diagonal element
vs
->
w
=
new
char
[
count
*
(
count
-
1
)];
//this will hold the matrix without the diagonal element
vs
->
f
=
f
;
//f contains the push complete command flag bit along with the value of L
vs
->
f
=
f
;
//f contains the push complete command flag bit along with the value of L
short
nf
=
0
;
// initially flag is zero
//
short nf = 0; // initially flag is zero
short
dis
;
// distance variable
//
short dis; // distance variable
/*copying the transitions for both the states to this new state*/
j
=
count
-
1
;
// index of the rightmost point of new state
j
=
count
-
1
;
// index of the rightmost point of new state
// Here we are copying points from s2->L+1 to s2->P of 2nd state to new state
// Here we are copying points from s2->L+1 to s2->P of 2nd state to new state
for
(
i
=
P2
-
1
;
i
>=
L2
;
i
--
,
j
--
)
{
for
(
i
=
P2
-
1
;
i
>=
L2
;
i
--
,
j
--
)
{
...
@@ -184,8 +184,9 @@ stateZone* stateZone::reduceShuffle(stateZone* s2) {
...
@@ -184,8 +184,9 @@ stateZone* stateZone::reduceShuffle(stateZone* s2) {
//copy the point L, doing it separately because of the flag variable which is not applicable for L-th point
//copy the point L, doing it separately because of the flag variable which is not applicable for L-th point
vs
->
del
[
L
-
1
]
=
del
[
L
-
1
];
vs
->
del
[
L
-
1
]
=
del
[
L
-
1
];
//vs->w[L-1] = w[L-1]; w doesnot contains time stamps any more it contains the matrix
//vs->w[L-1] = w[L-1]; w doesnot contains time stamps any more it contains the matrix
/*copying transition details done*/
//Here goes the logic of creating the matrix altogether with given values.
//Here goes the logic of creating the matrix altogether with given values.
/*copying matrix details to the new state*/
// copy weights of first state to WT1
// copy weights of first state to WT1
for
(
i
=
0
;
i
<
P
;
i
++
)
{
for
(
i
=
0
;
i
<
P
;
i
++
)
{
for
(
j
=
0
;
j
<
P
;
j
++
)
{
for
(
j
=
0
;
j
<
P
;
j
++
)
{
...
@@ -252,27 +253,28 @@ stateZone* stateZone::reduceShuffle(stateZone* s2) {
...
@@ -252,27 +253,28 @@ stateZone* stateZone::reduceShuffle(stateZone* s2) {
curReset
=
tempReset
;
//get the union of resets for points between s2->L+1 and s2->P
curReset
=
tempReset
;
//get the union of resets for points between s2->L+1 and s2->P
// current indices j of new state we have to take care
// current indices j of new state we have to take care
j
=
(
count
-
1
)
-
(
P2
-
L2
);
j
=
(
count
-
1
)
-
(
P2
-
L2
);
//this is the start of hanging points of state 2
for
(
i
=
P
-
1
;
i
>=
L
;
i
--
)
{
for
(
i
=
P
-
1
;
i
>=
L
;
i
--
)
{
//iterating on the points of the first state
reset
=
(
transitions
[
del
[
i
]
].
reset
);
// current point reset set
reset
=
(
transitions
[
del
[
i
]
].
reset
);
// current point reset set
if
(
reset
&
(
~
curReset
)
&
(
~
1
)
)
{
// if current point has more reset then seen earlier
if
(
reset
&
(
~
curReset
)
&
(
~
1
)
)
{
// if current point has more reset then seen earlier
vs
->
del
[
j
]
=
del
[
i
];
//if the current
vs
->
w
[
j
]
=
w
[
i
];
vs
->
del
[
j
]
=
del
[
i
];
//copy the transition number
/* //vs->w[j] = w[i];
if
(
lastindex
==
P
)
{
// if (i+1) is the first point we are considering after starting the loop
// In if : first check is for accuracy check from L to P of left state
// if( lastindex == P ) { // if (i+1) is the first point we are considering after starting the loop
// In if : second check is for cheking accuracy from L2 to L2+1 of right state, L2 is not choosen
// // In if : first check is for accuracy check from L to P of left state
if
(
!
big
(
i
+
1
,
P
)
&&
(
i
==
(
P
-
1
)
||
(
f2
&
a32
[
L2
])
)
)
{
// // In if : second check is for cheking accuracy from L2 to L2+1 of right state, L2 is not choosen
dis
=
dist
(
i
+
1
,
P
)
+
mod
(
w2
[
L2
]
-
w
[
P
-
1
],
M
);
// if( !big(i+1, P) && ( i == (P-1) || (f2 & a32[L2]) ) ) {
if
(
dis
<
M
)
// if total distance from i+1-th point to s2->L+1 is accurate
// dis = dist(i+1, P) + mod( w2[L2] - w[P-1], M);
nf
|=
a32
[
j
+
1
];
// if( dis < M ) // if total distance from i+1-th point to s2->L+1 is accurate
}
// nf |= a32[j+1];
}
// }
// }
else
{
if
(
!
big
(
i
+
1
,
lastindex
+
1
)
)
// else {
nf
|=
a32
[
j
+
1
];
// if( !big(i+1, lastindex+1) )
}
// nf |= a32[j+1];
// } */
curReset
|=
reset
;
curReset
|=
reset
;
j
--
;
j
--
;
...
@@ -281,28 +283,28 @@ stateZone* stateZone::reduceShuffle(stateZone* s2) {
...
@@ -281,28 +283,28 @@ stateZone* stateZone::reduceShuffle(stateZone* s2) {
}
}
// one accuracy we yet have to compute which starts from L-th point of first state
// one accuracy we yet have to compute which starts from L-th point of first state
if
(
lastindex
==
P
)
{
// if we have not taken any point from L+1 to P of 1st state
//
if( lastindex == P ) { // if we have not taken any point from L+1 to P of 1st state
// In if : first check is for accuracy check from L to P of left state
//
// In if : first check is for accuracy check from L to P of left state
// In if : second check is for cheking accuracy from L2 to L2+1 of right state, L2 is not choosen
//
// In if : second check is for cheking accuracy from L2 to L2+1 of right state, L2 is not choosen
if
(
!
big
(
L
,
P
)
&&
(
f2
&
a32
[
L2
]
)
)
{
// if distance between L and R of 1st state is accurate
//
if( !big(L, P) && (f2 & a32[L2] ) ) { // if distance between L and R of 1st state is accurate
dis
=
dist
(
L
,
P
)
+
mod
(
w2
[
L2
]
-
w
[
P
-
1
],
M
);
//
dis = dist(L, P) + mod( w2[L2] - w[P-1], M);
if
(
dis
<
M
)
// if total distance from i+1-th point to s2->L+1 is accurate
//
if( dis < M ) // if total distance from i+1-th point to s2->L+1 is accurate
nf
|=
a32
[
L
];
//
nf |= a32[L];
}
//
}
}
//
}
//
else
{
//
else{
// if distance from L-th point to lastindex+1-th of 1st state is accurate
//
// if distance from L-th point to lastindex+1-th of 1st state is accurate
if
(
!
big
(
L
,
lastindex
+
1
)
)
//
if( !big(L, lastindex+1) )
nf
|=
a32
[
L
];
//
nf |= a32[L];
}
//
}
//
if
(
f
&
1
)
// push info from left state will be same
//
if(f & 1) // push info from left state will be same
nf
|=
1
;
//
nf |= 1;
//
nf
|=
a3215
;
// pop at right(R) is done
//
nf |= a3215; // pop at right(R) is done
//
vs
->
f
=
nf
;
// add the flag variable also
//
vs->f = nf; // add the flag variable also
vs
->
P
=
count
;
// #points in new state
vs
->
P
=
count
;
// #points in new state
return
vs
;
return
vs
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment