1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468
|
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [
<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
]>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xlink="http://www.w3.org/1999/xlink" >
<head>
<title>Section2.7</title>
<link rel="stylesheet" type="text/css" href="graphicstyle.css" />
<script type="text/javascript" src="bookax1.js" />
</head>
<body>
<a href="book-contents.xhtml" style="margin-right: 10px;">Book Contents</a><a href="section-2.6.xhtml" style="margin-right: 10px;">Previous Section 2.6 The ``Any'' Domain</a><a href="section-2.8.xhtml" style="margin-right: 10px;">Next Section 2.8 Subdomains Again</a>
<a href="book-index.xhtml">Book Index</a><div class="section" id="sec-2.7">
<h2 class="sectiontitle">2.7 Conversion</h2>
<a name="ugTypesConvert" class="label"/>
<div class="boxed2">
<div class="boxed">
<p>Conversion is the process of changing an object of one type into an
object of another type. The syntax for conversion is:
<math xmlns="&mathml;" mathsize="big" display="block"><mstyle><mrow><mrow><mtext mathvariant='sans-serif-italic'>object</mtext></mrow><mrow><mtext mathvariant='monospace'>::</mtext></mrow><mrow><mtext mathvariant='sans-serif-italic'>newType</mtext></mrow></mrow></mstyle></math>
</p>
</div>
</div>
<p>By default, <math xmlns="&mathml;" mathsize="big"><mstyle><mn>3</mn></mstyle></math> has the type <span class="teletype">PositiveInteger</span>.
</p>
<div id="spadComm2-86" class="spadComm" >
<form id="formComm2-86" action="javascript:makeRequest('2-86');" >
<input id="comm2-86" type="text" class="command" style="width: 1em;" value="3" />
</form>
<span id="commSav2-86" class="commSav" >3</span>
<div id="mathAns2-86" ></div>
</div>
<div class="math">
<table>
<tr><td>
<math xmlns="&mathml;" mathsize="big" display="block"><mstyle><mn>3</mn></mstyle></math>
</td></tr>
</table>
</div>
<div class="returnType">
Type: PositiveInteger
</div>
<p>We can change this into an object of type <span class="teletype">Fraction Integer</span>
by using ``<span class="teletype">::</span>''.
</p>
<div id="spadComm2-87" class="spadComm" >
<form id="formComm2-87" action="javascript:makeRequest('2-87');" >
<input id="comm2-87" type="text" class="command" style="width: 14em;" value="3 :: Fraction Integer" />
</form>
<span id="commSav2-87" class="commSav" >3 :: Fraction Integer</span>
<div id="mathAns2-87" ></div>
</div>
<div class="math">
<table>
<tr><td>
<math xmlns="&mathml;" mathsize="big" display="block"><mstyle><mn>3</mn></mstyle></math>
</td></tr>
</table>
</div>
<div class="returnType">
Type: Fraction Integer
</div>
<p>A <span class="italic">coercion</span> is a special kind of conversion that Axiom is allowed
to do automatically when you enter an expression. Coercions are
usually somewhat safer than more general conversions. The Axiom
library contains operations called <span style="font-weight: bold;"> coerce</span> and <span style="font-weight: bold;"> convert</span>.
Only the <span style="font-weight: bold;"> coerce</span> operations can be used by the interpreter to
change an object into an object of another type unless you explicitly
use a <span class="teletype">::</span>.
</p>
<p>By now you will be quite familiar with what types and modes look like.
It is useful to think of a type or mode as a pattern for what you want
the result to be.
</p>
<p>Let's start with a square matrix of polynomials with complex rational
number coefficients. <span class="index">SquareMatrix</span><a name="chapter-2-48"/>
</p>
<div id="spadComm2-88" class="spadComm" >
<form id="formComm2-88" action="javascript:makeRequest('2-88');" >
<input id="comm2-88" type="text" class="command" style="width: 28em;" value="m : SquareMatrix(2,POLY COMPLEX FRAC INT)" />
</form>
<span id="commSav2-88" class="commSav" >m : SquareMatrix(2,POLY COMPLEX FRAC INT)</span>
<div id="mathAns2-88" ></div>
</div>
<div class="returnType">
Type: Void
</div>
<div id="spadComm2-89" class="spadComm" >
<form id="formComm2-89" action="javascript:makeRequest('2-89');" >
<input id="comm2-89" type="text" class="command" style="width: 46em;" value="m := matrix [ [x-3/4*%i,z*y**2+1/2],[3/7*%i*y**4 - x,12-%i*9/5] ]" />
</form>
<span id="commSav2-89" class="commSav" >m := matrix [ [x-3/4*%i,z*y**2+1/2],[3/7*%i*y**4 - x,12-%i*9/5] ]</span>
<div id="mathAns2-89" ></div>
</div>
<div class="math">
<table>
<tr><td>
<math xmlns="&mathml;" mathsize="big" display="block"><mstyle><mrow><mo>[</mo><mtable><mtr><mtd><mrow><mi>x</mi><mo>-</mo><mrow><mfrac><mn>3</mn><mn>4</mn></mfrac><mo></mo><mi>i</mi></mrow></mrow></mtd><mtd><mrow><mrow><mrow><msup><mi>y</mi><mn>2</mn></msup></mrow><mo></mo><mi>z</mi></mrow><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac></mrow></mtd></mtr><mtr><mtd><mrow><mrow><mfrac><mn>3</mn><mn>7</mn></mfrac><mo></mo><mi>i</mi><mo></mo><mrow><msup><mi>y</mi><mn>4</mn></msup></mrow></mrow><mo>-</mo><mi>x</mi></mrow></mtd><mtd><mrow><mn>12</mn><mo>-</mo><mrow><mfrac><mn>9</mn><mn>5</mn></mfrac><mo></mo><mi>i</mi></mrow></mrow></mtd></mtr></mtable><mo>]</mo></mrow></mstyle></math>
</td></tr>
</table>
</div>
<div class="returnType">
Type: SquareMatrix(2,Polynomial Complex Fraction Integer)
</div>
<p>We first want to interchange the <span class="teletype">Complex</span> and <span class="teletype">Fraction</span>
layers. We do the conversion by doing the interchange in the type
expression.
</p>
<div id="spadComm2-90" class="spadComm" >
<form id="formComm2-90" action="javascript:makeRequest('2-90');" >
<input id="comm2-90" type="text" class="command" style="width: 32em;" value="m1 := m :: SquareMatrix(2,POLY FRAC COMPLEX INT)" />
</form>
<span id="commSav2-90" class="commSav" >m1 := m :: SquareMatrix(2,POLY FRAC COMPLEX INT)</span>
<div id="mathAns2-90" ></div>
</div>
<div class="math">
<table>
<tr><td>
<math xmlns="&mathml;" mathsize="big" display="block"><mstyle><mrow><mo>[</mo><mtable><mtr><mtd><mrow><mi>x</mi><mo>-</mo><mfrac><mrow><mn>3</mn><mo></mo><mi>i</mi></mrow><mn>4</mn></mfrac></mrow></mtd><mtd><mrow><mrow><mrow><msup><mi>y</mi><mn>2</mn></msup></mrow><mo></mo><mi>z</mi></mrow><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac></mrow></mtd></mtr><mtr><mtd><mrow><mrow><mfrac><mrow><mn>3</mn><mo></mo><mi>i</mi></mrow><mn>7</mn></mfrac><mo></mo><mrow><msup><mi>y</mi><mn>4</mn></msup></mrow></mrow><mo>-</mo><mi>x</mi></mrow></mtd><mtd><mfrac><mrow><mn>60</mn><mo>-</mo><mrow><mn>9</mn><mo></mo><mi>i</mi></mrow></mrow><mn>5</mn></mfrac></mtd></mtr></mtable><mo>]</mo></mrow></mstyle></math>
</td></tr>
</table>
</div>
<div class="returnType">
Type: SquareMatrix(2,Polynomial Fraction Complex Integer)
</div>
<p>Interchange the <span class="teletype">Polynomial</span> and the <span class="teletype">Fraction</span> levels.
</p>
<div id="spadComm2-91" class="spadComm" >
<form id="formComm2-91" action="javascript:makeRequest('2-91');" >
<input id="comm2-91" type="text" class="command" style="width: 33em;" value="m2 := m1 :: SquareMatrix(2,FRAC POLY COMPLEX INT)" />
</form>
<span id="commSav2-91" class="commSav" >m2 := m1 :: SquareMatrix(2,FRAC POLY COMPLEX INT)</span>
<div id="mathAns2-91" ></div>
</div>
<div class="math">
<table>
<tr><td>
<math xmlns="&mathml;" mathsize="big" display="block"><mstyle><mrow><mo>[</mo><mtable><mtr><mtd><mfrac><mrow><mrow><mn>4</mn><mo></mo><mi>x</mi></mrow><mo>-</mo><mrow><mn>3</mn><mo></mo><mi>i</mi></mrow></mrow><mn>4</mn></mfrac></mtd><mtd><mfrac><mrow><mrow><mn>2</mn><mo></mo><mrow><msup><mi>y</mi><mn>2</mn></msup></mrow><mo></mo><mi>z</mi></mrow><mo>+</mo><mn>1</mn></mrow><mn>2</mn></mfrac></mtd></mtr><mtr><mtd><mfrac><mrow><mrow><mn>3</mn><mo></mo><mi>i</mi><mo></mo><mrow><msup><mi>y</mi><mn>4</mn></msup></mrow></mrow><mo>-</mo><mrow><mn>7</mn><mo></mo><mi>x</mi></mrow></mrow><mn>7</mn></mfrac></mtd><mtd><mfrac><mrow><mn>60</mn><mo>-</mo><mrow><mn>9</mn><mo></mo><mi>i</mi></mrow></mrow><mn>5</mn></mfrac></mtd></mtr></mtable><mo>]</mo></mrow></mstyle></math>
</td></tr>
</table>
</div>
<div class="returnType">
Type: SquareMatrix(2,Fraction Polynomial Complex Integer)
</div>
<p>Interchange the <span class="teletype">Polynomial</span> and the <span class="teletype">Complex</span> levels.
</p>
<div id="spadComm2-92" class="spadComm" >
<form id="formComm2-92" action="javascript:makeRequest('2-92');" >
<input id="comm2-92" type="text" class="command" style="width: 33em;" value="m3 := m2 :: SquareMatrix(2,FRAC COMPLEX POLY INT)" />
</form>
<span id="commSav2-92" class="commSav" >m3 := m2 :: SquareMatrix(2,FRAC COMPLEX POLY INT)</span>
<div id="mathAns2-92" ></div>
</div>
<div class="math">
<table>
<tr><td>
<math xmlns="&mathml;" mathsize="big" display="block"><mstyle><mrow><mo>[</mo><mtable><mtr><mtd><mfrac><mrow><mrow><mn>4</mn><mo></mo><mi>x</mi></mrow><mo>-</mo><mrow><mn>3</mn><mo></mo><mi>i</mi></mrow></mrow><mn>4</mn></mfrac></mtd><mtd><mfrac><mrow><mrow><mn>2</mn><mo></mo><mrow><msup><mi>y</mi><mn>2</mn></msup></mrow><mo></mo><mi>z</mi></mrow><mo>+</mo><mn>1</mn></mrow><mn>2</mn></mfrac></mtd></mtr><mtr><mtd><mfrac><mrow><mo>-</mo><mrow><mn>7</mn><mo></mo><mi>x</mi></mrow><mo>+</mo><mrow><mn>3</mn><mo></mo><mrow><msup><mi>y</mi><mn>4</mn></msup></mrow><mo></mo><mi>i</mi></mrow></mrow><mn>7</mn></mfrac></mtd><mtd><mfrac><mrow><mn>60</mn><mo>-</mo><mrow><mn>9</mn><mo></mo><mi>i</mi></mrow></mrow><mn>5</mn></mfrac></mtd></mtr></mtable><mo>]</mo></mrow></mstyle></math>
</td></tr>
</table>
</div>
<div class="returnType">
Type: SquareMatrix(2,Fraction Complex Polynomial Integer)
</div>
<p>All the entries have changed types, although in comparing the
last two results only the entry in the lower left corner looks different.
We did all the intermediate steps to show you what Axiom can do.
</p>
<p>In fact, we could have combined all these into one conversion.
</p>
<div id="spadComm2-93" class="spadComm" >
<form id="formComm2-93" action="javascript:makeRequest('2-93');" >
<input id="comm2-93" type="text" class="command" style="width: 28em;" value="m :: SquareMatrix(2,FRAC COMPLEX POLY INT)" />
</form>
<span id="commSav2-93" class="commSav" >m :: SquareMatrix(2,FRAC COMPLEX POLY INT)</span>
<div id="mathAns2-93" ></div>
</div>
<div class="math">
<table>
<tr><td>
<math xmlns="&mathml;" mathsize="big" display="block"><mstyle><mrow><mo>[</mo><mtable><mtr><mtd><mfrac><mrow><mrow><mn>4</mn><mo></mo><mi>x</mi></mrow><mo>-</mo><mrow><mn>3</mn><mo></mo><mi>i</mi></mrow></mrow><mn>4</mn></mfrac></mtd><mtd><mfrac><mrow><mrow><mn>2</mn><mo></mo><mrow><msup><mi>y</mi><mn>2</mn></msup></mrow><mo></mo><mi>z</mi></mrow><mo>+</mo><mn>1</mn></mrow><mn>2</mn></mfrac></mtd></mtr><mtr><mtd><mfrac><mrow><mo>-</mo><mrow><mn>7</mn><mo></mo><mi>x</mi></mrow><mo>+</mo><mrow><mn>3</mn><mo></mo><mrow><msup><mi>y</mi><mn>4</mn></msup></mrow><mo></mo><mi>i</mi></mrow></mrow><mn>7</mn></mfrac></mtd><mtd><mfrac><mrow><mn>60</mn><mo>-</mo><mrow><mn>9</mn><mo></mo><mi>i</mi></mrow></mrow><mn>5</mn></mfrac></mtd></mtr></mtable><mo>]</mo></mrow></mstyle></math>
</td></tr>
</table>
</div>
<div class="returnType">
Type: SquareMatrix(2,Fraction Complex Polynomial Integer)
</div>
<p>There are times when Axiom is not be able to do the conversion in one
step. You may need to break up the transformation into several
conversions in order to get an object of the desired type.
</p>
<p>We cannot move either <span class="teletype">Fraction</span> or <span class="teletype">Complex</span> above (or to the
left of, depending on how you look at it) <span class="teletype">SquareMatrix</span> because
each of these levels requires that its argument type have commutative
multiplication, whereas <span class="teletype">SquareMatrix</span> does not. That is because
<span class="teletype">Fraction</span> requires that its argument belong to the category
<span class="teletype">IntegralDomain</span> and <span class="index">category</span><a name="chapter-2-49"/> <span class="teletype">Complex</span> requires that its
argument belong to <span class="teletype">CommutativeRing</span>.
See <a href="section-2.1.xhtml#ugTypesBasic" class="ref" >ugTypesBasic</a> for a
brief discussion of categories. The <span class="teletype">Integer</span> level did not move
anywhere because it does not allow any arguments. We also did not
move the <span class="teletype">SquareMatrix</span> part anywhere, but we could have.
</p>
<p>Recall that <math xmlns="&mathml;" mathsize="big"><mstyle><mi>m</mi></mstyle></math> looks like this.
</p>
<div id="spadComm2-94" class="spadComm" >
<form id="formComm2-94" action="javascript:makeRequest('2-94');" >
<input id="comm2-94" type="text" class="command" style="width: 1em;" value="m" />
</form>
<span id="commSav2-94" class="commSav" >m</span>
<div id="mathAns2-94" ></div>
</div>
<div class="math">
<table>
<tr><td>
<math xmlns="&mathml;" mathsize="big" display="block"><mstyle><mrow><mo>[</mo><mtable><mtr><mtd><mrow><mi>x</mi><mo>-</mo><mrow><mfrac><mn>3</mn><mn>4</mn></mfrac><mo></mo><mi>i</mi></mrow></mrow></mtd><mtd><mrow><mrow><mrow><msup><mi>y</mi><mn>2</mn></msup></mrow><mo></mo><mi>z</mi></mrow><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac></mrow></mtd></mtr><mtr><mtd><mrow><mrow><mfrac><mn>3</mn><mn>7</mn></mfrac><mo></mo><mi>i</mi><mo></mo><mrow><msup><mi>y</mi><mn>4</mn></msup></mrow></mrow><mo>-</mo><mi>x</mi></mrow></mtd><mtd><mrow><mn>12</mn><mo>-</mo><mrow><mfrac><mn>9</mn><mn>5</mn></mfrac><mo></mo><mi>i</mi></mrow></mrow></mtd></mtr></mtable><mo>]</mo></mrow></mstyle></math>
</td></tr>
</table>
</div>
<div class="returnType">
Type: SquareMatrix(2,Polynomial Complex Fraction Integer)
</div>
<p>If we want a polynomial with matrix coefficients rather than a matrix
with polynomial entries, we can just do the conversion.
</p>
<div id="spadComm2-95" class="spadComm" >
<form id="formComm2-95" action="javascript:makeRequest('2-95');" >
<input id="comm2-95" type="text" class="command" style="width: 28em;" value="m :: POLY SquareMatrix(2,COMPLEX FRAC INT)" />
</form>
<span id="commSav2-95" class="commSav" >m :: POLY SquareMatrix(2,COMPLEX FRAC INT)</span>
<div id="mathAns2-95" ></div>
</div>
<div class="math">
<table>
<tr><td>
<math xmlns="&mathml;" mathsize="big" display="block"><mstyle><mrow><mrow><mrow><mo>[</mo><mtable><mtr><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd></mtr></mtable><mo>]</mo></mrow><mo></mo><mrow><msup><mi>y</mi><mn>2</mn></msup></mrow><mo></mo><mi>z</mi></mrow><mo>+</mo><mrow><mrow><mo>[</mo><mtable><mtr><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mrow><mfrac><mn>3</mn><mn>7</mn></mfrac><mo></mo><mi>i</mi></mrow></mtd><mtd><mn>0</mn></mtd></mtr></mtable><mo>]</mo></mrow><mo></mo><mrow><msup><mi>y</mi><mn>4</mn></msup></mrow></mrow><mo>+</mo><mrow><mrow><mo>[</mo><mtable><mtr><mtd><mn>1</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mo>-</mo><mn>1</mn></mtd><mtd><mn>0</mn></mtd></mtr></mtable><mo>]</mo></mrow><mo></mo><mi>x</mi></mrow><mo>+</mo><mrow><mo>[</mo><mtable><mtr><mtd><mo>-</mo><mrow><mfrac><mn>3</mn><mn>4</mn></mfrac><mo></mo><mi>i</mi></mrow></mtd><mtd><mfrac><mn>1</mn><mn>2</mn></mfrac></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mrow><mn>12</mn><mo>-</mo><mrow><mfrac><mn>9</mn><mn>5</mn></mfrac><mo></mo><mi>i</mi></mrow></mrow></mtd></mtr></mtable><mo>]</mo></mrow></mrow></mstyle></math>
</td></tr>
</table>
</div>
<div class="returnType">
Type: Polynomial SquareMatrix(2,Complex Fraction Integer)
</div>
<p>We have not yet used modes for any conversions. Modes are a great
shorthand for indicating the type of the object you want. Instead of
using the long type expression in the last example, we could have
simply said this.
</p>
<div id="spadComm2-96" class="spadComm" >
<form id="formComm2-96" action="javascript:makeRequest('2-96');" >
<input id="comm2-96" type="text" class="command" style="width: 8em;" value="m :: POLY ?" />
</form>
<span id="commSav2-96" class="commSav" >m :: POLY ?</span>
<div id="mathAns2-96" ></div>
</div>
<div class="math">
<table>
<tr><td>
<math xmlns="&mathml;" mathsize="big" display="block"><mstyle><mrow><mrow><mrow><mo>[</mo><mtable><mtr><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd></mtr></mtable><mo>]</mo></mrow><mo></mo><mrow><msup><mi>y</mi><mn>2</mn></msup></mrow><mo></mo><mi>z</mi></mrow><mo>+</mo><mrow><mrow><mo>[</mo><mtable><mtr><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mrow><mfrac><mn>3</mn><mn>7</mn></mfrac><mo></mo><mi>i</mi></mrow></mtd><mtd><mn>0</mn></mtd></mtr></mtable><mo>]</mo></mrow><mo></mo><mrow><msup><mi>y</mi><mn>4</mn></msup></mrow></mrow><mo>+</mo><mrow><mrow><mo>[</mo><mtable><mtr><mtd><mn>1</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mo>-</mo><mn>1</mn></mtd><mtd><mn>0</mn></mtd></mtr></mtable><mo>]</mo></mrow><mo></mo><mi>x</mi></mrow><mo>+</mo><mrow><mo>[</mo><mtable><mtr><mtd><mo>-</mo><mrow><mfrac><mn>3</mn><mn>4</mn></mfrac><mo></mo><mi>i</mi></mrow></mtd><mtd><mfrac><mn>1</mn><mn>2</mn></mfrac></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mrow><mn>12</mn><mo>-</mo><mrow><mfrac><mn>9</mn><mn>5</mn></mfrac><mo></mo><mi>i</mi></mrow></mrow></mtd></mtr></mtable><mo>]</mo></mrow></mrow></mstyle></math>
</td></tr>
</table>
</div>
<div class="returnType">
Type: Polynomial SquareMatrix(2,Complex Fraction Integer)
</div>
<p>We can also indicate more structure if we want the entries of the
matrices to be fractions.
</p>
<div id="spadComm2-97" class="spadComm" >
<form id="formComm2-97" action="javascript:makeRequest('2-97');" >
<input id="comm2-97" type="text" class="command" style="width: 22em;" value="m :: POLY SquareMatrix(2,FRAC ?)" />
</form>
<span id="commSav2-97" class="commSav" >m :: POLY SquareMatrix(2,FRAC ?)</span>
<div id="mathAns2-97" ></div>
</div>
<div class="math">
<table>
<tr><td>
<math xmlns="&mathml;" mathsize="big" display="block"><mstyle><mrow><mrow><mrow><mo>[</mo><mtable><mtr><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd></mtr></mtable><mo>]</mo></mrow><mo></mo><mrow><msup><mi>y</mi><mn>2</mn></msup></mrow><mo></mo><mi>z</mi></mrow><mo>+</mo><mrow><mrow><mo>[</mo><mtable><mtr><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mfrac><mrow><mn>3</mn><mo></mo><mi>i</mi></mrow><mn>7</mn></mfrac></mtd><mtd><mn>0</mn></mtd></mtr></mtable><mo>]</mo></mrow><mo></mo><mrow><msup><mi>y</mi><mn>4</mn></msup></mrow></mrow><mo>+</mo><mrow><mrow><mo>[</mo><mtable><mtr><mtd><mn>1</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mo>-</mo><mn>1</mn></mtd><mtd><mn>0</mn></mtd></mtr></mtable><mo>]</mo></mrow><mo></mo><mi>x</mi></mrow><mo>+</mo><mrow><mo>[</mo><mtable><mtr><mtd><mo>-</mo><mfrac><mrow><mn>3</mn><mo></mo><mi>i</mi></mrow><mn>4</mn></mfrac></mtd><mtd><mfrac><mn>1</mn><mn>2</mn></mfrac></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mfrac><mrow><mn>60</mn><mo>-</mo><mrow><mn>9</mn><mo></mo><mi>i</mi></mrow></mrow><mn>5</mn></mfrac></mtd></mtr></mtable><mo>]</mo></mrow></mrow></mstyle></math>
</td></tr>
</table>
</div>
<div class="returnType">
Type: Polynomial SquareMatrix(2,Fraction Complex Integer)
</div>
</div><a href="book-contents.xhtml" style="margin-right: 10px;">Book Contents</a>
<a href="section-2.6.xhtml" style="margin-right: 10px;">Previous Section 2.6 The ``Any'' Domain</a><a href="section-2.8.xhtml" style="margin-right: 10px;">Next Section 2.8 Subdomains Again</a>
<a href="book-index.xhtml">Book Index</a></body>
</html>
|