Post Reply 
Inout
01-30-2023, 02:42 PM (This post was last modified: 01-30-2023 02:44 PM by Gil.)
Post: #1
Inout
I was given by one of the forum experts the tool program INOUT, that convert HP-Language to normal, readable strings, and the reverse.

It works fine.

Is there a way to handle the bold characters in a program string not to be "translated", with the tool program INOUT, inout into an unknown character?

Thanks for your help.

Regards,
Gil
Find all posts by this user
Quote this message in a reply
02-04-2023, 02:29 PM
Post: #2
RE: Inout
(01-30-2023 02:42 PM)Gil Wrote:  Is there a way to handle the bold characters in a program string not to be "translated", with the tool program INOUT, inout into an unknown character?

INOUT just uses the built-in RPL compiler/decompiler to convert between strings and compiled objects. While there does exist a "translation mode" (set by TRANSIO) that can be changed to affect the translation of some specific characters, I don't believe that will have any impact on styles within strings.

Just to clarify, are you asking if it's possible to remove the sequences that toggle the bold status within strings when converting with INOUT? I'm not quite sure what you're asking here.

The SREPL command could be used to remove style-toggling sequences within strings, if that's what you're looking for.
Find all posts by this user
Quote this message in a reply
02-04-2023, 03:01 PM (This post was last modified: 02-04-2023 03:12 PM by Gil.)
Post: #3
RE: Inout
The basic idea would be to have the INOUT program
as it is and, regarding the output itself, to get something like <B>... ... ... <B> when having bold strings

Example original program A):
« "EXPRESSION NORMAL"
"EXPRESSION BOLD"
"EXPRESSION UNDERLINED»"
»

After INOUT, I get B):
\<< "EXPRESSION NORMAL" "EXPRESSION BOLD" "EXPRESSION UNDERLINED\>>"
\>>

I wished I could have,
after INOUT, C):
\<< "EXPRESSION NORMAL"
"<B>EXPRESSION BOLD<B>" "<U> EXPRESSION UNDERLINED<U>\>>"
\>>

The "crosses" insides the rectangle are not so clear to deduce what is meant (here, bold or underlined).

However, copying B into the stack of the calculator and executing INOUT does return well the initial program A.

Regards,
Gil
Find all posts by this user
Quote this message in a reply
02-05-2023, 04:14 PM (This post was last modified: 02-05-2023 04:17 PM by DavidM.)
Post: #4
RE: Inout
(02-04-2023 03:01 PM)Gil Wrote:  ...copying B into the stack of the calculator and executing INOUT does return well the initial program A.

There are many ways to do what I believe you are looking for here. I would suggest keeping the code for style translation separate from INOUT, as you may find reasons to perform one function without the other.

Here's an example. I've intentionally chosen not to focus on code compactness here, but rather code clarity. The repetitive nature of the code will likely suggest more efficient alternatives. For this example, I've assumed the following string "tokens" for styles:

Bold: <B>
Italic: <I>
Underline: <U>
Inverse: <N>

Code:
\->STYL
\<<
  19. CHR 1. CHR OVER + +     @ target
  "<B>"                       @ will be replaced by
  SREPL DROP                  @ string replace

  19. CHR 2. CHR OVER + +     @ target
  "<I>"                       @ will be replaced by
  SREPL DROP                  @ string replace

  19. CHR 3. CHR OVER + +     @ target
  "<U>"                       @ will be replaced by
  SREPL DROP                  @ string replace

  19. CHR 4. CHR OVER + +     @ target
  "<N>"                       @ will be replaced by
  SREPL DROP                  @ string replace
\>>

STYL\->
\<<
  "<B>"                       @ target
  19. CHR 1. CHR OVER + +     @ will be replaced by
  SREPL DROP                  @ string replace

  "<I>"                       @ target
  19. CHR 2. CHR OVER + +     @ will be replaced by
  SREPL DROP                  @ string replace

  "<U>"                       @ target
  19. CHR 3. CHR OVER + +     @ will be replaced by
  SREPL DROP                  @ string replace

  "<N>"                       @ target
  19. CHR 4. CHR OVER + +     @ will be replaced by
  SREPL DROP                  @ string replace
\>>

Try converting the following string with STYL→, then once again with →STYL:
Code:
"<B>This<B> <I>is<I> <U>a<U> <N>test<N>."

I would suggest re-coding the above programs once you are comfortable with how they work.
Find all posts by this user
Quote this message in a reply
02-05-2023, 05:22 PM
Post: #5
RE: Inout
It works, of course.

Very nice, indeed.
Great!

Why with
"<B>" @ target
19. CHR 1. CHR OVER + + @ will be replaced by
SREPL DROP

is it that
what is between "<B>" and "<B>" is to be replaced
and not "<B>" itself (normally "abcdef" "bc" "BC" SREPL replaces the second string)?

I deduce THAT "aaaaa"
19. CHR 1. CHR OVER + + SREPL
is a special use of SREPL for replacing between the "aaaa".

Where is it documented?

Regards,
Gil
Find all posts by this user
Quote this message in a reply
02-05-2023, 11:36 PM
Post: #6
RE: Inout
(02-05-2023 05:22 PM)Gil Wrote:  Why with
"<B>" @ target
19. CHR 1. CHR OVER + + @ will be replaced by
SREPL DROP

is it that
what is between "<B>" and "<B>" is to be replaced
and not "<B>" itself (normally "abcdef" "bc" "BC" SREPL replaces the second string)?

I deduce THAT "aaaaa"
19. CHR 1. CHR OVER + + SREPL
is a special use of SREPL for replacing between the "aaaa".

There's no special case here. SREPL is simply doing what it always does.

A narrative description of the above code could be as follows:

The program starts with a string in stack level 1. It then replaces all occurrences of the substring "<B>" in that source string with the string created by "19. CHR 1. CHR OVER + +". The number of occurrences (left on the stack by SREPL) is dropped because it is not needed.

The code segment "19. CHR 1. CHR OVER + +" simply creates a string with three "characters" (whose ordinal values happen to be 19, 1, and 19). In this situation, those characters have no distinct graphical representation, so you can't see them. You can, however, see the effect they have on subsequent characters being drawn (whether to the display or to a GROB).

Those characters (19,1,19) tell the text-rendering software that's built into the 50g to toggle the current bold status (turn it on if it was off, or turn it off if it was on). That's why you see the same characters being used regardless of whether the style is being activated or deactivated. Note that this "style mode" only applies to the string as it is being drawn, and all styles are reset by the O/S to "off" as soon as the string being rendered is completed.

SREPL doesn't alter any characters other than the ones specified as the target.

The application of styles to text rendered on a display with limited resolution such as the 50g is always going to be of limited value (IMHO). While the 50g does the best it can with what it's got, it's inevitable that styled text will sometimes be difficult to read in certain situations. That's probably why you don't see many people taking advantage of it.
Find all posts by this user
Quote this message in a reply
02-06-2023, 12:28 AM
Post: #7
RE: Inout
Thanks again for your step-by-step and very clear explanation.

As far as I am concerned, I use it quite often to explain,
at the beginning of the program, how that program works,
and what arguments are to be entered

I use it also quite often for the outputs,
to draw the attention to peculiar results,
as in Simplex program when special cases occur.
Find all posts by this user
Quote this message in a reply
02-06-2023, 10:19 AM
Post: #8
RE: Inout
By the way, I use a log the special character “3 dots" (3 lives above the capital N, when entering the list of all the available characters).

When I use INOUT, a rectangle with a cross inside.
What is the real meaning/use for that special character?

Thanks for your insight.

Gil
Find all posts by this user
Quote this message in a reply
02-06-2023, 01:47 PM
Post: #9
RE: Inout
(02-06-2023 10:19 AM)Gil Wrote:  By the way, I use a log the special character “3 dots" (3 lives above the capital N, when entering the list of all the available characters).

When I use INOUT, a rectangle with a cross inside.
What is the real meaning/use for that special character?

I believe you are referring to the ellipsis character (#30). It is sometimes used to designate that more data is available "offscreen" when displaying segments of numbers/strings/etc.

INOUT doesn't have any code that treats that character differently than any other. So any special treatment would be part of the built-in routines that convert special characters to trigraphs. That said, I can't replicate your result. Could you give more specific instructions on the steps you are performing and their results? It might be easier to understand with an example.
Find all posts by this user
Quote this message in a reply
02-06-2023, 02:26 PM (This post was last modified: 02-06-2023 02:54 PM by Gil.)
Post: #10
RE: Inout
Yes, my "..." is character number 30.

I use it also quite a lot in my verbal explanations as in Simplex
when saying, for instance from "a1, a2..., an", instead of repeated character "single dot".
It enables to show more characters in a line.

With your program, it's now easy to replace the bold characters to avoid the three rectangles relative to 19 CHR 1 CHR 19 CHR.

I use also a lot the small square (larger than a do), character number 14, to start different paragraphs in my explanations inside a program.

The same applies to "right triangle/large right arrow", character 134, relative to paragraphs in verbal explanation inside a program.

That is easy to change, for instance replace it by a minus sign with SRPL, so that INOUT could make it the appropriate conversion.

But a lot of work when the outlook of the original version, with character 14, is the want to keep in the program.

Perhaps I should just use your program to replace the bold characters by <B> and, after execution, replace at the end "<B>" by an empty string "".

Example, without INOUT,
for prog —>GO of Directory program SIMPLEX,
at line 12 starting with « (line 4 of the Matrix).



{ "« \"1 Arg:
MATRIX [m+1 × n+2]

m Row (In)Equalities
n Var xi (Š0/<0/Free)
& Z-Max/Min obj.funct
at last Row m+1:

[[1 0 0 0 0 'F' 0]
[0 1 0 0 0 'F' 0]
[0 1 0 0 0 'L' 9]
[]
[0 0 0 1 0 'E' 6]
[]
[Al1 Aln 'E' Cl]
[Am1 Amn 'G' Cm]
[ z1 zn C 0]]

† Letters F L E G
(& possible number C):
in Matrix Col n+1

'F' Free var xiŠ0, <0
'L' Less  ‰
'E' Equal  =
'G' Greater  Š

† Numbers Ci (Cl,Cm)
ž are free: Š0 or ‰0
ž & in Col n+2

† Input example
& explanations:

[[1 0 0 0 0 0 'F' 0]
Free var x1:-Ÿ<x1<Ÿ
Sign of xi unknown:
x1 may be Š0 or ‰0

[0 1 0 0 0 0 'F' 0]
[0 1 0 0 0 0 'L' 9]
'x2 is Free but ‰(L)9'
2 rows for -Ÿ<x2‰9!

[0 0 1 0 0 0 'L' 8]
var x3:  0!‰ x3 ‰ 8
 & not -Ÿ!‰ x3 ‰ 8,
as by rule/default
x3 (xi) alw. Š 0;
 for -Ÿ ‰ x3 ‰ 8
see above with F

 [0 0 0 1 0 0 'E' 6]
 var x4 = 6

 [0 0 0 0 1 0 'L' 0]
var x5:-Ÿ< x5 ‰ 0

 [0 0 0 0 0 1 'L'-8]
var x6:-Ÿ< x6 ‰ -8

[0 0 0 0 0 0 1 'G'-9]
 var x7: -9 ‰x7<Ÿ
& not: -9 ‰x7‰0!

  Contrarily to:
[0 0 0 0 0 0 1 'L' 9]
var x7: 0! ‰ x7 < 9
& not: -Ÿ! ‰ x7 < 9
  for -Ÿ ‰ x7 ‰ 9
see above with F

[]

[Ak1 Ako 'L' Ck]
-Ÿ< row k ‰ Ck

[Al1Aln 'E' Cl]
 row l = Cl

 [Am1Amn 'G' Cm]
Cm ‰ row m<Ÿ

[ z1 zn C 0 ]]
or [ z1 zn C 'Max']]
or [ z1 zn C 'Min']]
 for Z=z1x1+znxn+C
ž Z-row in last row
 ž C(often 0) of Z in
Col n+1 (not n+2!)
ž 0 'Max' or 'Min':
not important
but in Col n+2

†Rows order of the
(In)Equalit. is free

†Only Z-coef must alw.
be in last MatRow m+1

†At 1st question
further, reply:
1 for MAX
or 0 for MIN
& press ENTER 

† For the other 5 less
important questions:

žGeneral sol (slow)1
* Only SIMPLEX sol 0
žLin comb:all xiŠ0 1
Lin comb:allow x<00
žAuto/direct exec 1
Step-by-step 0
žFractions/exact 1
* Fast (no fract.) 0
žFull steps saved 1
* If lack of memory 0

choose 1/0 & ENTER
(1 is default sett.)

0 to above * Quest.
to speed up ( less
details & no fract.)

† Save all your
Matrixes in DATA Dir
(last menu page)

† If lack of memory:

choose option 0
for * above

† Still lack of memory

delete some MATrix
in DATA Dir
 ž delete this huge
string & following
DROP command
ž delete NOTE & VERS

† Review data/results
after output?

Press (at 1st Page)

žINPUT.last
žSOL (details)
žS.1­N (all vectors)

S.LIN (exact solut)

d.LIN (partial sol)

Press (at 2nd Page)

žSLACK.ß (transform)
žRESULT¦Ci.rows OK?
žSTEPS (details)

† About program
Max: OK
Min: should be OK
\" DROP 'INPUT.last' STO 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 { } DUP 0 0 0 0 0 RCLF 0 0 0 0 0 0 { } 0 1 0 0 0 0 { } DUP  ŽRnd ŽSTACK.full ŽAuto ŽMiMa.s Žm Žl.xi Žl.xi.s Žtime Žm0 Žm00 ŽminCi ŽZrow ŽI ŽJ ŽVECTßi Žstep0 ŽSTEPS.xß Žl.check ŽINP.cut ŽCi.sol ŽI.INP ŽF.l2 ŽJor Žl.xi.or Žfraction ŽINPUTmod ŽŸSOL Žfg ŽSOL1 Žjj ŽSLACK1.ß ŽSTEPS1 ŽRESULT1.ROW Žxab Žrow.prob.l ŽZ Žxr1 Žtable ŽCi Žineq ŽINPUTmod.OR ŽxsF ŽF.l
« OPTION TICKS 'Žtime' STO -100 CF RAD GO.NEXT
»
»"


[b]Original program
With only INOUT and your program


"« \"1 Arg:
<B>MATRIX [<B>m+1 × n+2<B>]<B>

<B>m<B> <B>Row<B> (In)Equalities
<B>n<B> Var xi (Š0<B>/<B><0<B>/<B>Free)
& Z-Max/Min obj.funct
at <B>last Row m<B>+<B>1<B>:

[[1 0 0 0 0 '<B>F<B>' 0]
[0 1 0 0 0 '<B>F<B>' 0]
[0 1 0 0 0 '<B>L<B>' 9]
[]
[0 0 0 1 0 '<B>E<B>' 6]
[]
[Al1 Aln '<B>E<B>' Cl]
[Am1 Amn '<B>G<B>' Cm]
[ <B>z1<B><B> zn C<B> 0]]

† Letters <B>F L E G<B>
(& possible number <B>C<B>):
in Matrix Col <B>n+1<B>

'<B>F<B>'<B> F<B>ree var <B>xi<B>Š0, <0
'<B>L<B>' <B>L<B>ess  ‰
'<B>E<B>' <B>E<B>qual  =
'<B>G<B>'<B> G<B>reater  Š

† Numbers <B>Ci<B> (Cl,Cm)
ž are free: Š0 or ‰0
ž & in Col <B>n+2<B>

† Input example
& explanations:

[[<B>1<B> 0 0 0 0 0 '<B>F<B>' 0]
<B><I>F<B>ree var x1:<I>-Ÿ<B><<B><I>x1<B><I><<B>Ÿ<I>
Sign of xi unknown:
x1<I> <I>may be <B><I>Š0<B><I> or <B><I>‰0<B>

[0 <B>1<B> 0 0 0 0 '<B>F<B>' <B>0<B>]
[0 <B>1<B> 0 0 0 0 '<B>L<B>' <B>9<B>]
'<I>x2 is <B>F<B>ree but<I> <B>‰<B>(<B>L<B>)<B>9<B>'
<B><I>2 rows<B> for <I>-Ÿ<B><<B><I>x2<B>‰<I>9!<B>

[0 0 <B>1<B> 0 0 0 '<B>L<B>' <B>8<B>]
<I>var x3:<I> <I> <B><I>0!‰ <B><I>x3 <B><I>‰ 8<B><I>
<I> & <B>not<B> -Ÿ<B>!‰ <B><I>x3 <B><I>‰ 8<B>,<I>
as by rule/default
x3 (xi) alw. <B><I>Š 0<B>;<I>
<I> <B>for<B> -Ÿ <B>‰ <B><I>x3 <B><I>‰ 8<B><I>
see above with <B><I>F

<B> [0 0 0 <B>1<B> 0 0 '<B>E<B>' <B>6<B>]
<I> var x4 <I>=<I> <B><I>6<B><I>

<I> [0 0 0 0 <B>1<B> 0 '<B>L<B>' <B>0<B>]
<I>var x5:<I>-Ÿ<B>< <B><I>x5 <B><I>‰ 0<B>
<B>
<B> [0 0 0 0 0 <B>1<B> '<B>L<B>'-<B>8<B>]
<I>var x6:<I>-Ÿ<B>< <B><I>x6 <B><I>‰ <B><I>-<B><I>8<B>

[0 0 0 0 0 0 <B>1 <B>'<B>G<B>'-<B>9<B>]
<I> var x7: -<B><I>9 ‰<B><I>x7<B><I><<B>Ÿ<B>
<B>&<B> not<B>:<B> <B><I>-<B><I>9 ‰<B><I>x7<B><I>‰0!

<B> <B> Contrarily <B>to:<B>
<B>[0 0 0 0 0 0 <B>1 <B>'<B>L<B>' <B>9<B>]
<I>var x7:<B><I> 0! ‰ <B><I>x7 <B><I>< 9
<B>& <B>not<B>:<B> <B><I>-<I>Ÿ<B>! ‰ <B><I>x7 <B><I>< 9
<B><I> <I> <B>for<B> -Ÿ <B>‰ <B><I>x7 <B><I>‰ 9<B><I>
see above with <B><I>F
<B>
[]

[Ak1 Ako '<B>L<B>' Ck]
-Ÿ<B>< <B><I>row k <B>‰<I> <B><I>Ck
<I>
[Al1Aln '<B>E<B>' Cl]
<I> row l <I>= <I>Cl

<I> [Am1Amn '<B>G<B>' Cm]
<I>Cm <B><I>‰ <B><I>row m<B><I><<B>Ÿ<I>
<I>
[ z1 zn <B>C <B><U>0<B><U> <B>]]
or [ z1 zn <B>C <B>'<U>Max<U>']]
or [ z1 zn <B>C <B>'<U>Min<U>']]
<I> for Z=z1x1+znxn+<B>C<B><I>
ž <B>Z-row<B> in <B>last<B> <B>row
<B> ž <B>C<B>(often 0) of Z in
Col <B>n+1<B> (not n+2!)
ž <U>0<U> '<U>Max<U>' or '<U>Min<U>':
not important
but in Col <B>n+2
<B>
†Rows order of the
(In)Equalit. is free

†Only <B>Z-<B>coef must alw.
be in <B>last<B> Mat<B>Row m+1
<B>
†At 1st question
further, reply:
<B>1<B> for <B>MAX<B>
or <B>0<B> for <B>MIN<B>
& press <B>ENTER <B>

† For the other 5 less
important questions:

žGeneral sol (slow)1
* <U>Only SIMPLEX sol 0<U>
žLin comb:all xiŠ0 1
<U>Lin comb:allow x<00<U>
žAuto/direct exec 1
<U>Step-by-step 0<U>
žFractions/exact 1
* <U>Fast (no fract.) 0<U>
žFull steps saved 1
<B>*<B> If lack of memory 0

choose <B>1<B>/<B>0<B> & <B>ENTER<B>
(1 is default sett.)

<B>0<B> to above * Quest<B>.<B>
to <B>speed up<B> ( less
details & no fract.)
<B>
<B>† <B>Save<B> all your
Matrixes in <B>DATA<B> Dir
(last menu page)

† If <B>lack<B> of <B>memory<B>:

choose option <B>0<B>
for <B>*<B> above

† Still <B>lack<B> of <B>memory<B>

delete some MATrix
in <B>DATA<B> Dir
<B> <B>ž<B> <B>delete this huge
string & following
<B>DROP<B> command
ž delete <B>NOTE <B>&<B> VERS
<B>
† <B>Review data/results<B>
after output?

Press (at 1st Page)

ž<B>INPUT<B>.last
ž<B>SOL <B>(details)
ž<B>S.1­N <B>(all vectors)<B>
<B>
<B>S.LIN <B>(exact solut)<B>
<B>
<B>d.LIN <B>(partial sol)

Press (at 2nd Page)

ž<B>SLACK<B>.ß (transform)
ž<B>RESUL<B>T¦Ci.rows OK?
ž<B>STEPS <B>(details)<B>

<B>† <B>About program<B>
Max: OK
Min: <B>should<B> be OK
\" DROP 'INPUT.last' STO 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 { } DUP 0 0 0 0 0 RCLF 0 0 0 0 0 0 { } 0 1 0 0 0 0 { } DUP  ŽRnd ŽSTACK.full ŽAuto ŽMiMa.s Žm Žl.xi Žl.xi.s Žtime Žm0 Žm00 ŽminCi ŽZrow ŽI ŽJ ŽVECTßi Žstep0 ŽSTEPS.xß Žl.check ŽINP.cut ŽCi.sol ŽI.INP ŽF.l2 ŽJor Žl.xi.or Žfraction ŽINPUTmod ŽŸSOL Žfg ŽSOL1 Žjj ŽSLACK1.ß ŽSTEPS1 ŽRESULT1.ROW Žxab Žrow.prob.l ŽZ Žxr1 Žtable ŽCi Žineq ŽINPUTmod.OR ŽxsF ŽF.l
« OPTION TICKS 'Žtime' STO -100 CF RAD GO.NEXT
»
»"

And, at the end, deleting the "<B>“
"« \"1 Arg:
MATRIX [m+1 × n+2]

m Row (In)Equalities
n Var xi (Š0/<0/Free)
& Z-Max/Min obj.funct
at last Row m+1:

[[1 0 0 0 0 'F' 0]
[0 1 0 0 0 'F' 0]
[0 1 0 0 0 'L' 9]
[]
[0 0 0 1 0 'E' 6]
[]
[Al1 Aln 'E' Cl]
[Am1 Amn 'G' Cm]
[ z1 zn C 0]]

† Letters F L E G
(& possible number C):
in Matrix Col n+1

'F' Free var xiŠ0, <0
'L' Less  ‰
'E' Equal  =
'G' Greater  Š

† Numbers Ci (Cl,Cm)
ž are free: Š0 or ‰0
ž & in Col n+2

† Input example
& explanations:

[[1 0 0 0 0 0 'F' 0]
<I>Free var x1:<I>-Ÿ<<I>x1<I><Ÿ<I>
Sign of xi unknown:
x1<I> <I>may be <I>Š0<I> or <I>‰0

[0 1 0 0 0 0 'F' 0]
[0 1 0 0 0 0 'L' 9]
'<I>x2 is Free but<I> ‰(L)9'
<I>2 rows for <I>-Ÿ<<I>x2‰<I>9!

[0 0 1 0 0 0 'L' 8]
<I>var x3:<I> <I> <I>0!‰ <I>x3 <I>‰ 8<I>
<I> & not -Ÿ!‰ <I>x3 <I>‰ 8,<I>
as by rule/default
x3 (xi) alw. <I>Š 0;<I>
<I> for -Ÿ ‰ <I>x3 <I>‰ 8<I>
see above with <I>F

[0 0 0 1 0 0 'E' 6]
<I> var x4 <I>=<I> <I>6<I>

<I> [0 0 0 0 1 0 'L' 0]
<I>var x5:<I>-Ÿ< <I>x5 <I>‰ 0

[0 0 0 0 0 1 'L'-8]
<I>var x6:<I>-Ÿ< <I>x6 <I>‰ <I>-<I>8

[0 0 0 0 0 0 1 'G'-9]
<I> var x7: -<I>9 ‰<I>x7<I><Ÿ
& not: <I>-<I>9 ‰<I>x7<I>‰0!

 Contrarily to:
[0 0 0 0 0 0 1 'L' 9]
<I>var x7:<I> 0! ‰ <I>x7 <I>< 9
& not: <I>-<I>Ÿ! ‰ <I>x7 <I>< 9
<I> <I> for -Ÿ ‰ <I>x7 <I>‰ 9<I>
see above with <I>F

[]

[Ak1 Ako 'L' Ck]
-Ÿ< <I>row k ‰<I> <I>Ck
<I>
[Al1Aln 'E' Cl]
<I> row l <I>= <I>Cl

<I> [Am1Amn 'G' Cm]
<I>Cm <I>‰ <I>row m<I><Ÿ<I>
<I>
[ z1 zn C <U>0<U> ]]
or [ z1 zn C '<U>Max<U>']]
or [ z1 zn C '<U>Min<U>']]
<I> for Z=z1x1+znxn+C<I>
ž Z-row in last row
ž C(often 0) of Z in
Col n+1 (not n+2!)
ž <U>0<U> '<U>Max<U>' or '<U>Min<U>':
not important
but in Col n+2

†Rows order of the
(In)Equalit. is free

†Only Z-coef must alw.
be in last MatRow m+1

†At 1st question
further, reply:
1 for MAX
or 0 for MIN
& press ENTER

† For the other 5 less
important questions:

žGeneral sol (slow)1
* <U>Only SIMPLEX sol 0<U>
žLin comb:all xiŠ0 1
<U>Lin comb:allow x<00<U>
žAuto/direct exec 1
<U>Step-by-step 0<U>
žFractions/exact 1
* <U>Fast (no fract.) 0<U>
žFull steps saved 1
* If lack of memory 0

choose 1/0 & ENTER
(1 is default sett.)

0 to above * Quest.
to speed up ( less
details & no fract.)

† Save all your
Matrixes in DATA Dir
(last menu page)

† If lack of memory:

choose option 0
for * above

† Still lack of memory

delete some MATrix
in DATA Dir
ž delete this huge
string & following
DROP command
ž delete NOTE & VERS

† Review data/results
after output?

Press (at 1st Page)

žINPUT.last
žSOL (details)
žS.1­N (all vectors)

S.LIN (exact solut)

d.LIN (partial sol)

Press (at 2nd Page)

žSLACK.ß (transform)
žRESULT¦Ci.rows OK?
žSTEPS (details)

† About program
Max: OK
Min: should be OK
\" DROP 'INPUT.last' STO 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 { } DUP 0 0 0 0 0 RCLF 0 0 0 0 0 0 { } 0 1 0 0 0 0 { } DUP  ŽRnd ŽSTACK.full ŽAuto ŽMiMa.s Žm Žl.xi Žl.xi.s Žtime Žm0 Žm00 ŽminCi ŽZrow ŽI ŽJ ŽVECTßi Žstep0 ŽSTEPS.xß Žl.check ŽINP.cut ŽCi.sol ŽI.INP ŽF.l2 ŽJor Žl.xi.or Žfraction ŽINPUTmod ŽŸSOL Žfg ŽSOL1 Žjj ŽSLACK1.ß ŽSTEPS1 ŽRESULT1.ROW Žxab Žrow.prob.l ŽZ Žxr1 Žtable ŽCi Žineq ŽINPUTmod.OR ŽxsF ŽF.l
« OPTION TICKS 'Žtime' STO -100 CF RAD GO.NEXT
»
»" "\\<< \"1 Arg:
MATRIX [m+1 \\.x n+2]

m Row (In)Equalities
n Var xi (\\>=0/<0/Free)
& Z-Max/Min obj.funct
at last Row m+1:

[[1 0 0 0 0 'F' 0]
[0 1 0 0 0 'F' 0]
[0 1 0 0 0 'L' 9]
[]
[0 0 0 1 0 'E' 6]
[]
[Al1 Aln 'E' Cl]
[Am1 Amn 'G' Cm]
[ z1 zn C 0]]

\\|> Letters F L E G
(& possible number C):
in Matrix Col n+1

'F' Free var xi\\>=0, <0
'L' Less \\-> \\<=
'E' Equal \\-> =
'G' Greater \\-> \\>=

\\|> Numbers Ci (Cl,Cm)
\\[] are free: \\>=0 or \\<=0
\\[] & in Col n+2

\\|> Input example
& explanations:

[[1 0 0 0 0 0 'F' 0]
<I>Free var x1:<I>-\\oo<<I>x1<I><\\oo<I>
Sign of xi unknown:
x1<I> <I>may be <I>\\>=0<I> or <I>\\<=0

[0 1 0 0 0 0 'F' 0]
[0 1 0 0 0 0 'L' 9]
'<I>x2 is Free but<I> \\<=(L)9'
\\-><I>2 rows for <I>-\\oo<<I>x2\\<=<I>9!

[0 0 1 0 0 0 'L' 8]
<I>var x3:<I> <I> <I>0!\\<= <I>x3 <I>\\<= 8<I>
<I> & not -\\oo!\\<= <I>x3 <I>\\<= 8,<I>
as by rule/default
x3 (xi) alw. <I>\\>= 0;<I>
<I> for -\\oo \\<= <I>x3 <I>\\<= 8<I>
see above with <I>F

[0 0 0 1 0 0 'E' 6]
<I> var x4 <I>=<I> <I>6<I>

<I> [0 0 0 0 1 0 'L' 0]
<I>var x5:<I>-\\oo< <I>x5 <I>\\<= 0

[0 0 0 0 0 1 'L'-8]
<I>var x6:<I>-\\oo< <I>x6 <I>\\<= <I>-<I>8

[0 0 0 0 0 0 1 'G'-9]
<I> var x7: -<I>9 \\<=<I>x7<I><\\oo
& not: <I>-<I>9 \\<=<I>x7<I>\\<=0!

 Contrarily to:
[0 0 0 0 0 0 1 'L' 9]
<I>var x7:<I> 0! \\<= <I>x7 <I>< 9
& not: <I>-<I>\\oo! \\<= <I>x7 <I>< 9
<I> <I> for -\\oo \\<= <I>x7 <I>\\<= 9<I>
see above with <I>F

[]

[Ak1 Ako 'L' Ck]
-\\oo< <I>row k \\<=<I> <I>Ck
<I>
[Al1Aln 'E' Cl]
<I> row l <I>= <I>Cl

<I> [Am1Amn 'G' Cm]
<I>Cm <I>\\<= <I>row m<I><\\oo<I>
<I>
[ z1 zn C <U>0<U> ]]
or [ z1 zn C '<U>Max<U>']]
or [ z1 zn C '<U>Min<U>']]
<I> for Z=z1x1+znxn+C<I>
\\[] Z-row in last row
\\[] C(often 0) of Z in
Col n+1 (not n+2!)
\\[] <U>0<U> '<U>Max<U>' or '<U>Min<U>':
not important
but in Col n+2

\\|>Rows order of the
(In)Equalit. is free

\\|>Only Z-coef must alw.
be in last MatRow m+1

\\|>At 1st question
further, reply:
1 for MAX
or 0 for MIN
& press ENTER

\\|> For the other 5 less
important questions:

\\[]General sol (slow)\\->1
* <U>Only SIMPLEX sol \\->0<U>
\\[]Lin comb:all xi\\>=0 \\->1
<U>Lin comb:allow x<0\\->0<U>
\\[]Auto/direct exec \\->1
<U>Step-by-step \\->0<U>
\\[]Fractions/exact \\->1
* <U>Fast (no fract.) \\->0<U>
\\[]Full steps saved \\->1
* If lack of memory \\->0

choose 1/0 & ENTER
(1 is default sett.)

0 to above * Quest.
to speed up (\\-> less
details & no fract.)

\\|> Save all your
Matrixes in DATA Dir
(last menu page)

\\|> If lack of memory:

choose option 0
for * above

\\|> Still lack of memory

delete some MATrix
in DATA Dir
\\[] delete this huge
string & following
DROP command
\\[] delete NOTE & VERS

\\|> Review data/results
after output?

\\->Press (at 1st Page)

\\[]INPUT.last
\\[]SOL (details)
\\[]S.1\\173N (all vectors)

S.LIN (exact solut)

d.LIN (partial sol)

\\->Press (at 2nd Page)

\\[]SLACK.\\Gb (transform)
\\[]RESULT\\166Ci.rows OK?
\\[]STEPS (details)

\\|> About program
Max: OK
Min: should be OK
\" DROP 'INPUT.last' STO 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 { } DUP 0 0 0 0 0 RCLF 0 0 0 0 0 0 { } 0 1 0 0 0 0 { } DUP \\-> \\<-Rnd \\<-STACK.full \\<-Auto \\<-MiMa.s \\<-m \\<-l.xi \\<-l.xi.s \\<-time \\<-m0 \\<-m00 \\<-minCi \\<-Zrow \\<-I \\<-J \\<-VECT\\Gbi \\<-step0 \\<-STEPS.x\\Gb \\<-l.check \\<-INP.cut \\<-Ci.sol \\<-I.INP \\<-F.l2 \\<-Jor \\<-l.xi.or \\<-fraction \\<-INPUTmod \\<-\\ooSOL \\<-fg \\<-SOL1 \\<-jj \\<-SLACK1.\\Gb \\<-STEPS1 \\<-RESULT1.ROW \\<-xab \\<-row.prob.l \\<-Z \\<-xr1 \\<-table \\<-Ci \\<-ineq \\<-INPUTmod.OR \\<-xsF \\<-F.l
\\<< OPTION TICKS '\\<-time' STO -100 CF RAD GO.NEXT
\\>>
\\>>"

readable than my initial, original version.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)