1
2% Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
3% All rights reserved.
4%
5% Redistribution and use in source and binary forms, with or without
6% modification, are permitted provided that the following conditions are
7% met:
8%
9%     - Redistributions of source code must retain the above copyright
10%       notice, this list of conditions and the following disclaimer.
11%
12%     - Redistributions in binary form must reproduce the above copyright
13%       notice, this list of conditions and the following disclaimer in
14%       the documentation and/or other materials provided with the
15%       distribution.
16%
17%     - Neither the name of The Numerical ALgorithms Group Ltd. nor the
18%       names of its contributors may be used to endorse or promote products
19%       derived from this software without specific prior written permission.
20%
21% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22% IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23% TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24% PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
25% OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26% EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27% PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES-- LOSS OF USE, DATA, OR
28% PROFITS-- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29% LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30% NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
33% *********************************************************************
34\head{chapter}{Browse}{ugBrowse}
35% *********************************************************************
36
37This chapter discusses the \Browse{}
38\index{Browse@\Browse{}}
39component of \HyperName{}.
40\index{HyperDoc@{\HyperName{}}}
41We suggest you invoke \Language{} and work through this
42chapter, section by section, following our examples to gain some
43familiarity with \Browse{}.
44
45% *********************************************************************
46\head{section}{The Front Page: Searching the Library}{ugBrowseStart}
47% *********************************************************************
48To enter \Browse{}, click on {\bf Browse} on the top level page
49of \HyperName{} to get the {\it front page} of \Browse{}.
50%
51%324pt is 4.5",180pt is 2.5",432pt is 6"=textwidth,54=(432-324)/2
52%ps files are 4.5"x2.5" except source 4.5"x2.5"
53%
54\begin{texonly}
55\begin{figure}[htbp]
56\begin{picture}(324,180)%(-54,0)
57\special{psfile=h-brfront.ps}
58\end{picture}
59\caption{The Browse front page.}
60\end{figure}
61\end{texonly}
62
63To use this page, you first enter a \spadgloss{search string} into
64the input area at the top, then click on one of the buttons below.
65We show the use of each of the buttons by example.
66
67\subsubsection{Constructors}
68
69First enter the search string {\tt Matrix} into the input area and
70click on {\bf Constructors}.
71What you get is the {\it constructor page} for \spadtype{Matrix}.
72We show and describe this page in detail in
73\spadref{ugBrowseDomain}.
74By convention, \Language{} does a case-insensitive search for a
75match.
76Thus {\tt matrix} is just as good as {\tt Matrix}, has the same
77effect as {\tt MaTrix}, and so on.
78We recommend that you generally use small letters for names
79however.
80A search string with only capital letters has a special meaning
81(see \spadref{ugBrowseCapitalizationConvention}).
82
83
84Click on \UpBitmap{} to return to the \Browse{} front page.
85
86Use the symbol ``{\tt *}'' in search strings as a \spadgloss{wild
87card}.
88A wild card matches any substring, including the empty string.
89For example, enter the search string {\tt *matrix*} into the input
90area and click on {\bf Constructors}.\footnote{To get only
91categories, domains, or packages, rather than all constructors,
92you can click on the corresponding button to the right of {\bf
93Constructors}.}
94What you get is a table of all constructors whose names contain
95the string ``{\tt matrix}.''
96
97\begin{texonly}
98\begin{figure}[htbp]
99\begin{picture}(324,180)%(-54,0)
100\special{psfile=h-consearch.ps}
101\end{picture}
102\caption{Table of exposed constructors matching \texttt{*matrix*}.}
103\end{figure}
104\end{texonly}
105
106%% Following para replaced 1995oct30 MGR
107%These are all the \spadglossSee{exposed}{expose} constructors in
108%\Language{}.
109%To see how to get all exposed and unexposed constructors in
110%\Language{}, skip to the section entitled {\bf Exposure} in
111%\spadref{ugBrowseOptions}.
112All constructors containing the string are listed, whether
113\spadglossSee{exposed}{expose} or \spadglossSee{unexposed}{expose}.
114You can hide the names of the unexposed constructors by clicking
115on the {\it *=}{\bf unexposed} button in the {\it Views} panel at
116the bottom of the window.
117(The button will change to {\bf exposed} {\it only}.)
118
119One of the names in this table is \spadtype{Matrix}.
120Click on \spadtype{Matrix}.
121What you get is again the constructor page for \spadtype{Matrix}.
122As you see, \Browse{} gives you a large network of
123information in which there are many ways to reach the same
124pages.
125\exptypeindex{Matrix}
126
127Again click on the \UpBitmap{} to return to the table of constructors
128whose names contain {\tt matrix}.
129%Below the table is a {\bf Views} panel. % here & globally MGR 1995oct30
130Below the table is a {\it Views} panel.
131This panel contains buttons that let you view constructors in different
132ways.
133To learn about views of constructors, skip to
134\spadref{ugBrowseViewsOfConstructors}.
135
136Click on \UpBitmap{} to return to the \Browse{} front page.
137
138\subsubsection{Operations}
139
140Enter {\tt *matrix} into the input area and click on {\bf
141Operations}.
142This time you get a table of {\it operations} whose names end with {\tt
143matrix} or {\tt Matrix}.
144
145\begin{texonly}
146\begin{figure}[htbp]
147\begin{picture}(324,180)%(-54,0)
148\special{psfile=h-matrixops.ps}
149\end{picture}
150\caption{Table of operations matching \texttt{*matrix}.}
151\end{figure}
152\end{texonly}
153
154If you select an operation name, you go to a page describing all
155the operations in \Language{} of that name.
156At the bottom of an operation page is another kind of {\it Views} panel,
157one for operation pages.
158To learn more about these views, skip to
159\spadref{ugBrowseViewsOfOperations}.
160
161Click on \UpBitmap{} to return to the \Browse{} front page.
162
163\subsubsection{General}
164
165This button does a general search for all constructor and operation
166names matching the search string.
167Enter the search string \allowbreak
168{\tt *matrix*} into the input area.
169Click on {\bf General} to find all constructs that have {\tt
170matrix} as a part of their name.
171
172\begin{texonly}
173\begin{figure}[htbp]
174\begin{picture}(324,180)%(-54,0)
175\special{psfile=h-gensearch.ps}
176\end{picture}
177\caption{Table of all constructs matching \texttt{*matrix*}.}
178\end{figure}
179\end{texonly}
180
181The summary gives you all the names under a heading when the number of
182entries is less than 10. % "less than 10." replaces the following:
183                         % sufficiently small%\footnote{See
184%\spadref{ugBrowseOptions} to see how you can change this.}.
185%% MGR 1995oct31
186
187Click on \UpBitmap{} to return to the \Browse{} front page.
188
189\subsubsection{Documentation}
190
191Again enter the search key {\tt *matrix*} and this time click on
192{\bf Documentation}.
193This search matches any constructor and operation
194name whose documentation contains a substring matching {\tt
195matrix}.
196
197\begin{texonly}
198\begin{figure}[htbp]
199\begin{picture}(324,180)%(-54,0)
200\special{psfile=h-docsearch.ps}
201\end{picture}
202\caption{Table of constructs with documentation matching \texttt{*matrix*}.}
203\end{figure}
204\end{texonly}
205
206Click on \UpBitmap{} to return to the \Browse{} front page.
207
208\subsubsection{Complete}
209
210This search combines both {\bf General} and {\bf Documentation}.
211
212\begin{texonly}
213\begin{figure}[htbp]
214\begin{picture}(324,180)%(-54,0)
215\special{psfile=h-comsearch.ps}
216\end{picture}
217\caption{Table summarizing complete search for pattern \texttt{*matrix*}.}
218\end{figure}
219\end{texonly}
220
221% *********************************************************************
222\head{section}{The Constructor Page}{ugBrowseDomain}
223% *********************************************************************
224
225In this section we look in detail at a constructor page for domain
226\spadtype{Matrix}.
227Enter {\tt matrix} into the input area on the main \Browse{} page
228and click on {\bf Constructors}.
229
230\begin{texonly}
231\begin{figure}[htbp]
232\begin{picture}(324,180)%(-54,0)
233\special{psfile=h-matpage.ps}
234\end{picture}
235\caption{Constructor page for \protect\spadtype{Matrix}.}
236\end{figure}
237\end{texonly}
238
239
240The header part tells you that \spadtype{Matrix} has abbreviation
241\spadtype{MATRIX} and one argument called {\tt R} that must be a
242domain of category \spadtype{Ring}.
243Just what domains can be arguments of \spadtype{Matrix}?
244To find this out, click on the {\tt R} on the second line of the
245heading.
246What you get is a table of all acceptable domain parameter values
247of {\tt R}, or a table of \spadgloss{rings} in \Language{}.
248
249\begin{texonly}
250\begin{figure}[htbp]
251\begin{picture}(324,180)%(-54,0)
252\special{psfile=h-matargs.ps}
253\end{picture}
254\caption{Table of acceptable domain parameters to \protect\spadtype{Matrix}.}
255\end{figure}
256\end{texonly}
257
258Click on \UpBitmap{} to return to the constructor page for
259\spadtype{Matrix}.
260\texht{\newpage}{}
261
262If you have access to the source code of \Language{}, the third
263\index{source code}
264line of the heading gives you the name of the source file
265containing the definition of \spadtype{Matrix}.
266Click on it to pop up an editor window containing the source code
267of \spadtype{Matrix}.
268
269\begin{texonly}
270\begin{figure}[htbp]
271\begin{picture}(324,168)%(-54,0)
272\special{psfile=h-matsource.ps}
273\end{picture}
274\caption{Source code for \protect\spadtype{Matrix}.}
275\end{figure}
276\end{texonly}
277
278We recommend that you leave the editor window up while working
279through this chapter as you occasionally may want to refer to it.
280\texht{\newpage}{}
281
282% *********************************************************************
283\head{subsection}{Constructor Page Buttons}{ugBrowseDomainButtons}
284% *********************************************************************
285
286We examine each button on this page in order.
287
288\subsubsection{Description}
289
290Click here to bring up a page with a brief description of
291constructor \spadtype{Matrix}.
292If you have access to system source code, note that these comments
293can be found directly over the constructor definition.
294
295\begin{texonly}
296\begin{figure}[htbp]
297\begin{picture}(324,180)%(-54,0)
298\special{psfile=h-matdesc.ps}
299\end{picture}
300\caption{Description page for \protect\spadtype{Matrix}.}
301\end{figure}
302\end{texonly}
303
304\subsubsection{Operations}
305
306Click here to get a table of operations exported by
307\spadtype{Matrix}.
308You may wish to widen the window to have multiple columns as
309below.
310
311\begin{texonly}
312\begin{figure}[htbp]
313\begin{picture}(324,180)%(-54,0)
314\special{psfile=h-matops.ps}
315\end{picture}
316\caption{Table of operations from \protect\spadtype{Matrix}.}
317\end{figure}
318\end{texonly}
319
320If you click on an operation name, you bring up a description
321page for the operations.
322For a detailed description of these pages, skip to
323\spadref{ugBrowseViewsOfOperations}.
324
325\subsubsection{Examples}
326
327Click here to get an {\it examples page} with examples of operations to
328create and manipulate matrices.
329
330\begin{texonly}
331\begin{figure}[htbp]
332\begin{picture}(324,180)%(-54,0)
333\special{psfile=h-matexamp.ps}
334\end{picture}
335\caption{Example page for \protect\spadtype{Matrix}.}
336\end{figure}
337\end{texonly}
338
339Read through this section.
340Try selecting the various buttons.
341Notice that if you click on an operation name, such as
342\spadfunFrom{new}{Matrix}, you bring up a description page for that
343operation from \spadtype{Matrix}.
344
345Example pages have several examples of \Language{} commands.
346Each example has an active button to its left.
347Click on it!
348A pre-computed answer is pasted into the page immediately following the
349command.
350If you click on the button a second time, the answer disappears.
351This button thus acts as a toggle:
352``now you see it; now you don't.''
353
354Note also that the \Language{} commands themselves are active.
355If you want to see \Language{} execute the command, then click on it!
356A new \Language{} window appears on your screen and the command is
357executed.
358
359\begin{htonly}
360At the end of the page is generally a menu of buttons that lead
361you to further sections.
362Select one of these topics to explore its contents.
363\end{htonly}
364
365\subsubsection{Exports}
366
367Click here to see a page describing the exports of \spadtype{Matrix}
368exactly as described by the source code.
369
370\begin{texonly}
371\begin{figure}[htbp]
372\begin{picture}(324,180)%(-54,0)
373\special{psfile=h-matexports.ps}
374\end{picture}
375\caption{Exports of \protect\spadtype{Matrix}.}
376\end{figure}
377\end{texonly}
378
379As you see, \spadtype{Matrix} declares that it exports all the operations
380and categories exported by category
381\spadtype{MatrixCategory(R, Row, Col)}.
382In addition, two operations, \spadfun{diagonalMatrix} and
383\spadfun{inverse}, are explicitly exported.
384
385To learn a little about the structure of \Language{}, we suggest you do
386the following exercise.
387\begin{texonly}
388Otherwise, go on to the next section.
389\end{texonly}
390\begin{htonly}
391Otherwise, click on \UpButton{} and go on to the next section.
392\end{htonly}
393\spadtype{Matrix} explicitly exports only two operations.
394The other operations are thus exports of \spadtype{MatrixCategory}.
395In general, operations are usually not explicitly exported by a domain.
396Typically they are \spadglossSee{inherited}{inherit} from several
397different categories.
398Let's find out from where the operations of \spadtype{Matrix} come.
399
400\begin{enumerate}
401\item Click on {\bf MatrixCategory}, then on {\bf Exports}.
402Here you see that {\bf MatrixCategory} explicitly exports many matrix
403operations.
404Also, it inherits its operations from
405\spadtype{TwoDimensionalArrayCategory}.
406
407\item Click on {\bf TwoDimensionalArrayCategory}, then on {\bf Exports}.
408Here you see explicit operations dealing with rows and columns.
409In addition, it inherits operations from
410\spadtype{HomogeneousAggregate}.
411
412%\item Click on {\bf HomogeneousAggregate}, then on {\bf Exports}.
413%And so on.
414%If you continue doing this, eventually you will
415
416\item Click on \UpBitmap{} and then
417click on {\bf Object}, then on {\bf Exports}, where you see
418there are no exports.
419
420\item Click on \UpBitmap{} repeatedly to return to the constructor page
421for \spadtype{Matrix}.
422
423\end{enumerate}
424
425\subsubsection{Related Operations}
426
427Click here bringing up a table of operations that are exported by
428\spadglossSee{packages}{package} but not by \spadtype{Matrix} itself.
429
430\begin{texonly}
431\begin{figure}[htbp]
432\begin{picture}(324,180)%(-54,0)
433\special{psfile=h-matrelops.ps}
434\end{picture}
435\caption{Related operations of \protect\spadtype{Matrix}.}
436\end{figure}
437\end{texonly}
438
439To see a table of such packages, use the {\bf Relatives} button on the
440{\bf Cross Reference} page described next.
441
442
443% *********************************************************************
444\head{subsection}{Cross Reference}{ugBrowseCrossReference}
445% *********************************************************************
446Click on the {\bf Cross Reference} button on the main constructor page
447for \spadtype{Matrix}.
448This gives you a page having various cross reference information stored
449under the respective buttons.
450
451\begin{texonly}
452\begin{figure}[htbp]
453\begin{picture}(324,180)%(-54,0)
454\special{psfile=h-matxref.ps}
455\end{picture}
456\caption{Cross-reference page for \protect\spadtype{Matrix}.}
457\end{figure}
458\end{texonly}
459
460\subsubsection{Parents}
461
462The parents of a domain are the same as the categories mentioned under
463the {\bf Exports} button on the first page.
464Domain \spadtype{Matrix} has only one parent but in general a domain can
465have any number.
466
467\subsubsection{Ancestors}
468
469The \spadglossSee{ancestors}{ancestor} of a constructor consist of its parents, the
470parents of its parents, and so on.
471Did you perform the exercise in the last section under {\bf Exports}?
472If so, you  see here all the categories you found while ascending the
473{\bf Exports} chain for \spadtype{Matrix}.
474
475\subsubsection{Relatives}
476
477The \spadglossSee{relatives}{relative} of a domain constructor are package
478constructors that provide operations in addition to those
479\spadglossSee{exported}{export} by the domain.
480
481Try this exercise.
482\begin{enumerate}
483\item Click on {\bf Relatives}, bringing up a list of
484\spadglossSee{packages}{package}.
485
486\item Click on {\bf LinearSystemMatrixPackage} bringing up its
487constructor page.\footnote{You may want to widen your \HyperName{}
488window to make what follows more legible.}
489
490\item Click on {\bf Operations}.
491Here you see \spadfun{rank}, an operation also exported by
492\spadtype{Matrix} itself.
493
494\item Click on {\bf rank}.
495This \spadfunFrom{rank}{LinearSystemMatrixPackage} has two arguments and
496thus is different from the \spadfunFrom{rank}{Matrix} from
497\spadtype{Matrix}.
498
499\item Click on \UpBitmap{} to return to the list of operations for the
500package \spadtype{LinearSystemMatrixPackage}.
501
502\item Click on {\bf solve} to bring up a
503\spadfunFrom{solve}{LinearSystemMatrixPackage} for linear systems of
504equations.
505
506\item Click on \UpBitmap{} several times to return to the cross
507reference page for \spadtype{Matrix}.
508\end{enumerate}
509
510\subsubsection{Dependents}
511
512The \spadglossSee{dependents}{dependent} of a constructor are those
513\spadglossSee{domains}{domain} or \spadglossSee{packages}{package}
514that mention that
515constructor either as an argument or in its \spadglossSee{exports}{export}.
516
517If you click on {\bf Dependents} two entries may surprise you:
518\spadtype{RectangularMatrix} and \spadtype{SquareMatrix}.
519This happens because \spadtype{Matrix}, as it turns out, appears in
520signatures of operations exported by these domains.
521
522\subsubsection{Search Path}
523
524The term \spadgloss{search path} refers to the {\it search order} for
525functions.
526If you are an expert user or curious about how the \Language{} system
527works, try the following exercise.
528Otherwise, you best skip this button and go on to {\bf Users}.
529
530Clicking on {\bf Search Path} gives you a
531list of domain constructors:
532\spadtype{InnerIndexedTwoDimensionalArray},
533\aliascon{MatrixCategory&}{MATCAT-},
534\aliascon{TwoDimensionalArrayCategory&}{ARR2CAT-},
535\aliascon{HomogeneousAggregate&}{HOAGG-},
536\aliascon{Aggregate&}{AGG-},
537\aliascon{Evalable&}{EVALAB-},
538\aliascon{SetCategory&}{SETCAT-},
539\aliascon{InnerEvalable&}{IEVALAB-},
540\aliascon{BasicType&}{BASTYPE-}.
541What are these constructors and how are they used?
542
543We explain by an example.
544Suppose you create a matrix using the interpreter, then ask for its
545\spadfun{rank}.
546\Language{} must then find a function implementing the \spadfun{rank}
547operation for matrices.
548The first place \Language{} looks for \spadfun{rank} is in the \spadtype{Matrix}
549domain.
550
551If not there, the search path of \spadtype{Matrix} tells \Language{} where
552else to look.
553Associated with the matrix domain are eight other search path domains.
554Their order is important.
555\Language{} first searches the first one,
556\spadtype{InnerIndexedTwoDimensionalArray}.
557If not there, it searches the second \aliascon{MatrixCategory&}{MATCAT-}.
558And so on.
559
560Where do these {\it search path constructors} come from?
561The source code for \spadtype{Matrix} contains this syntax for the
562\spadgloss{function body} of
563\spadtype{Matrix}:\footnote{\spadtype{InnerIndexedTwoDimensionalArray}
564is a special domain implemented for matrix-like domains to provide
565efficient implementations of \twodim{} arrays.
566For example, domains of category \spadtype{TwoDimensionalArrayCategory}
567can have any integer as their \spad{minIndex}.
568Matrices and other members of this special ``inner'' array have their
569\spad{minIndex} defined as \spad{1}.}
570\begin{verbatim}
571InnerIndexedTwoDimensionalArray(R,mnRow,mnCol,Row,Col)
572   add ...
573\end{verbatim}
574where the ``{\tt ...}'' denotes all the code that follows.
575In English, this means:
576``The functions for matrices are defined as those from
577\spadtype{InnerIndexedTwoDimensionalArray} domain augmented by those
578defined in `{\tt ...}','' where the latter take precedence.
579
580This explains \spadtype{InnerIndexedTwoDimensionalArray}.
581The other names, those with names ending with an ampersand \spadSyntax{&} are
582\spadglossSee{default packages}{default package}
583for categories to which \spadtype{Matrix} belongs.
584Default packages are ordered by the notion of ``closest ancestor.''
585
586\subsubsection{Users}
587
588A user of \spadtype{Matrix} is any constructor that uses
589\spadtype{Matrix} in its implementation.
590For example, \spadtype{Complex} is a user of \spadtype{Matrix}; it
591exports several operations that take matrices as arguments or return
592matrices as values.\footnote{A constructor is a user of
593\spadtype{Matrix} if it handles any matrix.
594For example, a constructor having internal (unexported) operations
595dealing with matrices is also a user.}
596
597\subsubsection{Uses}
598
599A \spadgloss{benefactor} of \spadtype{Matrix} is any constructor that
600\spadtype{Matrix} uses in its implementation.
601This information, like that for clients, is gathered from run-time
602structures.\footnote{The benefactors exclude constructors such as
603\spadtype{PrimitiveArray} whose operations macro-expand and so vanish
604from sight!}
605
606Cross reference pages for categories have some different buttons on
607them.
608Starting with the constructor page of \spadtype{Matrix}, click on
609\spadtype{Ring} producing its constructor page.
610Click on {\bf Cross Reference},
611producing the cross-reference page for \spadtype{Ring}.
612Here are buttons {\bf Parents} and {\bf Ancestors} similar to the notion
613for domains, except for categories the relationship between parent and
614child is defined through \spadgloss{category extension}.
615
616\subsubsection{Children}
617
618Category hierarchies go both ways.
619There are children as well as parents.
620A child can have any number of parents, but always at least one.
621Every category is therefore a descendant of exactly one category:
622\spadtype{Object}.
623
624\subsubsection{Descendants}
625
626These are children, children of children, and so on.
627
628Category hierarchies are complicated by the fact that categories take
629parameters.
630Where a parameterized category fits into a hierarchy {\it may} depend on
631values of its parameters.
632In general, the set of categories in \Language{} forms a {\it directed
633acyclic graph}, that is, a graph with directed arcs and no cycles.
634
635\subsubsection{Domains}
636
637This produces a table of all domain constructors that can possibly be
638rings (members of category \spadtype{Ring}).
639Some domains are unconditional rings.
640Others are rings for some parameters and not for others.
641To find out which, select the {\bf conditions} button in the views
642panel.
643For example, \spadtype{DirectProduct(n, R)} is a ring if {\tt R} is a
644ring.
645
646
647
648% *********************************************************************
649\head{subsection}{Views Of Constructors}{ugBrowseViewsOfConstructors}
650% *********************************************************************
651
652Below every constructor table page is a {\it Views} panel.
653As an example, click on {\bf Cross Reference} from
654the constructor page of \spadtype{Matrix},
655then on {\bf Benefactors} to produce a
656short table of constructor names.
657
658The {\it Views} panel is at the bottom of the page.
659Two items, {\it names} and {\it conditions,} are in italics.
660Others are active buttons.
661The active buttons are those that give you useful alternative views
662on this table of constructors.
663Once you select a view, you notice that the button turns
664off (becomes italicized) so that you cannot reselect it.
665
666\subsubsection{names}
667
668This view gives you a table of names.
669Selecting any of these names brings up the constructor page for that
670constructor.
671
672\subsubsection{abbrs}
673
674This view gives you a table of abbreviations, in the same order as the
675original constructor names.
676Abbreviations are in capitals and are limited to 7 characters.
677They can be used interchangeably with constructor names in input areas.
678
679\subsubsection{kinds}
680
681This view organizes constructor names into
682the three kinds: categories, domains and packages.
683
684\subsubsection{files}
685
686This view gives a table of file names for the source
687code of the constructors in alphabetic order after removing
688duplicates.
689
690\subsubsection{parameters}
691
692This view presents constructors with the arguments.
693This view of the benefactors of \spadtype{Matrix} shows that
694\spadtype{Matrix} uses as many as five different \spadtype{List} domains
695in its implementation.
696
697\subsubsection{filter}
698
699This button is used to refine the list of names or abbreviations.
700Starting with the {\it names} view, enter {\tt m*} into the input area
701and click on {\bf filter}.
702You then get a shorter table with only the names beginning with {\tt m}.
703
704\subsubsection{documentation}
705
706This gives you documentation for each of the constructors.
707
708\subsubsection{conditions}
709
710This page organizes the constructors according to predicates.
711The view is not available for your example page since all constructors
712are unconditional.
713For a table with conditions, return to the {\bf Cross Reference} page
714for \spadtype{Matrix}, click on {\bf Ancestors}, then on {\bf
715conditions} in the view panel.
716This page shows you that \spadtype{CoercibleTo(OutputForm)} and
717\spadtype{SetCategory} are ancestors of \spadtype{Matrix(R)} only if {\tt R}
718belongs to category \spadtype{SetCategory}.
719
720%*********************************************************************
721\head{subsection}{Giving Parameters to Constructors}{ugBrowseGivingParameters}
722%*********************************************************************
723
724Notice the input area at the bottom of the constructor page.
725If you leave this blank, then the information you get is for the
726domain constructor \spadtype{Matrix(R)}, that is, \spadtype{Matrix} for an
727arbitrary underlying domain {\tt R}.
728
729In general, however, the exports and other information {\it do} usually
730depend on the actual value of {\tt R}.
731For example, \spadtype{Matrix} exports the \spadfun{inverse} operation
732only if the domain {\tt R} is a \spadtype{Field}.
733To see this, try this from the main constructor page:
734
735\begin{enumerate}
736\item Enter {\tt Integer} into the input area at the bottom of the page.
737
738\item Click on {\bf Operations}, producing a table of operations.
739Note the number of operation names that appear at the top of the
740page.
741
742\item Click on \UpBitmap{} to return to the constructor page.
743
744\item Use the
745\texht{\fbox{\bf Delete}}{{\bf Delete}}
746or
747\texht{\fbox{\bf Backspace}}{{\bf Backspace}}
748keys to erase {\tt Integer} from the input area.
749
750\item Click on {\bf Operations} to produce a new table of operations.
751Look at the number of operations you get.
752This number is greater than what you had before.
753Find, for example, the operation \spadfun{inverse}.
754
755\item Click on {\bf inverse} to produce a page describing the operation
756\spadfun{inverse}.
757At the bottom of the description, you notice that the {\bf
758Conditions} line says ``{\tt R} has \spadtype{Field}.''
759This operation is {\it not} exported by \spadtype{Matrix(Integer)} since
760\spadtype{Integer} is not a \spadgloss{field}.
761
762Try putting the name of a domain such as \spadtype{Fraction Integer}
763(which is a field) into the input area, then clicking on {\bf Operations}.
764As you see, the operation \spadfun{inverse} is exported.
765\end{enumerate}
766
767% *********************************************************************
768\head{section}{Miscellaneous Features of Browse}{ugBrowseMiscellaneousFeatures}
769% *********************************************************************
770% *********************************************************************
771\head{subsection}{The Description Page for Operations}{ugBrowseDescriptionPage}
772% *********************************************************************
773From the constructor page of \spadtype{Matrix},
774click on {\bf Operations} to bring up the table of operations
775for \spadtype{Matrix}.
776
777Find the operation {\bf inverse} in the table and click on it.
778This takes you to a page showing the documentation for this operation.
779
780\begin{texonly}
781\begin{figure}[htbp]
782\begin{picture}(324,180)%(-54,0)
783\special{psfile=h-matinv.ps}
784\end{picture}
785\caption{Operation \protect\spadfunFrom{inverse}{Matrix} from \protect\spadtype{Matrix}.}
786\end{figure}
787\end{texonly}
788
789Here is the significance of the headings you see.
790
791\subsubsection{Arguments}
792
793This lists each of the arguments of the operation in turn, paraphrasing
794the \spadgloss{signature} of the operation.
795As for signatures, a \spadSyntax{%} is used to designate {\em this domain},
796that is, \spadtype{Matrix(R)}.
797
798\subsubsection{Returns}
799
800This describes the return value for the operation, analogous to the {\bf
801Arguments} part.
802
803\subsubsection{Origin}
804
805This tells you which domain or category explicitly exports the
806operation.
807In this example, the domain itself is the {\it Origin}.
808
809
810\subsubsection{Conditions}
811
812This tells you that the operation is exported by \spadtype{Matrix(R)} only if
813``{\tt R} has \spadtype{Field},'' that is, ``{\tt R} is a member of
814category \spadtype{Field}.''
815When no {\bf Conditions} part is given, the operation is exported for
816all values of {\tt R}.
817
818\subsubsection{Description}
819
820Here are the \spadSyntax{++} comments
821that appear in the source code of its {\it Origin}, here \spadtype{Matrix}.
822You find these comments in the source code for \spadtype{Matrix}.
823
824\begin{texonly}
825\begin{figure}[htbp]
826\begin{picture}(324,180)%(-54,0)
827\special{psfile=h-matmap.ps}
828\end{picture}
829\caption{Operations \protect\spadfun{map} from \protect\spadtype{Matrix}.}
830\end{figure}
831\end{texonly}
832
833Click on \UpBitmap{} to return to the table of operations.
834Click on {\bf map}.
835Here you find three different operations named \spadfun{map}.
836This should not surprise you.
837Operations are identified by name and \spadgloss{signature}.
838There are three operations named \spadfun{map}, each with
839different signatures.
840What you see is the {\it descriptions} view of the operations.
841If you like, select the button in the heading of one of these
842descriptions to get {\it only} that operation.
843
844\subsubsection{Where}
845
846This part qualifies domain parameters mentioned in the arguments to the
847operation.
848
849% *********************************************************************
850\head{subsection}{Views of Operations}{ugBrowseViewsOfOperations}
851% *********************************************************************
852
853We suggest that you go to the constructor page for \spadtype{Matrix}
854and click on {\bf Operations} to bring up a table of operations
855with a {\it Views} panel at the bottom.
856
857\subsubsection{names}
858
859This view lists the names of the operations.
860Unlike constructors, however, there may be several operations with the
861same name.
862The heading for the page tells you the number of unique names and the
863number of distinct operations when these numbers are different.
864
865\subsubsection{filter}
866
867As for constructors, you can use this button to cut down the list of
868operations you are looking at.
869Enter, for example, {\tt m*} into the input area to the right of {\bf
870filter} then click on {\bf filter}.
871As usual, any logical expression is permitted.
872For example, use
873\begin{verbatim}
874*! or *?
875\end{verbatim}
876to get a list of destructive operations and predicates.
877
878\subsubsection{documentation}
879
880This gives you the most information:
881a detailed description of all the operations in the form you have seen
882before.
883Every other button summarizes these operations in some form.
884
885\subsubsection{signatures}
886
887This views the operations by showing their signatures.
888
889\subsubsection{parameters}
890
891This views the operations by their distinct syntactic forms with
892parameters.
893
894\subsubsection{origins}
895
896This organizes the operations according to the constructor that
897explicitly exports them.
898
899\subsubsection{conditions}
900
901This view organizes the operations into conditional and unconditional
902operations.
903
904\subsubsection{usage}
905
906This button is only available if your user-level is set to {\it
907\index{user-level}
908development}.
909The {\bf usage} button produces a table of constructors that reference this
910operation.\footnote{\Language{} requires an especially long time to
911produce this table, so anticipate this when requesting this
912information.}
913
914\subsubsection{implementation}
915
916This button is only available if your user-level is set to {\it
917development}.
918\index{user-level}
919If you enter values for all domain parameters on the constructor page,
920then the {\bf implementation} button appears in place of the {\bf
921conditions} button.
922This button tells you what domains or packages actually implement the
923various operations.\footnote{This button often takes a long time; expect
924a delay while you wait for an answer.}
925
926With your user-level set to {\it development}, we suggest you try this
927exercise.
928Return to the main constructor page for \spadtype{Matrix}, then enter
929{\tt Integer} into the input area at the bottom as the value of {\tt R}.
930Then click on {\bf Operations} to produce a table of operations.
931Note that the {\bf conditions} part of the {\it Views} table is
932replaced by {\bf implementation}.
933Click on {\bf implementation}.
934After some delay, you get a page describing what implements each of
935the matrix operations, organized by the various domains and packages.
936
937\begin{texonly}
938\begin{figure}[htbp]
939\begin{picture}(324,180)%(-54,0)
940\special{psfile=h-matimp.ps}
941\end{picture}
942\caption{Implementation domains for \protect\spadtype{Matrix}.}
943\end{figure}
944\end{texonly}
945
946\subsubsection{generalize}
947
948This button only appears for an operation page of a constructor
949involving a unique operation name.
950
951From an operations page for \spadtype{Matrix}, select any
952operation name, say {\bf rank}.
953In the views panel, the {\bf filter} button is  replaced by
954{\bf generalize}.
955Click on it!
956%% Replaced {\bf threshold} with 10 below.  MGR 1995oct31
957What you get is a description of all \Language{} operations
958named \spadfun{rank}.\footnote{If there were more than 10
959operations of the name, you get instead a page
960with a {\it Views} panel at the bottom and the message to {\bf
961Select a view below}.
962To get the descriptions of all these operations as mentioned
963above, select the {\bf description} button.}
964%See the discussion of {\bf threshold} in
965%\spadref{ugBrowseOptions}.} %% Removed MGR 1995oct31
966
967\begin{texonly}
968\begin{figure}[htbp]
969\begin{picture}(324,180)%(-54,0)
970\special{psfile=h-allrank.ps}
971\end{picture}
972\caption{All operations named \protect\spadfun{rank} in \Language{}.}
973\end{figure}
974\end{texonly}
975
976\subsubsection{all domains}
977
978This button only appears on an operation page resulting from a
979search from the front page of \Browse{} or from selecting
980{\bf generalize} from an operation page for a constructor.
981
982Note that the {\bf filter} button in the {\it Views} panel is
983replaced by {\bf all domains}.
984Click on it to produce a table of {\it all} domains or packages that
985export a \spadfun{rank} operation.
986
987\begin{texonly}
988\begin{figure}[htbp]
989\begin{picture}(324,180)%(-54,0)
990\special{psfile=h-alldoms.ps}
991\end{picture}
992\caption{Table of all domains that export \spadfun{rank}.}
993\end{figure}
994\end{texonly}
995
996We note that this table specifically refers to all the \spadfun{rank}
997operations shown in the preceding page.
998Return to the descriptions of all the \spadfun{rank} operations and
999select one of them by clicking on the button in its heading.
1000Select {\bf all domains}.
1001As you see, you have a smaller table of constructors.
1002When there is only one constructor, you get the
1003constructor page for that constructor.
1004\texht{\newpage}{}
1005
1006% *********************************************************************
1007\head{subsection}{Capitalization Convention}{ugBrowseCapitalizationConvention}
1008% *********************************************************************
1009
1010When entering search keys for constructors, you can use capital
1011letters to search for abbreviations.
1012For example, enter {\tt UTS} into the input area and click on {\bf
1013Constructors}.
1014Up comes a page describing \spadtype{UnivariateTaylorSeries}
1015whose abbreviation is \spadtype{UTS}.
1016
1017Constructor abbreviations always have three or more capital
1018letters.
1019For short constructor names (six letters or less), abbreviations
1020are not generally helpful as their abbreviation is typically the
1021constructor name in capitals.
1022For example, the abbreviation for \spadtype{Matrix} is
1023\spadtype{MATRIX}.
1024
1025Abbreviations can also contain numbers.
1026For example, \spadtype{POLY2} is the abbreviation for constructor
1027\spadtype{PolynomialFunctions2}.
1028For default packages, the abbreviation is the same as the
1029abbreviation for the corresponding category with the ``\&''
1030replaced by ``-''.
1031For example, for the category default package
1032\aliascon{MatrixCategory&}{MATCAT-} the abbreviation is
1033\spadtype{MATCAT-} since the corresponding category
1034\spadtype{MatrixCategory} has abbreviation \spadtype{MATCAT}.
1035
1036%% *********************************************************************
1037%\head{subsection}{Browse Options}{ugBrowseOptions}
1038%% *********************************************************************
1039%
1040%You can set two options for using \Browse{}: exposure and threshold.
1041%
1042%% *********************************************************************
1043%\subsubsection{Exposure}
1044%% *********************************************************************
1045%
1046%By default, the only constructors and operations
1047%shown by \Browse{} are those from \spadglossSee{exposed constructors}{expose}.
1048%To change this, you can issue
1049%\syscmdindex{set hyperdoc browse exposure}
1050%\begin{verbatim}
1051%)set hyperdoc browse exposure on
1052%\end{verbatim}
1053%After you make this setting, you will see
1054%both exposed and unexposed constructs.
1055%By definition, an operation is exposed only if it is
1056%exported from an exposed constructor.
1057%Unexposed items are generally marked by \Browse{} with an asterisk.
1058%For more information on exposure, see \spadref{ugTypesExpose}.
1059%
1060%With this setting, try the following experiment.
1061%Starting with the main \Browse{} page, enter {\tt *matrix*} into the
1062%input area and click on {\bf Constructors}.
1063%The result is the following table. %% This line  should be texonly. MGR
1064%
1065%\begin{texonly}
1066%\begin{figure}[htbp]
1067%\begin{picture}(324,180)%(-54,0)
1068%\hspace*{\baseLeftSkip}\special{psfile=h-consearch2.ps}
1069%\end{picture}
1070%\caption{Table of all constructors matching {\tt *matrix*} .}
1071%\end{figure}
1072%\end{texonly}
1073%
1074%
1075%% *********************************************************************
1076%\subsubsection{Threshold}
1077%% *********************************************************************
1078%
1079%For General, Documentation or Complete searches, a summary is presented
1080%of all matches.
1081%When the number of items of a given kind is less than a number called
1082%{\bf threshold}, \Language{} presents a table of names with the heading
1083%for that kind.
1084%
1085%Also, when an operation name is chosen and there are less than {\bf
1086%threshold} distinct operations, the operations are initially shown in
1087%{\bf description} mode.
1088%
1089%The default value of {\bf threshold} is 10.
1090%To change its value to say 5, issue
1091%\syscmdindex{set hyperdoc browse threshold}
1092%\begin{verbatim}
1093%)set hyperdoc browse threshold 5
1094%\end{verbatim}
1095%Notice that the headings in
1096%the summary are active.
1097%If you click on a heading, you bring up a separate page for those
1098%entries.
1099%%
1100%% Above section removed by MGR, 1995oct30, as these two options do
1101%% not exist.
1102