Skip to content

Commit

Permalink
#112 Update documentation for new matrix definition: do not mix one- …
Browse files Browse the repository at this point in the history
…and two-dimensional arrays in the same variable
  • Loading branch information
mkulesh committed Oct 17, 2022
1 parent 6d2378b commit bfc2441
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 31 deletions.
50 changes: 28 additions & 22 deletions app/src/main/assets/doc_en/how_to_use.mmt
Original file line number Diff line number Diff line change
Expand Up @@ -300,40 +300,33 @@
<term key="text" text="Arrays" />
</text_fragment>
<text_fragment>
<term key="text" text='Arrays are special functions where&#10;instead of "( )", the argument is&#10;given in lower index by putting "["&#10;after array name.&#10;&#10;The argument can be a constant, or a&#10;previously defined interval:' />
<term key="text" text='Arrays are special functions where&#10;instead of "( )", the argument is&#10;given in lower index by putting "["&#10;after array name.&#10;&#10;The argument (index) can be a&#10;constant, or a previously defined&#10;interval:' />
</text_fragment>
<equation>
<term key="leftTerm" code="content:com.mkulesh.micromath.index.r">
<term key="argTerm" text="0" />
<term key="leftTerm" text="idx" />
<term key="rightTerm" code="equidistant_interval">
<term key="minValue" text="0" />
<term key="nextValue" text="1" />
<term key="maxValue" text="2" />
</term>
<term key="rightTerm" text="5" />
</equation>
<equation inRightOfPrevious="true">
<term key="leftTerm" code="content:com.mkulesh.micromath.index.r">
<term key="argTerm" text="3" />
<equation>
<term key="leftTerm" code="content:com.mkulesh.micromath.index.r1">
<term key="argTerm" text="idx" />
</term>
<term key="rightTerm" text="6" />
<term key="rightTerm" text="5" />
</equation>
<equation inRightOfPrevious="true">
<term key="leftTerm" code="content:com.mkulesh.micromath.index.r:2">
<term key="argTerm1" text="2" />
<term key="argTerm2" text="0" />
<term key="leftTerm" code="content:com.mkulesh.micromath.index.r1">
<term key="argTerm" text="2" />
</term>
<term key="rightTerm" text="-4" />
<term key="rightTerm" text="6" />
</equation>
<text_fragment>
<term key="text" text="Like a function, right side of array&#10;can be either a constant or a&#10;mathematical formula based on the&#10;array argument:" />
</text_fragment>
<equation>
<term key="leftTerm" text="idx" />
<term key="rightTerm" code="equidistant_interval">
<term key="minValue" text="0" />
<term key="nextValue" text="1" />
<term key="maxValue" text="3" />
</term>
</equation>
<equation inRightOfPrevious="true">
<term key="leftTerm" code="content:com.mkulesh.micromath.index.r:2">
<term key="leftTerm" code="content:com.mkulesh.micromath.index.r2:2">
<term key="argTerm1" text="idx" />
<term key="argTerm2" text="1" />
</term>
Expand All @@ -342,6 +335,13 @@
<term key="rightTerm" text="idx" />
</term>
</equation>
<equation inRightOfPrevious="true">
<term key="leftTerm" code="content:com.mkulesh.micromath.index.r2:2">
<term key="argTerm1" text="2" />
<term key="argTerm2" text="0" />
</term>
<term key="rightTerm" text="-4" />
</equation>
<equation>
<term key="leftTerm" text="k" />
<term key="rightTerm" code="equidistant_interval">
Expand Down Expand Up @@ -405,6 +405,12 @@
<text_fragment>
<term key="text" text="a) Like interval, array elements can be&#10;only accessed by using a lower index:" />
</text_fragment>
<result disableCalculation="false" hideResultField="false" arrayLength="7">
<term key="leftTerm" code="content:com.mkulesh.micromath.index.r1">
<term key="argTerm" text="idx" />
</term>
<term key="rightTerm" text="" />
</result>
<result disableCalculation="false" hideResultField="false" arrayLength="7">
<term key="leftTerm" code="content:com.mkulesh.micromath.index.M:2">
<term key="argTerm1" text="5" />
Expand Down Expand Up @@ -454,7 +460,7 @@
</term>
</equation>
<result disableCalculation="false" hideResultField="false" arrayLength="7">
<term key="leftTerm" code="content:com.mkulesh.micromath.index.r:2">
<term key="leftTerm" code="content:com.mkulesh.micromath.index.r2:2">
<term key="argTerm1" text="i1" />
<term key="argTerm2" text="i2" />
</term>
Expand Down
24 changes: 15 additions & 9 deletions doc/how_to_use.tex
Original file line number Diff line number Diff line change
Expand Up @@ -276,21 +276,24 @@ \subsubsection{Arrays}
given in lower index by putting ''[''
after array name.

The argument can be a constant, or a
previously defined interval:
\begin{center}\begin{tabular}{ccc}
$r_{0} := 5$ &
$r_{3} := 6$ &
$r_{2,\, 0} := -4$ \cr
The argument (index) can be a
constant, or a previously defined
interval:
\begin{center}\begin{tabular}{c}
$idx := \left[ 0,\, 1 \,..\, 2 \right]$
\end{tabular}\end{center}
\begin{center}\begin{tabular}{cc}
$r1_{idx} := 5$ &
$r1_{2} := 6$ \cr
\end{tabular}\end{center}

Like a function, right side of array
can be either a constant or a
mathematical formula based on the
array argument:
\begin{center}\begin{tabular}{cc}
$idx := \left[ 0,\, 1 \,..\, 3 \right]$ &
$r_{idx,\, 1} := 5 + idx$ \cr
$r2_{idx,\, 1} := 5 + idx$ &
$r2_{2,\, 0} := -4$ \cr
\end{tabular}\end{center}
\begin{center}\begin{tabular}{cc}
$k := \left[ 0,\, 1 \,..\, 100 \right]$ &
Expand All @@ -311,6 +314,9 @@ \subsubsection{Arrays}

a) Like interval, array elements can be
only accessed by using a lower index:
\begin{center}\begin{tabular}{c}
$r1_{idx} = \begin{bmatrix}5.0\\5.0\\6.0\\\end{bmatrix}$
\end{tabular}\end{center}
\begin{center}\begin{tabular}{cc}
$M_{5,\, 10} = -1.39106$ &
$M_{10,\, 5} = -1.92467$ \cr
Expand All @@ -331,7 +337,7 @@ \subsubsection{Arrays}
$i2 := \left[ 0,\, 1 \,..\, 2 \right]$ \cr
\end{tabular}\end{center}
\begin{center}\begin{tabular}{c}
$r_{i1,\, i2} = \begin{bmatrix}0.0&5.0&NaN\\0.0&6.0&NaN\\-4.0&7.0&NaN\\\end{bmatrix}$
$r2_{i1,\, i2} = \begin{bmatrix}0.0&5.0&NaN\\0.0&6.0&NaN\\-4.0&7.0&NaN\\\end{bmatrix}$
\end{tabular}\end{center}
\begin{center}\begin{tabular}{cc}
$M_{10i,\, 100} = NaN$ &
Expand Down

0 comments on commit bfc2441

Please sign in to comment.