Skip to content

Commit

Permalink
🐛 fix Matrix and Array management
Browse files Browse the repository at this point in the history
See:
- asciimathml/issue 42
- asciimathml/PR 62
  • Loading branch information
The-Lum committed Apr 30, 2024
1 parent ccf65a5 commit 046e6bc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/math/ASCIIMathTeXImg.java
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ private String[] aAMTparseExpr(String str, boolean rightbracket) {
if (i == 0) {
columnaligns = "|" + columnaligns;
}
//subarr.splice(j,1);
subarr.remove(j);
} else if (i == 0) {
columnaligns = "c" + columnaligns;
}
Expand Down
22 changes: 11 additions & 11 deletions app/src/test/java/math/ASCIIMathTeXImgUnitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class ASCIIMathTeXImgUnitTest {
" '[(2,3,4,5)]' , {\\left[\\begin{array}{cccc} {2}&{3}&{4}&{5}\\end{array}\\right]} ",
" '((1),(2))' , {\\left(\\begin{array}{c} {1}\\\\{2}\\end{array}\\right)} ",
" '{(1,if,x ge 3),(2,if,x gt 3):}' , {\\left\\lbrace\\begin{array}{ccc} {1}&{\\quad\\text{if}\\quad}&{x}\\ge{3}\\\\{2}&{\\quad\\text{if}\\quad}&{x}\\gt{3}\\end{array}\\right.} ",
" '[(1,2,|,3),(4,5,|,6)]' , {\\left[\\begin{array}{cccc} {1}&{2}&{\\mid}&{3}\\\\{4}&{5}&{\\mid}&{6}\\end{array}\\right]} ",
" '[(1,2,|,3),(4,5,|,6)]' , {\\left[\\begin{array}{cc|c} {1}&{2}&{3}\\\\{4}&{5}&{6}\\end{array}\\right]} ",
" int_2^3 3dx , {\\int_{{2}}^{{3}}}{3}{\\left.{d}{x}\\right.} ",
" sum_(n=1)^3 n , {\\sum_{{{n}={1}}}^{{3}}}{n} ",
" lim_(h->0)(f(x+h)-f(x))/h , \\lim_{{{h}\\to{0}}}\\frac{{{f{{\\left({x}+{h}\\right)}}}-{f{{\\left({x}\\right)}}}}}{{h}} ",
Expand Down Expand Up @@ -416,17 +416,17 @@ class ASCIIMathTeXImgUnitTest {
" '[2,3rangle' , '{\\left[{2},{3}\\right\\rangle}' ",
" '2,3)' , '{2},{3}{)}' ",
" '(2,3' , '{\\left({2},{3}\\right.}' ",
" '[(1,2,3,|,4),(5,6,7, |,8)]' , {\\left[\\begin{array}{ccccc} {1}&{2}&{3}&{\\mid}&{4}\\\\{5}&{6}&{7}&{\\mid}&{8}\\end{array}\\right]} ",
" '[(1,2,3, | ,4,5),(5,6,7, | ,8,9)]' , {\\left[\\begin{array}{cccccc} {1}&{2}&{3}&{\\mid}&{4}&{5}\\\\{5}&{6}&{7}&{\\mid}&{8}&{9}\\end{array}\\right]} ",
" '[(1,|,2,3,4),(5,|,6,7,8)]' , {\\left[\\begin{array}{ccccc} {1}&{\\mid}&{2}&{3}&{4}\\\\{5}&{\\mid}&{6}&{7}&{8}\\end{array}\\right]} ",
" '[(1,|,3,|,4),(5,|,7,|,8)]' , {\\left[\\begin{array}{ccccc} {1}&{\\mid}&{3}&{\\mid}&{4}\\\\{5}&{\\mid}&{7}&{\\mid}&{8}\\end{array}\\right]} ",
" '[(1,2,3,|,4),(5,6,7, |,8)]' , {\\left[\\begin{array}{ccc|c} {1}&{2}&{3}&{4}\\\\{5}&{6}&{7}&{8}\\end{array}\\right]} ",
" '[(1,2,3, | ,4,5),(5,6,7, | ,8,9)]' , {\\left[\\begin{array}{ccc|cc} {1}&{2}&{3}&{4}&{5}\\\\{5}&{6}&{7}&{8}&{9}\\end{array}\\right]} ",
" '[(1,|,2,3,4),(5,|,6,7,8)]' , {\\left[\\begin{array}{c|ccc} {1}&{2}&{3}&{4}\\\\{5}&{6}&{7}&{8}\\end{array}\\right]} ",
" '[(1,|,3,|,4),(5,|,7,|,8)]' , {\\left[\\begin{array}{c|c|c} {1}&{3}&{4}\\\\{5}&{7}&{8}\\end{array}\\right]} ",
" '[(2,|x|,5),(3,|y|,4)]' , {\\left[\\begin{array}{ccc} {2}&{\\left|{x}\\right|}&{5}\\\\{3}&{\\left|{y}\\right|}&{4}\\end{array}\\right]} ",
" '[(1,|,2,|x|,5),(3,|,4,|y|,7)]' , {\\left[\\begin{array}{ccccc} {1}&{\\mid}&{2}&{\\left|{x}\\right|}&{5}\\\\{3}&{\\mid}&{4}&{\\left|{y}\\right|}&{7}\\end{array}\\right]} ",
" '[(1,2,3,|,4),(5,6,7,8,9)]' , {\\left[\\begin{array}{ccccc} {1}&{2}&{3}&{\\mid}&{4}\\\\{5}&{6}&{7}&{8}&{9}\\end{array}\\right]} ",
" '[(1,2,3,|,4),(5,6,7,8)]' , '{\\left[{\\left({1},{2},{3},{\\mid},{4}\\right)},{\\left({5},{6},{7},{8}\\right)}\\right]}' ",
" '[(1,2,3,4,5),(5,6,7,|,9)]' , {\\left[\\begin{array}{ccccc} {1}&{2}&{3}&{4}&{5}\\\\{5}&{6}&{7}&{\\mid}&{9}\\end{array}\\right]} ",
" '[(1,2,3,4),(5,6,7,|,9)]' , '{\\left[{\\left({1},{2},{3},{4}\\right)},{\\left({5},{6},{7},{\\mid},{9}\\right)}\\right]}' ",
" '[(1,2,3,|),(5,6,7,|)]' , {\\left[\\begin{array}{cccc} {1}&{2}&{3}&{\\mid}\\\\{5}&{6}&{7}&{\\mid}\\end{array}\\right]} ",
" '[(1,|,2,|x|,5),(3,|,4,|y|,7)]' , {\\left[\\begin{array}{c|ccc} {1}&{2}&{\\left|{x}\\right|}&{5}\\\\{3}&{4}&{\\left|{y}\\right|}&{7}\\end{array}\\right]} ",
" '[(1,2,3,|,4),(5,6,7,8,9)]' , '{\\left[{\\left({1},{2},{3},{\\mid},{4}\\right)},{\\left({5},{6},{7},{8},{9}\\right)}\\right]}' ",
" '[(1,2,3,|,4),(5,6,7,8)]' , {\\left[\\begin{array}{ccc|c} {1}&{2}&{3}&{4}\\\\{5}&{6}&{7}&{8}\\end{array}\\right]} ",
" '[(1,2,3,4,5),(5,6,7,|,9)]' , '{\\left[{\\left({1},{2},{3},{4},{5}\\right)},{\\left({5},{6},{7},{\\mid},{9}\\right)}\\right]}' ",
" '[(1,2,3,4),(5,6,7,|,9)]' , {\\left[\\begin{array}{cccc} {1}&{2}&{3}&{4}\\\\{5}&{6}&{7}&{9}\\end{array}\\right]} ",
" '[(1,2,3,|),(5,6,7,|)]' , {\\left[\\begin{array}{ccc|} {1}&{2}&{3}\\\\{5}&{6}&{7}\\end{array}\\right]} ",
" '|x/2+3|,|x-4/5|' , '{\\left|\\frac{{x}}{{2}}+{3}\\right|},{\\left|{x}-\\frac{{4}}{{5}}\\right|}' ",
" int_2^4 2x dx = x^2|_2^4 , {\\int_{{2}}^{{4}}}{2}{x}{\\left.{d}{x}\\right.}={x}^{{2}}{{\\mid}_{{2}}^{{4}}} ",
" 3+sin(x)/5-2Sin(x) , {3}+\\frac{{\\sin{{\\left({x}\\right)}}}}{{5}}-{2}{\\Sin{{\\left({x}\\right)}}} ",
Expand Down
12 changes: 6 additions & 6 deletions docs/jacocoSummary.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
|Type | Missed/Total| Coverage|
|:--- | ---:| ---:|
|INSTRUCTION|(Not Changed)60/6763|(Not Changed)99.11%|
|BRANCH | (Not Changed)43/377|(Not Changed)88.59%|
|LINE | (Not Changed)10/423|(Not Changed)97.64%|
|Type | Missed/Total| Coverage|
|:--- | ---:| ---:|
|INSTRUCTION|~~60/6763~~ 54/6769|~~99.11~~ 99.20%|
|BRANCH | ~~43/377~~ 40/377|~~88.59~~ 89.39%|
|LINE | ~~10/423~~ 8/424|~~97.64~~ 98.11%|

Class list with less coverage (Worst 5)

|Class |Instructions(C0)| Branches(C1)|
|:--- | ---:| ---:|
|math.ASCIIMathTeXImg| 60/6606(99.09%)|43/377(88.59%)|
|math.ASCIIMathTeXImg| 54/6612(99.18%)|40/377(89.39%)|

0 comments on commit 046e6bc

Please sign in to comment.