url
stringlengths 22
1.01k
| url_host_registered_domain
stringlengths 5
36
⌀ | crawl
stringlengths 15
15
| content_mime_type
stringlengths 2
68
| content_mime_detected
stringlengths 9
39
⌀ | warc_filename
stringlengths 108
138
| warc_record_offset
int64 16.1k
1.59B
| warc_record_length
int64 537
1.05M
| content
stringlengths 0
1.05M
|
|---|---|---|---|---|---|---|---|---|
https://www.zentralblatt-math.org/matheduc/en/?id=23192&type=tex
|
zentralblatt-math.org
|
CC-MAIN-2019-43
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2019-43/segments/1570987833766.94/warc/CC-MAIN-20191023122219-20191023145719-00038.warc.gz
| 1,136,450,152
| 1,540
|
\input zb-basic
\input zb-matheduc
\iteman{ZMATH 2012a.00455}
\itemau{Gooya, Zahra; Khosroshahi, Leyla G.; Teppo, Anne R.}
\itemti{Iranian students' measurement estimation performance involving linear and area attributes of real-world objects.}
\itemso{ZDM, Int. J. Math. Educ. 43, No. 5, 709-722 (2011).}
\itemab
Summary: This article reports on an exploratory investigation of the measurement estimation performance of ten Iranian high school students on a set of real-world length and area measurement tasks. The results of a qualitative analysis of the data indicate that the students employed a variety of either mental or physically present Individual Frames of Reference as the non-tool units of measure in various estimation tasks. The analysis also found that a range of types of frames of reference was used across students in response to particular tasks and to the physical environments in which the tasks were situated. These results suggest that there is a complex interaction among a student's individual preference for a particular type of Individual Frame of Reference, the nature of the estimation activity, and the physical context in which the activity takes place. These findings, which contribute to an understanding of the nature of the measurement unit that is employed during an estimation process, provide a different perspective from other studies that focus on categorizing estimation strategies, or processes.
\itemrv{~}
\itemcc{F73 G33}
\itemut{high school students; measurement estimation tasks; linear measurement; area measurement; individual frame of reference; educational research}
\itemli{doi:10.1007/s11858-011-0338-1}
\end
|
https://www.coaps.fsu.edu/bibliography/search.php?sqlQuery=SELECT%20author%2C%20title%2C%20type%2C%20year%2C%20publication%2C%20abbrev_journal%2C%20volume%2C%20issue%2C%20pages%2C%20keywords%2C%20abstract%2C%20thesis%2C%20editor%2C%20publisher%2C%20place%2C%20abbrev_series_title%2C%20series_title%2C%20series_editor%2C%20series_volume%2C%20series_issue%2C%20edition%2C%20language%2C%20author_count%2C%20online_publication%2C%20online_citation%2C%20doi%2C%20serial%2C%20area%20FROM%20refs%20WHERE%20serial%20%3D%20558%20ORDER%20BY%20first_author%2C%20author_count%2C%20author%2C%20year%2C%20title&client=&formType=sqlSearch&submit=Cite&viewType=&showQuery=0&showLinks=1&showRows=10&rowOffset=&wrapResults=1&citeOrder=&citeStyle=APA&exportFormat=RIS&exportType=html&exportStylesheet=&citeType=LaTeX&headerMsg=
|
fsu.edu
|
CC-MAIN-2023-06
|
application/x-latex
|
application/x-latex
|
crawl-data/CC-MAIN-2023-06/segments/1674764499695.59/warc/CC-MAIN-20230128220716-20230129010716-00632.warc.gz
| 720,823,181
| 1,549
|
%&LaTeX
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\begin{document}
\begin{thebibliography}{1}
\bibitem{Smith2010} Smith, S. R., J. T. Rettig, J. Rolph, J. Hu, E. C. Kent, E. Schulz, R. Verein, S. Rutz, and C. Paver. (2010). The Data Management System for the Shipboard Automated Meteorological and Oceanographic System (SAMOS) Initiative. In J. Hall, D. E. Harrison, \& D. Stammer (Eds.), \textit{Proceedings of OceanObs{\textquoteright}09: Sustained Ocean Observations and Information for Society} (Vol. 2).
\end{thebibliography}
\end{document}
|
http://dlmf.nist.gov/13.26.E1.tex
|
nist.gov
|
CC-MAIN-2014-10
|
application/x-tex
| null |
crawl-data/CC-MAIN-2014-10/segments/1394010650250/warc/CC-MAIN-20140305091050-00002-ip-10-183-142-35.ec2.internal.warc.gz
| 52,983,863
| 670
|
\[e^{{-\frac{1}{2}y}}\left(\frac{x}{x+y}\right)^{{\mu-\frac{1}{2}}}\sum_{{n=0}}^%
{{\infty}}\frac{\left(-2\mu\right)_{{n}}}{n!}\left(\frac{-y}{\sqrt{x}}\right)^%
{n}\*\mathop{M_{{\kappa-\frac{1}{2}n,\mu-\frac{1}{2}n}}\/}\nolimits\!\left(x%
\right),\]
|
http://papers.ahmadassaf.com/Thesis/Thesis.aux
|
ahmadassaf.com
|
CC-MAIN-2017-39
|
unk
|
application/x-tex
|
crawl-data/CC-MAIN-2017-39/segments/1505818688671.43/warc/CC-MAIN-20170922055805-20170922075805-00540.warc.gz
| 256,007,575
| 18,258
|
\relax
\providecommand\hyper@newdestlabel[2]{}
\providecommand\BKM@entry[2]{}
\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
\global\let\oldcontentsline\contentsline
\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
\global\let\oldnewlabel\newlabel
\gdef\newlabel#1#2{\newlabelxx{#1}#2}
\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
\AtEndDocument{\ifx\hyper@anchor\@undefined
\let\contentsline\oldcontentsline
\let\newlabel\oldnewlabel
\fi}
\fi}
\global\let\hyper@last\relax
\gdef\HyperFirstAtBeginDocument#1{#1}
\providecommand\HyField@AuxAddToFields[1]{}
\providecommand\HyField@AuxAddToCoFields[2]{}
\@input{title/title.aux}
\@input{title/separator.aux}
\@input{title/basmalah.aux}
\@input{title/separator.aux}
\BKM@entry{id=1,dest={73656374696F6E2A2E33},srcline={34}}{41636B6E6F776C656467656D656E7473}
\@writefile{toc}{\contentsline {section}{Acknowledgements}{iv}{section*.3}}
\@writefile{@@@}{\chapterbegin }
\@input{title/separator.aux}
\BKM@entry{id=2,dest={73656374696F6E2A2E35},srcline={42}}{4162737472616374}
\@writefile{toc}{\contentsline {section}{Abstract}{vi}{section*.5}}
\@writefile{@@@}{\chapterbegin }
\BKM@entry{id=3,dest={636861707465722A2E36},srcline={47}}{436F6E74656E7473}
\@writefile{toc}{\contentsline {section}{Contents}{vii}{chapter*.6}}
\@writefile{@@@}{\chapterbegin }
\BKM@entry{id=4,dest={636861707465722A2E37},srcline={55}}{4C697374206F662046696775726573}
\@writefile{toc}{\contentsline {section}{List of Figures}{xiii}{chapter*.7}}
\@writefile{@@@}{\chapterbegin }
\BKM@entry{id=5,dest={636861707465722A2E38},srcline={62}}{4C697374206F66205461626C6573}
\@writefile{toc}{\contentsline {section}{List of Tables}{xv}{chapter*.8}}
\BKM@entry{id=6,dest={636861707465722A2E39},srcline={69}}{4C697374206F66204C697374696E6773}
\@writefile{@@@}{\chapterbegin }
\@writefile{toc}{\contentsline {section}{List of Listings}{xvi}{chapter*.9}}
\BKM@entry{id=7,dest={636861707465722A2E3130},srcline={76}}{4C697374206F66205075626C69636174696F6E73}
\@writefile{@@@}{\chapterbegin }
\@writefile{toc}{\contentsline {section}{List of Publications}{xvii}{chapter*.10}}
\@writefile{@@@}{\chapterbegin }
\newlabel{sec:journals}{{}{xviii}{Journal}{section*.12}{}}
\newlabel{sec:conferences}{{}{xviii}{Conferences}{section*.13}{}}
\newlabel{sec:workshops}{{}{xviii}{Workshops}{section*.14}{}}
\BKM@entry{id=8,dest={4974656D2E39},srcline={83}}{4163726F6E796D73}
\@writefile{toc}{\contentsline {section}{Acronyms}{xix}{Item.9}}
\@input{acronyms/acronyms.aux}
\BKM@entry{id=9,dest={636861707465722E31},srcline={1}}{496E74726F64756374696F6E}
\BKM@entry{id=10,dest={73656374696F6E2E312E31},srcline={14}}{436F6E7465787420616E64204D6F7469766174696F6E}
\citation{Mihindukulasooriya:COLD:13}
\citation{Lenzerini:SIGMOD:02}
\citation{Frischmuth:ISWC:13}
\citation{Frischmuth:SemWebJorunal:12}
\citation{Wache:IJCAI:01}
\citation{Bizer:IJSWIS:09}
\@writefile{toc}{\contentsline {chapter}{\numberline {1}Introduction}{1}{chapter.1}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{lof}{\contentsline {xchapter}{Introduction}{1}{chapter.1}}
\@writefile{lot}{\contentsline {xchapter}{Introduction}{1}{chapter.1}}
\newlabel{chapter:introduction}{{1}{1}{Introduction}{chapter.1}{}}
\@writefile{toc}{\contentsline {section}{\numberline {1.1}Context and Motivation}{1}{section.1.1}}
\newlabel{section:motivation}{{1.1}{1}{Context and Motivation}{section.1.1}{}}
\citation{Bizer:IJSWIS:09}
\citation{Boyd:Article:11}
\citation{LaValle:MIT:11}
\BKM@entry{id=11,dest={73656374696F6E2E312E32},srcline={22}}{5573652043617365205363656E6172696F}
\@writefile{toc}{\contentsline {section}{\numberline {1.2}Use Case Scenario}{2}{section.1.2}}
\newlabel{section:scenario}{{1.2}{2}{Use Case Scenario}{section.1.2}{}}
\BKM@entry{id=12,dest={73656374696F6E2E312E33},srcline={39}}{5265736561726368204368616C6C656E676573}
\BKM@entry{id=13,dest={73756273656374696F6E2E312E332E31},srcline={43}}{4461746173657420496E746567726174696F6E20616E6420456E726963686D656E74}
\@writefile{toc}{\contentsline {section}{\numberline {1.3}Research Challenges}{3}{section.1.3}}
\newlabel{section:challenges}{{1.3}{3}{Research Challenges}{section.1.3}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.3.1}Dataset Integration and Enrichment}{3}{subsection.1.3.1}}
\BKM@entry{id=14,dest={73756273656374696F6E2E312E332E32},srcline={52}}{44617461736574204D61696E74656E616E6365205C30343620446973636F76657279}
\citation{Lalithsena:WI:13}
\BKM@entry{id=15,dest={73756273656374696F6E2E312E332E33},srcline={60}}{44617461736574205175616C697479}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.3.2}Dataset Maintenance \& Discovery}{4}{subsection.1.3.2}}
\BKM@entry{id=16,dest={73656374696F6E2E312E34},srcline={64}}{54686573697320436F6E747269627574696F6E73}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.3.3}Dataset Quality}{5}{subsection.1.3.3}}
\@writefile{toc}{\contentsline {section}{\numberline {1.4}Thesis Contributions}{5}{section.1.4}}
\newlabel{section:contribution}{{1.4}{5}{Thesis Contributions}{section.1.4}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {1.1}{\ignorespaces Architecture diagram for enabling self-service data provisioning\relax }}{5}{figure.caption.16}}
\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
\newlabel{fig:architecutre_diagram}{{1.1}{5}{Architecture diagram for enabling self-service data provisioning\relax }{figure.caption.16}{}}
\BKM@entry{id=17,dest={73756273656374696F6E2E312E342E31},srcline={77}}{436F6E747269627574696F6E73206F6E2044617461736574204D61696E74656E616E6365205C30343620446973636F76657279}
\BKM@entry{id=18,dest={73756273656374696F6E2E312E342E32},srcline={85}}{436F6E747269627574696F6E73206F6E2044617461736574205175616C69747920436F6E74726F6C}
\BKM@entry{id=19,dest={73756273656374696F6E2E312E342E33},srcline={92}}{436F6E747269627574696F6E73206F6E204461746173657420496E746567726174696F6E20616E6420456E726963686D656E74}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.4.1}Contributions on Dataset Maintenance \& Discovery}{6}{subsection.1.4.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.4.2}Contributions on Dataset Quality Control}{6}{subsection.1.4.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.4.3}Contributions on Dataset Integration and Enrichment}{6}{subsection.1.4.3}}
\BKM@entry{id=20,dest={73656374696F6E2E312E35},srcline={101}}{546865736973204F75746C696E65}
\citation{Assaf:DQMST:12}
\citation{Assaf:WWW:15}
\citation{Assaf:IJSWIS:15}
\citation{Assaf:PROFILES:15}
\citation{Assaf:ESWC:PROFILES:15}
\citation{Assaf:ESWC:LDQ:15}
\@writefile{toc}{\contentsline {section}{\numberline {1.5}Thesis Outline}{7}{section.1.5}}
\newlabel{section:outline}{{1.5}{7}{Thesis Outline}{section.1.5}{}}
\citation{Assaf:WOD:12}
\citation{Assaf:ESWC:13}
\BKM@entry{id=21,dest={706172742E31},srcline={99}}{4920546F7761726473204120436F6D706C65746520446174617365742050726F66696C65}
\@writefile{toc}{\contentsline {part}{I\hspace {1em}Towards A Complete Dataset Profile}{9}{part.1}}
\@writefile{lof}{\contentsline {xpart}{Towards A Complete Dataset Profile}{11}{part.1}}
\@writefile{lot}{\contentsline {xpart}{Towards A Complete Dataset Profile}{11}{part.1}}
\@writefile{toc}{\contentsline {xpart}{Towards A Complete Dataset Profile}{11}{part.1}}
\newlabel{part:dataset_profiling}{{I}{11}{Towards A Complete Dataset Profile}{part.1}{}}
\@writefile{@@@}{\chapterbegin }
\BKM@entry{id=22,dest={636861707465722E32},srcline={1}}{4261636B67726F756E64}
\BKM@entry{id=23,dest={73656374696F6E2E322E31},srcline={4}}{53656D616E74696320576562}
\citation{Mika:book:07}
\citation{BernersLee:ScientificAmerican:01}
\@writefile{toc}{\contentsline {chapter}{\numberline {2}Background}{12}{chapter.2}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{lof}{\contentsline {xchapter}{Background}{12}{chapter.2}}
\@writefile{lot}{\contentsline {xchapter}{Background}{12}{chapter.2}}
\newlabel{chapter:part1-background}{{2}{12}{Background}{chapter.2}{}}
\@writefile{toc}{\contentsline {section}{\numberline {2.1}Semantic Web}{12}{section.2.1}}
\newlabel{section:sematic-web}{{2.1}{12}{Semantic Web}{section.2.1}{}}
\BKM@entry{id=24,dest={73756273656374696F6E2E322E312E31},srcline={20}}{5265736F75726365204465736372697074696F6E204672616D65776F726B205C285244465C29}
\citation{Lassila:RDF:99}
\citation{Berners:RFC:05}
\citation{Lassila:RDF:99}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1.1}Resource Description Framework (RDF)}{13}{subsection.2.1.1}}
\BKM@entry{id=25,dest={73756273656374696F6E2E322E312E32},srcline={48}}{52444620536368656D61}
\citation{Cambridge:RDF-101:13}
\citation{Gruber:KA:93}
\@writefile{lof}{\contentsline {figure}{\numberline {2.1}{\ignorespaces Example of RDF representation of an address\relax }}{14}{figure.caption.18}}
\newlabel{fig:rdfGraph}{{2.1}{14}{Example of RDF representation of an address\relax }{figure.caption.18}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1.2}RDF Schema}{14}{subsection.2.1.2}}
\citation{Brickley:RDFS:14}
\BKM@entry{id=26,dest={73756273656374696F6E2E322E312E33},srcline={73}}{576562204F6E746F6C6F6779204C616E6775616765}
\citation{W3C:OWL:12}
\BKM@entry{id=27,dest={73756273656374696F6E2E322E312E34},srcline={77}}{53504152514C205175657279204C616E6775616765}
\citation{Prud:SPARQL:08}
\BKM@entry{id=28,dest={73756273656374696F6E2E322E312E35},srcline={83}}{4C696E6B65642044617461}
\citation{Bizer:IJSWIS:09}
\citation{Berners-Lee:W3C:06}
\citation{Schmachtenberg:ISWC:14}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1.3}Web Ontology Language}{16}{subsection.2.1.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1.4}SPARQL Query Language}{16}{subsection.2.1.4}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1.5}Linked Data}{16}{subsection.2.1.5}}
\citation{Bizer:WebSemJorunal:09}
\BKM@entry{id=29,dest={73656374696F6E2E322E32},srcline={108}}{4F70656E2044617461}
\citation{Davies:Report:15}
\@writefile{lof}{\contentsline {figure}{\numberline {2.2}{\ignorespaces The LOD cloud as of May, 2007\relax }}{17}{figure.caption.19}}
\newlabel{fig:lodcloud2007}{{2.2}{17}{The LOD cloud as of May, 2007\relax }{figure.caption.19}{}}
\@writefile{toc}{\contentsline {section}{\numberline {2.2}Open Data}{17}{section.2.2}}
\newlabel{section:openData}{{2.2}{17}{Open Data}{section.2.2}{}}
\citation{Deloitte:Report:12}
\citation{Berners-Lee:W3C:06}
\citation{Deloitte:Report:12}
\citation{Manyika:Report:13}
\@writefile{lof}{\contentsline {figure}{\numberline {2.3}{\ignorespaces Open Data ecosystem\relax }}{18}{figure.caption.20}}
\newlabel{fig:opendata_ecosystem}{{2.3}{18}{Open Data ecosystem\relax }{figure.caption.20}{}}
\citation{Boyd:Article:11}
\citation{Prateek:Misc:13}
\citation{Manyika:Report:13}
\citation{Davies:Report:15}
\BKM@entry{id=30,dest={73756273656374696F6E2E322E322E31},srcline={154}}{4F70656E204C6963656E736573}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2.1}Open Licenses}{19}{subsection.2.2.1}}
\citation{Prateek:Misc:13}
\citation{Boyd:Article:11}
\citation{Manyika:Report:13}
\BKM@entry{id=31,dest={73656374696F6E2E322E33},srcline={183}}{446174612050726F66696C696E67}
\citation{Li:WISM:12}
\citation{Kimball:DWL:98}
\@writefile{lof}{\contentsline {figure}{\numberline {2.4}{\ignorespaces Heat map of Open Government Data adoption according to the Open Data Barometer 2015\relax }}{20}{figure.caption.21}}
\newlabel{fig:god_adoption}{{2.4}{20}{Heat map of Open Government Data adoption according to the Open Data Barometer 2015\relax }{figure.caption.21}{}}
\citation{Halo:TechReport:13}
\@writefile{lof}{\contentsline {figure}{\numberline {2.5}{\ignorespaces Linking Open Data cloud diagram 2014, by Max Schmachtenberg, Christian Bizer, Anja Jentzsch and Richard Cyganiak colored by licensing types. \url {http://www.cosasbuenas.es/blog/how-o-is-lod-2015}\relax }}{21}{figure.caption.22}}
\newlabel{fig:lodcloud2014}{{2.5}{21}{Linking Open Data cloud diagram 2014, by Max Schmachtenberg, Christian Bizer, Anja Jentzsch and Richard Cyganiak colored by licensing types. \url {http://www.cosasbuenas.es/blog/how-o-is-lod-2015}\relax }{figure.caption.22}{}}
\@writefile{toc}{\contentsline {section}{\numberline {2.3}Data Profiling}{21}{section.2.3}}
\newlabel{section:dataProfiling}{{2.3}{21}{Data Profiling}{section.2.3}{}}
\citation{Juran:McGraw:99}
\citation{Bizer:DB:11}
\citation{NISO:TechReport:04}
\citation{Graham:TechReport:11}
\citation{NISO:TechReport:04}
\BKM@entry{id=32,dest={73656374696F6E2E322E34},srcline={204}}{436F6E636C7573696F6E}
\@writefile{toc}{\contentsline {section}{\numberline {2.4}Conclusion}{22}{section.2.4}}
\BKM@entry{id=33,dest={636861707465722E33},srcline={1}}{446174617365742050726F66696C657320616E64204D6F64656C73}
\BKM@entry{id=34,dest={73656374696F6E2E332E31},srcline={16}}{44617461204D616E6167656D656E742053797374656D7320616E642044617461736574204D6F64656C73}
\BKM@entry{id=35,dest={73756273656374696F6E2E332E312E31},srcline={21}}{44434154}
\citation{Erickson:DCV:14}
\@writefile{toc}{\contentsline {chapter}{\numberline {3}Dataset Profiles and Models}{23}{chapter.3}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{lof}{\contentsline {xchapter}{Dataset Profiles and Models}{23}{chapter.3}}
\@writefile{lot}{\contentsline {xchapter}{Dataset Profiles and Models}{23}{chapter.3}}
\newlabel{chapter:hdl}{{3}{23}{Dataset Profiles and Models}{chapter.3}{}}
\@writefile{toc}{\contentsline {section}{\numberline {3.1}Data Management Systems and Dataset Models}{23}{section.3.1}}
\newlabel{section:datasetModels}{{3.1}{23}{Data Management Systems and Dataset Models}{section.3.1}{}}
\BKM@entry{id=36,dest={73756273656374696F6E2E332E312E32},srcline={26}}{444341542D4150}
\BKM@entry{id=37,dest={73756273656374696F6E2E332E312E33},srcline={29}}{4461746173657420557361676520566F636162756C617279}
\citation{Loscio:DUV:15}
\BKM@entry{id=38,dest={73756273656374696F6E2E332E312E34},srcline={32}}{41444D53}
\citation{Archer:W3C:13}
\BKM@entry{id=39,dest={73756273656374696F6E2E332E312E35},srcline={35}}{566F4944}
\citation{Bohm:WebSemJournal:11}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.1}DCAT}{24}{subsection.3.1.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.2}DCAT-AP}{24}{subsection.3.1.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.3}Dataset Usage Vocabulary}{24}{subsection.3.1.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.4}ADMS}{24}{subsection.3.1.4}}
\BKM@entry{id=40,dest={73756273656374696F6E2E332E312E36},srcline={38}}{434B414E}
\BKM@entry{id=41,dest={73756273656374696F6E2E332E312E37},srcline={47}}{444B414E}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.5}VoID}{25}{subsection.3.1.5}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.6}CKAN}{25}{subsection.3.1.6}}
\BKM@entry{id=42,dest={73756273656374696F6E2E332E312E38},srcline={52}}{536F6372617461}
\BKM@entry{id=43,dest={73756273656374696F6E2E332E312E39},srcline={57}}{4A756E6172}
\BKM@entry{id=44,dest={73756273656374696F6E2E332E312E3130},srcline={60}}{494E5350495245206D65746164617461}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.7}DKAN}{26}{subsection.3.1.7}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.8}Socrata}{26}{subsection.3.1.8}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.9}Junar}{26}{subsection.3.1.9}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.10}INSPIRE metadata}{26}{subsection.3.1.10}}
\BKM@entry{id=45,dest={73756273656374696F6E2E332E312E3131},srcline={65}}{536368656D612E6F7267}
\BKM@entry{id=46,dest={73756273656374696F6E2E332E312E3132},srcline={70}}{436F6D6D6F6E20436F7265204D65746164616120536368656D61205C2843434D535C29}
\BKM@entry{id=47,dest={73656374696F6E2E332E32},srcline={79}}{4D65746164617461204D6F64656C20436C617373696669636174696F6E}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.11}Schema.org}{27}{subsection.3.1.11}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.12}Common Core Metadaa Schema (CCMS)}{27}{subsection.3.1.12}}
\@writefile{toc}{\contentsline {section}{\numberline {3.2}Metadata Model Classification}{27}{section.3.2}}
\newlabel{section:harmonized_metadata}{{3.2}{27}{Metadata Model Classification}{section.3.2}{}}
\citation{Iannella:W3C:14}
\citation{Reynolds:W3C:14}
\citation{Lebo:W3C:13}
\citation{Brummer::ICSS:14}
\citation{Hausenblas:ESWC:09}
\citation{Berners-Lee:W3C:06}
\citation{Debattista:WWW:14}
\BKM@entry{id=48,dest={73656374696F6E2E332E33},srcline={114}}{4D617070696E67204D65746164617461204D6F64656C73}
\@writefile{lof}{\contentsline {figure}{\numberline {3.1}{\ignorespaces Information sections and groups across data models \relax }}{30}{figure.caption.23}}
\newlabel{fig:information_grouping}{{3.1}{30}{Information sections and groups across data models \relax }{figure.caption.23}{}}
\@writefile{toc}{\contentsline {section}{\numberline {3.3}Mapping Metadata Models}{30}{section.3.3}}
\newlabel{section:model_mappings}{{3.3}{30}{Mapping Metadata Models}{section.3.3}{}}
\@writefile{lot}{\contentsline {table}{\numberline {3.1}{\ignorespaces Data models sections mapping\relax }}{31}{table.caption.24}}
\newlabel{table:models_section_mappings}{{3.1}{31}{Data models sections mapping\relax }{table.caption.24}{}}
\@writefile{lot}{\contentsline {table}{\numberline {3.2}{\ignorespaces Harmonized Dataset Models Mappings}}{32}{table.3.2}}
\newlabel{table:harmonized_dataset_models_mappings}{{3.2}{32}{Harmonized Dataset Models Mappings}{table.3.2}{}}
\gdef \LT@ii {\LT@entry
{1}{69.3055pt}\LT@entry
{5}{100.6037pt}\LT@entry
{5}{80.68643pt}\LT@entry
{5}{83.53188pt}\LT@entry
{5}{120.52054pt}\LT@entry
{5}{120.52054pt}\LT@entry
{5}{170.31287pt}\LT@entry
{5}{83.53188pt}}
\BKM@entry{id=49,dest={73656374696F6E2E332E34},srcline={398}}{546F77617264732041204861726D6F6E697A6564204D6F64656C205C2848444C5C29}
\@writefile{toc}{\contentsline {section}{\numberline {3.4}Towards A Harmonized Model (HDL)}{35}{section.3.4}}
\newlabel{section:hdl}{{3.4}{35}{Towards A Harmonized Model (HDL)}{section.3.4}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {3.2}{\ignorespaces CKAN data model\relax }}{35}{figure.caption.25}}
\newlabel{fig:ckan_model}{{3.2}{35}{CKAN data model\relax }{figure.caption.25}{}}
\BKM@entry{id=50,dest={73756273656374696F6E2E332E342E31},srcline={453}}{5265736F7572636573}
\@writefile{lot}{\contentsline {table}{\numberline {3.3}{\ignorespaces Common required metadata fields for all the datasets sections\relax }}{36}{table.caption.26}}
\newlabel{table:common_sections_metadata}{{3.3}{36}{Common required metadata fields for all the datasets sections\relax }{table.caption.26}{}}
\@writefile{lot}{\contentsline {table}{\numberline {3.4}{\ignorespaces Metadata fields for ownership information\relax }}{36}{table.caption.27}}
\newlabel{table:ownership_metadata_fields}{{3.4}{36}{Metadata fields for ownership information\relax }{table.caption.27}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.1}Resources}{36}{subsection.3.4.1}}
\gdef \LT@iii {\LT@entry
{5}{108.69194pt}\LT@entry
{5}{69.3055pt}\LT@entry
{2}{268.4748pt}\LT@entry
{5}{64.56003pt}}
\BKM@entry{id=51,dest={73756273656374696F6E2E332E342E32},srcline={515}}{47726F757073}
\BKM@entry{id=52,dest={73756273656374696F6E2E332E342E33},srcline={518}}{54616773}
\BKM@entry{id=53,dest={73756273656374696F6E2E332E342E34},srcline={521}}{4F7267616E697A6174696F6E}
\citation{Reynolds:W3C:14}
\@writefile{lot}{\contentsline {table}{\numberline {3.5}{\ignorespaces Metadata fields for resources information section}}{38}{table.3.5}}
\newlabel{table:resources_metadata_fields}{{3.5}{38}{Metadata fields for resources information section}{table.3.5}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.2}Groups}{38}{subsection.3.4.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.3}Tags}{38}{subsection.3.4.3}}
\BKM@entry{id=54,dest={73756273656374696F6E2E332E342E35},srcline={543}}{436F7265204D65746164617461}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.4}Organization}{39}{subsection.3.4.4}}
\@writefile{lot}{\contentsline {table}{\numberline {3.6}{\ignorespaces Metadata fields for organization information section\relax }}{39}{table.caption.28}}
\newlabel{table:organization_metadata_fields}{{3.6}{39}{Metadata fields for organization information section\relax }{table.caption.28}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.5}Core Metadata}{39}{subsection.3.4.5}}
\newlabel{core-metadata}{{3.4.5}{39}{Core Metadata}{subsection.3.4.5}{}}
\gdef \LT@iv {\LT@entry
{6}{94.14899pt}\LT@entry
{5}{69.3055pt}\LT@entry
{2}{268.4748pt}\LT@entry
{5}{64.56003pt}}
\BKM@entry{id=55,dest={73756273656374696F6E2E332E342E36},srcline={596}}{436F6E74726F6C6C696E67204669656C642056616C756573}
\@writefile{lot}{\contentsline {table}{\numberline {3.7}{\ignorespaces Dataset core metadata fields}}{40}{table.3.7}}
\newlabel{table:core_metadata_fields}{{3.7}{40}{Dataset core metadata fields}{table.3.7}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.6}Controlling Field Values}{40}{subsection.3.4.6}}
\newlabel{lodcloud_extras_report}{{3.1}{41}{Excerpt of the \textit {extras} aggregation report for the LOD Cloud}{lstlisting.3.1}{}}
\@writefile{lol}{\contentsline {lstlisting}{\numberline {3.1}Excerpt of the \textit {extras} aggregation report for the LOD Cloud}{41}{lstlisting.3.1}}
\newlabel{openafrica_extras_report}{{3.2}{41}{Excerpt of the \textit {extras} field aggregation report for OpenAfrica portal}{lstlisting.3.2}{}}
\@writefile{lol}{\contentsline {lstlisting}{\numberline {3.2}Excerpt of the \textit {extras} field aggregation report for OpenAfrica portal}{41}{lstlisting.3.2}}
\newlabel{lodcloud_resource_type__report}{{3.3}{41}{Result for aggregating \textit {resource\_type} field values on the LOD Cloud}{lstlisting.3.3}{}}
\@writefile{lol}{\contentsline {lstlisting}{\numberline {3.3}Result for aggregating \textit {resource\_type} field values on the LOD Cloud}{41}{lstlisting.3.3}}
\BKM@entry{id=56,dest={73656374696F6E2E332E35},srcline={638}}{53756D6D617279}
\citation{Erickson:DCV:14}
\citation{Brummer::ICSS:14}
\@writefile{toc}{\contentsline {section}{\numberline {3.5}Summary}{42}{section.3.5}}
\newlabel{section:hdl_summary}{{3.5}{42}{Summary}{section.3.5}{}}
\BKM@entry{id=57,dest={636861707465722E34},srcline={1}}{446174617365742050726F66696C65732047656E65726174696F6E20616E642056616C69646174696F6E}
\BKM@entry{id=58,dest={73656374696F6E2E342E31},srcline={7}}{496E74726F64756374696F6E}
\citation{Bizer:WebSemJorunal:09}
\citation{Bollacker:SIGMOD:08}
\citation{Suchanek::WWW:07}
\citation{Lalithsena:WI:13}
\@writefile{toc}{\contentsline {chapter}{\numberline {4}Dataset Profiles Generation and Validation}{43}{chapter.4}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{lof}{\contentsline {xchapter}{Dataset Profiles Generation and Validation}{43}{chapter.4}}
\@writefile{lot}{\contentsline {xchapter}{Dataset Profiles Generation and Validation}{43}{chapter.4}}
\newlabel{chapter:roomba}{{4}{43}{Dataset Profiles Generation and Validation}{chapter.4}{}}
\@writefile{toc}{\contentsline {section}{\numberline {4.1}Introduction}{43}{section.4.1}}
\BKM@entry{id=59,dest={73656374696F6E2E342E32},srcline={19}}{4D6F7469766174696F6E}
\citation{Bizer:DB:11}
\citation{Kovacs:GTOS:00}
\citation{Graham:TechReport:11}
\BKM@entry{id=60,dest={73656374696F6E2E342E33},srcline={32}}{52656C6174656420576F726B}
\citation{Erickson:DCV:14}
\citation{Cyganiak:W3C:11}
\citation{Bohm:WebSemJournal:11}
\@writefile{toc}{\contentsline {section}{\numberline {4.2}Motivation}{44}{section.4.2}}
\@writefile{toc}{\contentsline {section}{\numberline {4.3}Related Work}{45}{section.4.3}}
\newlabel{section:roomba-related-work}{{4.3}{45}{Related Work}{section.4.3}{}}
\citation{Jentzsch:ISWC:14}
\citation{Frosterus:Springer:11}
\citation{Lalithsena:WI:13}
\citation{Cyganiak:ESWC:08}
\citation{Lanegger:DEXA:09}
\citation{Khatchadourian:ESWC:10}
\citation{Li:WISM:12}
\citation{Auer:EKAW:12}
\citation{Abedjan:ICDE:14}
\citation{Bohm:ICDEW:10}
\citation{Makela:ESWC:14}
\citation{Forchhammer:PROFILES:14}
\citation{Kaafer:ESWC:13}
\citation{Usbeck:WWW:15}
\citation{Cornolti:WWW:13}
\citation{Frosterus:ESWC:11}
\citation{Lalithsena:WI:13}
\citation{Bohm:CIKM:12}
\citation{Fetahu:ESWC:14}
\citation{Alexander:LDOW:09}
\citation{Harth:WWW:10}
\citation{Konrath:WebSemJorunal:12}
\citation{Delbru:ESWC:10}
\citation{Ding:CIKM:04}
\citation{daquin:SemWebJorunal:11}
\citation{Nikolov:JIST:11}
\citation{Tummarello:WebSemJorunal:10}
\BKM@entry{id=61,dest={73656374696F6E2E342E34},srcline={52}}{50726F66696C696E67204461746120506F7274616C73}
\@writefile{lof}{\contentsline {figure}{\numberline {4.1}{\ignorespaces Processing pipeline for validating and generating dataset profiles\relax }}{47}{figure.caption.29}}
\newlabel{fig:Roomba_architecture}{{4.1}{47}{Processing pipeline for validating and generating dataset profiles\relax }{figure.caption.29}{}}
\@writefile{toc}{\contentsline {section}{\numberline {4.4}Profiling Data Portals}{47}{section.4.4}}
\newlabel{section:roomba-framework}{{4.4}{47}{Profiling Data Portals}{section.4.4}{}}
\BKM@entry{id=62,dest={73756273656374696F6E2E342E342E31},srcline={84}}{44617461204D616E6167656D656E742053797374656D204964656E74696669636174696F6E}
\@writefile{lof}{\contentsline {figure}{\numberline {4.2}{\ignorespaces Screenshot for Roomba command line tool\relax }}{48}{figure.caption.30}}
\newlabel{fig:roomba_cli}{{4.2}{48}{Screenshot for Roomba command line tool\relax }{figure.caption.30}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.4.1}Data Management System Identification}{48}{subsection.4.4.1}}
\BKM@entry{id=63,dest={73756273656374696F6E2E342E342E32},srcline={100}}{4D657461646174612045787472616374696F6E}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.4.2}Metadata Extraction}{49}{subsection.4.4.2}}
\BKM@entry{id=64,dest={73756273656374696F6E2E342E342E33},srcline={110}}{496E7374616E636520616E64205265736F757263652045787472616374696F6E}
\newlabel{ckan_standard_model_excerpt}{{4.1}{50}{Excerpt of a dataset profile in CKAN standard model}{lstlisting.4.1}{}}
\@writefile{lol}{\contentsline {lstlisting}{\numberline {4.1}Excerpt of a dataset profile in CKAN standard model}{50}{lstlisting.4.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.4.3}Instance and Resource Extraction}{50}{subsection.4.4.3}}
\citation{Fetahu:ESWC:14}
\citation{Leskovec:KDD:06}
\BKM@entry{id=65,dest={73756273656374696F6E2E342E342E34},srcline={127}}{50726F66696C652056616C69646174696F6E}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.4.4}Profile Validation}{51}{subsection.4.4.4}}
\BKM@entry{id=66,dest={73756273656374696F6E2E342E342E35},srcline={148}}{50726F66696C6520616E64205265706F72742047656E65726174696F6E}
\newlabel{json}{{4.2}{52}{License mapping file sample}{lstlisting.4.2}{}}
\@writefile{lol}{\contentsline {lstlisting}{\numberline {4.2}License mapping file sample}{52}{lstlisting.4.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.4.5}Profile and Report Generation}{52}{subsection.4.4.5}}
\newlabel{roomba_validation_report}{{4.3}{53}{Excerpt of the DBpedia validation report}{lstlisting.4.3}{}}
\@writefile{lol}{\contentsline {lstlisting}{\numberline {4.3}Excerpt of the DBpedia validation report}{53}{lstlisting.4.3}}
\BKM@entry{id=67,dest={73656374696F6E2E342E35},srcline={204}}{4578706572696D656E747320616E64204576616C756174696F6E}
\@writefile{toc}{\contentsline {section}{\numberline {4.5}Experiments and Evaluation}{54}{section.4.5}}
\newlabel{section:roomba_experiment}{{4.5}{54}{Experiments and Evaluation}{section.4.5}{}}
\BKM@entry{id=68,dest={73756273656374696F6E2E342E352E31},srcline={218}}{4578706572696D656E74616C205365747570}
\citation{Schmachtenberg:ISWC:14}
\citation{Isele:ISWC:10}
\BKM@entry{id=69,dest={73756273656374696F6E2E342E352E32},srcline={238}}{50726F66696C696E6720436F72726563746E657373}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.5.1}Experimental Setup}{55}{subsection.4.5.1}}
\@writefile{lot}{\contentsline {table}{\numberline {4.1}{\ignorespaces Summary of the experiments details\relax }}{55}{table.caption.31}}
\newlabel{table:data_portals_experiments}{{4.1}{55}{Summary of the experiments details\relax }{table.caption.31}{}}
\BKM@entry{id=70,dest={73756273656374696F6E2E342E352E33},srcline={277}}{50726F66696C696E6720436F6D706C6574656E657373}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.5.2}Profiling Correctness}{56}{subsection.4.5.2}}
\@writefile{lot}{\contentsline {table}{\numberline {4.2}{\ignorespaces Datasets chosen for the correctness evaluation\relax }}{56}{table.caption.32}}
\newlabel{table:dataset_experiment}{{4.2}{56}{Datasets chosen for the correctness evaluation\relax }{table.caption.32}{}}
\@writefile{lot}{\contentsline {table}{\numberline {4.3}{\ignorespaces Groups chosen for the correctness evaluation\relax }}{56}{table.caption.33}}
\newlabel{table:groups_experiment}{{4.3}{56}{Groups chosen for the correctness evaluation\relax }{table.caption.33}{}}
\BKM@entry{id=71,dest={73656374696F6E2E342E36},srcline={291}}{416E616C797A696E672050726F66696C696E6720526573756C7473}
\BKM@entry{id=72,dest={73756273656374696F6E2E342E362E31},srcline={354}}{47656E6572616C20496E666F726D6174696F6E}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.5.3}Profiling Completeness}{57}{subsection.4.5.3}}
\@writefile{toc}{\contentsline {section}{\numberline {4.6}Analyzing Profiling Results}{57}{section.4.6}}
\newlabel{section:running_roomba}{{4.6}{57}{Analyzing Profiling Results}{section.4.6}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.6.1}General Information}{57}{subsection.4.6.1}}
\BKM@entry{id=73,dest={73756273656374696F6E2E342E362E32},srcline={357}}{41636365737320496E666F726D6174696F6E}
\@writefile{lot}{\contentsline {table}{\numberline {4.4}{\ignorespaces Top metadata fields error \% by type\relax }}{58}{table.caption.34}}
\newlabel{table:top_metadata_fields_errors}{{4.4}{58}{Top metadata fields error \% by type\relax }{table.caption.34}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.6.2}Access Information}{58}{subsection.4.6.2}}
\BKM@entry{id=74,dest={73756273656374696F6E2E342E362E33},srcline={373}}{4F776E65727368697020496E666F726D6174696F6E}
\@writefile{lof}{\contentsline {figure}{\numberline {4.3}{\ignorespaces LOD Cloud error \% by section\relax }}{59}{figure.caption.35}}
\newlabel{fig:metadata_noise_by_section}{{4.3}{59}{LOD Cloud error \% by section\relax }{figure.caption.35}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.6.3}Ownership Information}{59}{subsection.4.6.3}}
\BKM@entry{id=75,dest={73756273656374696F6E2E342E362E34},srcline={376}}{50726F76656E616E636520496E666F726D6174696F6E}
\BKM@entry{id=76,dest={73756273656374696F6E2E342E362E35},srcline={379}}{456E7269636865642050726F66696C6573}
\BKM@entry{id=77,dest={73656374696F6E2E342E37},srcline={395}}{53756D6D617279}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.6.4}Provenance Information}{60}{subsection.4.6.4}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.6.5}Enriched Profiles}{60}{subsection.4.6.5}}
\@writefile{toc}{\contentsline {section}{\numberline {4.7}Summary}{60}{section.4.7}}
\newlabel{section:roomba_summary}{{4.7}{60}{Summary}{section.4.7}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {4.4}{\ignorespaces LOD Cloud error \% by information type\relax }}{61}{figure.caption.36}}
\newlabel{fig:metadata_noise_by_metadata_type}{{4.4}{61}{LOD Cloud error \% by information type\relax }{figure.caption.36}{}}
\BKM@entry{id=78,dest={636861707465722E35},srcline={1}}{4F626A656374697665204C696E6B65642044617461205175616C697479204173736573736D656E74}
\BKM@entry{id=79,dest={73656374696F6E2E352E31},srcline={7}}{496E74726F64756374696F6E}
\citation{Boyd:Article:11}
\citation{Kahn:ACM:02}
\citation{Stvilia:ASIST:07}
\citation{Wang:MIS:96}
\citation{Juran:McGraw:99}
\citation{Page:TechReport:98}
\citation{Bizer:WebSemantics:09}
\citation{Bizer:WebSemJorunal:09}
\citation{Suchanek::WWW:07}
\citation{Mendes:ICS:11}
\citation{Marie:ICS:13}
\citation{DiNoia:iSemantics:12}
\@writefile{toc}{\contentsline {chapter}{\numberline {5}Objective Linked Data Quality Assessment}{62}{chapter.5}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{lof}{\contentsline {xchapter}{Objective Linked Data Quality Assessment}{62}{chapter.5}}
\@writefile{lot}{\contentsline {xchapter}{Objective Linked Data Quality Assessment}{62}{chapter.5}}
\newlabel{chapter:data-quality}{{5}{62}{Objective Linked Data Quality Assessment}{chapter.5}{}}
\@writefile{toc}{\contentsline {section}{\numberline {5.1}Introduction}{62}{section.5.1}}
\citation{Assaf:DQMST:12}
\citation{Zaveri:SemWebJorunal:12}
\BKM@entry{id=80,dest={73656374696F6E2E352E32},srcline={25}}{44617461205175616C697479204173736573736D656E74}
\citation{Zaveri:SemWebJorunal:12}
\@writefile{toc}{\contentsline {section}{\numberline {5.2}Data Quality Assessment}{63}{section.5.2}}
\newlabel{section:data-quality-assessment}{{5.2}{63}{Data Quality Assessment}{section.5.2}{}}
\citation{Anisa:LDQ:14}
\BKM@entry{id=81,dest={73656374696F6E2E352E33},srcline={43}}{4F626A656374697665204C696E6B65642044617461205175616C69747920436C617373696669636174696F6E}
\citation{Berners-Lee:W3C:06}
\@writefile{toc}{\contentsline {section}{\numberline {5.3}Objective Linked Data Quality Classification}{64}{section.5.3}}
\newlabel{section:data-quality-classification}{{5.3}{64}{Objective Linked Data Quality Classification}{section.5.3}{}}
\citation{Assaf:DQMST:12}
\citation{Flemming:Thesis:10}
\citation{Assaf:DQMST:12}
\citation{Assaf:PROFILES:15}
\citation{Hogan:LDOW:10}
\citation{Zaveri:SemWebJorunal:12}
\citation{Zaveri:SemWebJorunal:12}
\citation{Hogan:LDOW:10}
\citation{Mader:TBDL:12}
\citation{Gueret:ESWC:12}
\citation{Mader:TBDL:12}
\citation{Hogan:LDOW:10}
\citation{Mader:TBDL:12}
\citation{Hogan:LDOW:10}
\citation{Mader:TBDL:12}
\citation{Maria:KEOD:13}
\citation{Maria:KEOD:13}
\citation{Maria:KEOD:13}
\citation{Flemming:Thesis:10}
\citation{Hogan:LDOW:10}
\citation{Hogan:WebSemJorunal:12}
\citation{Hogan:WebSemJorunal:12}
\citation{Zaveri:SemWebJorunal:12}
\citation{Flouris:EvoDyn:12}
\citation{Hogan:LDOW:10}
\citation{Hogan:LDOW:10}
\citation{Suominen:DataSemantics:13}
\citation{Mader:TBDL:12}
\citation{Mader:TBDL:12}
\citation{Mader:TBDL:12}
\citation{Acosta:ISWC:13}
\citation{Mader:TBDL:12}
\citation{Acosta:ISWC:13}
\citation{Mader:TBDL:12}
\citation{Suominen:IKEM:12}
\citation{Hogan:LDOW:10}
\citation{Acosta:ISWC:13}
\citation{Suominen:IKEM:12}
\citation{Mader:TBDL:12}
\citation{Zaveri:SemWebJorunal:12}
\citation{Zaveri:SemWebJorunal:12}
\citation{Flemming:Thesis:10}
\citation{Mader:TBDL:12}
\citation{Maria:KEOD:13}
\citation{Maria:KEOD:13}
\citation{Mader:TBDL:12}
\citation{Maria:KEOD:13}
\citation{Flouris:EvoDyn:12}
\citation{Hogan:LDOW:10}
\citation{Suominen:IKEM:12}
\citation{Hogan:WebSemJorunal:12}
\citation{Hogan:LDOW:10}
\citation{Dagobert:DL:02}
\citation{Suominen:IKEM:12}
\citation{Mader:TBDL:12}
\citation{Hogan:LDOW:10}
\citation{Mader:TBDL:12}
\citation{Hogan:LDOW:10}
\citation{Mader:TBDL:12}
\citation{Isaac:W3C:09}
\citation{Mader:TBDL:12}
\citation{Maria:KEOD:13}
\citation{Mader:TBDL:12}
\citation{Hogan:LDOW:10}
\@writefile{lot}{\contentsline {table}{\numberline {5.1}{\ignorespaces Objective Linked Data quality framework}}{66}{table.5.1}}
\newlabel{DQM}{{5.1}{66}{Objective Linked Data quality framework}{table.5.1}{}}
\citation{Maria:KEOD:13}
\citation{Hogan:LDOW:10}
\citation{Zaveri:SemWebJorunal:12}
\citation{Zaveri:SemWebJorunal:12}
\gdef \LT@v {\LT@entry
{1}{95.06274pt}\LT@entry
{1}{93.13504pt}\LT@entry
{1}{24.57626pt}\LT@entry
{5}{332.91586pt}}
\BKM@entry{id=82,dest={73756273656374696F6E2E352E332E31},srcline={245}}{436F6D706C6574656E657373}
\citation{Mader:TBDL:12}
\citation{Miles:W3C:09}
\citation{Mader:TBDL:12}
\citation{Hogan:LDOW:10}
\citation{Zaveri:SemWebJorunal:12}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.1}Completeness}{67}{subsection.5.3.1}}
\citation{Zaveri:SemWebJorunal:12}
\citation{Hogan:LDOW:10}
\citation{Mader:TBDL:12}
\citation{Gueret:ESWC:12}
\citation{Mader:TBDL:12}
\citation{Mader:TBDL:12}
\citation{Hogan:LDOW:10}
\citation{Mader:TBDL:12}
\citation{Maria:KEOD:13}
\BKM@entry{id=83,dest={73756273656374696F6E2E352E332E32},srcline={261}}{417661696C6162696C697479}
\citation{Flemming:Thesis:10}
\citation{Hogan:LDOW:10}
\BKM@entry{id=84,dest={73756273656374696F6E2E352E332E33},srcline={264}}{436F72726563746E657373}
\citation{Hogan:LDOW:10}
\citation{Hogan:LDOW:10}
\citation{Mader:TBDL:12}
\citation{Mader:TBDL:12}
\citation{Hogan:LDOW:10}
\citation{Acosta:ISWC:13}
\citation{Suominen:IKEM:12}
\citation{Mader:TBDL:12}
\citation{Suominen:IKEM:12}
\citation{Acosta:ISWC:13}
\citation{Mader:TBDL:12}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.2}Availability}{68}{subsection.5.3.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.3}Correctness}{68}{subsection.5.3.3}}
\BKM@entry{id=85,dest={73756273656374696F6E2E352E332E34},srcline={267}}{436F6E73697374656E6379}
\citation{Isaac:W3C:09}
\citation{Mader:TBDL:12}
\citation{Mader:TBDL:12}
\citation{Suominen:IKEM:12}
\citation{Hogan:LDOW:10}
\citation{Maria:KEOD:13}
\citation{Mader:TBDL:12}
\citation{Maria:KEOD:13}
\citation{Mader:TBDL:12}
\citation{Hogan:LDOW:10}
\citation{Maria:KEOD:13}
\BKM@entry{id=86,dest={73756273656374696F6E2E352E332E35},srcline={270}}{46726573686E657373}
\citation{Flouris:EvoDyn:12}
\BKM@entry{id=87,dest={73756273656374696F6E2E352E332E36},srcline={273}}{50726F76656E616E6365}
\citation{Lebo:W3C:13}
\BKM@entry{id=88,dest={73756273656374696F6E2E352E332E37},srcline={276}}{4C6963656E73696E67}
\citation{Hogan:WebSemJorunal:12}
\citation{Hogan:WebSemJorunal:12}
\citation{Zaveri:SemWebJorunal:12}
\BKM@entry{id=89,dest={73756273656374696F6E2E352E332E38},srcline={279}}{436F6D70726568656E736962696C697479}
\citation{Flemming:Thesis:10}
\citation{Mader:TBDL:12}
\citation{Maria:KEOD:13}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.4}Consistency}{69}{subsection.5.3.4}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.5}Freshness}{69}{subsection.5.3.5}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.6}Provenance}{69}{subsection.5.3.6}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.7}Licensing}{69}{subsection.5.3.7}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.8}Comprehensibility}{69}{subsection.5.3.8}}
\BKM@entry{id=90,dest={73756273656374696F6E2E352E332E39},srcline={282}}{436F686572656E6365}
\citation{Hogan:LDOW:10}
\citation{Hogan:LDOW:10}
\citation{Hogan:WebSemJorunal:12}
\citation{Hogan:LDOW:10}
\citation{Suominen:IKEM:12}
\citation{Hogan:LDOW:10}
\citation{Dagobert:DL:02}
\citation{Suominen:IKEM:12}
\citation{Mader:TBDL:12}
\citation{Mader:TBDL:12}
\citation{Hogan:LDOW:10}
\citation{Mader:TBDL:12}
\BKM@entry{id=91,dest={73756273656374696F6E2E352E332E3130},srcline={285}}{5365637572697479}
\citation{Zaveri:SemWebJorunal:12}
\BKM@entry{id=92,dest={73656374696F6E2E352E34},srcline={292}}{4C696E6B65642044617461205175616C69747920546F6F6C73}
\BKM@entry{id=93,dest={73756273656374696F6E2E352E342E31},srcline={297}}{496E666F726D6174696F6E205175616C697479}
\citation{Berrueta:SFSW:08}
\citation{Berners-Lee:W3C:06}
\citation{Bohm:ICDEW:10}
\citation{Abedjan:ICDE:14}
\citation{Makela:ESWC:14}
\citation{Auer:EKAW:12}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.9}Coherence}{70}{subsection.5.3.9}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.10}Security}{70}{subsection.5.3.10}}
\@writefile{toc}{\contentsline {section}{\numberline {5.4}Linked Data Quality Tools}{70}{section.5.4}}
\newlabel{section:quality-tools}{{5.4}{70}{Linked Data Quality Tools}{section.5.4}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.1}Information Quality}{70}{subsection.5.4.1}}
\BKM@entry{id=94,dest={73756273656374696F6E2E352E342E32},srcline={302}}{4D6F64656C696E67205175616C697479}
\citation{Suominen:DataSemantics:13}
\citation{Harpring:Getty:10}
\citation{Lehmann:MLResearch:09}
\citation{Cherix:WASABI:14}
\citation{Mader:TBDL:12}
\citation{Suominen:IKEM:12}
\citation{PovedaVillalon:EKAW:12}
\citation{Sirin:OWLED:08}
\citation{Tao:HICSS:09}
\citation{Hogan:LDOW:10}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.2}Modeling Quality}{71}{subsection.5.4.2}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.4.2.1}Semi-automatic Approaches}{71}{subsubsection.5.4.2.1}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.4.2.2}Automatic Approaches}{71}{subsubsection.5.4.2.2}}
\BKM@entry{id=95,dest={73756273656374696F6E2E352E342E33},srcline={313}}{44617461736574205175616C697479}
\citation{Mendes:EDBT:12}
\citation{Furber:ECIS:11}
\citation{Acosta:ISWC:13}
\citation{Bizer:WebSemJorunal:09}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.3}Dataset Quality}{72}{subsection.5.4.3}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.4.3.1}Manual Ranking Approaches}{72}{subsubsection.5.4.3.1}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.4.3.2}Crowd-sourcing Approaches}{72}{subsubsection.5.4.3.2}}
\citation{Kontokostas:KESW:13}
\citation{Debattista:CoRR:14}
\citation{Anisa:LDQ:14}
\citation{Debattista:WWW:14}
\citation{Kontokostas:WWW:14}
\citation{Ruckhaus:ESWC:14}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.4.3.3}Semi-automatic Approaches}{73}{subsubsection.5.4.3.3}}
\citation{Verlic:iSemantics:12}
\citation{Page:TechReport:98}
\citation{Kleinberg:ACM:99}
\citation{Brin:WWW:98}
\citation{Chakrabarti:IEEE:99}
\citation{Toupikov:LDOW:09}
\citation{Ding:CIKM:04}
\citation{Hogan:SSKB:06}
\citation{Toupikov:LDOW:09}
\citation{Haslhofer:IWS:09}
\citation{Gueret:ESWC:12}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {5.4.3.4}Automatic Ranking Approaches}{74}{subsubsection.5.4.3.4}}
\citation{Hartig:ISWC:09}
\citation{Flouris:EvoDyn:12}
\citation{Harth:ISWC:09}
\citation{Tummarello:ISWC:07}
\citation{Delbru:ESWC:10}
\BKM@entry{id=96,dest={73756273656374696F6E2E352E342E34},srcline={354}}{517565727961626C6520456E642D706F696E74205175616C697479}
\citation{BuilAranda:ISWC:13}
\BKM@entry{id=97,dest={73656374696F6E2E352E35},srcline={362}}{416E204F626A656374697665205175616C697479204173736573736D656E74204672616D65776F726B}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.4}Queryable End-point Quality}{76}{subsection.5.4.4}}
\@writefile{toc}{\contentsline {section}{\numberline {5.5}An Objective Quality Assessment Framework}{76}{section.5.5}}
\newlabel{section:quality-assessment-framework}{{5.5}{76}{An Objective Quality Assessment Framework}{section.5.5}{}}
\BKM@entry{id=98,dest={73756273656374696F6E2E352E352E31},srcline={431}}{5175616C6974792053636F72652043616C63756C6174696F6E}
\@writefile{lot}{\contentsline {table}{\numberline {5.2}{\ignorespaces Objective Quality Assessment Methods for CKAN-based Data Portals\relax }}{77}{table.caption.37}}
\newlabel{table:objective-methods-ckan}{{5.2}{77}{Objective Quality Assessment Methods for CKAN-based Data Portals\relax }{table.caption.37}{}}
\BKM@entry{id=99,dest={73756273656374696F6E2E352E352E32},srcline={448}}{4576616C756174696F6E}
\citation{Assaf:ESWC:PROFILES:15}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.1}Quality Score Calculation}{78}{subsection.5.5.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.2}Evaluation}{78}{subsection.5.5.2}}
\BKM@entry{id=100,dest={73756273656374696F6E2E352E352E33},srcline={482}}{4578706572696D656E747320616E6420416E616C79736973}
\@writefile{lot}{\contentsline {table}{\numberline {5.3}{\ignorespaces Datasets chosen for the correctness evaluation\relax }}{79}{table.caption.38}}
\newlabel{table:quality_dataset_experiment}{{5.3}{79}{Datasets chosen for the correctness evaluation\relax }{table.caption.38}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {5.1}{\ignorespaces Average Error \% per quality indicator for LOD group\relax }}{79}{figure.caption.39}}
\newlabel{fig:average-error-lod-group}{{5.1}{79}{Average Error \% per quality indicator for LOD group\relax }{figure.caption.39}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.3}Experiments and Analysis}{79}{subsection.5.5.3}}
\newlabel{qualityReport}{{5.1}{80}{Excerpt of the LOD cloud group quality report}{lstlisting.5.1}{}}
\@writefile{lol}{\contentsline {lstlisting}{\numberline {5.1}Excerpt of the LOD cloud group quality report}{80}{lstlisting.5.1}}
\BKM@entry{id=101,dest={73656374696F6E2E352E36},srcline={516}}{526F6F6D6261205175616C69747920457874656E73696F6E2076732E207374617465206F662074686520617274}
\citation{Maria:KEOD:13}
\citation{Debattista:DQV:15}
\BKM@entry{id=102,dest={73656374696F6E2E352E37},srcline={555}}{53756D6D617279}
\@writefile{toc}{\contentsline {section}{\numberline {5.6}Roomba Quality Extension vs. state of the art}{81}{section.5.6}}
\@writefile{lot}{\contentsline {table}{\numberline {5.4}{\ignorespaces Functional Comparison of Automatic Linked Data quality Tools\relax }}{82}{table.caption.40}}
\newlabel{table:quality_tools_comparison_table}{{5.4}{82}{Functional Comparison of Automatic Linked Data quality Tools\relax }{table.caption.40}{}}
\@writefile{toc}{\contentsline {section}{\numberline {5.7}Summary}{82}{section.5.7}}
\@writefile{@@@}{\chapterbegin }
\BKM@entry{id=103,dest={706172742E32},srcline={111}}{494920546F776172647320456E72696368656420456E74657270726973652044617461}
\@writefile{toc}{\contentsline {part}{II\hspace {1em}Towards Enriched Enterprise Data}{84}{part.2}}
\@writefile{lof}{\contentsline {xpart}{Towards Enriched Enterprise Data}{86}{part.2}}
\@writefile{lot}{\contentsline {xpart}{Towards Enriched Enterprise Data}{86}{part.2}}
\@writefile{toc}{\contentsline {xpart}{Towards Enriched Enterprise Data}{86}{part.2}}
\newlabel{part:data_integration}{{II}{86}{Towards Enriched Enterprise Data}{part.2}{}}
\@writefile{@@@}{\chapterbegin }
\BKM@entry{id=104,dest={636861707465722E36},srcline={1}}{4261636B67726F756E64}
\BKM@entry{id=105,dest={73656374696F6E2E362E31},srcline={4}}{4461746120496E746567726174696F6E}
\citation{Lenzerini:DIT:02}
\citation{Frischmuth:ISWC:13}
\BKM@entry{id=106,dest={73656374696F6E2E362E32},srcline={20}}{427573696E65737320496E74656C6C6967656E6365}
\citation{Rud:Wiley:09}
\@writefile{toc}{\contentsline {chapter}{\numberline {6}Background}{87}{chapter.6}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{lof}{\contentsline {xchapter}{Background}{87}{chapter.6}}
\@writefile{lot}{\contentsline {xchapter}{Background}{87}{chapter.6}}
\newlabel{chapter:part2-background}{{6}{87}{Background}{chapter.6}{}}
\@writefile{toc}{\contentsline {section}{\numberline {6.1}Data Integration}{87}{section.6.1}}
\newlabel{section:dataIntegration}{{6.1}{87}{Data Integration}{section.6.1}{}}
\BKM@entry{id=107,dest={73756273656374696F6E2E362E322E31},srcline={24}}{4D756C746964696D656E73696F6E616C204D6F64656C}
\@writefile{toc}{\contentsline {section}{\numberline {6.2}Business Intelligence}{88}{section.6.2}}
\newlabel{section:businessIntelligence}{{6.2}{88}{Business Intelligence}{section.6.2}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.2.1}Multidimensional Model}{88}{subsection.6.2.1}}
\@writefile{lof}{\contentsline {figure}{\numberline {6.1}{\ignorespaces Example of a hierarchical geography dimension\relax }}{88}{figure.caption.43}}
\newlabel{fig:dimension}{{6.1}{88}{Example of a hierarchical geography dimension\relax }{figure.caption.43}{}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {6.2.1.1}Relational Representation}{89}{subsubsection.6.2.1.1}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {6.2.1.2}Analysis and Querying}{89}{subsubsection.6.2.1.2}}
\BKM@entry{id=108,dest={73756273656374696F6E2E362E322E32},srcline={67}}{534150204249204170706C69636174696F6E205375697465}
\BKM@entry{id=109,dest={73656374696F6E2E362E33},srcline={79}}{534150204869676820506572666F726D616E636520416E616C79746963204170706C69616E6365205C2848414E415C29}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.2.2}SAP BI Application Suite}{90}{subsection.6.2.2}}
\@writefile{toc}{\contentsline {section}{\numberline {6.3}SAP High Performance Analytic Appliance (HANA)}{90}{section.6.3}}
\@writefile{lof}{\contentsline {figure}{\numberline {6.2}{\ignorespaces SAP's High Performance Analytic Appliance (HANA) with the SAP BI suite\relax }}{91}{figure.caption.44}}
\newlabel{fig:hana_architecture}{{6.2}{91}{SAP's High Performance Analytic Appliance (HANA) with the SAP BI suite\relax }{figure.caption.44}{}}
\BKM@entry{id=110,dest={73756273656374696F6E2E362E332E31},srcline={106}}{48414E412058532D456E67696E65}
\BKM@entry{id=111,dest={73756273656374696F6E2E362E332E32},srcline={110}}{41637469766520496E666F726D6174696F6E2053746F7265205C284149535C29}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.3.1}HANA XS-Engine}{92}{subsection.6.3.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.3.2}Active Information Store (AIS)}{92}{subsection.6.3.2}}
\newlabel{ais}{{6.3.2}{92}{Active Information Store (AIS)}{subsection.6.3.2}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {6.3}{\ignorespaces AIS data model\relax }}{92}{figure.caption.45}}
\newlabel{fig:ais}{{6.3}{92}{AIS data model\relax }{figure.caption.45}{}}
\BKM@entry{id=112,dest={73656374696F6E2E362E34},srcline={127}}{536F6369616C20576562}
\citation{Porter:NewRiders:08}
\@writefile{toc}{\contentsline {section}{\numberline {6.4}Social Web}{93}{section.6.4}}
\newlabel{social-web}{{6.4}{93}{Social Web}{section.6.4}{}}
\BKM@entry{id=113,dest={636861707465722E37},srcline={1}}{4461746120496E746567726174696F6E20696E2074686520456E7465727072697365}
\citation{Boyd:Article:11}
\citation{LaValle:MIT:11}
\citation{Frischmuth:SemWebJorunal:12}
\BKM@entry{id=114,dest={73656374696F6E2E372E31},srcline={16}}{456E7465727072697365204B6E6F776C65646765204261736573}
\citation{Bizer:WebSemJorunal:09}
\@writefile{toc}{\contentsline {chapter}{\numberline {7}Data Integration in the Enterprise}{95}{chapter.7}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{lof}{\contentsline {xchapter}{Data Integration in the Enterprise}{95}{chapter.7}}
\@writefile{lot}{\contentsline {xchapter}{Data Integration in the Enterprise}{95}{chapter.7}}
\newlabel{chapter:rubix}{{7}{95}{Data Integration in the Enterprise}{chapter.7}{}}
\@writefile{toc}{\contentsline {section}{\numberline {7.1}Enterprise Knowledge Bases}{96}{section.7.1}}
\@writefile{lot}{\contentsline {table}{\numberline {7.1}{\ignorespaces Tables structure for DBpedia in HANA column store\relax }}{96}{table.caption.46}}
\newlabel{dbpedia_tables_hana}{{7.1}{96}{Tables structure for DBpedia in HANA column store\relax }{table.caption.46}{}}
\BKM@entry{id=115,dest={73756273656374696F6E2E372E312E31},srcline={56}}{456E7469747920446973616D626967756174696F6E2077697468204442706564696120696E205341502048414E41}
\@writefile{toc}{\contentsline {subsection}{\numberline {7.1.1}Entity Disambiguation with DBpedia in SAP HANA}{97}{subsection.7.1.1}}
\newlabel{section:disamigutation_HANA}{{7.1.1}{97}{Entity Disambiguation with DBpedia in SAP HANA}{subsection.7.1.1}{}}
\@writefile{lot}{\contentsline {table}{\numberline {7.2}{\ignorespaces Results of combining text search score with the number of incoming associations for query ``apple''\relax }}{97}{table.caption.47}}
\newlabel{tab:text_search_combined_incoming_associations}{{7.2}{97}{Results of combining text search score with the number of incoming associations for query ``apple''\relax }{table.caption.47}{}}
\newlabel{equation:equation_1}{{7.1}{97}{Entity Disambiguation with DBpedia in SAP HANA}{equation.7.1.1}{}}
\BKM@entry{id=116,dest={73656374696F6E2E372E32},srcline={118}}{456E68616E63696E6720536368656D61204D61746368696E67}
\BKM@entry{id=117,dest={73756273656374696F6E2E372E322E31},srcline={124}}{52656C6174656420576F726B}
\citation{Miller:IEEE:03}
\citation{Reis:WWW:04}
\citation{Wang:WWW:03}
\citation{DaSilva:OTM:07}
\citation{Limaye:VLDB:10}
\@writefile{lot}{\contentsline {table}{\numberline {7.3}{\ignorespaces Results of the enhanced equation\nobreakspace {}\ref {equation:equation_2} and its affect on the overall score for query ``apple''\relax }}{98}{table.caption.48}}
\newlabel{tab:text_search_combined_incoming_associations_enhanced}{{7.3}{98}{Results of the enhanced equation~\ref {equation:equation_2} and its affect on the overall score for query ``apple''\relax }{table.caption.48}{}}
\newlabel{equation:equation_2}{{7.2}{98}{Entity Disambiguation with DBpedia in SAP HANA}{equation.7.1.2}{}}
\@writefile{toc}{\contentsline {section}{\numberline {7.2}Enhancing Schema Matching}{98}{section.7.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {7.2.1}Related Work}{98}{subsection.7.2.1}}
\citation{Syed:WebSci:10}
\citation{Finin:AAAI:09}
\citation{Syed:WebSci:10}
\citation{Hassanzadeh:WWW:11}
\BKM@entry{id=118,dest={73756273656374696F6E2E372E322E32},srcline={136}}{50726F706F736974696F6E}
\@writefile{toc}{\contentsline {subsection}{\numberline {7.2.2}Proposition}{99}{subsection.7.2.2}}
\newlabel{Section:RUBIX}{{7.2.2}{99}{Proposition}{subsection.7.2.2}{}}
\citation{Peukert:ICDE:12}
\BKM@entry{id=119,dest={73756273656374696F6E2E372E322E33},srcline={146}}{416374697669747920466C6F77}
\citation{Peukert:ICDE:11}
\@writefile{toc}{\contentsline {subsection}{\numberline {7.2.3}Activity Flow}{100}{subsection.7.2.3}}
\@writefile{lof}{\contentsline {figure}{\numberline {7.1}{\ignorespaces RUBIX Activity Workflow\relax }}{100}{figure.caption.49}}
\newlabel{figure:Activity_workflow}{{7.1}{100}{RUBIX Activity Workflow\relax }{figure.caption.49}{}}
\BKM@entry{id=120,dest={73756273656374696F6E2E372E322E34},srcline={169}}{44617461205265636F6E63696C696174696F6E}
\@writefile{lof}{\contentsline {figure}{\numberline {7.2}{\ignorespaces Screenshot showing the results mapping view in RUBIX\relax }}{101}{figure.caption.50}}
\newlabel{figure:rubix_screenshot}{{7.2}{101}{Screenshot showing the results mapping view in RUBIX\relax }{figure.caption.50}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {7.2.4}Data Reconciliation}{101}{subsection.7.2.4}}
\BKM@entry{id=121,dest={73756273656374696F6E2E372E322E35},srcline={172}}{4D61746368696E6720556E6E616D656420616E6420556E747970656420436F6C756D6E73}
\citation{Peukert:ICDE:12}
\citation{conf/wise/StracciaT05}
\citation{Kowalski:RoyalStat:72}
\@writefile{toc}{\contentsline {subsection}{\numberline {7.2.5}Matching Unnamed and Untyped Columns}{102}{subsection.7.2.5}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {7.2.5.1}Vector-based Similarity}{102}{subsubsection.7.2.5.1}}
\newlabel{equation:equation_3}{{7.3}{102}{Vector-based Similarity}{equation.7.2.3}{}}
\newlabel{equation:equation_4}{{7.4}{102}{Vector-based Similarity}{equation.7.2.4}{}}
\newlabel{equation:equation_5}{{7.5}{102}{Vector-based Similarity}{equation.7.2.5}{}}
\BKM@entry{id=122,dest={73756273656374696F6E2E372E322E36},srcline={239}}{436F6C756D6E204C6162656C696E67}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {7.2.5.2}Pearson Product-Moment Correlation Coefficient (PPMCC)}{103}{subsubsection.7.2.5.2}}
\newlabel{equation:equation_6}{{7.6}{103}{Pearson Product-Moment Correlation Coefficient (PPMCC)}{equation.7.2.6}{}}
\newlabel{equation:equation_7}{{7.7}{103}{Pearson Product-Moment Correlation Coefficient (PPMCC)}{equation.7.2.7}{}}
\newlabel{equation:equation_8}{{7.8}{103}{Pearson Product-Moment Correlation Coefficient (PPMCC)}{equation.7.2.8}{}}
\newlabel{equation:equation_9}{{7.9}{103}{Pearson Product-Moment Correlation Coefficient (PPMCC)}{equation.7.2.9}{}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {7.2.5.3}Spearman's Rank Correlation Coefficient}{103}{subsubsection.7.2.5.3}}
\BKM@entry{id=123,dest={73756273656374696F6E2E372E322E37},srcline={254}}{48616E646C696E67204E6F6E2D537472696E672056616C756573}
\BKM@entry{id=124,dest={73756273656374696F6E2E372E322E38},srcline={263}}{4578706572696D656E7473}
\@writefile{toc}{\contentsline {subsection}{\numberline {7.2.6}Column Labeling}{104}{subsection.7.2.6}}
\newlabel{equation:equation_10}{{7.10}{104}{Column Labeling}{equation.7.2.10}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {7.2.7}Handling Non-String Values}{104}{subsection.7.2.7}}
\@writefile{toc}{\contentsline {subsection}{\numberline {7.2.8}Experiments}{104}{subsection.7.2.8}}
\@writefile{lot}{\contentsline {table}{\numberline {7.4}{\ignorespaces Similarity Scores Using the AMC Default Matching Algorithms\relax }}{106}{table.caption.51}}
\newlabel{tab:Similarity_Scores_Using_the_AMC_Default_Matching_Algorithms}{{7.4}{106}{Similarity Scores Using the AMC Default Matching Algorithms\relax }{table.caption.51}{}}
\@writefile{lot}{\contentsline {table}{\numberline {7.5}{\ignorespaces Similarity Scores Using the AMC Default Matching Algorithms + Cosine Similarity Method\relax }}{107}{table.caption.52}}
\newlabel{tab:Similarity_Scores_Using_the_AMC_Default_Matching_Algorithms_+_Cosine_Similarity_Method}{{7.5}{107}{Similarity Scores Using the AMC Default Matching Algorithms + Cosine Similarity Method\relax }{table.caption.52}{}}
\@writefile{lot}{\contentsline {table}{\numberline {7.6}{\ignorespaces Similarity Scores Using the AMC Default Matching Algorithms+ the PPMCC Similarity Method\relax }}{108}{table.caption.53}}
\newlabel{tab:Similarity_Scores_Using_the_AMC_Default_Matching_Algorithms+__the_PPMCC_Similarity_Method}{{7.6}{108}{Similarity Scores Using the AMC Default Matching Algorithms+ the PPMCC Similarity Method\relax }{table.caption.53}{}}
\@writefile{lot}{\contentsline {table}{\numberline {7.7}{\ignorespaces Similarity Scores Using the AMC Default Matching Algorithms + Spearman Similarity Method\relax }}{108}{table.caption.54}}
\newlabel{tab:Similarity_Scores_Using_the_AMC_Default_Matching_Algorithms_+_Spearman_Similarity_Method}{{7.7}{108}{Similarity Scores Using the AMC Default Matching Algorithms + Spearman Similarity Method\relax }{table.caption.54}{}}
\@writefile{lot}{\contentsline {table}{\numberline {7.8}{\ignorespaces Similarity Scores Using the Combination of Cosine, PPMCC and AMC's defaults\relax }}{109}{table.caption.55}}
\newlabel{tab:Similarity_Scores_Using_the_Combination_of_Cosine,_PPMCC_and_AMC's_defaults}{{7.8}{109}{Similarity Scores Using the Combination of Cosine, PPMCC and AMC's defaults\relax }{table.caption.55}{}}
\BKM@entry{id=125,dest={73656374696F6E2E372E33},srcline={476}}{496D706F7274616E742050726F7065727469657320666F7220456E746974696573}
\BKM@entry{id=126,dest={73756273656374696F6E2E372E332E31},srcline={490}}{5265766572736520456E67696E656572696E672074686520476F6F676C65204B472050616E656C}
\@writefile{toc}{\contentsline {section}{\numberline {7.3}Important Properties for Entities}{110}{section.7.3}}
\newlabel{Section:EKG}{{7.3}{110}{Important Properties for Entities}{section.7.3}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {7.3.1}Reverse Engineering the Google KG Panel}{110}{subsection.7.3.1}}
\newlabel{sec:knowledge-graph}{{7.3.1}{110}{Reverse Engineering the Google KG Panel}{subsection.7.3.1}{}}
\citation{Bergman:GKG:12}
\@writefile{lof}{\contentsline {figure}{\numberline {7.3}{\ignorespaces Google knowledge graph panel for the city of Nice, France\relax }}{111}{figure.caption.57}}
\newlabel{fig:gkb}{{7.3}{111}{Google knowledge graph panel for the city of Nice, France\relax }{figure.caption.57}{}}
\@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces Google Knowledge Panel reverse engineering algorithm\relax }}{111}{algorithm.1}}
\newlabel{algoscrapping}{{1}{111}{Google Knowledge Panel reverse engineering algorithm\relax }{algorithm.1}{}}
\BKM@entry{id=127,dest={73756273656374696F6E2E372E332E32},srcline={524}}{4576616C756174696F6E}
\@writefile{toc}{\contentsline {subsection}{\numberline {7.3.2}Evaluation}{112}{subsection.7.3.2}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {7.3.2.1}User survey}{112}{subsubsection.7.3.2.1}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {7.3.2.2}Comparison with Google Knowledge Graph}{112}{subsubsection.7.3.2.2}}
\citation{Pietriga:ISWC:06}
\BKM@entry{id=128,dest={73656374696F6E2E372E34},srcline={558}}{53756D6D617279}
\citation{Steiner:IKEC:12}
\@writefile{lot}{\contentsline {table}{\numberline {7.9}{\ignorespaces Agreement on properties between users and the Knowledge Graph Panel\relax }}{113}{table.caption.58}}
\newlabel{tab:agreement}{{7.9}{113}{Agreement on properties between users and the Knowledge Graph Panel\relax }{table.caption.58}{}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {7.3.2.3}Modeling the preferred properties with Fresnel}{113}{subsubsection.7.3.2.3}}
\@writefile{toc}{\contentsline {section}{\numberline {7.4}Summary}{113}{section.7.4}}
\BKM@entry{id=129,dest={636861707465722E38},srcline={1}}{53656D616E74696320536F6369616C204E657773204167677265676174696F6E}
\BKM@entry{id=130,dest={73656374696F6E2E382E31},srcline={4}}{496E74726F64756374696F6E}
\citation{Bakshy:WWW:12}
\BKM@entry{id=131,dest={73656374696F6E2E382E32},srcline={13}}{556E6465726C79696E67204D656368616E69736D}
\@writefile{toc}{\contentsline {chapter}{\numberline {8}Semantic Social News Aggregation}{115}{chapter.8}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{lof}{\contentsline {xchapter}{Semantic Social News Aggregation}{115}{chapter.8}}
\@writefile{lot}{\contentsline {xchapter}{Semantic Social News Aggregation}{115}{chapter.8}}
\newlabel{chapter:snarc}{{8}{115}{Semantic Social News Aggregation}{chapter.8}{}}
\@writefile{toc}{\contentsline {section}{\numberline {8.1}Introduction}{115}{section.8.1}}
\BKM@entry{id=132,dest={73756273656374696F6E2E382E322E31},srcline={17}}{446F63756D656E742048616E646C6572}
\@writefile{toc}{\contentsline {section}{\numberline {8.2}Underlying Mechanism}{116}{section.8.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {8.2.1}Document Handler}{116}{subsection.8.2.1}}
\@writefile{lof}{\contentsline {figure}{\numberline {8.1}{\ignorespaces SNARC's Document Handler\relax }}{116}{figure.caption.59}}
\newlabel{fig:architecture_document_handler}{{8.1}{116}{SNARC's Document Handler\relax }{figure.caption.59}{}}
\BKM@entry{id=133,dest={73756273656374696F6E2E382E322E32},srcline={59}}{5175657279204C61796572}
\@writefile{toc}{\contentsline {subsection}{\numberline {8.2.2}Query Layer}{118}{subsection.8.2.2}}
\@writefile{lof}{\contentsline {figure}{\numberline {8.2}{\ignorespaces SNARC's Query Layer\relax }}{118}{figure.caption.60}}
\newlabel{fig:architecture_query_layer}{{8.2}{118}{SNARC's Query Layer\relax }{figure.caption.60}{}}
\BKM@entry{id=134,dest={73756273656374696F6E2E382E322E33},srcline={91}}{4461746120506172736572}
\citation{Zanardi:RecSys:08}
\citation{Cantador:EC-WEB:11}
\citation{Ernesto:RecSys:12}
\citation{Preotiuc-Pietro:ICWSM:12}
\citation{Zanardi:RecSys:08}
\@writefile{toc}{\contentsline {subsection}{\numberline {8.2.3}Data Parser}{120}{subsection.8.2.3}}
\@writefile{lof}{\contentsline {figure}{\numberline {8.3}{\ignorespaces SNARC's Data Parser\relax }}{120}{figure.caption.61}}
\newlabel{fig:architecture_data_parser}{{8.3}{120}{SNARC's Data Parser\relax }{figure.caption.61}{}}
\newlabel{social_modeler}{{8.1}{121}{Social Modeler output snippet for different social networks}{lstlisting.8.1}{}}
\@writefile{lol}{\contentsline {lstlisting}{\numberline {8.1}Social Modeler output snippet for different social networks}{121}{lstlisting.8.1}}
\BKM@entry{id=135,dest={73656374696F6E2E382E33},srcline={136}}{46726F6E742D456E64}
\BKM@entry{id=136,dest={73656374696F6E2E382E34},srcline={144}}{53756D6D617279}
\@writefile{toc}{\contentsline {section}{\numberline {8.3}Front-End}{122}{section.8.3}}
\@writefile{lof}{\contentsline {figure}{\numberline {8.4}{\ignorespaces SNARC's User Interface - The Google Chrome Extension\relax }}{122}{figure.caption.62}}
\newlabel{fig:SNARC_UI}{{8.4}{122}{SNARC's User Interface - The Google Chrome Extension\relax }{figure.caption.62}{}}
\@writefile{toc}{\contentsline {section}{\numberline {8.4}Summary}{122}{section.8.4}}
\@writefile{@@@}{\chapterbegin }
\BKM@entry{id=137,dest={636861707465722E39},srcline={1}}{436F6E636C7573696F6E7320616E642046757475726520506572737065637469766573}
\BKM@entry{id=138,dest={73656374696F6E2E392E31},srcline={6}}{5363656E6172696F20466C6173686261636B}
\BKM@entry{id=139,dest={73656374696F6E2E392E32},srcline={12}}{416368696576656D656E7473}
\@writefile{toc}{\contentsline {chapter}{\numberline {9}Conclusions and Future Perspectives}{124}{chapter.9}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{lof}{\contentsline {xchapter}{Conclusions and Future Perspectives}{124}{chapter.9}}
\@writefile{lot}{\contentsline {xchapter}{Conclusions and Future Perspectives}{124}{chapter.9}}
\newlabel{ch:conclusion}{{9}{124}{Conclusions and Future Perspectives}{chapter.9}{}}
\@writefile{toc}{\contentsline {section}{\numberline {9.1}Scenario Flashback}{124}{section.9.1}}
\@writefile{toc}{\contentsline {section}{\numberline {9.2}Achievements}{124}{section.9.2}}
\@writefile{lof}{\contentsline {figure}{\numberline {9.1}{\ignorespaces Annoteted architecture diagram for enabling self-service data provisioning\relax }}{125}{figure.caption.64}}
\newlabel{fig:architecutre_diagram_annotated}{{9.1}{125}{Annoteted architecture diagram for enabling self-service data provisioning\relax }{figure.caption.64}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {9.2}{\ignorespaces UI Prototype of semantic data enrichment in SAP Lumira\relax }}{126}{figure.caption.65}}
\newlabel{fig:lumira}{{9.2}{126}{UI Prototype of semantic data enrichment in SAP Lumira\relax }{figure.caption.65}{}}
\BKM@entry{id=140,dest={73656374696F6E2E392E33},srcline={59}}{506572737065637469766573}
\@writefile{toc}{\contentsline {section}{\numberline {9.3}Perspectives}{127}{section.9.3}}
\BKM@entry{id=141,dest={706172742E33},srcline={127}}{49494920525C33353173756D5C3335312064652054685C3335307365}
\@writefile{toc}{\contentsline {part}{III\hspace {1em}R\'{e}sum\'{e} de Th\`{e}se}{129}{part.3}}
\BKM@entry{id=142,dest={636861707465722E3130},srcline={1}}{496E74726F64756374696F6E}
\BKM@entry{id=143,dest={73656374696F6E2E31302E31},srcline={10}}{436F6E7465787465206574204D6F7469766174696F6E}
\citation{Mihindukulasooriya:COLD:13}
\citation{Lenzerini:SIGMOD:02}
\citation{Frischmuth:ISWC:13}
\citation{Frischmuth:SemWebJorunal:12}
\citation{Wache:IJCAI:01}
\citation{Bizer:IJSWIS:09}
\@writefile{lof}{\contentsline {xpart}{R\'{e}sum\'{e} de Th\`{e}se}{131}{part.3}}
\@writefile{lot}{\contentsline {xpart}{R\'{e}sum\'{e} de Th\`{e}se}{131}{part.3}}
\@writefile{toc}{\contentsline {xpart}{R\'{e}sum\'{e} de Th\`{e}se}{131}{part.3}}
\newlabel{part:french_summary}{{III}{131}{R\'{e}sum\'{e} de Th\`{e}se}{part.3}{}}
\@writefile{toc}{\contentsline {chapter}{\numberline {10}Introduction}{131}{chapter.10}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{lof}{\contentsline {xchapter}{Introduction}{131}{chapter.10}}
\@writefile{lot}{\contentsline {xchapter}{Introduction}{131}{chapter.10}}
\newlabel{french-introduction}{{10}{131}{Introduction}{chapter.10}{}}
\@writefile{toc}{\contentsline {section}{\numberline {10.1}Contexte et Motivation}{131}{section.10.1}}
\citation{Bizer:IJSWIS:09}
\citation{Boyd:Article:11}
\citation{LaValle:MIT:11}
\BKM@entry{id=144,dest={73656374696F6E2E31302E32},srcline={18}}{53635C3335316E6172696F2064277574696C69736174696F6E}
\@writefile{toc}{\contentsline {section}{\numberline {10.2}Sc\'{e}nario d'utilisation}{133}{section.10.2}}
\BKM@entry{id=145,dest={73656374696F6E2E31302E33},srcline={39}}{50726F626C5C3335316D6174697175657320646520526563686572636865}
\BKM@entry{id=146,dest={73756273656374696F6E2E31302E332E31},srcline={43}}{496E745C33353167726174696F6E20657420416D5C3335316C696F726174696F6E2064657320446F6E6E5C3335316573}
\@writefile{toc}{\contentsline {section}{\numberline {10.3}Probl\'{e}matiques de Recherche}{134}{section.10.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.3.1}Int\'{e}gration et Am\'{e}lioration des Donn\'{e}es}{134}{subsection.10.3.1}}
\BKM@entry{id=147,dest={73756273656374696F6E2E31302E332E32},srcline={52}}{4D61696E74656E616E636520657420445C333531636F7576657274652064657320446F6E6E5C3335316573}
\citation{Lalithsena:WI:13}
\BKM@entry{id=148,dest={73756273656374696F6E2E31302E332E33},srcline={60}}{5175616C69745C3335312064657320446F6E6E5C3335316573}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.3.2}Maintenance et D\'{e}couverte des Donn\'{e}es}{135}{subsection.10.3.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.3.3}Qualit\'{e} des Donn\'{e}es}{135}{subsection.10.3.3}}
\BKM@entry{id=149,dest={73656374696F6E2E31302E34},srcline={68}}{436F6E747269627574696F6E73206465206C612054685C3335307365}
\BKM@entry{id=150,dest={73756273656374696F6E2E31302E342E31},srcline={81}}{436F6E747269627574696F6E7320737572206C61204D61696E74656E616E636520657420445C333531636F7576657274652064657320446F6E6E5C3335316573}
\@writefile{toc}{\contentsline {section}{\numberline {10.4}Contributions de la Th\`{e}se}{136}{section.10.4}}
\@writefile{lof}{\contentsline {figure}{\numberline {10.1}{\ignorespaces Sch\'{e}ma de l'architecture des donn\'{e}es pour permettre l'acces en libre-service\relax }}{136}{figure.caption.66}}
\newlabel{fig:architecutre_diagram_summary_french}{{10.1}{136}{Sch\'{e}ma de l'architecture des donn\'{e}es pour permettre l'acces en libre-service\relax }{figure.caption.66}{}}
\BKM@entry{id=151,dest={73756273656374696F6E2E31302E342E32},srcline={89}}{436F6E747269627574696F6E7320737572206C61205175616C69745C3335312064657320446F6E6E5C3335316573}
\BKM@entry{id=152,dest={73756273656374696F6E2E31302E342E33},srcline={96}}{436F6E747269627574696F6E7320737572206C27696E745C33353167726174696F6E206574206C27616D5C3335316C696F726174696F6E2064657320446F6E6E5C3335316573}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.4.1}Contributions sur la Maintenance et D\'{e}couverte des Donn\'{e}es}{137}{subsection.10.4.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.4.2}Contributions sur la Qualit\'{e} des Donn\'{e}es}{137}{subsection.10.4.2}}
\BKM@entry{id=153,dest={73656374696F6E2E31302E35},srcline={109}}{5665727320756E2050726F66696C20646520446F6E6E5C333531657320436F6D706C6574}
\BKM@entry{id=154,dest={73756273656374696F6E2E31302E352E31},srcline={115}}{50726F66696C73206574204D6F645C3335306C6573206427656E73656D626C657320646520446F6E6E5C3335316573}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.4.3}Contributions sur l'int\'{e}gration et l'am\'{e}lioration des Donn\'{e}es}{138}{subsection.10.4.3}}
\@writefile{toc}{\contentsline {section}{\numberline {10.5}Vers un Profil de Donn\'{e}es Complet}{138}{section.10.5}}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.5.1}Profils et Mod\`{e}les d'ensembles de Donn\'{e}es}{138}{subsection.10.5.1}}
\citation{Iannella:W3C:14}
\citation{Reynolds:W3C:14}
\citation{Lebo:W3C:13}
\citation{Brummer::ICSS:14}
\citation{Hausenblas:ESWC:09}
\citation{Berners-Lee:W3C:06}
\citation{Debattista:WWW:14}
\BKM@entry{id=155,dest={73756273656374696F6E2E31302E352E32},srcline={164}}{475C3335316E5C333531726174696F6E2065742056616C69646174696F6E2064652050726F66696C7320646520446F6E6E5C3335316573}
\citation{Bizer:WebSemJorunal:09}
\citation{Bollacker:SIGMOD:08}
\citation{Suchanek::WWW:07}
\citation{Lalithsena:WI:13}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.5.2}G\'{e}n\'{e}ration et Validation de Profils de Donn\'{e}es}{143}{subsection.10.5.2}}
\citation{Fetahu:ESWC:14}
\citation{Schmachtenberg:ISWC:14}
\citation{Isele:ISWC:10}
\BKM@entry{id=156,dest={73756273656374696F6E2E31302E352E33},srcline={201}}{5C33313076616C756174696F6E204F626A656374697665206465206C61205175616C69745C3335312064657320446F6E6E5C3335316573204173736F63695C3335316573}
\citation{Boyd:Article:11}
\citation{Kahn:ACM:02}
\citation{Stvilia:ASIST:07}
\citation{Wang:MIS:96}
\citation{Juran:McGraw:99}
\citation{Page:TechReport:98}
\citation{Bizer:WebSemantics:09}
\citation{Bizer:WebSemJorunal:09}
\citation{Suchanek::WWW:07}
\citation{Mendes:ICS:11}
\citation{Marie:ICS:13}
\citation{DiNoia:iSemantics:12}
\citation{Berners-Lee:W3C:06}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.5.3}\`{E}valuation Objective de la Qualit\'{e} des Donn\'{e}es Associ\'{e}es}{147}{subsection.10.5.3}}
\citation{Assaf:DQMST:12}
\citation{Flemming:Thesis:10}
\citation{Assaf:DQMST:12}
\citation{Assaf:PROFILES:15}
\BKM@entry{id=157,dest={73656374696F6E2E31302E36},srcline={252}}{566572732064657320446F6E6E5C3335316573206427656E7472657072697365204167725C3335316D656E745C3335316573}
\BKM@entry{id=158,dest={73756273656374696F6E2E31302E362E31},srcline={254}}{496E745C33353167726174696F6E2064657320446F6E6E5C33353165732064616E73206C27656E7472657072697365}
\citation{Boyd:Article:11}
\citation{LaValle:MIT:11}
\citation{Frischmuth:SemWebJorunal:12}
\@writefile{toc}{\contentsline {section}{\numberline {10.6}Vers des Donn\'{e}es d'entreprise Agr\'{e}ment\'{e}es}{149}{section.10.6}}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.6.1}Int\'{e}gration des Donn\'{e}es dans l'entreprise}{149}{subsection.10.6.1}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {10.6.1.1}Rapprochement des Donn\'{e}es}{150}{subsubsection.10.6.1.1}}
\citation{Peukert:ICDE:12}
\citation{conf/wise/StracciaT05}
\citation{Kowalski:RoyalStat:72}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {10.6.1.2}Identification des Colonnes Non-nomm\'{e}es et Non Typ\'{e}es}{151}{subsubsection.10.6.1.2}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {10.6.1.3}\`{E}tiquetage des Colonnes}{151}{subsubsection.10.6.1.3}}
\BKM@entry{id=159,dest={73756273656374696F6E2E31302E362E32},srcline={289}}{50726F7072695C333531745C3335317320496D706F7274616E74657320706F7572206C657320456E7469745C33353173}
\citation{Bergman:GKG:12}
\citation{Pietriga:ISWC:06}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {10.6.1.4}Gestion des Valeurs typ\'{e}es}{152}{subsubsection.10.6.1.4}}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.6.2}Propri\'{e}t\'{e}s Importantes pour les Entit\'{e}s}{152}{subsection.10.6.2}}
\BKM@entry{id=160,dest={73756273656374696F6E2E31302E362E33},srcline={325}}{4167725C333531676174657572206465204E6F7576656C6C657320536F6369616C6520735C3335316D616E7469717565}
\citation{Bakshy:WWW:12}
\@writefile{loa}{\contentsline {algorithm}{\numberline {2}{\ignorespaces Retro-enginerie de l'algorithme du Google Knowledge Panel\relax }}{153}{algorithm.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.6.3}Agr\'{e}gateur de Nouvelles Sociale s\'{e}mantique}{153}{subsection.10.6.3}}
\BKM@entry{id=161,dest={73656374696F6E2E31302E37},srcline={337}}{525C333531616C69736174696F6E73}
\BKM@entry{id=162,dest={73756273656374696F6E2E31302E372E31},srcline={341}}{436F6E747269627574696F6E7320706F7572206C65732041646D696E6973747261746575727320646520506F727461696C20646520446F6E6E5C3335316573}
\@writefile{toc}{\contentsline {section}{\numberline {10.7}R\'{e}alisations}{154}{section.10.7}}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.7.1}Contributions pour les Administrateurs de Portail de Donn\'{e}es}{154}{subsection.10.7.1}}
\BKM@entry{id=163,dest={73756273656374696F6E2E31302E372E32},srcline={349}}{436F6E747269627574696F6E7320706F7572206C657320416E616C797374657320646520446F6E6E5C3335316573}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.7.2}Contributions pour les Analystes de Donn\'{e}es}{155}{subsection.10.7.2}}
\BKM@entry{id=164,dest={73656374696F6E2E31302E38},srcline={364}}{506572737065637469766573}
\BKM@entry{id=165,dest={73756273656374696F6E2E31302E382E31},srcline={368}}{526570725C33353173656E746174696F6E2064752070726F66696C2064657320646F6E6E5C3335316573}
\BKM@entry{id=166,dest={73756273656374696F6E2E31302E382E32},srcline={371}}{50726F66696C616765204175746F6D6174697175652064657320446F6E6E5C3335316573}
\@writefile{toc}{\contentsline {section}{\numberline {10.8}Perspectives}{156}{section.10.8}}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.8.1}Repr\'{e}sentation du profil des donn\'{e}es}{156}{subsection.10.8.1}}
\BKM@entry{id=167,dest={73756273656374696F6E2E31302E382E33},srcline={374}}{5175616C69745C333531204F626A65637469766520646573204C696E6B65642044617461}
\BKM@entry{id=168,dest={73756273656374696F6E2E31302E382E34},srcline={377}}{496E745C33353167726174696F6E2064657320446F6E6E5C3335316573206427656E747265707269736573}
\bibstyle{plain}
\bibdata{bibliography}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.8.2}Profilage Automatique des Donn\'{e}es}{157}{subsection.10.8.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.8.3}Qualit\'{e} Objective des Linked Data}{157}{subsection.10.8.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {10.8.4}Int\'{e}gration des Donn\'{e}es d'entreprises}{157}{subsection.10.8.4}}
\BKM@entry{id=169,dest={636861707465722A2E3637},srcline={1}}{4269626C696F677261706879}
\bibcite{Abedjan:ICDE:14}{1}
\bibcite{Acosta:ISWC:13}{2}
\bibcite{Alexander:LDOW:09}{3}
\bibcite{Anisa:LDQ:14}{4}
\bibcite{Assaf:WOD:12}{5}
\bibcite{Assaf:DQMST:12}{6}
\bibcite{Assaf:ESWC:13}{7}
\bibcite{Assaf:WWW:15}{8}
\bibcite{Assaf:IJSWIS:15}{9}
\bibcite{Assaf:PROFILES:15}{10}
\bibcite{Assaf:ESWC:PROFILES:15}{11}
\@writefile{@@@}{\chapterbegin }
\@writefile{toc}{\contentsline {chapter}{Bibliography}{158}{chapter*.67}}
\bibcite{Assaf:ESWC:LDQ:15}{12}
\bibcite{Auer:EKAW:12}{13}
\bibcite{Bergman:GKG:12}{14}
\bibcite{Berners:RFC:05}{15}
\bibcite{Berners-Lee:W3C:06}{16}
\bibcite{BernersLee:ScientificAmerican:01}{17}
\bibcite{Berrueta:SFSW:08}{18}
\bibcite{Stvilia:ASIST:07}{19}
\bibcite{Bizer:DB:11}{20}
\bibcite{Bizer:IJSWIS:09}{21}
\bibcite{Bizer:WebSemantics:09}{22}
\bibcite{Bizer:WebSemJorunal:09}{23}
\bibcite{Bohm:CIKM:12}{24}
\bibcite{Bohm:WebSemJournal:11}{25}
\bibcite{Bohm:ICDEW:10}{26}
\bibcite{Bollacker:SIGMOD:08}{27}
\bibcite{Boyd:Article:11}{28}
\bibcite{Brickley:RDFS:14}{29}
\bibcite{Brin:WWW:98}{30}
\bibcite{Brummer::ICSS:14}{31}
\bibcite{BuilAranda:ISWC:13}{32}
\bibcite{Chakrabarti:IEEE:99}{33}
\bibcite{Cherix:WASABI:14}{34}
\bibcite{Cornolti:WWW:13}{35}
\bibcite{Cyganiak:ESWC:08}{36}
\bibcite{Cyganiak:W3C:11}{37}
\bibcite{DaSilva:OTM:07}{38}
\bibcite{daquin:SemWebJorunal:11}{39}
\bibcite{Davies:Report:15}{40}
\bibcite{Reis:WWW:04}{41}
\bibcite{Debattista:DQV:15}{42}
\bibcite{Debattista:WWW:14}{43}
\bibcite{Debattista:CoRR:14}{44}
\bibcite{Delbru:ESWC:10}{45}
\bibcite{Ding:CIKM:04}{46}
\bibcite{Ernesto:RecSys:12}{47}
\bibcite{Bakshy:WWW:12}{48}
\bibcite{Fetahu:ESWC:14}{49}
\bibcite{Finin:AAAI:09}{50}
\bibcite{Flemming:Thesis:10}{51}
\bibcite{Flouris:EvoDyn:12}{52}
\bibcite{Forchhammer:PROFILES:14}{53}
\bibcite{Frischmuth:ISWC:13}{54}
\bibcite{Frischmuth:SemWebJorunal:12}{55}
\bibcite{Frosterus:Springer:11}{56}
\bibcite{Frosterus:ESWC:11}{57}
\bibcite{Furber:ECIS:11}{58}
\bibcite{W3C:OWL:12}{59}
\bibcite{Gruber:KA:93}{60}
\bibcite{Gueret:ESWC:12}{61}
\bibcite{Deloitte:Report:12}{62}
\bibcite{Harpring:Getty:10}{63}
\bibcite{Harth:WWW:10}{64}
\bibcite{Harth:ISWC:09}{65}
\bibcite{Hartig:ISWC:09}{66}
\bibcite{Haslhofer:IWS:09}{67}
\bibcite{Hassanzadeh:WWW:11}{68}
\bibcite{Hausenblas:ESWC:09}{69}
\bibcite{Hogan:SSKB:06}{70}
\bibcite{Hogan:LDOW:10}{71}
\bibcite{Hogan:WebSemJorunal:12}{72}
\bibcite{Iannella:W3C:14}{73}
\bibcite{Halo:TechReport:13}{74}
\bibcite{Isaac:W3C:09}{75}
\bibcite{Isele:ISWC:10}{76}
\bibcite{Cantador:EC-WEB:11}{77}
\bibcite{Prateek:Misc:13}{78}
\bibcite{Jentzsch:ISWC:14}{79}
\bibcite{Kaafer:ESWC:13}{80}
\bibcite{Kahn:ACM:02}{81}
\bibcite{Maria:KEOD:13}{82}
\bibcite{Khatchadourian:ESWC:10}{83}
\bibcite{Kimball:DWL:98}{84}
\bibcite{Kleinberg:ACM:99}{85}
\bibcite{Konrath:WebSemJorunal:12}{86}
\bibcite{Kontokostas:WWW:14}{87}
\bibcite{Kontokostas:KESW:13}{88}
\bibcite{Kovacs:GTOS:00}{89}
\bibcite{Kowalski:RoyalStat:72}{90}
\bibcite{Lalithsena:WI:13}{91}
\bibcite{Lanegger:DEXA:09}{92}
\bibcite{Lassila:RDF:99}{93}
\bibcite{LaValle:MIT:11}{94}
\bibcite{Lebo:W3C:13}{95}
\bibcite{Lehmann:MLResearch:09}{96}
\bibcite{Lenzerini:SIGMOD:02}{97}
\bibcite{Lenzerini:DIT:02}{98}
\bibcite{Leskovec:KDD:06}{99}
\bibcite{Li:WISM:12}{100}
\bibcite{Limaye:VLDB:10}{101}
\bibcite{Loscio:DUV:15}{102}
\bibcite{Juran:McGraw:99}{103}
\bibcite{Erickson:DCV:14}{104}
\bibcite{Mader:TBDL:12}{105}
\bibcite{Makela:ESWC:14}{106}
\bibcite{Manyika:Report:13}{107}
\bibcite{Marie:ICS:13}{108}
\bibcite{Mendes:EDBT:12}{109}
\bibcite{Mendes:ICS:11}{110}
\bibcite{Mihindukulasooriya:COLD:13}{111}
\bibcite{Mika:book:07}{112}
\bibcite{Miles:W3C:09}{113}
\bibcite{Miller:IEEE:03}{114}
\bibcite{Nikolov:JIST:11}{115}
\bibcite{DiNoia:iSemantics:12}{116}
\bibcite{Page:TechReport:98}{117}
\bibcite{Peukert:ICDE:11}{118}
\bibcite{Peukert:ICDE:12}{119}
\bibcite{Archer:W3C:13}{120}
\bibcite{Pietriga:ISWC:06}{121}
\bibcite{Porter:NewRiders:08}{122}
\bibcite{PovedaVillalon:EKAW:12}{123}
\bibcite{Preotiuc-Pietro:ICWSM:12}{124}
\bibcite{NISO:TechReport:04}{125}
\bibcite{Prud:SPARQL:08}{126}
\bibcite{Reynolds:W3C:14}{127}
\bibcite{Ruckhaus:ESWC:14}{128}
\bibcite{Rud:Wiley:09}{129}
\bibcite{Schmachtenberg:ISWC:14}{130}
\bibcite{Cambridge:RDF-101:13}{131}
\bibcite{Sirin:OWLED:08}{132}
\bibcite{Dagobert:DL:02}{133}
\bibcite{Steiner:IKEC:12}{134}
\bibcite{conf/wise/StracciaT05}{135}
\bibcite{Suchanek::WWW:07}{136}
\bibcite{Suominen:IKEM:12}{137}
\bibcite{Suominen:DataSemantics:13}{138}
\bibcite{Syed:WebSci:10}{139}
\bibcite{Tao:HICSS:09}{140}
\bibcite{Toupikov:LDOW:09}{141}
\bibcite{Tummarello:WebSemJorunal:10}{142}
\bibcite{Tummarello:ISWC:07}{143}
\bibcite{Usbeck:WWW:15}{144}
\bibcite{Zanardi:RecSys:08}{145}
\bibcite{Verlic:iSemantics:12}{146}
\bibcite{Graham:TechReport:11}{147}
\bibcite{Wache:IJCAI:01}{148}
\bibcite{Wang:WWW:03}{149}
\bibcite{Wang:MIS:96}{150}
\bibcite{Zaveri:SemWebJorunal:12}{151}
\BKM@entry{id=170,dest={636861707465722A2E3637},srcline={141}}{417070656E646978}
\@writefile{toc}{\contentsline {part}{Appendix}{171}{chapter*.67}}
\newlabel{part:appendix}{{10.8.4}{171}{Int\'{e}gration des Donn\'{e}es d'entreprises}{chapter*.67}{}}
\@input{appendix/appendix_D.aux}
\BKM@entry{id=171,dest={617070656E6469782E41},srcline={1}}{496E7374616C6C6174696F6E20616E64204375746F6D697A6174696F6E20496E737472756374696F6E73}
\BKM@entry{id=172,dest={73656374696F6E2E412E31},srcline={4}}{496E7374616C6C6174696F6E20616E64206375746F6D697A6174696F6E20696E737472756374696F6E7320666F7220526F6F6D6261}
\BKM@entry{id=173,dest={73656374696F6E2E412E32},srcline={24}}{437573746F6D697A696E6720526F6F6D6261}
\BKM@entry{id=174,dest={73756273656374696F6E2E412E322E31},srcline={39}}{4C6F63616C697A6174696F6E}
\BKM@entry{id=175,dest={73656374696F6E2E412E33},srcline={46}}{496E7374616C6C6174696F6E20616E64206375746F6D697A6174696F6E20696E737472756374696F6E7320666F72204B6E6F776C656467652047726170682053637261706572}
\BKM@entry{id=176,dest={73756273656374696F6E2E412E332E31},srcline={73}}{437573746F6D697A6174696F6E}
\@input{appendix/appendix_E.aux}
\BKM@entry{id=177,dest={617070656E6469782E42},srcline={1}}{526F6F6D626120526573756C7473}
\BKM@entry{id=178,dest={73656374696F6E2E422E31},srcline={4}}{526F6F6D62612070726F66696C696E67207265706F727420666F7220746865204C4F4420436C6F7564}
\BKM@entry{id=179,dest={73656374696F6E2E422E32},srcline={10}}{526F6F6D6261207175616C6974792070726F66696C696E67207265706F727420666F7220746865204C4F4420436C6F7564}
\@input{appendix/appendix_B.aux}
\BKM@entry{id=180,dest={617070656E6469782E43},srcline={1}}{444270656469612052616E6B65642050726F7065727469657320696E20467265736E656C20566F636162756C617279}
\@input{appendix/appendix_F.aux}
\BKM@entry{id=181,dest={617070656E6469782E44},srcline={1}}{5341502048414E412053656D616E74696320536572766963657320415049}
\BKM@entry{id=182,dest={73656374696F6E2E442E31},srcline={3}}{58534A532041504920496D706C656D656E746174696F6E}
\BKM@entry{id=183,dest={73656374696F6E2E442E32},srcline={84}}{41504920446F63756D656E746174696F6E}
\BKM@entry{id=184,dest={73756273656374696F6E2E442E322E31},srcline={86}}{456E7469747920456E726963686D656E74}
\BKM@entry{id=185,dest={73756273656374696F6E2E442E322E32},srcline={101}}{456E7469747920446973616D626967756174696F6E205C28646973616D626967756174652E78736A735C29}
\BKM@entry{id=186,dest={73756273656374696F6E2E442E322E33},srcline={110}}{536368656D61204D61746368696E67205C286D617463685461626C65732E78736A735C29}
\@input{appendix/appendix_C.aux}
\BKM@entry{id=187,dest={617070656E6469782E45},srcline={1}}{536F7572636520436F646520666F72204D617070696E6773}
\BKM@entry{id=188,dest={73656374696F6E2E452E31},srcline={4}}{4F70656E204C6963656E736573204D617070696E6773}
\BKM@entry{id=189,dest={73656374696F6E2E452E32},srcline={10}}{53656D616E74696320536F6369616C204E657773204167677265676174696F6E204D617070696E6773}
\global\mtcsecondpartfalse
\@writefile{@@@}{\chapterbegin }
|
http://sectioneurosens.free.fr/docs/premiere/s02e07.tex
|
free.fr
|
CC-MAIN-2019-30
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2019-30/segments/1563195529175.83/warc/CC-MAIN-20190723085031-20190723111031-00089.warc.gz
| 133,890,321
| 2,658
|
\documentclass[a4paper,10pt]{article}
\usepackage[Mickael]{ammaths}
\usepackage{alterqcm}
\begin{document}
\entete{European section, season 2}{Test \#1}{Monday, october the 16th, 2009}
\begin{center}
\begin{minipage}{12cm}
{\sf Some items of this test are multiple choice questions. A good answer earns 2 points and any wrong answer costs 1 point, a missing answer earns or costs nothing. Other items are free response questions, all of them worth 4 points, where any incomplete or imperfect answer will be rewarded.}
\end{minipage}
\end{center}
\medskip
\begin{center}
\begin{tabularx}{16cm}{XcX}
{\cellcolor{lightgray}} & {\cellcolor{lightgray}}\bfseries\sffamily Section 1 -- Syllogisms & {\cellcolor{lightgray}}\\
\end{tabularx}
\end{center}
\begin{alterqcm}[tone=\sf QUESTIONS,ttwo=\sf ANSWERS,symb=\dingsquare,corsymb=\dingchecksquare]
\AQquestion{Is the following syllogism valid, true, neither of both ?
\begin{quote}No horses are blue.\\ Some birds are blue.\\ No birds are horses.\end{quote}}{%
{True},
{Valid},
{Neither},
{Both} }
\AQquestion{Is the following syllogism valid, true, neither of both ?
\begin{quote}Driving a big car uses a lot of gas.\\ Using a lot of gas is expensive.\\ Driving a big car is expensive.\end{quote}}{%
{True},
{Valid},
{Neither},
{Both} }
\AQquestion{What is the middle term in the following syllogism ?
\begin{quote}All sunny days are great.\\ Some mondays are sunny days.\\ Some Mondays are great.\end{quote}}{%
{Sunny days},
{Great},
{Mondays},
{Are} }
\AQquestion{What is the total number of valid types of syllogisms.}{%
{256},
{19},
{4},
{42} }
\AQquestion{The letter A stands for}{%
{Universal affirmative.},
{Universal negative.},
{Particular affirmative.},
{Particular negative.} }
\end{alterqcm}
\begin{enumerate}\setcounter{enumi}{5}
\item Write a ``Barbara'' syllogism of your own invention.
\begin{center}
\begin{tabular}{p{10cm}}
\ \\[10pt] \hline
\ \\[10pt] \hline
\ \\[10pt] \hline
\end{tabular}
\end{center}
\end{enumerate}
\pagebreak
\begin{center}
\begin{tabularx}{16cm}{XcX}
{\cellcolor{lightgray}} & {\cellcolor{lightgray}}\bfseries\sffamily Section 2 -- Formal logic and equivalences & {\cellcolor{lightgray}}\\
\end{tabularx}
\end{center}
\begin{enumerate}
\item Match each logical operator to the right truth table.
\begin{center}
\begin{tabular}{cccccc}
& $p\wedge q$ & $p\vee q$ & $p\rightarrow q$ & $p\leftrightarrow q$ & \\
& \ding{114} & \ding{114} & \ding{114} & \ding{114} & \\[20pt]
\ding{114} & \ding{114} & \ding{114} & \ding{114} & \ding{114} & \ding{114} \\
$\begin{array}{c|c|c}
p & q & \\ \hline
0 & 0 & 1\\
0 & 1 & 0\\
1 & 0 & 0\\
1 & 1 & 1\\
\end{array}$ & $\begin{array}{c|c|c}
p & q & \\ \hline
0 & 0 & 1\\
0 & 1 & 0\\
1 & 0 & 1\\
1 & 1 & 1\\
\end{array}$ & $\begin{array}{c|c|c}
p & q & \\ \hline
0 & 0 & 0\\
0 & 1 & 1\\
1 & 0 & 1\\
1 & 1 & 1\\
\end{array}$ & $\begin{array}{c|c|c}
p & q & \\ \hline
0 & 0 & 0\\
0 & 1 & 0\\
1 & 0 & 0\\
1 & 1 & 1\\
\end{array}$ & $\begin{array}{c|c|c}
p & q & \\ \hline
0 & 0 & 1\\
0 & 1 & 1\\
1 & 0 & 0\\
1 & 1 & 1\\
\end{array}$ & $\begin{array}{c|c|c}
p & q & \\ \hline
0 & 0 & 0\\
0 & 1 & 0\\
1 & 0 & 1\\
1 & 1 & 1\\
\end{array}$ \\
\end{tabular}
\end{center}
\end{enumerate}
\bigskip
\begin{alterqcm}[tone=\sf QUESTIONS,ttwo=\sf ANSWERS,symb=\dingsquare,corsymb=\dingchecksquare,numbreak=1]
\AQquestion{The proposition $p\rightarrow q$ is formally equivalent to}{%
{$q\rightarrow p$},
{$\neg q\rightarrow \neg p$},
{$\neg p\rightarrow \neg q$},
{$p\leftrightarrow q$} }
\AQquestion{The proposition $\neg(p\vee q)$ is formally equivalent to}{%
{$p\wedge q$},
{$\neg p\wedge \neg q$},
{$\neg p\vee \neg q$},
{$p\vee q$} }
\AQquestion{The proposition $\neg(p\wedge q)$ is formally equivalent to}{%
{$p\wedge q$},
{$\neg p\wedge \neg q$},
{$\neg p\vee \neg q$},
{$p\vee q$} }
\AQquestion{The proposition $p\leftrightarrow q$ is formally equivalent to}{%
{$(p\rightarrow q)\wedge (q\rightarrow p)$},
{$(p\rightarrow q)\vee (q\rightarrow p)$},
{$(p\rightarrow q)\wedge (p\rightarrow \neg q)$},
{$(p\rightarrow q)\vee (p\rightarrow \neg q)$} }
\end{alterqcm}
\begin{enumerate}\setcounter{enumi}{5}
\item Prove, by building their truth tables, that the following propositions are formally equivalent.
$$\neg(r\rightarrow p\vee q)\textrm{ and }\neg p\wedge\neg q\wedge r.$$
\end{enumerate}
\fbox{\parbox{15.7cm}{\ \vspace{6cm}}}
\pagebreak
\begin{center}
\begin{tabularx}{16cm}{XcX}
{\cellcolor{lightgray}} & {\cellcolor{lightgray}}\bfseries\sffamily Section 3 -- Venn diagrams & {\cellcolor{lightgray}}\\
\end{tabularx}
\end{center}
\begin{multicols}{2}
\begin{enumerate}
\item Draw a Venn diagram with two sets $A$ and $B$ such that $x\in A\rightarrow x\in B$.
\end{enumerate}
\fbox{\parbox{7.5cm}{\ \vspace{4cm}}}
\begin{enumerate}\setcounter{enumi}{1}
\item Draw a Venn diagram with three sets $A$, $B$ and $C$ such that $A\subset B$ and $C\subset\bar{B}$.
\end{enumerate}
\fbox{\parbox{7.5cm}{\ \vspace{4cm}}}
\end{multicols}
{\sf The following multiple choice questions are all about the configuration you represented in the question 2.}
\begin{alterqcm}[tone=\sf QUESTIONS,ttwo=\sf ANSWERS,symb=\dingsquare,corsymb=\dingchecksquare,numbreak=2]
\AQquestion{The intersection $A\cap B$ is equal to}{%
{$\varnothing$},
{$A$},
{$B$},
{Neither of these sets.} }
\AQquestion{The intersection $A\cap C$ is equal to}{%
{$\varnothing$},
{$A$},
{$B$},
{Neither of these sets.} }
\AQquestion{The intersection $B\cap C$ is equal to}{%
{$\varnothing$},
{$A$},
{$B$},
{Neither of these sets.} }
\AQquestion{Is the equality $A\cup B=A$ true of false in this situation ?}{%
{True},
{False},
{It's impossible to say} }
\AQquestion{Is the equality $A\cup B=B$ true of false in this situation ?}{%
{True},
{False},
{It's impossible to say} }
\AQquestion{Is the inclusion $A\cup C\subset B$ true of false in this situation ?}{%
{True},
{False},
{It's impossible to say} }
\AQquestion{Is the equality $B\cup C=\Omega$ true of false in this situation ?}{%
{True},
{False},
{It's impossible to say} }
\AQquestion{Is the equality $B\cup \bar{A}=\Omega$ true of false in this situation ?}{%
{True},
{False},
{It's impossible to say} }
\end{alterqcm}
\pagebreak
\begin{center}
\begin{tabularx}{16cm}{XcX}
{\cellcolor{lightgray}} & {\cellcolor{lightgray}}\bfseries\sffamily Section 4 -- Set-builder notation & {\cellcolor{lightgray}}\\
\end{tabularx}
\end{center}
\begin{enumerate}
\item Match each set definition with the right partial list of elements.
\begin{center}
\begin{tabular}{cccc}
$\{n^2 : n\in\N\cap[2,7]\}$ & $\{x\in\R : x^2=2x\}$ & $\{3k+1 : k\in\Z\}$ & $\{n : n\in\Z\wedge \dis\frac{15}{n}\in\Z\}$\\
\ding{114} & \ding{114} & \ding{114} & \ding{114} \\[20pt]
\ding{114} & \ding{114} & \ding{114} & \ding{114} \\
$2$, $0$ & $16$, $37$, $10$ & $16$, $36$, $9$ & $1$, $3$, $15$\\
\end{tabular}
\end{center}
\end{enumerate}
\begin{alterqcm}[tone=\sf QUESTIONS,ttwo=\sf ANSWERS,symb=\dingsquare,corsymb=\dingchecksquare,numbreak=1]
\AQquestion{Which one of the following sets is empty ?}{%
{$\{n\in\N : n^2=4\}$},
{$\{n\in\N : n^2=5\}$},
{$\{n\in\R : n^2=4\}$},
{$\{n\in\R : n^2=5\}$} }
\AQquestion{The notation $\R^+$ denotes what set ?}{%
{$\N$},
{$]0;+\infty[$},
{$[0;+\infty[$},
{$\Q^+$} }
\AQquestion{The natural numbers are the elements of what set ?}{%
{$\N$},
{$\N^\star$},
{$\Z$},
{$\Z^\star$} }
\AQquestion{Only one of the following statements is true. Which one ?}{%
{$\forall x\in\R$, $x^2=5$},
{$\forall x\in\Z$, $x^2=5$},
{$\exists x\in\R$, $x^2=5$},
{$\exists x\in\Z$, $x^2=5$} }
\end{alterqcm}
\begin{enumerate}\setcounter{enumi}{5}
\item Explain in a few words Russell's paradox.
\end{enumerate}
\fbox{\parbox{15.8cm}{\ \vspace{7cm}}}
\end{document}
|
https://www.mathematik.tu-dortmund.de/lsiii/cms/bibtex/53631320.tex
|
tu-dortmund.de
|
CC-MAIN-2021-21
|
application/x-tex
|
application/x-bibtex-text-file
|
crawl-data/CC-MAIN-2021-21/segments/1620243988923.22/warc/CC-MAIN-20210508181551-20210508211551-00271.warc.gz
| 915,842,811
| 810
|
@TECHREPORT{Kuzmin2018a,
author = {Kuzmin, D.},
title = {Algebraic limiting techniques and hp--adaptivity for continuous finite element discretizations},
year = {2018},
month = sep,
institution = {Fakult\"{a}t f\"{u}r Mathematik, TU Dortmund},
note = {Ergebnisberichte des Instituts f\"{u}r Angewandte Mathematik, Nummer 591},
}
|
https://trac.ct2.cryptool.org/export/HEAD/trunk/Documentation/PluginHowTo/frontpage.tex
|
cryptool.org
|
CC-MAIN-2022-05
|
text/x-latex
|
application/x-tex
|
crawl-data/CC-MAIN-2022-05/segments/1642320304883.8/warc/CC-MAIN-20220129092458-20220129122458-00214.warc.gz
| 626,117,297
| 1,353
|
\makeatletter
\def\maketitle{%
\null
\thispagestyle{empty}%
\vfill
\begin{figure} [ht]
\centering
\includegraphics[height=4cm]{figures/ct_logo}
\end{figure}
\vskip 1cm
\begin{center}\leavevmode
\normalfont
{\huge CrypTool 2}
\vskip 1.3cm
{\bf \fontsize{38}{40}\selectfont \@title\par}%
\vskip 0.5cm
{\Large -- \@subtitle\ --\par}%
\vskip 4cm
{\Large \@author\par}%
{\large\it \@email\par}%
\vskip 4cm
{\Large Version: \@version\par}%
{\Large \@date\par}%
\end{center}%
\vfill
\null
\cleardoublepage
}
\def\date#1{\def\@date{#1}}
\def\author#1{\def\@author{#1}}
\def\title#1{\def\@title{#1}}
\def\subtitle#1{\def\@subtitle{#1}}
\def\version#1{\def\@version{#1}}
\def\email#1{\def\@email{#1}}
\makeatother
|
http://cr.yp.to/bib/1981/even.tex
|
yp.to
|
CC-MAIN-2023-14
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2023-14/segments/1679296943562.70/warc/CC-MAIN-20230320211022-20230321001022-00482.warc.gz
| 14,069,178
| 674
|
\bib{1981/even}
\yr 1981
\editor Shimon Even
\editor Oded Kariv
\book Automata, langauges and programming
\series Lecture Notes in Computer Science
\seriesvol 115
\publ Springer-Verlag
\publaddr Berlin
\endref
|
https://wiki.horde.org/KlutzComicsConfiguration?actionID=export&format=tex
|
horde.org
|
CC-MAIN-2021-04
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-04/segments/1610703506832.21/warc/CC-MAIN-20210116165621-20210116195621-00775.warc.gz
| 643,983,889
| 3,276
|
\documentclass{article}
\usepackage{ulem}
\pagestyle{headings}
\begin{document}
\part{Adding Comics to Klutz}
\section{Background}
Klutz was originally designed to fetch on-line comic strips to one place I could read them. It's original version was written back when I had a 14.4kbps modem and preferred to get all my comics on one page and walk away for a while to let it load. I grabbed a whopping five strips each day. Even then I had a few things that kept throwing me off, so when I decided to rewrite it as a Horde module, not a Perl script, I added quite a few features that make it more flexible. Though I haven't tried yet, I'm reasonably certain it could be used to fetch the latest photo on a friend's blog (though currently limited to one per day), and with a few minor tweaks it could be used to grab other media types as well.
But enough rambling, let's get to some configuration.
\section{klutz/config/comics.php}
When you first install Klutz you are required to copy the comics.php.dist configuration file to comics.php (under the klutz/config folder). This file is a PHP file that defines an array holding a list of comics and all their settings. Standard PHP syntax applies. The default file has dozens of comics for samples and each configuration can grow to be insanely complex. So far the only comics I've found that Klutz won't handle are made up of multiple images.
\subsection{Basic Syntax}
Each comic definition is made up of a few simple building blocks. A sample might look like:
\begin{verbatim}
'doonesbury' => array(
'name' => 'Doonesbury',
'author' => 'Gary Trudeau',
'homepage' => 'http://www.doonesbury.com/',
'method' => 'direct',
'url' => 'http://images.ucomics.com/comics/db/{%Y}/db{%y%m%d}.gif',
'days' => array('mon', 'thu'),
'enabled' => true
),
\end{verbatim}
Because the overall layout of the file is a giant array declaration, each comic defines an element in an array. The first line:\newline
\begin{verbatim}
'doonesbury' => array(
\end{verbatim}
states that we're creating a new comic definition for key "doonesbury". The key will be used in two ways: (1) to internally identify the comic, and (2) to name the files when running in caching mode. That means it needs to be unique and follow all filename constraints of PHP and your operating system.
The next three settings are mandatory but are purely annotation, and fairly self-explanatory.
\begin{itemize}
\item{\texttt{name} sets the display name for the comic.}
\item{\texttt{author} displays the author name.}
\item{\texttt{homepage} is the home page for the comic. I usually recommend this be the comic's main page, not a link to "today's strip" pages, unless they're the same. If you click on the title of the comic on a display page it will automatically take you to the site.}
\end{itemize}
The next setting, \texttt{method}, sets which method should be used for fetching the comic, and will determine other options that are needed. The current modes are:
\begin{itemize}
\item{\texttt{direct} - The URL will have any substitutions done, and the result of that should be a direct URL to the image.}
\item{\texttt{search} - Fetch the URL then search for the text matched by the regular expression. The first capture group is assumed to be the next URL to fetch. The last one should be the URL for the actual image.}
\item{\texttt{bysize} - Try to make a best guess at which image on a page is the comic based on the size of the image (after some filters are applied).}
\end{itemize}
The \texttt{url} setting is the first page that the library will use to start the fetch cycle. For \texttt{direct} this is the image itself; otherwise it's just the start of the page and what's found mixed with other settings will direct things from there.
The \texttt{days} setting is to specify the page apparition frequency. Available options are:
\begin{itemize}
\item{\texttt{array('mon', 'thu')} - It will make the comic entry appear only on the specified days.}
\item{\texttt{random} - It will make the comic only appear on the date where there was an fetched images file.}
\end{itemize}
Finally, for this simplified example, \texttt{enabled} is set to true. Rather than having to comment out large chunks of comics.php, we have a setting for each comic that will set it to disabled which will not fetch or display the comic. It's also handy to allow us to keep older comics around without them showing up in the user interface.
\subsection{URL Example}
Here is a "date" example in witch the image name is related to the date it has appeared.
\begin{verbatim}
'url' => 'http://images.ucomics.com/comics/db/{%Y}/db{%y%m%d}.gif',
\end{verbatim}
If, for example you fetch the comic on the June 24th of 2009, the \texttt{\{\%y\%m\%d\}} would be replace by \texttt{090624} , the \texttt{\{\%Y\}} would give \texttt{2009} to finally have a working url: \newline
\begin{verbatim}
http://http://images.ucomics.com/comics/db/2009/db090624.gif
\end{verbatim}
Some web comic use a incrementing number for they're file name like in this example:
\begin{verbatim}
'lfg' => array(
'name' => 'Looking for Group',
'author' => 'Ryan Sohmer and Lar deSouza',
'method' => 'direct',
'url' => 'http://archive.lfgcomic.com/lfg{i}.gif',
'icount' => 263,
'idate' => 'June 22, 2009',
'iformat' => '%04d',
'itype' => 'ref',
'days' => array('mon', 'thu'),
'homepage' => 'http://lfgcomic.com/',
'enabled' => true
),
\end{verbatim}
The \texttt{url} setting is now using a variable directly manageable by those others settings \texttt{icount, idate and iformat}. It will increment (or decrement) at each day given in the \texttt{days} setting.
\begin{itemize}
\item{\texttt{icount} - Is the initial value from where it start incrementing or decrementing.}
\item{\texttt{idate} - Is the initial date from witch it start incrementing or decrementing.}
\item{\texttt{iformat} - Is the number of characters to keep in the variable, for this example 4, then : \texttt{0263} .}
\end{itemize}
\end{document}
|
http://ljk.imag.fr/Seminars/seminaires-ljk-probabilites_-_statistique_en.tex
|
imag.fr
|
CC-MAIN-2018-51
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2018-51/segments/1544376823445.39/warc/CC-MAIN-20181210212544-20181210234044-00601.warc.gz
| 169,944,913
| 23,098
|
\subsection{Seminars of LJK-Probability & Statistics}
\vspace{0.5cm}{\Large 2019}
\begin{itemize}
\item Jeudi 4 Avril Mr Dmitry BELYAEV
\item Jeudi 28 Mars Mr Jean-Fran\c cois LE GALL
\item Jeudi 21 Mars Mr Johannes SÖDING (Max Planck Institute)
\item Jeudi 7 Mars Mr Bertrand MICHEL
\item Jeudi 14 F\'evrier Mme Emilie LEBARBIER (AgroParisTech)
\item Jeudi 31 Janvier Mr Yoann BLANGERO (LBBE/HCL Lyon)
M\'ethode bay\'esienne pour estimer le seuil optimal d'un marqueur utilis\'e pour choisir le traitement des patients
\item Jeudi 24 Janvier Mr R\'emi RHODES (Universit\'e d'Aix-Marseille)
Introduction \`a la th\'eorie quantique de Liouville
\item Jeudi 10 Janvier Mr Julien STOEHR (Universit\'e Paris-Dauphine)
\end{itemize}
\vspace{0.5cm}{\Large 2018}
\begin{itemize}
\item Jeudi 13 D\'ecembre Mr Mads Bonde RAAD (University of Copenhagen)
\item Jeudi 6 D\'ecembre Mr Sergi PUJADES ROCAMORA
\item Jeudi 29 Novembre DATA DÉPARTEMENT (LJK - UGA)
\item Jeudi 22 Novembre Mr Clovis GALIEZ (LJK - UGA)
\item Jeudi 15 Novembre Mr Antoine USSEGLIO-CARLEVE (Inria Grenoble Rh\^one-Alpes)
Estimation de mesures de risque pour des distributions elliptiques conditionn\'ees
\item Jeudi 25 Octobre Mr Vincent BEFFARA (CNRS/IF)
Colloquium pour introduire le th\`eme du s\'eminaire commun
\item Jeudi 18 Octobre D\'epartement DATA
R\'eunion de rentr\'ee
\item Jeudi 11 Octobre Mr Gilles PAGÈS (LPMA)
Quantification optimale, gloutonne, robuste et fonctionnelle
\item Jeudi 4 Octobre Mme Irene TUBIKANEC (Institute for Stochastics, Johannes Kepler University Linz)
\item Jeudi 27 Septembre Mr Paul BASTIDE (KU Leuven)
D\'etection de ruptures sur arbre pour l'inf\'erence de sc\'enarios \'evolutifs \`a partir de l'observation d'esp\`eces actuelles
\item Jeudi 27 Septembre Mr Vincent BRAULT (LJK - UGA)
Mini cours
\item Jeudi 20 Septembre Mr Olivier ZHAM (LJK / AIRSEA)
\item Jeudi 21 Juin Mme Corinne BERZIN (LJK (UGA))
Vers un test de lin\'earit\'e de la variance d'une diffusion fractionnaire
\item Jeudi 14 Juin Mme Antoniano-Villalobos ISADORA (Bocconi University, Milan, Italy)
\item Jeudi 7 Juin Mr Franck IUTZELER (LJK (UGA))
\item Jeudi 24 Mai Mr Vincent BRAULT (LJK - UGA)
Suejt surprise
\item Jeudi 17 Mai Mme Sophie DONNET (UMR518 AgroParisTech/INRA)
Inf\'erence de donn\'ees de r\'eseaux multipartites par mod\`eles \`a blocs latents et stochastiques. Application en \'ecologie et ethnobiologie.
\item Jeudi 3 Mai Mr Ghislain DURIF (LJK - G\'eom\'etrie-Images (INRIA))
\item Jeudi 19 Avril Mr Antoine GODICHON-BAGGIONI (INSA de Rouen)
Algorithmes stochastiques pour la statistique robuste en grande dimension
\item Jeudi 12 Avril Mme Patricia BOURET (Universit\'e de Nice Sophia-Antipolis)
R\'eseaux neuronaux et connectivit\'e fonctionnelle
\item Jeudi 5 Avril Mr Hugo RAGUET
\item Jeudi 29 Mars Mr Justin SALEZ (LPMA - Paris Diderot)
Temps de m\'elange et ph\'enom\`ene de cutoff pour la marche al\'eatoire sur des grands graphes al\'eatoires
\item Jeudi 22 Mars Mr Paul-Marie GROLLEMUND (Montpellier)
R\'egression lin\'eaire bay\'esienne sur donn\'ees fonctionnelles
\item Jeudi 15 Mars Mr Edsel A. PEÑA (University of South Carolina)
\item Jeudi 8 Mars Mr Laurent MENARD (Paris Ouest Nanterre La D\'efense)
\`a la recherche de longs chemins simples dans les graphes d'Erdös R\'enyi
\item Jeudi 1 Mars Mr Riccardo CORRADIN (University of Milano-Bicocca, Department of Statistics and Quantitative Methods & Trinity College of Dublin, School of computer Science and Statistics)
\item Jeudi 15 F\'evrier Mr Paul DOUKHAN (Universit\'e Cergy-Pontoise)
\item Jeudi 8 F\'evrier Mr Éric MARCHAND (Universit\'e de Sherbrooke)
Estimation par densit\'es pr\'edictives : r\'esultats r\'ecents
\item Jeudi 25 Janvier Mme Anna BONNET (Universit\'e Lyon 1)
\item Jeudi 18 Janvier Mme Adeline LECLERCQ SAMSON (LJK (UGA))
Estimation dans les mod\`eles stochastiques neuronaux
\item Jeudi 11 Janvier Mr Nicolas BROUTIN (LPMA (Paris 6))
Limites d'\'echelles des graphes inhomog\`enes
\end{itemize}
\vspace{0.5cm}{\Large 2017}
\begin{itemize}
\item Jeudi 21 D\'ecembre Mr Pierre LATOUCHE (Universit\'e Paris 1 Sorbonne)
\item Jeudi 14 D\'ecembre Mr Vincent AUDIGIER (CNAM)
\item Jeudi 7 D\'ecembre Mr Guillaume GARRIGOS (École Normale Sup\'erieure)
\item Jeudi 30 Novembre
1/2 journ\'ee des doctorants
\item Jeudi 23 Novembre Mr Walid HACHEM (DR CNRS au LIGM universit\'e Paris est Marne la vall\'ee)
\item Jeudi 16 Novembre Mme Anne ESTRADE (Laboratoire MAP5, Universit\'e Paris Descartes)
Test de normalit\'e bas\'e sur la caract\'eristique d'Euler des ensembles d'excursion
\item Jeudi 16 Novembre Mr Julien CHEVALLIER (LJK-IF)
Mini cours
\item Jeudi 19 Octobre Mme Myriam TAMI (LIG)
Approche EM pour mod\`eles multi-blocs \`a facteurs \`a une \'equation structurelle
\item Jeudi 12 Octobre BRAULT VINCENT¹, CHEVALLIER JULIEN¹ ² ET ROSSIGNOL RAPHAËL² (¹LJK et ²IF)
Colloquium pr\'eparant le s\'eminaire commun
\item Jeudi 5 Octobre Mme Mathilde DE GRANRUT (3SR/EDF)
Analyse et interpr\'etation statistique des mesures d'auscultation de pi\'ezom\'etrie \`a l'interface b\'eton-rocher d'un barrage vo\^ute
\item Jeudi 28 Septembre Mme Ester MARIUCCI (Humboldt-Universit\"at zu Berlin)
\item Jeudi 21 Septembre Mme Charlotte LACLAU (LIG)
\item Jeudi 29 Juin Stanislas MINSKER (USC (USA))
\item Jeudi 22 Juin Guillaume DEHAENE (EPFL)
\item Jeudi 15 Juin Anton BOVIER (Universit\'e de Bonn)
\item Jeudi 8 Juin R\'emi BARDENET (Universit\'e de Lille)
\item Jeudi 18 Mai Laurent DOYEN (Universit\'e de Grenoble)
Estimateurs semi-param\'etriques consistants pour des mod\`eles d'\'ev\'enements r\'ecurrents bas\'es sur la notion d'\^age virtuel
\item Jeudi 4 Mai Jonathan WEED (MIT, Department of Mathematics)
\item Jeudi 27 Avril Antoine CHANNAROND (Universit\'e de Rouen)
Mod\`ele de graphe al\'eatoire \`a positions latentes, et applications statistiques
\item Jeudi 13 Avril Viet Chi TRAN (Universit\'e de Lille)
(SEMINAIRE COMMUN LJK/IF:) Evolution de phylog\'enies avec interaction
\item Jeudi 6 Avril Émilie SORET (IRCICA-IEMN)
Équilibre, diffusion et acc\'el\'eration stochastique dans des gaz de Lorentz
\item Jeudi 30 Mars Lorick HUANG (Universit\'e du Michigan)
M\'ethode parametrix pour des EDS dirig\'ees par des processus stables et applications aux probabilit\'es num\'eriques
\item Jeudi 23 Mars Beno\^it HENRY (Universit\'e de Lorraine)
Approximation du spectre de fr\'equences all\'eliques d'un splitting tree avec mutations Poissoniennes neutres
\item Jeudi 9 Mars Jorge CLARKE (Universit\'e Paris Dauphine)
\item Jeudi 2 Mars Fran\c cois PORTIER (TELECOM ParisTech)
\item Jeudi 16 F\'evrier Vincent RIVOIRARD (Universit\'e Paris Dauphine)
(SEMINAIRE COMMUN LJK/IF:) Estimation du noyau de division d'une population structur\'ee par la taille
\item Jeudi 9 F\'evrier Nicolas LARTILLOT (Universit\'e de Lyon)
Mod\`eles bay\'esiens non-param\'etriques en phylog\'enie et en \'evolution mol\'eculaire
\item Jeudi 2 F\'evrier Anne AUGER (INRIA Saclay)
\item Jeudi 26 Janvier
EXPOSE ANNULE ET REPORTE au 27/04/1017
\item Jeudi 19 Janvier Paolo PIGATO (Universit\'e de Lorraine)
\item Jeudi 12 Janvier St\'ephane MENOZZI (Universit\'e d'Evry)
\item Jeudi 5 Janvier Ali HAJJ HASSAN (LJK / IPS)
D\'etection Multidimensionnelle au Test Param\'etrique avec Recherche Automatique des Causes
\end{itemize}
\vspace{0.5cm}{\Large 2016}
\begin{itemize}
\item Jeudi 15 D\'ecembre Nicolas CHAMPAGNAT (Institut Elie Cartan de Lorraine / Universit\'e de Lorraine)
(SEMINAIRE COMMUN LJK/IF:)Convergence exponentielle uniforme vers la distribution quasi-stationnaire de processus de Markov absorb\'es
\item Jeudi 8 D\'ecembre DEMI-JOURNÉE DES DOCTORANTS EN PROBABILITÉS ET STATISTIQUES
\item Jeudi 1 D\'ecembre Claire BOYER (Universit\'e Paris 6)
\item Jeudi 24 Novembre Olivier ZAHM (MIT)
R\'eduction de l'espace param\'etrique pour des probl\`emes d'inf\'erence bayesienne de grande dimension
\item Jeudi 17 Novembre Julyan ARBEL (LJK / Mistis)
\item Jeudi 10 Novembre Ahlame DOUZAL (Universit\'e de Grenoble (LIG))
\item Jeudi 20 Octobre Sylvie MELEARD (Ecole Polytechnique)
(SEMINAIRE COMMUN LJK/IF:) Dynamique stochastique pour l'adaptation et l'\'evolution de micro-organismes
\item Jeudi 6 Octobre Miguel MARTINEZ (Universit\'e Marne-la-Vall\'ee Paris-Est)
Rebondissement des mouvements browniens asym\'etriques
\item Jeudi 29 Septembre Martial MERMILLOD (Universit\'e de Grenoble)
Vers l'Exploration des Fondements Math\'ematiques de la Psych\'e
\item Jeudi 7 Juillet Gianfausto SALVADORI (Universita del Salento (IT))
\item Jeudi 30 Juin Cl\'ement MARTEAU (Universit\'e de Lyon 1)
\item Jeudi 23 Juin
Une approche statistique de l'analyse topologique des donn\'ees
\item Jeudi 16 Juin Jean-Michel BECU (LJK / Mistis)
Contr\^ole des fausses d\'ecouvertes lors de la s\'election de variables en grande dimension
\item Jeudi 9 Juin Fran\c cois LE GLAND (INRIA Rennes)
(SEMINAIRE COMMUN LJK/IF:) Marginalisation pour la simulation d'\'ev\`enements rares dans les mod\`eles de diffusion coupl\'es par un processus de sauts (Auditorium de l'IMAG)
\item Jeudi 26 Mai Gaspar MASSIOT (ENSAI)
Deux tests non param\'etriques pour les processus de Cox (A NOTER: S\'eminaire en amphi D de l'ENSIMAG)
\item Jeudi 12 Mai Edouard OLLIER (ENS Lyon)
\item Jeudi 28 Avril C\'eline DUVAL (Universit\'e Paris 5 - Descartes)
\item Jeudi 14 Avril M\'elina GALLOPIN (Universit\'e Paris Sud)
Inf\'erence de r\'eseaux pour les donn\'ees RNA-seq
\item Jeudi 7 Avril Sylvain LE CORFF (D\'epartement de Math\'ematiques de l'Universit\'e Paris Sud / CNRS)
Quelques r\'esultats d'identifiabilit\'e pour des mod\`eles de r\'egression non param\'etrique \`a donn\'ees cach\'ees
\item Jeudi 31 Mars M\'elisande ALBERT (Universit\'e de Grenoble)
Tests d'ind\'ependance par permutation, \'etude asymptotique et non-asymptotique, avec application en neurosciences
\item Jeudi 24 Mars Ir\`ene GANNAZ (INSA Lyon)
Etude multivari\'ee de s\'eries temporelles par ondelettes : estimation de la corr\'elation \`a long-terme et des propri\'et\'es de longue m\'emoire.
\item Jeudi 17 Mars Vincent BRAULT (AgroParisTech)
Une m\'ethode rapide de segmentation des lignes et des colonnes pour des matrices de grandes tailles
\item Jeudi 10 Mars Emilie DEVIJVER (Universit\'e Paris Sud)
Mod\`eles de m\'elanges en r\'egression
\item Jeudi 3 Mars Djalil CHAFAI (Universit\'e Paris Dauphine)
(SEMINAIRE COMMUN LJK/IF:) Au bord de syst\`emes de particules en interaction
\item Jeudi 18 F\'evrier Julien CHEVALLIER (Universit\'e de Nice / Laboratoire J.A. Dieudonn\'e)
EDP structur\'ee en \^age : une approche par processus ponctuels.
\item Jeudi 11 F\'evrier Anna DUDEK (Universite de Rennes 2)
\item Jeudi 4 F\'evrier Ad\'ela\"ide OLIVIER (Universit\'e Paris Dauphine)
Estimation du taux de division dans des mod\`eles de croissance-fragmentation
\item Jeudi 28 Janvier Mme Claire LACOUR (Universit\'e Paris Sud)
Estimation adaptative pour des mod\`eles de Markov cach\'es non-param\'etriques
\item Jeudi 21 Janvier Mr Adrien HARDY (Universit\'e de Lille)
(SEMINAIRE COMMUN LJK/IF:) TCL pour processus d\'eterminantaux et m\'ethodes de Monte Carlo
\item Jeudi 14 Janvier Mme Nino KORDZAKHIA (MacQuarie University, Sydney)
\item Jeudi 7 Janvier Mr Luc PRONZATO (Universit\'e Nice Sophia Antipolis)
\end{itemize}
\vspace{0.5cm}{\Large 2015}
\begin{itemize}
\item Jeudi 17 D\'ecembre
\item Jeudi 10 D\'ecembre Mme Emeline PERTHAME (INRIA Grenoble)
Stabilit\'e de la s\'election de variables pour la r\'egression et la classification de donn\'ees corr\'el\'ees en grande dimension
\item Jeudi 26 Novembre Hermine BIERMÉ (Universit\'e de Poitiers / LMA)
(SEMINAIRE COMMUN LJK/IF:)Simulation de champs gaussiens anisotropes
\item Jeudi 19 Novembre Mr Nicolas GOIX (T\'el\'ecom ParisTech)
\item Jeudi 12 Novembre Tony LELIEVRE (CERMICS / École des Ponts ParisTech)
\item Jeudi 5 Novembre Sophie DONNET (INRA / unit\'e MIA 518 / Agroparistech)
Stochastic Block model pour les r\'eseaux multiplex. Application \`a un r\'eseau de chercheurs
\item Jeudi 22 Octobre Abdelhakim NECIR (Mohamed Khider University of Biskra (Alg\'erie))
\item Jeudi 1 Octobre Mr Vianney PERCHET (Universit\'e Denis Diderot)
\item Jeudi 24 Septembre Mme Olga KLOPP (Universit\'e Paris Ouest)
Les in\'egalit\'es d'oracle pour les mod\`eles de r\'eseaux parcimonieux
\item Jeudi 17 Septembre Mme Loren COQUILLE (Universit\'e de Grenoble)
(SEMINAIRE COMMUN LJK/IF:) Une approche stochastique \`a la mod\'elisation de l'immunoth\'erapie contre le cancer
\item Jeudi 18 Juin Simone HERMANN (Technische Universit\"at Dortmund (Allemagne))
\item Jeudi 11 Juin Mr Jos\'e R. LEON (Universit\'e de Caracas (Venezuela))
Estimation non param\'etrique pour des diffusions hypoelliptiques
\item Jeudi 28 Mai Mr Laurent GARDES (Universit\'e de Strasbourg)
Estimation de quantiles extr\^emes pour des donn\'ees tronqu\'ees
\item Jeudi 21 Mai Mr Alexis ARNAUD (Universit\'e de Grenoble)
M\'elanges de lois de Student \`a Échelles Multiples : application \`a la caract\'erisation de tumeurs par IRM multiparam\'etrique
\item Jeudi 7 Mai Mr Pierre ETORÉ (Universit\'e de Grenoble)
Equations diff\'erentielles stochastiques unidimensionnelles inhomog\`enes en temps faisant intervenir le temps local du processus inconnu
\item Jeudi 30 Avril Nhu DANG (LJK / IPS)
\item Jeudi 23 Avril Mr St\'ephane CHRETIEN (Universit\'e de Franche-Comt\'e)
Reconstruction de tenseurs sym\'etriques de faible rang par optimisation convexe
\item Jeudi 9 Avril C\'ecile CHAUVEL (LJK / FIGAL)
Tests de comparaison de courbes de survie
\item Jeudi 26 Mars Pablo MESEJO SANTIAGO (LJK / Mistis)
\item Jeudi 19 Mars Samy TINDEL (Universit\'e de Lorraine)
Repr\'esentations de Feynman-Kac pour l'\'equation de la chaleur stochastique
\item Jeudi 12 Mars Nil VENET (Universit\'e de Toulouse)
Champs Browniens fractionnaires index\'es par des vari\'et\'es \`a au moins une g\'eod\'esique ferm\'ee
\item Jeudi 5 Mars Sylvain SARDY (Universit\'e de Gen\`eve / Section de math\'ematiques)
\item Jeudi 26 F\'evrier Karteek ALAHARI (Inria Grenoble, LJK / Lear)
\item Jeudi 12 F\'evrier Mr Souhil CHAKAR (Universit\'e de Grenoble)
\item Jeudi 5 F\'evrier Mr Omiros PAPASPILIOPOULOS (Universitat Pompeu Fabra, Barcelone)
\item Jeudi 29 Janvier Mr Gabriel PEYRE (Charg\'e de recherche, Universit\'e Paris Dauphine)
\item Jeudi 22 Janvier Mr Markus REISS (Humbolt-Universit\"at zu Berlin (Allemagne))
\item Jeudi 15 Janvier Pierre FERNIQUE (Inria Virtual Plants, Montpellier)
Un cadre de mod\'elisation statistique pour l'analyse de donn\'ees index\'ees par des arborescences
\end{itemize}
\vspace{0.5cm}{\Large 2014}
\begin{itemize}
\item Jeudi 18 D\'ecembre Matthias DE LOZZO (CEA Cadarache)
Mesures de d\'ependance pour l'analyse de sensibilit\'e et le criblage : application aux simulateurs num\'eriques
\item Jeudi 11 D\'ecembre Mr Christophe BISCIO (Universit\'e de Nantes)
Quantifier la r\'epulsion des processus ponctuels d\'eterminantaux
\item Vendredi 5 D\'ecembre Benoit LIQUET (School of Mathematics and Physics / The University of Queensland)
\item Jeudi 4 D\'ecembre 1/2 journ\'ee des doctorants du d\'epartement de probabilit\'es / statistique
\item Jeudi 20 Novembre Mr Nicolas CHAMPAGNAT (Universit\'e de Lorraine)
M\'ethode de Monte-Carlo et marche sur les sph\`eres pour l'\'equation de Poisson-Boltzmann lin\'eaire et non-lin\'eaire de la dynamique mol\'eculaire
\item Jeudi 23 Octobre Julien GREPAT (LJK / SAM)
Convergence des ensembles de sur-r\'eplication avec co\^uts de transaction \'evanescents.
\item Jeudi 16 Octobre Elena DI BERNARDINO (CNAM / IMATH / Laboratoire CEDRIC)
\item Jeudi 9 Octobre Jean-Marc FREYERMUTH (KU Leuven)
\item Jeudi 25 Septembre Mr Axel MUNK (Universit\'e de Goettingen (Allemagne))
\item Jeudi 18 Septembre Massih-Reza AMINI (Universit\'e Grenoble I / LIG / AMA)
\item Jeudi 26 Juin Mr Thierry KLEIN (Universit\'e Paul Sabatier Toulouse III)
Existence et unicit\'e de Barycentre dans l'espace de Wasserstein
\item Jeudi 12 Juin Mr Vladimir KOLTCHINSKII (GeorgiaTech, USA)
\item Jeudi 22 Mai ANNULE: Massih-Reza AMINI (Universit\'e Grenoble I / LIG / AMA)
\item Jeudi 15 Mai Paul ROCHET (Laboratoire de Math\'ematiques Jean Leray / Universit\'e de Nantes)
\item Jeudi 24 Avril Jean PEYHARDI (Universit\'e de Montpellier 2 / Inria Virtual Plants)
Une nouvelle sp\'ecification des mod\`eles lin\'eaires g\'en\'eralis\'es pour donn\'ees cat\'egorielles
\item Jeudi 17 Avril Jos\'e R. LEÓN (Universidad Central de Venezuela, Caracas)
A central limit theorem for the Euler characteristic of a Gaussian excursion set
\item Jeudi 10 Avril Ki\^en KIÊU (Unit\'e INRA MIA, Jouy-en-Josas)
Tessellations en T stochastiques : un mod\`ele compl\`etement al\'eatoire et ses variantes gibbsiennes
\item Jeudi 3 Avril Pierre MAHÉ (bioM\'erieux)
\item Jeudi 27 Mars Victor M. PANARETOS (Swiss Federal Institute of Technology (EPFL) / Institute of Mathematics)
\item Jeudi 13 Mars Bernard DELYON (Universit\'e Rennes 1)
Acc\'el\'eration de le convergence des moyennes empiriques: application \`a la r\'egression semi-param\'etrique.
\item Vendredi 28 F\'evrier Wenceslao GONZÁLEZ–MANTEIGA (Universit\'e de St Jacques de Compostelle)
\item Jeudi 27 F\'evrier Ahmed KEBAIER (Universit\'e Paris 13)
\item Jeudi 20 F\'evrier Charles-Elie RABIER (INRA Toulouse)
Processus Gaussiens et de Chi Deux pour la detection de g\`enes
\item Jeudi 13 F\'evrier J\'er\^ome DEDECKER (Universit\'e Paris Descartes)
Convergence faible de la fonction de r\'epartition empirique des it\'er\'ees d'une transformation intermittentes
\item Jeudi 6 F\'evrier Charlotte DION (LJK/MAP5)
Nouvelles strat\'egies d'estimation non param\'etrique dans des mod\`eles lin\'eaires mixtes \`a effets al\'eatoires
\item Jeudi 30 Janvier Farida ENIKEEVA (LJK / Mistis)
D\'etection de rupture en grande dimension avec parcimonie
\item Jeudi 23 Janvier Christophe GIRAUD (Universit\'e Paris Sud)
Estimation dans les mod\`eles graphiques
\item Jeudi 16 Janvier Yann GUÉDON (CIRAD, Équipe Inria Virtual Plants, Montpellier)
\item Jeudi 9 Janvier Fabienne COMTE (Universit\'e Paris Descartes / Laboratoire MAP5)
S\'election de mod\`ele pour des contrastes de r\'egression
\end{itemize}
\vspace{0.5cm}{\Large 2013}
\begin{itemize}
\item Jeudi 19 D\'ecembre Violaine LOUVET (Universit\'e Lyon 1)
Estimation de param\`etres via des mod\`eles non lin\'eaires \`a effets mixtes: application aux EDP
\item Jeudi 12 D\'ecembre Valentine GENON-CATALOT (Universit\'e Paris Descartes / Laboratoire MAP5)
\item Jeudi 5 D\'ecembre Thomas OPITZ (Universit\'e de Montpellier 2)
\item Jeudi 28 Novembre Eric MOULINES (TELECOM ParisTech)
Gradient proximal stochastique pour r\'egression al\'eatoire en grande dimension
\item Jeudi 21 Novembre Matthieu LERASLE (CNRS / Laboratoire J.A. Dieudonn\'e)
Tests par r\'e\'echantillonnage pour le probl\`eme de comparaison d’\'echantillons
\item Jeudi 14 Novembre Simon BARTHELMÉ (Universit\'e de Gen\`eve)
Mod\`eles log-additifs pour des cha\^ines de Markov: une extension s\'equentielle des processus ponctuels
\item Jeudi 24 Octobre Bahram HOUCHMANDZADEH (UJF, Laboratoire interdisciplinaire de Physique (LIPhy))
Évolution Darwinienne, g\'en\'etique des populations et s\'election de comportements altruistes
\item Jeudi 17 Octobre Romain AZAÏS (Équipe Inria Virtual Plants, Montpellier)
Estimation non param\'etrique pour les processus markoviens d\'eterministes par morceaux
\item Jeudi 3 Octobre Marc HOFFMANN (Universit\'e Paris Dauphine)
Statistical estimation of a growth-fragmentation model observed on a genealogical tree
\item Jeudi 26 Septembre Michaela PROKESOVA (Charles University, Prague, R\'epublique Tch\`eque)
\item Jeudi 19 Septembre Jean-Fran\c cois COEURJOLLY (LJK / FIGAL)
Approche variationnelle pour l'estimation de l'intensit\'e d'un processus spatial
\item Jeudi 27 Juin Gilles STUPFLER (Universit\'e d'Aix-Marseille)
Estimation de l'indice des valeurs extr\^emes conditionnel par un estimateur de Hill local liss\'e
\item Jeudi 20 Juin C\'ecile AMBLARD (UJF, Equipe AMA, LIG)
\item Jeudi 13 Juin Julien HAMONIER (Universit\'e de Valenciennes et du Hainaut-Cambr\'esis)
Estimation par ondelettes du param\`etre fonctionnel H() et du param\`etre du mouvement multifractionnaire stable lin\'eaire
\item Jeudi 6 Juin Anne-Laure FOUGÈRES (Universit\'e Claude Bernard Lyon 1 / Institut Camille Jordan)
D\'ependance dans les extr\^emes multidimensionnels : estimation avec correction de biais
\item Jeudi 23 Mai Nicolas JÉGOU (Universit\'e de Rennes 2)
R\'egression isotonique it\'er\'ee
\item Jeudi 11 Avril Jean-Baptiste GOUÉRÉ (Universit\'e d'Orl\'eans / Laboratoire MAPMO)
Seuil de percolation dans le mod\`ele bool\'een
\item Jeudi 4 Avril Yves ROZENHOLC (Universit\'e Paris Descartes)
D\'econvolution de Laplace : Estimation des temps de transit d'un agent de contraste en imagerie dynamique - Application au suivi de l'angiog\'en\`ese tumorale
\item Jeudi 28 Mars Jean BÉRARD (Universit\'e de Lyon 1 / Institut Camille Jordan)
Mod\`eles de substitutions de nucl\'eotides avec d\'ependance au contexte
\item Jeudi 21 Mars Sergue\"i DACHIAN (Universit\'e Blaise Pascal / Laboratoire de Math\'ematiques)
Sur les rapports de vraisemblance limites des mod\`eles de rupture
\item Vendredi 15 Mars Bruno SAUSSEREAU (Universit\'e de Franche-Comt\'e / Laboratoire de Math\'ematiques de Besan\c con)
Estimation non param\'etrique du coefficient de d\'erive dans une diffusion fractionnaire
\item Jeudi 14 Mars Adeline SAMSON (Universite Paris Descartes / Laboratoire MAP5)
Estimation param\'etrique dans les mod\`eles neuronaux
\item Jeudi 7 Mars Florent AUTIN (Universit\'e d'Aix-Marseille 1 / LATP)
Point de vue maxiset en estimation non param\'etrique
\item Jeudi 21 F\'evrier Cl\'ement DOMBRY (Universit\'e de Poitiers / Laboratoire de Math\'ematiques et Applications)
Quelques propri\'et\'es des processus max-stables: lois conditionnelles et m\'elange fort.
\item Jeudi 14 F\'evrier Anne GÉGOUT-PETIT (Universit\'e Victor Segalen Bordeaux 2 / Institut de Math\'ematiques de Bordeaux (IMB))
Autour des Processus Markoviens D\'eterministes par Morceaux : inf\'erence sur le taux de saut ; quelques exemples de mod\'elisation
\item Jeudi 7 F\'evrier Philippe NAVEAU (Laboratoire des Sciences du Climat et l'Environnement (LSCE) CNRS Saclay)
Analysis of heavy rainfall in high dimensions
\item Jeudi 31 Janvier Florent MALRIEU (Universit\'e de Rennes 1 / IRMAR / Inria ASPI)
Comportement en temps long de quelques processus de Markov d\'eterministes par morceaux
\item Jeudi 24 Janvier Sylvain RUBENTHALER (Universit\'e de Nice / Laboratoire J.A. Dieudonn\'e)
Simulation exacte pour des trajectoires sous une loi de Feynman-Kac
\item Jeudi 17 Janvier Anne SABOURIN (Universit\'e de Lyon 1 / ICJ / LSCE - CNRS, CEA, UVSQ)
Mod\`ele Bay\'esien de m\'elange de Dirichlet pour extr\^emes multivari\'es : une reparam\'etrisation
\item Jeudi 10 Janvier C\'eline LACAUX (École des Mines de Nancy / Institut Élie Cartan)
S\'eries conditionnellement sous-gaussiennes : r\'egularit\'e et vitesse de convergence
\end{itemize}
\vspace{0.5cm}{\Large 2012}
\begin{itemize}
\item Jeudi 20 D\'ecembre Julien JACQUES (Universit\'e de Lille 1 / Laboratoire Paul Painlev\'e / Équipe Inria MODAL)
Mod\`eles g\'en\'eratifs pour donn\'ees de rang et donn\'ees ordinales avec applications en clustering.
\item Jeudi 6 D\'ecembre Charles BOUVEYRON (Laboratoire SAMM, Universit\'e Paris 1)
\item Jeudi 22 Novembre Ren\'e BLACHER (LJK / SAM)
M\'ethode pour obtenir des suites de nombres prouv\'ees al\'eatoires
\item Jeudi 8 Novembre Ren\'e AÏD (EDF - Finance for Energy Market Research Centre / Laboratoire FIME)
\item Jeudi 25 Octobre Rasmus WAAGEPETERSEN ET Jos\'e LEON (Universit\'e d'Aalborg, Danemark ET Universidad Central de Venezuela, Caracas)
Unbiased estimating equation for spatial point processes ET CLT for Crossings of random trigonometric Polynomials
\item Jeudi 18 Octobre Bastien MARCHINA (Universit\'e de Montpellier 2)
Vecteurs al\'eatoires \`a valeurs complexes et formes quadratiques hermitiennes avec applications au test de l'ad\'equation \`a la loi normale complexe
\item Jeudi 27 Septembre Jean-Baptiste DURAND (LJK / Mistis)
Quantification de l'incertitude sur le processus d'\'etats dans des mod\`eles de Markov cach\'es
\item Jeudi 20 Septembre Mr Jesper MOLLER (Aalborg University)
\item Jeudi 28 Juin C\'ecile AMBLARD (UJF, Equipe AMA, LIG)
Propri\'et\'es algebriques de copules definies \`a partir de matrices
\item Jeudi 21 Juin Asis Kumar CHATTOPADHYAY (Department of Statistics / Calcutta University)
\item Jeudi 14 Juin J\'er\^ome LELONG (LJK / MATHFI)
Expos\'e + table ronde : "Calcul haute performance et applications en probabilit\'es et statistique"
\item Jeudi 7 Juin Michael BLUM (TIMC / BCM)
\item Jeudi 31 Mai Ryozo MIURA (Hitotsubashi University, Japan)
\item Jeudi 10 Mai Lionel CUCALA (Universit\'e Montpellier II)
Inf\'erence bay\'esienne sur un mod\`ele de m\'elange \`a interaction spatiale
\item Jeudi 3 Mai Pierre ÉTORÉ (LJK / MATHFI)
Simulation exacte d'Equations Diff\'erentielles Stochastiques faisant intervenir le temps local en z\'ero du processus inconnu
\item Jeudi 26 Avril Bernard YCART (LJK / IPS)
Mod\`eles de mutation et division cellulaire
\item Jeudi 19 Avril Gersende FORT (LTCI, CNRS & Telecom ParisTech)
M\'ethodes d'\'echantillonnage d'importance adaptatives pour l'estimation de param\`etres cosmologiques
\item Jeudi 5 Avril Anne-Laure BOULESTEIX (University of Munich)
Critical issues and developments in high-dimensional prediction with biomedical applications
\item Jeudi 29 Mars Antoine LEJAY (Equipe TOSCA, INRIA Nancy & IECN)
Simulation de processus de diffusion en milieux discontinus
\item Jeudi 15 Mars EXPOSÉS D'ÉQUIPE : ÉQUIPE MOISE (LJK)
Analyse de sensibilit\'e pour variables d’entr\'ee corr\'el\'ees. ET : Cokrigeage et Multi-Fid\'elit\'e
\item Jeudi 8 Mars Gilles STUPFLER (Institut de Recherche Math\'ematique Avanc\'ee (IRMA) / Universit\'e de Strasbourg)
Estimation de point terminal par une m\'ethode des moments d'ordre \'elev\'e
\item Jeudi 1 Mars Thomas BURGER (CNRS, Unit\'e Biologie \`a Grande Échelle (BGE) / Étude de la Dynamique des Prot\'eomes (EDyP) (CEA /DSV / iRTSV))
\item Jeudi 23 F\'evrier Lotfi CHAARI (LJK / Mistis)
Approches bay\'esiennes variationnelles pour la d\'etection-estimation des activations c\'er\'ebrales en IRM fonctionnelle
\item Jeudi 9 F\'evrier Ivan NOURDIN (Universit\'e de Nancy 1)
Convergence des int\'egrales multiples de Wigner vers la loi semi-circulaire
\item Jeudi 2 F\'evrier Patrick CATTIAUX (Institut Math\'ematiques Toulouse)
D\'eviations et TCL pour fonctionnelles additives de processus de Markov
\item Jeudi 26 Janvier Etienne BIRMELÉ (Laboratoire Statistique et G\'enome, Universit\'e d'Evry / Laboratoire de Biom\'etrie et Biologie Evolutive, Universit\'e Lyon 1 / Equipe Bamboo, Inria Rh\^one-Alpes)
Mod\`eles de m\'elanges pour les r\'eseaux: estimation et application \`a la recherche de motifs locaux
\item Jeudi 19 Janvier Yohann DE CASTRO (Institut de Math\'ematiques de Toulouse)
Sections "presque"-Euclidienne et Lasso
\item Jeudi 12 Janvier Adeline SAMSON (Laboratoire MAP5, Universite Paris Descartes)
Estimateur de contraste pour des diffusions hypoelliptiques completement ou partiellement observ\'ees
\item Jeudi 5 Janvier Herv\'e MONOD (Unit\'e INRA MIA, Jouy-en-Josas)
Construction de plans factoriels r\'eguliers polyvalents et son impl\'ementation sous R
\end{itemize}
\vspace{0.5cm}{\Large 2011}
\begin{itemize}
\item Jeudi 15 D\'ecembre Pierre CALKA (Universit\'e de Rouen)
R\'esultats du second ordre pour des polytopes al\'eatoires
\item Jeudi 8 D\'ecembre ATELIER : ASTROSTATISTIQUE EN FRANCE (IPAG / LJK / INRIA / IXXI)
Atelier : astrostatistique en France
\item Jeudi 1 D\'ecembre EXPOSÉS D'ÉQUIPE : ÉQUIPE FIGAL (LJK)
Pr\'esentation du package R EBSpat pour la simulation/estimation de mod\`eles de Gibbs de type plus proches voisins. ET: Zeros complexes de la constante de normalisation pour le mod\`ele de Potts pour une famille de graphes self-duaux.
\item Jeudi 24 Novembre Laure SANSONNET (Universit\'e Paris-Sud)
Estimation adaptative dans le cadre d'une mod\'elisation d'interaction poissonienne et application \`a des donn\'ees g\'enomiques
\item Jeudi 17 Novembre Madison GIACOFCI (LJK / SAM)
Classification de courbes non supervis\'ee dans les mod\`eles mixtes
\item Jeudi 10 Novembre Benjamin CHARLIER (Institut Math\'ematiques de Toulouse)
Une condition n\'ecessaire et suffisante d'existence de la moyenne de Fr\'echet sur le cercle
\item Jeudi 3 Novembre Radu HORAUD (Équipe PERCEPTION, INRIA Grenoble et LJK)
M\'ethodes d'apprenstissage statistique pour la perception visuelle et auditive
\item Jeudi 20 Octobre Elena DI BERNARDINO (Institut Camille Jordan, Lyon)
Estimation de type plug-in des ensembles de niveau dans un cadre non-compact avec applications \`a la th\'eorie des risques multivari\'ee
\item Jeudi 13 Octobre St\'ephane GIRARD (LJK / Mistis (INRIA))
Introduction \`a la statistique des valeurs extr\^emes
\item Jeudi 29 Septembre Simone SCOTTI (Universit\'e de Paris 7 / LPMA)
\item Jeudi 30 Juin Christian PAROISSIN (Universit\'e de Pau et des Pays de l'Adour, Laboratoire de Math\'ematiques et de leurs Applications)
Processus gamma perturb\'e sans/avec covariables : inf\'erence statistique et autres probl\`emes
\item Jeudi 23 Juin Sara BERTHOUMIEUX (Equipe IBIS, INRIA Grenoble-Rh\^one-Alpes)
\item Jeudi 16 Juin Lo\"ic LE GRATIET (LPMA, Universit\'e Paris 7 & CEA-DAM-DIF Bruy\`eres-le-Ch\^atel)
M\'eta-mod\'elisation multi-fid\'elit\'e pour les codes \`a pr\'ecision r\'eglable
\item Jeudi 9 Juin Mr St\'ephane CHRETIEN (Universit\'e de Franche-Comt\'e)
Le LASSO lorsque la variance est inconnue
\item Jeudi 19 Mai Giansalvo CIRRINCIONE (Laboratoire LTI, Universite de Picardie Jules Verne)
R\'egression orthogonale par les r\'eseaux de neurones
\item Jeudi 12 Mai Jean-Marc BARDET (SAMM, Universit\'e Paris 1)
Un estimateur non-param\'etrique de la densit\'e spectrale d’un processus gaussien observ\'e en des temps al\'eatoires
\item Jeudi 21 Avril Michael CHICHIGNOUD (LATP, Universit\'e de Marseille)
Performances statistiques d'un estimateur Bay\'esien
\item Jeudi 14 Avril Anne CUZOL
imulation stochastique conditionnelle dans un cadre de filtrage - Application \`a l'analyse d'\'ecoulements fluides
\item Jeudi 7 Avril Robin GENUER (MAP5, Universit\'e Paris Descartes)
For\^ets al\'eatoires : s\'election de variables et bornes de risque.
\item Jeudi 31 Mars Matthieu LERASLE (Universit\'e de São Paulo)
Propri\'et\'es Oracles des estimateurs BIC pour l'estimation d'arbre de contexte
\item Jeudi 10 Mars Paul DOUKHAN (Universit\'e Cergy Pontoise)
S\'eries temporelles \`a valeurs enti\`eres
\item Jeudi 10 F\'evrier Ir\`ene GANNAZ (INSA de Lyon, Laboratoire ICJ)
Logvraisemblance p\'enalis\'ee dans des mod\`eles fonctionnels g\'en\'eralis\'es
\item Jeudi 3 F\'evrier Nathalie SAINT-GEOURS (AgroParisTech - UMR TETIS (Territoires, Environnement, T\'el\'ed\'etection et Information Spatiale) - Montpellier)
Analyse de sensibilit\'e de Sobol de mod\`eles \`a entr\'ee/sortie spatialis\'ee
\item Jeudi 27 Janvier Marianne CLAUSEL (Institut Camille Jordan, Lyon)
Estimation du param\`etre de longue m\'emoire de s\'eries temporelles non-lin\'eaires
\item Jeudi 20 Janvier Pr\'esentations d'\'equipes : ÉQUIPES MISTIS ET M3S
Pr\'esentations d'\'equipes : ÉQUIPES MISTIS ET M3S
\item Mercredi 19 Janvier
\item Jeudi 13 Janvier Konstantinos FOKIANOS (Department of Mathematics & Statistics, University of Cyprus)
\item Jeudi 6 Janvier David DEGRAS (Statistical and Applied Mathematical Sciences Institute, USA)
Sondage adaptatif pour donnees fonctionnelles
\end{itemize}
\vspace{0.5cm}{\Large 2010}
\begin{itemize}
\item Jeudi 16 D\'ecembre Pr\'esentations d'\'equipe : ÉQUIPES IPS ET SAM
Pr\'esentations d'\'equipe : ÉQUIPES IPS ET SAM
\item Jeudi 9 D\'ecembre Laurent BORDES (Universit\'e de Pau)
Estimation de mod\`eles de m\'elanges en pr\'esence de censure
\item Jeudi 2 D\'ecembre Agn\`es DESOLNEUX (MAP5 (UMR CNRS))
Quelques applications et propri\'et\'es des mod\`eles shot-noise
\item Jeudi 25 Novembre Emmanuel RIO (Laboratoire de Math\'ematiques de Versailles)
Constantes asymptotiques pour les distances de Wasserstein dans le Th\'eor\`eme limite central
\item Mardi 23 Novembre
\item Jeudi 18 Novembre J\'er\^ome SARACCO (Institut Polytechnique de Bordeaux; Institut de Mathematiques de Bordeaux & Equipe CQFD, INRIA Bordeaux Sud Ouest)
Quelques travaux nouveaux sur SIR
\item Jeudi 21 Octobre Pr\'esentations d'\'equipe : ÉQUIPES FIGAL ET MATHFI
Pr\'esentations d'\'equipe : \'equipes FIGAL et MathFi
\item Jeudi 14 Octobre Gabriela CIUPERCA (Universit\'e Lyon 1)
Inf\'erence statistique dans un mod\`ele de rupture: de l'ind\'ependance \`a la longue m\'emoire
\item Jeudi 24 Juin Vera GEORGESCU (INRA Avignon, UR 546 Biostatistique et Processus Spatiaux.)
\item Jeudi 17 Juin Nicolas LE BIHAN (GIPSA LAB)
Processus de Poisson compos\'es sur les groupes de Lie
\item Jeudi 10 Juin Eugenio CINQUEMANI (INRIA - IBIS)
\item Jeudi 20 Mai <a href="mailto:jose.leon@imag.fr"> Jos\'e LEON</a> (PR)
Test danisotropie pour Champs Gaussiens
\item Jeudi 6 Mai Eric MATNER-LOBER (Universit\'e de Rennes 2)
R\'eduction it\'er\'ee du biais pour des lisseurs multivari\'es
\item Jeudi 29 Avril Laure AMATE (Laboratoire d'informatique de Grenoble)
Apprentissage de mod\`eles de courbes parcimonieux bas\'es sur les repr\'esentations splines
\item Jeudi 22 Avril Guillemette MAROT (Laboratoire de Biom\'etrie et Biologie Évolutive, Lyon)
Mod\'elisation statistique pour les donn\'ees de puces \`a ADN
\item Jeudi 8 Avril Nathalie VILLA-VIALANEIX (Institut Math\'ematique de Toulouse)
Discrimination et r\'egression pour des d\'eriv\'ees : un r\'esultat de consistance pour des donn\'ees fonctionnelles discr\'etis\'ees
\item Jeudi 1 Avril Thomas LALOË (Universit\'e de Montpellier 2)
Apprentissage Statistique : Classification, R\'egression et Applications
\item Jeudi 18 Mars Caroline BAZZOLI (Ater STID, Grenoble)
Evaluation et optimisation de protocoles dans les mod\`eles non lin\'eaires \`a effets mixtes application \`a la mod\'elisation de la pharmacologie des antir\'etroviraux
\item Jeudi 11 Mars Eugen URSU (LJK / MISTIS)
Mod\'elisation et ajustement des mod\`eles de s\'eries chronologiques autoregressives p\'eriodiques vectorielles
\item Jeudi 4 Mars Fr\'ed\'eric LAVANCIER (Universit\'e de Nantes)
R\'esidus et tests d'ad\'equation pour les processus ponctuels de Gibbs marqu\'es
\item Jeudi 25 F\'evrier Ilya MOLCHANOV (Universit\'e de Bern)
\item Jeudi 11 F\'evrier Olivier ROUSTANT (École des Mines de Saint-Etienne)
\item Jeudi 4 F\'evrier Sana LOUHICHI (Universit\'e Paris Sud)
Sur la convergence des processus ponctuels \`a points d\'ependants
\item Jeudi 21 Janvier Christian ROBERT (ENSAE)
Erreur de couverture en pr\'esence de bruit de microstructure
\item Jeudi 14 Janvier <a href="mailto:Christiane.COCOZZA-THIVENT@imag.fr"> Christiane COCOZZA-THIVENT</a> (Universit\'e de Marne-la-Vall\'ee)
Renouvellement markovien et fiabilit\'e pr\'evisionnelle
\item Jeudi 7 Janvier Giovanni PECCATI (Universit\'es Paris 6 et 10)
Stein, Malliavin et Universalit\'e
\end{itemize}
\vspace{0.5cm}{\Large 2009}
\begin{itemize}
\item Vendredi 18 D\'ecembre Jean-Pierre FOUQUE (University of California)
\item Jeudi 10 D\'ecembre Fr\'ed\'eric RICHARD (Universit\'e Paris Descartes)
Mod\`ele \`a effets mixtes non-lin\'eaire et estimation SAEM pour les s\'equences visuelles d'objets en mouvement. Applications \`a l'imagerie m\'edicale dynamique.
\item Jeudi 3 D\'ecembre J\'er\'emie BIGOT (Universit\'e Paul Sabatier, Toulouse)
Estimation nonlin\'eaire en r\'egression fonctionnelle
\item Jeudi 26 Novembre Philippe CIUCIU (CEA Saclay)
Sch\'emas d'extrapolation rapide de fonction de partition de champs de Potts. Application \`a l'analyse d'images en IRM fonctionnelle
\item Jeudi 19 Novembre Alejandro MURUA (Institut de Math\'ematiques, Ecole Polytechnique F\'ed\'erale de Lausanne, Suisse, et D\'epartement de math\'ematiques et de statistique, Universit\'e de Montr\'eal, Qu\'ebec, Canada.)
\item Jeudi 5 Novembre C\'eline HELBERT (LJK / SMS)
Plans dexp\'eriences num\'eriques et m\'etamod\`eles
\item Jeudi 22 Octobre Vincent RIVOIRARD (Universit\'e Paris Sud Orsay)
Le fl\'eau du support pour lestimation de densit\'e
\item Jeudi 15 Octobre R\'emi SERVIEN (LJK / SMS)
Estimation de r\'egularit\'e locale
\item Jeudi 1 Octobre J\'er\^ome LELONG (LJK / MATHFI)
\item Jeudi 24 Septembre Jean-Marc AZAÏS (Universit\'e Paul Sabatier, Toulouse)
Calcul de la distribution du maximum de processus et de s\'eries temporelles. Calcul de la distribution du maximum de processus et de s\'eries temporelles.
\item Jeudi 25 Juin Massimiliano PONTIL (University College London)
Multi-task learning via matrix regularization
\item Jeudi 18 Juin Abass SAGNA (Universit\'e Paris 6)
Introduction \`a la quantification optimale et application au risque de credit
\item Jeudi 11 Juin Matthieu LERASLE (Universit\'e Toulouse 3)
M\'ethode de s\'election de mod\`ele pour donn\'es m\'elangeantes
\item Jeudi 14 Mai Philippe SAINT-PIERRE (Universit\'e Paris 6)
\item Jeudi 30 Avril Anatoli IOUDITSKI (LJK)
Sur les conditions v\'erifiables d'estimation parcimonieuse par la minimisation l1
\item Jeudi 23 Avril Paul DOUKHAN (Universit\'e Cergy Pontoise)
Division
\item Jeudi 9 Avril Gwladys TOULEMONDE (Universit\'e Montpellier 2)
Mod\`eles de Markov cach\'es en th\'eorie des valeurs extr\^emes
\item Jeudi 2 Avril Mme Marianne CLAUSEL
Mouvements Browniens Fractionnaires Lacunaires
\item Jeudi 26 Mars Jean-Christophe BRETON (Universit\'e de La Rochelle)
Variations hermitiennes du mBf et applications
\item Jeudi 12 Mars Pierre LAFAYE DE MICHEAUX (LJK)
Tests lisses de non normalit\'e dans un contexte de s\'eries chronologiques
\item Jeudi 5 Mars Marc HALLIN (Universit\'e Libre de Bruxelles)
Facteurs dynamiques en pr\'esence de blocs
\item Jeudi 26 F\'evrier Vladimir SPOKOINY (WIAS, Berlin)
\item Jeudi 12 F\'evrier Philippe SOULIER (Universit\'e Paris 10)
Lois limites pour des vecteurs al\'eatoires dont une composante est extr\^eme: mod\`eles et estimation
\item Jeudi 5 F\'evrier Merlin KELLER (LNAO Neurospin, CEA Saclay)
Prise en compte de l'incertitude spatiale pour la d\'etection d'activations en IRM fonctionnelle
\item Jeudi 22 Janvier Emmanuel GOBET (LJK)
Approximations des mod\`eles stochastiques de la finance et calculs temps r\'eel
\item Jeudi 15 Janvier Stefan GEISS (University of Jyv\"askyl\"a)
\item Jeudi 8 Janvier Sylvie VIGUIER-PLA (Universit\'e de Toulouse - UPS)
Comparaison de groupes de courbes bas\'ee sur les facteurs
\end{itemize}
\vspace{0.5cm}{\Large 2008}
\begin{itemize}
\item Jeudi 18 D\'ecembre Jean-Fran\c cois DUPUY (Universit\'e Paul Sabatier)
Estimation efficace dans un mod\`ele de dur\'ees censur\'ees partiellement observ\'e
\item Jeudi 4 D\'ecembre Jean-Yves DAUXOIS (Universit\'e de Besan\c con)
Év\`enements r\'ecurrents, risques concurrents et causes manquantes en statistique des dur\'ees de vie
\item Jeudi 27 Novembre Laurent DELSOL (Universit\'e Catholique de Louvain-la-Neuve)
Tests de structure en r\'egression sur variable fonctionnelle
\item Jeudi 20 Novembre Mr Pierre ETORE
Approximation de processus de diffusion \`a coefficients discontinus en dimension un et applications \`a la simulation
\item Jeudi 13 Novembre Steven SHREVE (Carnegie Mellon University)
\item Jeudi 6 Novembre Emmanuel GUERRE (University of London)
\item Jeudi 23 Octobre Bernard DELYON (Universit\'e de Rennes I)
Simulation de diffusions conditionn\'ees
\item Jeudi 16 Octobre Sergey PERGAMECHTCHIKOV (Universit\'e de Rouen)
Estimation non-param\'etrique dans le mod\`ele de regression h\'et\'eroscedastique
\item Jeudi 2 Octobre Alexander GOLDENSHLUGER (Haifa University)
\item Jeudi 26 Juin
Sur la vitesse de m\'elange pour un type d'EDS 2-dimensionnelles
\item Jeudi 12 Juin Denis ALLARD (INRA Avignon)
Une classe de champs al\'eatoires dissym\'etriques : les skew-normal random fields. Propri\'et\'es, simulation et estimation
\item Jeudi 5 Juin Eric MATZNER-LEBER (Universit\'e Haute Bretagne, Rennes)
R\'eduction it\'er\'ee du biais en r\'egression non param\'etrique et boosting.
\item Jeudi 29 Mai Magalie FROMONT (Universit\'e Haute Bretagne, Rennes)
Tests adaptatifs d'homog\'en\'eit\'e pour des processus de Poisson
\item Jeudi 22 Mai Yuri GOLUBEV (Universit\'e Aix-Marseille)
Processus ordonn\'es en mod\`eles lin\'eaires de grande dimension
\item Jeudi 15 Mai Robin GIRARD (SMS/LJK)
Titre : Perturbation de r\`egles de classification dans le cadre de donn\'ees gaussiennes
\item Jeudi 24 Avril Christophe POUET (Universit\'e Aix-Marseille)
Tests d'ad\'equation adaptatifs dans les mod\`eles de convolution avec bruit connu ou partiellement connu
\item Jeudi 10 Avril Diana-Nicoleta DOROBANTU (Universit\'e Paul Sabatier, Toulouse)
Arr\^et optimal pour les processus de L\'evy et les fonctions affines
\item Jeudi 3 Avril Eva CANTONI (Universit\'e de Gen\`eve)
Donn\'ees de comptages en grappe avec surrepr\'esentation de z\'eros
\item Jeudi 20 Mars Pierre BERTRAND (Universit\'e Clermont-Ferrand 2)
Analyse en ondelettes d'un processus gaussien \`a accroissements stationnaires. Discr\'etisation avec un \'echantillonnage al\'eatoire.
\item Jeudi 13 Mars Yves ROZENHOLC (Universit\'e Paris 5)
D\'ebruitage d'image dynamique pour l'estimation des param\`etres de la micro-circulation in vivo
\item Jeudi 6 Mars Olivier WINTENBERGER (SAMOS, Paris)
Comportement de l'estimateur de quasi maximum de vraisemblance pour les mod\`eles affines g\'en\'eraux
\item Jeudi 28 F\'evrier Lionel TRUQUET (CREST / Paris 1)
Construction et propri\'et\'es de champs al\'eatoires autor\'egressifs \`a port\'ee infinie
\item Jeudi 14 F\'evrier Matthieu CORNEC (Paris X)
In\'egalit\'es oracle pour l'estimateur de la validation crois\'ee pour l'estimation du risque
\item Jeudi 31 Janvier C\'eline LACAUX (Institut Elie Cartan, Nancy)
Champs stables \`a autosimilarit\'e matricielle
\item Jeudi 24 Janvier Michæl BLUM (TIMB / TIMC)
M\'ethodes bay\'esiennes sans vraisemblance
\item Jeudi 17 Janvier Cl\'ementine PRIEUR (INSA Toulouse)
Mesures de d\'ependance pour certains syst\`emes dynamiques
\item Jeudi 10 Janvier Mr Emmanuel TROUVÉ (LISTIC, Universit\'e de Savoie)
Analyse d'images RSO interf\'erom\'etriques et polarim\'etriques.
Application \`a l'observation des glaciers temp\'er\'es
\end{itemize}
\vspace{0.5cm}{\Large 2007}
\begin{itemize}
\item Jeudi 13 D\'ecembre Marc HOFFMAN (Universit\'e Marne-la-Vall\'ee)
Estimation multi-\'echelle de la volatili\'e et bruit de microstructure
\item Jeudi 6 D\'ecembre Alexander NAZIN (Institute of Control Sciences RAS, Moscow)
\item Jeudi 29 Novembre Olivier RENAUD (Universit\'e de Gen\`eve)
Tests simultan\'es dans le plan temps-fr\'equence: le cas de signaux d'\'electro-enc\'ephalogrammes dans la recherche en psychologie
\item Jeudi 22 Novembre
Filtrage lin\'eaire et crit\`eres exponentiels
\item Jeudi 15 Novembre
In\'egalit\'es oracle pour l'estimateur de la validation crois\'ee pour l'estimation du risque
\item Jeudi 8 Novembre Christophe CRAMBES (Universit\'e Paul Sabatier)
Mod\`ele lin\'eaire fonctionnel lorsque la variable explicative est bruit\'ee
\item Jeudi 25 Octobre Mr Emmanuel MAZER (Soci\'et\'e Probayes, Montbonnot)
La programmation probabiliste
\item Jeudi 18 Octobre Laure RIGAL (SMS/LJK)
Étude sur la performance d'algorithmes g\'en\'etiques sur une classe de probl\`emes d'optimisation
\item Jeudi 11 Octobre Mr Anatoli IOUDITSKI (SMS / LJK)
Estimation de fonctionnelles lin\'eaires
\item Jeudi 4 Octobre Anne ESTRADE (MAP5, Universit\'e Paris-Descartes)
Description microscopique de champs al\'eatoires autosimilaires d'indice H ( <H < d/2)
\item Jeudi 28 Juin Arnak DALAYAN (LPMA, Paris 6)
R\'eduction de dimension dans le mod\`ele de r\'egression \`a plusieurs directions r\'ev\'elatrices
\item Jeudi 31 Mai David DEREUDRE (Universit\'e de Valenciennes)
Mosaique de Delaunay gibbsienne
\item Jeudi 24 Mai Pascal SARDA (LPS, Universit\'e Paul Sabatier, Toulouse III)
Estimation par splines de lissages de la r\'egression lin\'eaire fonctionnelle
\item Jeudi 10 Mai Gersende FORT (ENST, Paris)
Limites fluides de quelques \'echantillonneurs MCMC
\item Jeudi 3 Mai Shigejoshi OGAWA (Ritsumeikan University, Japon)
Probl\`emes noncausaux dans l'analyse stochastique
\item Jeudi 26 Avril Benoit SCHERRER (MISTIS / LJK)
\item Jeudi 19 Avril Michel SORTAIS (Universit\'e Technique de Berlin)
Probabilit\'es appliqu\'ees \`a l'\'evaluation de performance des r\'eseaux de t\'el\'ecommunication : deux exemples
\item Jeudi 5 Avril Javiera BARRERA (Universit\'e Santa Maria, Valparaiso, Chili)
\item Jeudi 29 Mars Alexander Yu. VERETENNIKOV (University of Leeds)
\item Jeudi 22 Mars Mr Arthur CHARPENTIER (ENSAI Rennes)
D\'ependance entre risques extr\^emes, une introduction \`a la th\'eorie des extr\^emes multivari\'es
\item Jeudi 8 Mars Mr Romuald ELIE (CREST-ENSAE)
Gestion de portefeuille sous contrainte Drawdown
\item Jeudi 1 Mars Mr Aur\'elien GARIVIER (Universit\'e Paris-Sud)
Th\'eorie de l'information - application \`a l'identification d'ordre
\item Jeudi 15 F\'evrier Mr Dominique PASTOR (ENST Bretagne)
D\'etection et estimation non param\'etrique : d\'etecter pour mieux estimer
\item Jeudi 8 F\'evrier Mr Georgi BOSHNAKOV (Manchester University)
\item Jeudi 1 F\'evrier Mr Bernard YCART (SMS / LJK)
Dimensions de Vapnik-Chervonenkis pour des classes de fonctions al\'eatoires
\item Jeudi 25 Janvier Mr Guillaume LECUE (Paris 6)
Classification avec vitesse rapides sur des classes de r\`egles de Bayes ayant une repr\'esentation parcimonieuse
\item Jeudi 18 Janvier Mr Christian DERQUENNE (EDF R&D, Clamart)
Mod\`eles \`a relations structurelles fond\'es sur l'approche "Partial Maximum Likelihood"
\item Jeudi 11 Janvier Mr julien BERRO (TIMC)
R\'egulation(s) locale(s) de quantit\'es globales au sein du cytosquelette: un exemple de syst\`eme complexe en biologie
\item Jeudi 4 Janvier Mr Pavel CHIGANSKY (Universit\'e du Maine)
Stability of the nonlinear filter for slowly switching Markov chains
\end{itemize}
\vspace{0.5cm}{\Large 2006}
\begin{itemize}
\item Jeudi 21 D\'ecembre Jacques ISTAS (SMS/LMC/IMAG)
Champs fractionnaires index\'es par des espaces m\'etriques
\item Jeudi 14 D\'ecembre Arnaud GLOTER (Universit\'e de Marne-La-Vall\'ee)
Estimation non param\'etrique de fonctions multifractales
\item Jeudi 7 D\'ecembre Adriana CLIMESCU (LBIM/CEA, Grenoble)
Mod\'elisation des r\'eseaux de transcription g\'enique par des \'equations diff\'erentielles stochastiques
\item Jeudi 30 Novembre
Filtrage sans ergodicit\'e uniforme, II. L'in\'egalit\'e de Harnack
\item Jeudi 23 Novembre Laurent ZWALD (UJF - LJK / SMS& LEAR)
Performances statistiques d'algorithmes d'apprentissage : "Kernel Projection Machine" et analyse en composantes principales \`a noyau
\item Jeudi 9 Novembre
D\'ependance faible, mod\`eles, th\'eorie limite et quelques applications
\item Jeudi 26 Octobre Philippe RIGOLLET (LPMA, Paris 6)
Agr\'egation universelle et continue par m\'ethodes de descente miroir
\item Jeudi 19 Octobre Adriana CLIMESCU, (LBIM/CEA, Grenoble)
Mod\'elisation des r\'eseaux de transcription g\'enique par des \'equations diff\'erentielles stochastiques
\item Jeudi 12 Octobre Ying JIAO (Ecole Polytechnique, Paris)
L'approximation de la perte cumulative par la m\'ethode de Stein et zero bias transformation
\item Jeudi 5 Octobre Andrea RIDOLFI (Universit\'e Paris V et EPFL)
A point process journey into data analysis with applications in life sciences and communications
\item Jeudi 6 Juillet Eric MOULINES (ENST Paris)
Correction de l'empilement en spectrom\'etrie
\item Jeudi 29 Juin Claudine SCHWARTZ (SMS/LMC/IMAG)
Apprivoiser l'al\'eatoire \`a l'\'ecole primaire et au coll\`ege
\item Jeudi 22 Juin
Filtrage sans ergodicit\'e uniforme
\item Jeudi 8 Juin Charles BOUVEYRON (SMS/LMC/IMAG)
Mod\`eles de m\'elange gaussien pour la classification des donn\'ees de grande dimension et application \`a l'analyse d'image
\item Jeudi 18 Mai Juliette BLANCHET (Mistis/INRIA)
Approximation en champ moyen pour un mod\`ele markovien appliqu\'e \`a la classification d'images textur\'ees
\item Jeudi 11 Mai Jean-Fran\c cois COEURJOLLY (LabSAD/UPMF)
Maximum de pseudo-vraisemblance pour les processus ponctuels de Gibbs de type plus proches voisins
\item Jeudi 27 Avril Fran\c cois PERRON (CREST et Universit\'e Paris-Dauphine)
Estimer une fonction de r\'epartition par une perturbation de sa version \'echantillonnale
\item Jeudi 20 Avril Anne-Fran\c coise YAO (Centre
d'Oc\'eanologie de Marseille, Aix-Marseille 2)
Mod\`ele de r\'eduction de dimension pour la r\'egression de variables fonctionnelles
\item Jeudi 13 Avril Nicolas BRUNEL (CEREMADE, Universit\'e Paris-Dauphine)
Mod\`eles sp\'ecifi\'es par copule et estimation par fonction estimante
\item Jeudi 6 Avril Anne AUGER (Computational Laboratory, ETH Zurich)
Optimisation stochastique par algorithmes \'evolutionnaires : analyse de convergence - borne inf\'erieure pour la complexit\'e
\item Jeudi 30 Mars Ir\`ene GANNAZ (SMS/LMC/IMAG)
Ondelettes et estimateur de Huber dans un mod\`ele partiellement lin\'eaire
\item Jeudi 23 Mars Yannick BARAUD (Universit\'e de Nice Sophia-Antipolis)
Estimation d'intensit\'es par s\'election d'histogrammes
\item Jeudi 16 Mars Alexandre POPIER (CMAP, Polytechnique)
Equations diff\'erentielles stochastiques r\'etrogrades (et EDP) avec condition finale singuli\`ere
\item Jeudi 9 Mars Vivien ROSSI (Projet ASPI, IRISA-INRIA Rennes)
Filtrage particulaire de mod\`eles de Markov cach\'es. Application \`a un bioproc\'ed\'e de d\'epollution
\item Jeudi 23 F\'evrier Anestis ANTONIADIS (SMS/LMC/IMAG)
Mod\`eles \`a effets fonctionnels mixtes par d\'ecomposition en ondelettes
\item Jeudi 16 F\'evrier Fr\'ed\'eric LAVANCIER (CREST, Paris et Lab. Paul Painlev\'e, Lille 1)
La longue m\'emoire dans les champs al\'eatoires : mod\'elisation et test
\item Jeudi 9 F\'evrier Emmanuel BACRY (CMAP, Polytechnique)
Processus multifractals \`a incr\'ements stationnaires, mod\'elisation de s\'eries financi\`eres
\item Jeudi 2 F\'evrier St\'ephane GIRARD (SMS/LMC/IMAG)
Les lois \`a queues de type Weibull
\item Mercredi 25 Janvier Mr Vuk MILISIC
Vers les lois de paroi multi-\'echelle: approche unifi\'ee et nouvaux r\'esultats
\item Jeudi 19 Janvier Julien JACQUES (LABSAD / UPMF)
Discrimination sur variables binaires pour des populations d'apprentissage et de test diff\'erentes
\item Jeudi 12 Janvier Nathalie PEYRARD (INRA Avignon)
M\'ethodes variationnelles pour l'approximation de dynamiques \'epid\'emiques sur graphe
\item Jeudi 5 Janvier Florin AVRAM (Universit\'e de Pau et des Pays de l'Adour)
Solution exacte et asymptotique d'un probl\`eme de ruine multidimensionnel
\end{itemize}
\vspace{0.5cm}{\Large 2005}
\begin{itemize}
\item Jeudi 15 D\'ecembre
Sur l'utilisation d'algorithmes de diagonalisation conjointe approch\'ee en s\'eparation de sources, sans contrainte d'orthogonalit\'e et en pr\'esence de bruit additif
\item Jeudi 8 D\'ecembre Alexandre BROUSTE (SMS/LMC/IMAG)
S\'eries al\'eatoires de fonctions bas\'ees sur un processus de branchement simple
\item Jeudi 1 D\'ecembre Isidore Paul AKAM BITA (SMS/LMC/IMAG)
Application de l'ACI \`a la compression des images satellites
\item Jeudi 24 Novembre Herv\'e GUIOL (TIMB/TIMC)
Hydrodynamique \`a l'\'echelle Euler des syst\`emes de particules attractifs en dimension un
\item Jeudi 17 Novembre Francis COMETS (Universit\'e Paris 7 - Denis Diderot)
Polym\`eres dirig\'es en milieu al\'eatoire
\item Jeudi 10 Novembre Patricia REYNAUD-BOURET (ENS Ulm)
Processus de Hawkes ou comment d\'etecter les distances \'evit\'ees ou favoris\'ees entre mots sur l'ADN
\item Jeudi 3 Novembre Radu STOICA (INRA Avignon)
Processus ponctuels marqu\'es et reconnaissance de formes
\item Jeudi 20 Octobre Jean-Fran\c cois COEURJOLLY (LabSAD/UPMF)
L-Estimateurs de l'exposant de Hölder de certains processus gaussiens
\item Jeudi 6 Octobre Emmanuel GOBET (SMS/LMC/IMAG)
une convergence g\'eom\'etrique pour les EDP lin\'eaires
\item Jeudi 7 Juillet Alexander Yu VERETENNIKOV (University of Leeds)
On operator norm approximations for SDEs
\item Jeudi 30 Juin
Contr\^ole optimal pour des syst\`emes lin\'eaires gouvern\'es par des MBF
\item Jeudi 23 Juin Qinghua ZHANG (IRISA, Rennes)
Filtrage particulaire pour le diagnostic de pannes dans des syst\`emes non lin\'eaires
\item Jeudi 16 Juin Iyadh GACEM (LABSAD / UPMF)
Limites de la post-stratification dans les sondages
\item Jeudi 2 Juin Anatoli IOUDITSKI (SMS/LMC/IMAG)
D\'etection et estimation d'une rupture dans un probl\`eme inverse
\item Jeudi 26 Mai Gilles GUILLOT (INRA - INAPG - ENGREF, Paris)
Mod\'elisation statistique spatiale en g\'en\'etique des populations
\item Jeudi 19 Mai Antoine PHAM (SMS/LMC/IMAG)
Crit\`ere d'information mutuelle en d\'econvolution aveugle
\item Jeudi 12 Mai Christelle MELO DE LIMA (Universit\'e Lyon 1)
Pr\'ediction et analyse de la structure en isochore des g\'enomes \`a partir de mod\`eles de Markov cach\'es
\item Jeudi 28 Avril Sandie FERRIGNO (Universit\'e Montpellier II)
Un test d'ad\'equation global pour la fonction de r\'epartition conditionnelle
\item Jeudi 14 Avril Rodolphe PRIAM (IRISA Rennes)
Des mod\`eles de m\'elanges aux cartes auto-organisatrices pour la fouille de donn\'ees visuelles
\item Jeudi 7 Avril Mohamed EL MACHKOURI (Universit\'e de Rouen)
R\'esultats asymptotiques pour les champs al\'eatoires
\item Jeudi 31 Mars Paul DOUKHAN (CREST/ENSAE)
D\'ependance faible: un TLC sous des hypoth\`eses de moments faibles
\item Jeudi 17 Mars Claudine ROBERT (Universit\'e Joseph Fourier)
De franc-carreau \`a la loi de Benford
\item Jeudi 10 Mars Sandrine PECHE (Institut Fourier)
Grandes matrices de covariance empirique et valeurs propres extr\^emes
\item Jeudi 3 Mars Hermine BIERME (Universit\'e d'Orl\'eans)
Mod\`eles anisotropes pour les os et transform\'ee X-ray
\item Jeudi 24 F\'evrier Keith WORSLEY (Department of Statistics, Mac Gill University)
La g\'eom\'etrie d'images al\'eatoires dans l'astrophysique et la cartographie c\'er\'ebrale
\item Jeudi 10 F\'evrier Camelia GOGA (LPS/ UPS, Toulouse 3)
Mod\`eles non-param\'etriques pour tenir compte de l'information auxiliaire dans les sondages : une approche par splines de r\'egression
\item Jeudi 3 F\'evrier Emmanuel GOBET (Ecole Polytechnique)
Equations stochastiques r\'etrogrades et mesures de risques en finance : mod\'elisation et simulation num\'erique
\item Jeudi 27 Janvier Bernard GAREL (ENSEEIHT, Toulouse)
Maximum de la vraisemblance d'un mod\`ele stochastique de m\'elanges de lois
\item Jeudi 20 Janvier Fabienne COMTE (MAP5, Paris 5)
Estimation du taux de hasard par contraste p\'enalis\'e pour des donn\'ees censur\'ees
\item Jeudi 13 Janvier Tristan MARY-HUARD (INA-PG / INRA)
S\'election de variables en classification supervis\'ee
\item Jeudi 6 Janvier Elias OULD-SAID (Universit\'e du Littoral)
Rate of convergence of a nonparametric regression function estimator with randomly truncated data
\end{itemize}
\vspace{0.5cm}{\Large 2004}
\begin{itemize}
\item Jeudi 16 D\'ecembre Fr\'ed\'eric FERRATY (LSP/ UPS, Toulouse 3)
Mod\'elisations non-param\'etriques :
probl\`emes de pr\'ediction et variables fonctionnelles
\item Jeudi 2 D\'ecembre J\'er\'emie BIGOT (LSP/ UPS, Toulouse 3)
Probl\`emes inverses pour des processus de Poisson
\item Jeudi 25 Novembre Julien JACQUES (MISTIS, INRIA Rh\^one-Alpes)
Analyse de sensibilit\'e et incertitude de mod\`ele
\item Jeudi 18 Novembre Eric KOLACZYK (Dept of Mathematics and Statistics, Boston University)
Multiscale, Multigranular Image Segmentation
\item Jeudi 4 Novembre Anestis ANTONIADIS (SMS/LMC/IMAG)
R\'eduction de la dimension en r\'egression fonctionnelle et quelques applications
\item Jeudi 21 Octobre Alexandre NAZIN (Institute of Control Sciences, Moscou)
Estimation of a Regression Function via Direct Weight Optimization
\item Jeudi 14 Octobre Corinne BERZIN (LabSAD/UPMF)
TCL pour des fonctionnelles non-lin\'eaires de processus Gaussiens stationnaires et application \`a l'estimation du param\`etre de Hurst
\item Jeudi 7 Octobre Bernard YCART (MAP5)
D\'etection de temps de convergence pour des \'echantillons de processus
\item Mardi 6 Juillet St\'ephane GIRARD (SMS/LMC/IMAG)
Contributions \`a l'inf\'erence statistique semi- et non-param\'etrique
\item Jeudi 24 Juin Jean-Fran\c cois COEURJOLLY (LABSAD / UPMF)
Une approche exp\'erimentale de la statistique comme compl\'ement visuel \`a une approche plus classique
\item Jeudi 17 Juin Gersende FORT (SMS / LMC /IMAG)
L'algorithme Ridge-Partial Least Squares et application \`a la classification de puces \`a ADN
\item Jeudi 10 Juin Yves GRANDVALET (UTC)
Apprentissage semi-supervis\'e par approche discriminante
\item Jeudi 3 Juin Edith GABRIEL (INRA Avignon)
D\'etection de zones de changement abrupt dans des donn\'ees spatiales
\item Jeudi 27 Mai Jacques ISTAS (LabSAD / UPMF & SMS / LMC / IMAG)
Autour de l'auto-similarit\'e locale
\item Jeudi 13 Mai Laurent GARDES (SMS / LMC / IMAG)
Un estimateur de l'indice de valeur extr\^eme du type "Pickands"
\item Jeudi 6 Mai R\'emy DROUILHET (LABSAD / UPMF)
Processus ponctuels de Gibbs d'inhibition sur le graphe de Delaunay R-local
\item Jeudi 29 Avril Beno\^it LIQUET (Universit\'e Montpellier 2)
Choix entre mod\`eles \`a risques proportionnels et mod\`eles stratifi\'es fond\'e sur l'esp\'erance de la log-vraisemblance
\item Jeudi 22 Avril Jean-Baptiste DURAND (CIRAD Montpellier)
Arbres de Markov cach\'es pour l'\'etude de l'architecture des plantes
\item Jeudi 15 Avril Christian PAROISSIN (Universit\'e Paris X, MODAL'X)
Analyse probabiliste d'heuristiques auto-organisatrices avec probabilit\'es de requetes aleatoires
\item Jeudi 25 Mars Mr Roland HILDEBRAND
Planification optimale d'exp\'eriences avec l'analyse convexe
\item Jeudi 18 Mars Armelle GUILLOU (LSTA/Paris VI)
Analyse des valeurs extr\^emes en pr\'esence de censure
\item Jeudi 11 Mars Fran\c cois PERRON (Universit\'e de Montr\'eal)
Sur l'\'etape de r\'e\'echantillonnage dans les algorithmes PMC (Population Monte Carlo)
\item Jeudi 4 Mars Sophie DABO-NIANG (Laboratoire de Statistique du CREST)
Estimation du mode pour une variable fonctionnelle et application \`a la classification de courbes spectrom\'etriques
\item Jeudi 26 F\'evrier Franck CORSET (LABSAD / UPMF)
Reconstruction d'images binaires par les moindres carr\'es et l'optimisation de la valeur propre
\item Jeudi 12 F\'evrier Olivier GIMENEZ (TIMC / IMAG)
Les mod\`eles de capture-recapture : dynamique des populations et inf\'erence statistique
\item Jeudi 5 F\'evrier Landy RABEHASAINA (SMS / LMC / IMAG)
Files et r\'eseaux de files d'attente fluides du second ordre en environnement al\'eatoire
\item Jeudi 29 Janvier Olivier FRANCOIS (TIMC / IMAG)
Coalescence et parent\'es
\item Jeudi 22 Janvier Ren\'e BLACHER (SMS / LMC / IMAG)
Solution compl\`ete au probl\`eme des nombres pseudo-al\'eatoires
\item Jeudi 15 Janvier Ki\^en KIÊU (INRA Jouy-en-Josas)
Comportement asymptotique de la densit\'e spectrale d'ensembles al\'eatoires. Application \`a l'\'evaluation de la pr\'ecision d'estimateur st\'er\'eologiques
\item Jeudi 8 Janvier G\'erard DROUET-D'AUBIGNY (LABSAD / UPMF)
L'imputation des donn\'ees manquantes en statistique descriptive multidimensionnelle
\end{itemize}
\vspace{0.5cm}{\Large 2003}
\begin{itemize}
\item Jeudi 18 D\'ecembre Anestis ANTONIADIS (SMS / LMC / IMAG)
Noyaux autoreproduisants \`a base d'ondelettes et d\'ebruitage de signaux sur plan d'exp\'erience al\'eatoire
\item Jeudi 11 D\'ecembre Laurent DOYEN (SMS / LMC / IMAG)
Mod\'elisation et \'evaluation de l'efficacit\'e des maintenances d'un syst\`eme r\'eparable
\item Jeudi 4 D\'ecembre Mr Fateh CHEBANA (LSTA, Paris 6)
Processus de Bickel-Rosenblatt pond\'er\'e et tests d'ajustement
\item Jeudi 27 Novembre Joachim MÖCKS (Roche Diagnostics and University of Mannheim)
Nonparametric Two-Sample Omnibus Tests: Hunting the Best Order
\item Jeudi 20 Novembre Philippe VIEU (LSP / UPS, Toulouse III)
Estimation fonctionnelle : de la dimension un \`a la dimension infinie
\item Jeudi 13 Novembre Alain LATOUR (LABSAD / UPMF)
S\'eries \'epid\'emiologiques et mod\'elisation GARCH
\item Jeudi 6 Novembre
Simulation des champs de L\'evy fractionnaires
\item Jeudi 23 Octobre Adriana CLIMESCU-HAULICA (SMS / LMC / IMAG)
La d\'ecomposition de Cramer-Hida comme outil de mod\'elisation et calcul pour les canaux de communication multiples et nongaussiens
\item Jeudi 16 Octobre Sophie ACHARD (SMS / LMC / IMAG)
Une mesure de d\'ependance : pourquoi et comment ?
\item Jeudi 9 Octobre Soulafa ALI (LABSAD / UPMF)
L'effet de l'agr\'egation sur la structure d'un mod\`ele ARMA spatial unilat\'eral
\item Jeudi 2 Octobre St\'ephane GIRARD (SMS / LMC / IMAG)
Estimation de fronti\`ere par programmation lin\'eaire
\item Jeudi 26 Juin Gilbert RITSCHARD (Universit\'e de Gen\`eve)
Les arbres d'induction comme outils de mod\'elisation de tables de contingence multidimensionnelles
\item Jeudi 19 Juin Denis BOSQ (LSTA, Paris 6)
Moyennes mobiles Hilbertiennes
\item Jeudi 12 Juin Emmanuel GUERRE (LSTA, Paris 6)
Estimation semiparam\'etrique de l'aversion au risque dans un mod\`ele d'ench\`eres
\item Jeudi 5 Juin Raj J. BHANSALI (University of Liverpool)
Chaotic Maps with Slowly Decaying Correlations and Intermittency
\item Jeudi 22 Mai Serge COHEN (Universit\'e Paul Sabatier, Toulouse)
Identification d'axes de Draps gaussiens
\item Jeudi 15 Mai Jean-Louis PHILOCHE (GET, Paris)
Estimation de maximum de vraisemblance en Analyse en composantes principales : une nouvelle m\'ethode dans un mod\`ele gaussien
\item Jeudi 24 Avril Christine KERIBIN (Universit\'e Paris-Sud)
Estimation dans les arbres phylog\'eniques
\item Jeudi 17 Avril H\'el\`ene POILLEUX-MILHEM (INRA, Universit\'e d'Evry)
Test adaptatif de validation bas\'e sur une proc\'edure de tests multiples
\item Jeudi 10 Avril Myrtille VIVIEN (Universit\'es Montpellier 1&2)
La r\'egression PLS multi-tableaux : m\'ethodes et applications
\item Jeudi 3 Avril ETIENNE BERTIN, JEAN-MICHEL BILLIOT ET RÉMY DROUILHET (UPMF - Labsad)
Transition de phase dans le mod\`ele de Potts bas\'e sur le graphe de Delaunay
\item Jeudi 27 Mars JOURNEE ONDELETTES
Ondelettes et Images
\item Jeudi 20 Mars YANNICK LEFEBVRE (Universit\'e de Marne-la-Vall\'ee, EDF Rpt. MRI)
Etude d'un syst\`eme vieillissant: de la mod\'elisation au calcul de disponiblit\'e
\item Jeudi 13 Mars Oleg LEPSKI (Universit\'e d'Aix-Marseille)
Probl\`emes statistiques pour des fonctions multidimensionnelles
\item Jeudi 6 Mars Jean-Marc VESIN (EPFL)
Les d\'efis en traitement des signaux biom\'edicaux
\item Jeudi 20 F\'evrier P. LAFAYE DE MICHEAUX (Universit\'e de Montr\'eal)
A multivariate empirical characteristic function test of independence with normal marginals
\item Jeudi 13 F\'evrier C. VIAL (CREST/ENSAI)
Test d'une direction r\'ev\'elatrice :une approche g\'eom\'etrique
\item Jeudi 6 F\'evrier L. GARDES (Universit\'e Montpellier 2)
Utilisation de seuils al\'eatoires pour l'estimation de quantiles extr\^emes
\item Jeudi 30 Janvier A. TSYBAKOV (Universit\'e Paris 6)
Classification non-param\'etrique adaptative
\item Jeudi 23 Janvier M. LAVIELLE (Universit\'es Descartes & Paris Sud)
Estimation non param\'etrique de processus autor\'egressifs non lin\'eaires sous des contraintes dynamiques
\item Jeudi 16 Janvier M. GARRIDO (LabSAD, Universit\'e Grenoble 2)
Une nouvelle approche bay\'esienne pour l'estimation des param\`etres d'une loi de Pareto g\'en\'eralis\'ee, application \`a l'estimation de quantiles extremes
\item Jeudi 9 Janvier N. CHOPIN (CREST, Paris)
Applications des m\'ethodes de Monte Carlo s\'equentielles \`a la statistique bay\'esienne
\end{itemize}
\vspace{0.5cm}{\Large 2002}
\begin{itemize}
\item Jeudi 19 D\'ecembre A. PHAM (SMS/LMC/IMAG)
S\'eparation de sources par une approche temps/fr\'equence.
\item Jeudi 12 D\'ecembre C. HUE (INRIA/IRISA Rennes)
M\'ethodes particulaires pour le filtrage bayesien non lin\'eaire et non gaussien.
\item Jeudi 5 D\'ecembre RIVOIRARD V. (Universit\'e Paris 6)
Approche maxiset et estimation bay\'esienne sur les espaces de Besov faibles.
\item Jeudi 21 Novembre A. IOUDITSKI (SMS/LMC, Universit\'e Grenoble 1)
Quelques remarques sur les algorithmes stochastiques
\item Jeudi 14 Novembre J.F. CARDOSO (Dept TSI, ENST, Paris)
Trois versions ind\'ependantes de l'ind\'ependance pour la s\'eparation de sources
\item Jeudi 7 Novembre C. AMBROISE (UTC)
Mod\`eles de m\'elange hierarchique pour la fouille d'images
\item Jeudi 24 Octobre S. GEY (Universit\'e Paris 11)
Boosting CART pour la r\'egression
\item Jeudi 17 Octobre V. GUIGUES (SMS/LMC, Universit\'e Grenoble 1)
Analyse stochastique, optimisation robuste et calibration des param\`etres d'un mod\`ele financier
\item Jeudi 10 Octobre E.BERTIN, J-M BILLIOT, R DROUILHET (LabSAD, Universit\'e Grenoble 2)
Percolation dans le graphe de Gabriel
\item Jeudi 3 Octobre M. TITTERINGTON (Universit\'e de Glasgow)
The use of variational approximations in statistical inference
\item Jeudi 27 Juin C. MARTIN O. (UJF-LSR-GBM/INRIA)
Mod\`eles de m\'elange de mod\`eles lin\'eaires mixtes pour la classification de donn\'ees r\'ep\'et\'ees- applications au transcriptome
\item Jeudi 20 Juin J. ANTOCH (Universit\'e Charles de Prague)
Some approaches on change-point problems
\item Vendredi 7 Juin O. GAUDOIN (SMS/LMC/IMAG)
Mod\`eles stochastiques et m\'ethodes statistiques pour la fiabilit\'es des syst\`emes
\item Jeudi 30 Mai E. LEBARBIER (Universit\'e Paris 11)
D\'etection de zones homog\`enes dans une s\'equence d'ADN par m\'ethode de s\'election de mod\`ele
\item Jeudi 23 Mai Mr C. CZADO (SCA Zentrum Mathematik, Technische Universitaet Muenchen)
Binary time series with autoregressive innovation
\item Jeudi 25 Avril J.M. MARIN
Estimation quadratique non biais\'ee pour les mod\`eles \`a structures de covariance bande-diagonale
\item Jeudi 18 Avril A. FEUEVERGER
Some Applications of Fourier Analysis in Statistics
\item Jeudi 4 Avril Anestis ANTONIADIS (SMS/LMC, Universit\'e Grenoble 1)
Pr\'ediction par une m\'ethode d'ondelettes pour les processus autor\'egressifs hilbertiens et applications
\item Jeudi 28 Mars Ouadia RADOUANE (SMS-LMC-IMAG)
Tests lisses pour hypoth\`eses composites. Statistique du score de Wald. Application \`a la loi de Pareto g\'en\'eralis\'ee
\item Jeudi 21 Mars Olivier CAPPE (D\'ept. TSI, ENST, Paris)
La simulation \`a temps continu comme alternative aux m\'ethodes MCMC \`a sauts r\'eversibles
\item Jeudi 14 Mars Jean-Christophe BRETON (Universit\'e Lille 1)
Principes locaux d'invariance pour des variables stationnaires
\item Jeudi 7 Mars Olivier TEYTAUD (ISC Lyon)
Applications des convergences uniformes sur des espaces de fonctions: imagerie, identification de syst\`eme contr\^ole, extraction de r\`egles
\item Jeudi 28 F\'evrier Cyril HOR (LIS, INPG)
M\'elange de distributions du chi2 pour la segmentation du spectrogramme. Vers un outil d'interpr\'etation de signaux non-stationnaires
\item Jeudi 21 F\'evrier Fr\'ed\'erique LETUE (LABSAD-UPMF)
Estimation de la fonction de r\'egression de Cox par s\'election de mod\`ele
\item Jeudi 7 F\'evrier Bruno JEDYNAK (Universit\'e Lille 1)
Grandes d\'eviations et performances maximales en reconnaissance de formes
\item Jeudi 31 Janvier Yann GUERMEUR (LORIA Vandoeuvre-les-Nancy)
Machines \`a vecteurs de support multiclasses
\item Jeudi 24 Janvier Antoine CHAMBAZ (Universit\'e Paris-Sud, Orsay)
D\'etection de ruptures multidimensionnelles : th\'eorie et application
\item Jeudi 17 Janvier Georges MOUSTAKIDES (IRISA, Rennes)
Adaptive Algorithms for Blind Separation of Dependent Sources
\item Jeudi 10 Janvier Jean-Fran\c cois CARDOSO (D\'ept. TSI, ENST, Paris)
S\'eparation de sources en imagerie astronomique
\item Samedi 5 Janvier V. RIVOIRARD (Universit\'e Paris 6)
Approche maxiset et estimation bay\'esienne sur les espaces de Besov faibles.
\end{itemize}
|
https://dlmf.nist.gov/10.22.E37.tex
|
nist.gov
|
CC-MAIN-2021-10
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-10/segments/1614178363211.17/warc/CC-MAIN-20210302003534-20210302033534-00237.warc.gz
| 289,713,578
| 792
|
\[\int_{0}^{1}tJ_{\nu}\left(j_{\nu,\ell}t\right)J_{\nu}\left(j_{\nu,m}t\right)%
\mathrm{d}t=\tfrac{1}{2}\left(J_{\nu}'\left(j_{\nu,\ell}\right)\right)^{2}%
\delta_{\ell,m},\]
|
https://mirror.anarhija.net/anarhisticka-biblioteka.net/mirror/j/jz/john-zerzan-gvozdeni-stisak-civilizacije-aksijalno-doba.tex
|
anarhija.net
|
CC-MAIN-2021-25
|
application/octet-stream
|
application/x-tex
|
crawl-data/CC-MAIN-2021-25/segments/1623487621519.32/warc/CC-MAIN-20210615180356-20210615210356-00163.warc.gz
| 332,751,094
| 14,636
|
\documentclass[DIV=12,%
BCOR=10mm,%
headinclude=false,%
footinclude=false,open=any,%
fontsize=11pt,%
twoside,%
paper=a4]%
{scrbook}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainfont{Linux Libertine O}
% these are not used but prevents XeTeX to barf
\setsansfont[Scale=MatchLowercase]{CMU Sans Serif}
\setmonofont[Scale=MatchLowercase]{CMU Typewriter Text}
\setmainlanguage{croatian}
% global style
\pagestyle{plain}
\usepackage{microtype} % you need an *updated* texlive 2012, but harmless
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{verbatim}
% http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\PassOptionsToPackage{hyphens}{url}\usepackage[hyperfootnotes=false,hidelinks,breaklinks=true]{hyperref}
\usepackage{bookmark}
% footnote handling
\usepackage[fragile]{bigfoot}
\usepackage{perpage}
\DeclareNewFootnote{default}
\DeclareNewFootnote{B}
\MakeSorted{footnoteB}
\renewcommand*\thefootnoteB{(\arabic{footnoteB})}
\deffootnote[3em]{0em}{4em}{\textsuperscript{\thefootnotemark}~}
% continuous numbering across the document. Defaults to resetting at chapter. Unclear
% \usepackage{chngcntr}
% \counterwithout{footnote}{chapter}
\usepackage[shortlabels]{enumitem}
\usepackage{tabularx}
\usepackage[normalem]{ulem}
\def\hsout{\bgroup \ULdepth=-.55ex \ULset}
% https://tex.stackexchange.com/questions/22410/strikethrough-in-section-title
% Unclear if \protect \hsout is needed. Doesn't looks so
\DeclareRobustCommand{\sout}[1]{\texorpdfstring{\hsout{#1}}{#1}}
\usepackage{wrapfig}
\usepackage{indentfirst}
% remove the numbering
\setcounter{secnumdepth}{-2}
% remove labels from the captions
\renewcommand*{\captionformat}{}
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\KOMAoption{captions}{belowfigure,nooneline}
\addtokomafont{caption}{\centering}
% avoid breakage on multiple <br><br> and avoid the next [] to be eaten
\newcommand*{\forcelinebreak}{\strut\\*{}}
\newcommand*{\hairline}{%
\bigskip%
\noindent \hrulefill%
\bigskip%
}
% reverse indentation for biblio and play
\newenvironment*{amusebiblio}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newenvironment*{amuseplay}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newcommand*{\Slash}{\slash\hspace{0pt}}
\addtokomafont{disposition}{\rmfamily}
\addtokomafont{descriptionlabel}{\rmfamily}
% forbid widows/orphans
\frenchspacing
\sloppy
\clubpenalty=10000
\widowpenalty=10000
% http://tex.stackexchange.com/questions/304802/how-not-to-hyphenate-the-last-word-of-a-paragraph
\finalhyphendemerits=10000
% given that we said footinclude=false, this should be safe
\setlength{\footskip}{2\baselineskip}
\title{Gvozdeni stisak civilizacije: aksijalno doba}
\date{2006.}
\author{John Zerzan}
\subtitle{Pojava velikih religija i širenje dominacije}
% https://groups.google.com/d/topic/comp.text.tex/6fYmcVMbSbQ/discussion
\hypersetup{%
pdfencoding=auto,
pdftitle={Gvozdeni stisak civilizacije: aksijalno doba},%
pdfauthor={John Zerzan},%
pdfsubject={Pojava velikih religija i širenje dominacije},%
pdfkeywords={Kritika civilizacije; istorija}%
}
\begin{document}
\begin{titlepage}
\strut\vskip 2em
\begin{center}
{\usekomafont{title}{\huge Gvozdeni stisak civilizacije: aksijalno doba\par}}%
\vskip 1em
{\usekomafont{subtitle}{Pojava velikih religija i širenje dominacije\par}}%
\vskip 2em
{\usekomafont{author}{John Zerzan\par}}%
\vskip 1.5em
\vfill
{\usekomafont{date}{2006.\par}}%
\end{center}
\end{titlepage}
\cleardoublepage
Civilizacija znači kontrolu i, u velikoj meri, proces širenja kontrole. Ta dinamika se odvija na više nivoa i do sada je proizvela nekoliko prelaznih tačaka od suštinskog značaja.
Neolitska revolucija pripitomljavanja, koja je ustanovila civilizaciju, dovela je do preusmeravanja čovekovog mentaliteta. Žak Kovan je taj stepen uvođenja društvene kontrole nazvao „nekom vrstom simboličke revolucije“.\footnote{Jacques Cauvin, \emph{The Birth of the Gods and the Origins of Agriculture} (Cambridge: Cambridge University Press, 2000), str.2.} Ali, pokazalo se da pobeda dominacije nije bila potpuna i da su njenim temeljima nedostajali dodatna potpora i restrukturiranje. Prve velike civilizacije i carstva, u Egiptu, Kini i Mesopotamiji, ostali su utemeljeni na svesti plemenskih kultura. Pripitomljavanje je odnelo prevagu – bez njega, civilizacija ne bi mogla da postoji – ali, nova vladajuća perspektiva još uvek je bilo tesno povezana s prirodnim i kosmičkim ciklusima. Njihova potpuno simbolička izražajnost još nije bila sasvim usklađena sa zahtevima gvozdenog doba, koje počinje s prvim milenijumom pre n. e.
Karl Jaspers je tvrdio da se prelomni trenutak u ljudskoj resimbolizaciji, takozvano „aksijalno doba“,\footnote{Karl Jaspers, \emph{The Origin and Goal of History} (New Haven: Yale University Press, 1953), posebno prvih 25 str.} dogodio između 800. i 200. godine pre n. e., u tri velike oblasti civilizacije: na Bliskom istoku (uključujući i Grčku), u Indiji i Kini. Jaspers je izdvojio proroke i duhovne ličnosti koji su se pojavili tokom tih šest vekova, kao što su Zoroaster u Persiji, Deutero-Isaja među Hebrejima, Heraklit i Pitagora u Grčkoj, Buda u Indiji i Konfučije u Kini. Ti pojedinci su istovremeno – ali nezavisno jedni od drugih – dali neprocenjiv doprinos razvoju postneolitske svesti i nastanku svetskih religija.\footnote{Hrišćanstvo i islam se mogu smatrati kasnijim odjecima aksijalnog doba, pošto je njihov karakter bio formiran nekoliko vekova ranije.} U zapanjujuće uporednom razvoju, došlo je do promene s kojom je civilizacija, širom sveta, uspostavila još dublju dominaciju na ljudskim duhom.
Unutrašnji razvoj svakog od ovih društava razbio je relativnu stabilnost prethodnih kultura bronzanog doba. Oštre promene i novi pritisci na prvobitne obrasce postali su očigledni u mnogim delovima sveta. Na primer, svetska urbana populacija se skoro udvostručila između 600. i 450. godine pre n. e.\footnote{Andrew Bosworth, „World Cities and World Economic Cycles“, u \emph{Civilizations and World Systems}, ed. Stephan K. Sanderson (Walnut Creek, CA: AltaMira Press, 1995), str. 214.} Javila se potreba za opštim preobražajem, a njegovo sprovođenje je stvorilo „duhovne temelje čovečanstva“ kakvo je danas.\footnote{Karl Jaspers, \emph{Way to Wisdom} (New Haven: Yale University Press, 2003; 1951), str. 98–99.} Pojedinac je brzo počeo da zaostaje u odnosu na sve brži ritam civilizacije gvozdenog doba. Pošto su ljudske razmere i celina bili odbačeni, ubrzani proces pripitomljavanja zahtevao je drugačije podešavanje svesti. Na primer, dok su u ranijim mesopotamskim civilizacijama božanstva bila povezivana s raznim prirodnim silama, društvo se sada sve više raslojavalo, što je produbljivalo podelu između prirodnog i natprirodnog. Naravno, prirodni procesi su i dalje bili poštovani, ali sve veće društvene i ekonomske tenzije ograničavale su njihov integritet kao izvora značenja.
Neolit – kao ni bronzano doba – nije doneo potpuno narušavanje ravnoteže između prirode i kulture. Pre nastupanja aksijalnog doba, predmeti su lingvistički bili opisivani pomoću drugih aktivnosti. U aksijalnom dobu, naglasak se pomera na statične kvalitete predmeta, uz izbegavanje referenci na organske procese. Drugim rečima, javlja se postvarenje, u kojem se pogled na svet (to jest, etika) okreće od diskursa vezanog za konkretnu situaciju i usmerava ka apstrakcijama lišenim konteksta. Po rečima Henrija Bamforda Parksa, nove vere su više naglašavale „ljudsko, a ne tribalističko viđenje života.“\footnote{Henry Bamford Parkes, \emph{Gods and Men: The Origins of Western Culture} (New York: Vintage Books, 1965), str. 77.}
Celo nasleđe svetih mesta, plemenskog politeizma i vezanosti za zemlju bilo je slomljeno, a njegovi obredi i žrtvovanja iznenada su postali staromodni. U tesnoj vezi s razvojem „viših civilizacija“ i svetskih religija, pojavljuje se i osećaj za sistem, a potreba za kodifikacijom postaje dominantna.\footnote{John Plott, \emph{Global History of Philosophy}, vol. I (Delhi: Motilal Manarsidass, 1963), str. 8.} Prema Špengleru, „ceo svet (postaje) dinamični sistem, precizan, matematički utemeljen, sposoban da eksperimentalno utvrdi i matematički fiksira svoje najdublje uzroke, tako da čovek može njime dominirati\dots{}“\footnote{Oswald Spengler, \emph{The Decline of the West}, vol. II (New York: Alfred A. Knopf, 1928), str. 309.} Zajednički aspekt te nove definicije sveta bio je uspon jednog univerzalnog božanstva, koje je zahtevalo moralnu savršenost, pre nego izvođenje starih obreda. Povećana kontrola nad prirodom i društvom razvijala se u pravcu sve veće unutrašnje kontrole.
Preaksijalno, „animističko“ čovečanstvo počivalo je ne samo na manje totalitarnoj represiji već i na preživelom osećaju za jedinstvo s prirodnim svetom. Nove religije su nastojale da naruše veze s raznolikim, profanim svetom, tako što su ga ogradile i suprotstavile mu natprirodno i neprirodno.
To je podrazumevalo (i još uvek podrazumeva) ono što je Mirče Elijade nazvao „kosmizacijom“: prelazak s plana utemeljenosti i uslovljenosti, na „bezuslovni oblik bića“.\footnote{Mircea Eliade, „Structures and Changes in the History of Religions“, in \emph{City Invincible}, eds. Carl H. Kraeling and Robert M. Adams (Chicago: University of Chicago Press, 1958), str. 365.} Jedna budistička metafora govori o „probijanju krova“: drugim rečima, insistira se na prevazilaženju svetovnog i ulasku u transhumanu stvarnost.\footnote{\emph{Ibid}., str. 365–366. Skok Karla Bartha na „viši stepen priče o veri“ ima slično značenje; navedeno u Seyyed Hossein Nasr, \emph{Knowledge and the Sacred} (Albany: State University of New York, 1989), str. 48.} Nove, tipično monoteističke religije jasno su u toj transcendenciji videle jedinstvo, s one strane svakog konkretnog oblika egzistencije. Nadlični autoritet ili činilac – taj „kulturno najzastupljeniji, kognitivno najrelevantniji i evolucionistički najubedljiviji religijski koncept“\footnote{Scott Atran, \emph{In Gods We Trust: the Evolutionary Landscape of Religion} (New York: Oxford University Press, 2002), str. 57.} – bio je potreban da bi se izašlo na kraj sa sve većom nesposobnošću političkih i verskih autoriteta da obuzdaju nezadovoljstvo gvozdenim dobom.
Direktan, lični odnos s jednom krajnje spiritualnom realnošću bio je nov fenomen, koji je svedočio o slomu zajednice. Razvoj individualnog religioznog identiteta, kao suprotnost pojedincu s njegovim mestom u okviru plemena i prirodnog sveta, glavna je odlika aksijalne svesti. Personalizacija duhovnog putovanja i udaljavanje od zemlje za uzvrat su izmenili ljudska društva. Te inovacije su osporavale i potiskivale urođeničke tradicije i u isto vreme jasno ohrabrivale iluziju o bekstvu iz civilizacije. Unutrašnja transformacija i njeno „uzdizanje“ značili su razdvajanje duha i tela, nirvane od samsare. Joginsko povlačenje, esktremni asketizam i slične prakse, bili su, skoro bez izuzetka, duboko dualistički.
Sve to se, na mnogim mestima, dešavalo u kontekstu do tada neviđene racionalizacije i kontrole svakodnevnog života, naročito u VI veku pre. n. e. Šmuel Noa Ajzenštat je pisao o brojnim „pobunama protiv stega podele rada, autoriteta, hijerarhije i\dots{} struktuiranja vremenske dimenzije\dots{}“\footnote{S. N. Eisenstadt, „The Axial Age Breakthroughs“, \emph{Daedalus} 104 (1975), str. 13. „Neka bogovi zgrome onog ko je prvi otkrio sate i ovde postavio prvi sunačni časovnik.“ — Plautus, III vek pre n. e. Ajzenštatov esej je najbolji tekst na ovu temu koji sam uspeo da pronađem.} Aksijalne religije su nastale u dugom periodu društvene dezintegracije, kada su drevni izvori zadovoljstva i sigurnosti bili uveliko narušeni, a nekadašnja relativna autonomija plemena i sela slomljena. Glavne posledice bile su jačanje tehnološkog sistema i skoro istovremeni uspon moćnih imperija u Kini (Cin Ši), Indiji (Maurijska dinastija) i na Zapadu (helenistička carstva i nešto kasnije, \emph{Imperium Romanum}).
Pripitomljavanje i civilizacija su pokrenuli taj proces sâmim svojim karakterom, razvijajući tehnologiju kao oblik dominacije nad prirodom i sistem utemeljen na podeli rada. Rudarstvo se javlja nešto pre 3000. godine pre. n. e., na Sinaju (rano bronzano doba), da bi tokom celog trećeg milenijuma usledio snažan razvoj metalurške industrije. Te inovacije su se podudarale s pojavom prvih pravih država i pisma. Imenovanje faza kulturnog razvoja na osnovu metala adekvatno je svedočanstvo o njihovoj središnjoj ulozi. Metalurgija je dugo podsticala sve ostale proizvodne aktivnosti. Najkasnije do 800 godine pre. n. e., gvozdeno doba je potpuno zahvatilo Zapad, s masovnom proizvodnjom standardizovanih dobara.
Masifikacija društva, utemeljena na specijalizaciji, težila je da postane norma. Na primer, kovači iz bronzanog doba su sami pronalazili, kopali i topili udu, da bi je zatim obrađivali i pravili metalne legure. Postepeno je svaki od tih procesa postao domen odgovarajućeg specijaliste, što je ugrožavalo autonomiju i samodovoljnost. Kada je reč o grnčarstvu, običan domaći posao preuzeli su profesionalci.\footnote{To nas podseća na sudbinu kućnih razboja skoro tri milenijuma kasnije; nezavisni kućni tkači bili su potisnuti fabričkim sistemom Industrijske revolucije.} Hleb je počeo da sve više stiže iz pekara, nego iz domaćinstava. Nije slučajno što gvozdeno i aksijalno doba počinju u isto vreme, oko 800. godine pre n. e. Previranja i ustanci u stvarnom svetu pronašli su novu utehu i kompenzaciju u oblasti spiritualnog – u novim simboličkim oblicima koji su dodatno fragmentirali društvo.\footnote{Zapanjuje ironija s kojom je Niče svoj lik „s one strane dobra i zla“ nazvao Zaratustra.}
U Homerovoj \emph{Odiseji} (VIII vek pre. n. e.), tehnološki zaostali Kiklopi uživaju u iznenađujuće lagodnom životu, u poređenju s ljudima iz Grčke gvozdenog doba, kada se već javljaju prvi začeci fabričkog sistema. Razvoj gvozdenih plugova i oružja ubrzao je uništavanje prirode (erozija, nestanak šuma, itd.) i napredovanje razornog ratovanja.
U Persiji, nafta je već bila prerađivana, iako još uvek nije bila izvlačena iz bušotina. Tamo se pojavljuje vidovnjak Zoroaster (ili Zaratustra), koji je razvio tako moćne koncepte kao što su besmrtnost, Strašni sud i Sveti Duh (koji su brzo bili uključeni u judaizam). Dualizam borbe između božanskog Ahure Mazde i Zla postao je teološki kamen temeljac svih religioznih sistema tesno povezanih s potrebama države. Tačnije, persijski zakonski sistem iz ahemenidskog perioda (558–350. pre n. e.) bio je doslovno podudaran sa zoroasterizmom, koji ubrzo postao zvanična državna religija. Prema Harleu, zoroasterizam je „rođen da bi služio zahtevima društvenog poretka u procesu naglih promena i velike ekspanzije.“\footnote{Vilho Harle, \emph{Ideas of Social Order in the Ancient World} (Westport, CT: Greenwood Press, 1998), str. 18.}
Zoroasterski monoteizam nije označio samo konačno udaljavanje od animizma i starih bogova, nego i uspon kategorija dobra i zla, kao univerzalnih i vladajućih koncepata. Obe te karakteristike suštinski su pripadale aksijalnom dobu. Špengler je u Zoroasteru video „saputnika izraelskih proroka“, koji su takođe nastojali da razdvoje verovanja ljudi od mreže panteističkih, lokalnih i na prirodu usmerenih običaja i stavova.\footnote{Spengler, \emph{op. cit}., str. 168, 205.}
Hebrejsko-judaistička tradicija je prolazila kroz sličnu promenu, takođe u VI veku pre. n. e., na vrhuncu gvozdenog doba. Istočni Mediteran, a posebno Izrael, bili su zahvaćeni velikim talasom urbanizacije. Društveni poredak je bio u vidnom neskladu s novom potrebom za nacionalnim identitetom i zbijenošću, posebno naspram moćnijih suseda, koji su tada gradili svoja carstva. Izraelićani su dve trećine VI veka proveli kao zarobljenici Vavilonaca.
Jahve se izdigao iznad lokalnih božanstava plodnosti do statusa monoteizma, u skladu s težnjama opkoljenog i potlačenog naroda. Njegova uzvišenost i univerzalnost njegovog domena odgovarali su želji Hebreja za sticanjem snage u neprijateljskom svetu.\footnote{V. Nikiprowetzky, „Ethical Monotheism“, \emph{Daedalus} 104 (1975), str. 80–81.} U VIII veku pre. n. e., Amos je objavio tu viziju, kao deritualizujuće, onostrano spiritualno usmerenje. Jedinstvenost Jevreja tako je bila naglašena na pozadini koju je pružalo radikalno unitarno božanstvo.
Jezekiljov „novi čovek“ (početak VI veka pre. n. e.) bio je deo te nove natprirodne dimenzije, koja se takođe razvila u burnom periodu. Kao što naglašava Jakob Nojsner, najkasnije do VI veka pre n. e., ekonomija više nije više bila ograničena na osnovne potrebe, niti se temeljila na principu samodovoljnosti.\footnote{Jacob Neusner, \emph{The Social Studies of Judaism: Essays and Reflections}, vol. 1 (Atlanta: Scholars Press, 1985), str. 71.} S podelom rada i masifikacijom tržišta, uloga domaćinstava je sve više opadala. Sveprisutni bog sada je zahtevao apsolutno potčinjavanje, što je samo odražavalo aspiracije vladara i učvršćivalo vlast. Jahve je, kao i Zevs, prvobitno bio bog prirode, iako povezan s pripitomljavanjem. Njegova vladavina sada je obuhvatala celokupni moralni i građanski poredak i bila usidrena u vladavini kraljeva. Do izražaja dolazi pozitivna, iskupljujuća uloga patnje, koju je, sasvim predvidljivo, pratila usavršena politička dominacija. Deutero-Isaija (Isaija Drugi), najveći hebrejski prorok iz aksijalnog doba, osmislio je posebnu kraljevsku ideologiju u VI veku pre. n. e.\footnote{Paolo Sacchi, \emph{The History of the Second Temple Period} (Sheffield: Sheffield Academic Press Ltd., 2000), str. 87.} Objavio je da je sama suština Zaveta Bogu oličena u kralju – da je \emph{sâm} kralj Zavet.\footnote{\emph{Ibid}., str. 99–100.} Snaga te objave počivala je u univerzalnom kosmičkom zakonu, s one strane svake čulne percepcije ili zemaljske paralele; prirodne pojave bile su samo njegovi izrazi, uvijeni u smrtnicima nepojmljivu večnost.
U presokratovskoj Grčkoj, posebno do vremena Pitagore i Heraklita, u VI veku pre. n. e., plemenske zajednice su se raspadale, dok su se novi kolektiviteti i institucionalni kompleksi ubrzano gradili. U rudnicima srebra u Laurijumu radile su hiljade robova. „Napredna manufakturna tehnologija“\footnote{Frederick Klemm, \emph{A History of Western Technology} (New York: Charles Scribners Sons, 1959), str. 28.} u velikim urbanim radionicama često se odlikovala visokim stepenom podele rada. „Grnčarija se u Atini proizvodila u fabrikama u kojima je, pod nadzorom grnčarskog majstora, moglo raditi i sedamdeset ljudi.“\footnote{Charles Singer, E.J. Holmyard and A.R. Hall, eds., \emph{A History of Technology}, vol. I (Oxford: Clarendon Press, 1954), str. 408.} Štrajkovi i pobune robove nisu bili retkost,\footnote{C. Osborne Ward, \emph{The Ancient Lowly}, vol. I (Chicago: Charles Kerr, 1888), Chapter V.} dok su se, u uslovima nove masifikacije, kućni pogoni i mali proizvođači borili za opstanak. Kao i uvek, društvene tenzije pronašle su izraz u sukobljenim pogledima na svet.
Hesiod (VIII vek pre. n. e.) je pripadao tradiciji zagovornika Zlatnog doba, koja je slavila prvobitno, neiskvareno čovečanstvo. Oni su u gvozdenom dobu videli samo tragično udaljavanje od tih početaka. Nasuprot njima, Ksenofan (VI vek pre. n. e.) je odlučno tvrdio da je novo bolje, ponavljajući reči jevrejskih proroka aksijalnog doba, koji su značajno doprineli razvoju progresističke misli. Išao je toliko daleko da je u napredovanju civilizacije video izvor svih vrednosti i slavio urbanizaciju i razvoj složenih tehnoloških sistema.\footnote{Ludwig Edelstein, \emph{The Idea of Progress in Classical Antiquity} (Baltimore: Johns Hopkins University Press, 1967), str. 15–16.} Bio je prvi koji je jasno izrazio veru u progres.\footnote{\emph{Ibid}., str. 3.} Iako si kinici stali na stranu ranije vitalnosti i nezavisnosti, novo učenje je uspelo da se ukoreni. Sofisti su prihvatili njegove standarde, da bi tokom V veka pre n. e. opšte prihvatanje razvijene civilizacije potpuno potisnulo stare žudnje za primordijalnim, neotuđenim svetom.
Onostrani temelji tog pomaka mogu se pratiti kroz ubrzano udaljavanje ljudi od zemlje, što se dešavalo na više nivoa. Na zemlji zasnovan pluralizam malih proizvođača, politeistički vezanih za lokalne običaje, bio je izmenjen rastom i stratifikacijom urbanih celina, kao i njihovom otuđujućom perspektivom. Platonova \emph{Republika} (oko 400. godine pre n. e.) predstavlja hladan, otuđeni artefakt te snažne težnje ka promeni svesti i društva, u pravcu standardizacije i izolacije. Novi društveni model je značio i svesno nametanje novih autoriteta, krajnje udaljenih od preostalog obilja s kojim je civilizacija do tada koegzistirala.
Nova pravila društvene egzistencije počela su da prodiru do najudaljenijih kutkova svesti, a preplitanje i interakcija obrazaca gvozdenog i aksijalnog doba sreću se i u Indiji. U mlađem gvozdenom dobu, od X do VI veka pre. n. e., došlo je do promene društveno-ekonomsko-kulturnog koda, s plemensko\Slash{} pastoralnog, na sedelačko\Slash{} agrarni. Dominacija viškova i sedelačkog načina života velikim delom su bili podstaknuti i prošireni proizvodnjom kovanog gvožđa i upotrebom čeličnih plugova. Rudnici i preteče fabrika i u Indiji bili su skoncentrisani oko tehnologije gvožđa, što je podstaklo homogenizaciju kultura pod vladavinom Maurijske dinastije. Novi talas pripitomljavanja (na primer, konja), urbanizacija, veliki posedi i najamni rad preplavili su dolinu Ganga, dok je, po rečima Romila Tapara, „plemenski egalitarizam“ poklekao pred tim novim sistemom oko 500. godine pre n. e.\footnote{Romila Thapar, „Ethics, Religion, and Social Protest in India“, \emph{Daedalus} (104), 1975, str. 122. Videti i str. 118–121.}
To je otprilike vreme kada se pojavljuje Gautama Buda. Poreklo budizma i njegova uloga i širenju društva gvozdenog doba mogu se lako pratiti.\footnote{Na primer, Vibha Tripathi, ed., \emph{Archaeometallurgy in India} (Delhi: Sharada Publishing House, 1998), posebno Vijay Kumar, „Social Implications of Technology“.} Kanonski tekstovi govore da su prvi budistički učitelji bili savetnici vladara indijskih država, što svedoči da je u vreme velikog preobražaja budizam bio od direktne koristi novom urbanom poretku. Razni komentatori su u budističkoj reformulaciji premisa hinduizma videli ideologiju koja je služila potrebama novih struktura koje su još uvek nailazile na otpor.\footnote{Videti Greg Bailey and Ian Mabbet, \emph{The Sociology of Early Buddhism} (Cambridge: Cambridge University Press, 2004), str. 18–21. Treba reći da su Bailey i Mabbet svesni mnogo šire slike, a ne samo ovog aspekta.} Jasno je i da su prvi sledbenici bili uglavnom pripadnici urbanih i ruralnih elita.\footnote{Thapar, \emph{op. cit}., str. 125.}
Za Budu – što važi i za ostale aksijalne proroke – lično je imalo prednost nad društvenim. Bio je udaljeni posmatrač, koji je želeo da se oslobodi sveta, a njegova pažnja i odgovornost bili su usmereni na veoma usku sferu. To je stvorilo fatalističke temelje budizma, koji je u patnji video osnovnu činjenicu, životni uslov koji mora biti prihvaćen. Poruka o \emph{dukkha} (patnji) izražava uverenje da ljudsko stanje nikako ne može podrazumevati sreću.
Ipak, budizam je obećavao izlaz iz poremećnog i bolesnog društva, naglašavajući lično spasenje.\footnote{Bailey and Mabbet, \emph{op. cit}., str. 3.} Cilj je bio „nestanak“ u nirvani, potiskivanje svakog interesovanja za svet kod onih koji su već izgubili veru u njega. Slično tome, Budino objašnjenje „kosmičkog procesa“ bilo je lišeno svake reference na zemaljske procese, ljudske ili neljudske. Iako je kritikovao kastinski sistem i nasledno sveštenstvo, nije im se aktivno suprotstavljao. Budizam se pokazao kao veoma prilagodljiv promenama društvene situacije i zato je bio od koristi vladajućoj klasi.
Budizam je postao druga svetska religija, globalnog dometa i s posebnim nadljuskim bićima kojima su upućivane molitve. Do 250. godine pre n. e., Buda je postao poznata figura sedećeg božanstva, a budizam zvanična religija u Indiji, po dekretu Ašoke, poslednjeg vladara iz Maurijske dinastije.
U Kini je gvozdeno doba nastupilo nešto kasnije nego u Indiji; industrijska proizvodnja livenog gvožđa bila je raširena do IV veka pre n. e., zajedno s mnoštvom duhova i festivala posvećenih prirodi i plodnosti, sve u skladu s manje specijalizovanim i relativno malim oblicima zajedničkog života. Dinastija Džou se postepeno raspala do početka VIII veka pre n. e.; neprekidni ratovi i borba za vlast pojačali su se u periodu Zaraćenih država (482–221. pre n. e). Tako je stara duhovna tradicija, koja je uključivala šamanizam i lokalne kultove prirode, bila potisnuta ozbiljnim tehnološkim i političkim promenama.
Taoizam je bio deo tog burnog perioda, koji je nudio put ka odvajanju i onostranosti, ali je u isto vreme ostao povezan sa animističkom duhovnom tradicijom. Tačnije, rani taoizam je bio aktivistička religija, s nekim „legendarnim buntovnicima“ koji su se uključili u otpor novom trendu stratfikacije i borbu za povratak besklasnog Zlatnog doba.\footnote{Joseph Needham, \emph{Science and Civilization in China}, vol. 2 (Cambridge: Cambridge University Press, 1962), str. 99–100, 119.}
Primitivističke teme su očigledne kod Čuang Cea, a preživele su i u \emph{Tao Te Đingu}, ključnom tekstu vodeće ličnosti taoizma, Lao Cea (VI vek pre n. e.). Naglasak na jednostavnosti i antietatizmu doveo je taoizam u sukob sa zahtevima razvijene kineske civilizacije. I još jednom, oko prelomne 500. godine pre n. e., dolazi do sudara između oprečnih poruka Lao Cea i Konfučija, kao tipičnih alternativa aksijalnog doba.
Za razliku od Lao Cea, njegov glavni protivnik, Konfučije (557–479. pre n. e.) prihvatio je državu i Novi svetski poredak. Umesto da žudi za dobrim vremenima „plemenitog divljaka“, pre klasne podele i podele rada, Konfučije je u svojoj doktrini kombinovao kulturni progresivizam s napuštanjem veza s prirodom. Bogovi planina i vetrova, duhovi predaka i tome slično, nisu bili zabranjeni; ali, nisu više imali središnji značaj ili su ga čak potpuno izubili.
Konfučijanizam je predstavljao potpuno prilagođavanje novoj stvarnosti, postrojavanje uz vlast na mnogo praktičniji, manje transcendentan način nego u slučaju drugih duhovnih škola aksijalnog doba. Za Konfučija, transcendencija se odnosila na unutrašnjost; naglašavao je moralnu strogost u služenju autoritetima. To je podstaklo dalji kolonistički pohod civilizacije, sve do niova lične unutrašnjosti. Usvajanje strogog zdanja vlasti, bez teologije, ali uz disciplinovanje preko razvijenih pravila ponašanja, bilo je tipično za konfučijanski metod, koji je vladao Kinom dve hiljade godina.
Ovaj krajnje letimičan pregled društava aksijalnog doba možda može pomoći da se makar naznači kontekst Jaspersove formulacije o tom globalnom spiritualnom „prodoru“. Sve veći sukob između kulture i prirode, kao i narastajuće tenzije ljudske egzistencije, razrešavali su se u korist civilizacije i doveli do novog stepena dominacije. Jaram pripitomljavanja bio je modernizovan i poboljšan, tako da je pritiskao jače nego ikad. Oblast duhovnosti bila je drastično sužena, a ranija, na zemlji zasnovana shvatanja proglašena zastarelim. Ta prvobitna pobeda civilizacije nad slobodom i zdravljem od tada se ponavlja i širi, a njeno osavremenjavanje zahteva ogromne žrtve.
Celo polje duhovne prakse bilo je izmenjeno da bi se prilagodilo novim zahtevima masovne civilizacije. Religije aksijalnog doba ponudile su „spasenje“ po cenu slobode, samodovoljnosti i najvećeg dela onoga što je preostalo od neposrednih, komunalnih odnosa. Vlast je u početku morala da se služi najgrubljom prinudom i korupcijom da bi svoje podanike držala pod kontrolom. Sada je mogla da deluje mnogo slobodnije, na novoosvojenom terenu služenja i obožavanja.
Stvoreni su bogovi, u početku iz najdubljih žudnja ljudi neprestano lišavanih sopstvenih autentičnih moći i autonomije. Ali, iako su promene iz aksijalnog doba utrle put tom progresivnom lišavanju, civilizacija nikada nije bila prihvaćena svim srcem, a većina ljudi se nikada nije mogla potpuno poistovetiti sa svojim „spiritualizovanim“ bićem. Kako su te ideje uopšte bile prihvaćene? Kako je moglo doći do tako džinovskog poraza? Prema Špengleru, ljudi iz aksijalnog doba, koji su prihvatili tu novu religiju, bili su „umorni žitelji megalopolisa“.\footnote{Spengler, \emph{op. cit}., str. 356.} Sasvim je moguće da to važi i za žitelje današnjih megalopolisa – tako duboko omađijane, posle dugotrajnog izlaganja ideologijama zasnovanim na žrtvovanju, patnji i spasenju.
Odricanje je bilo Legija. Na primer, osnivač budizma bio je čovek koji je napustio svoju ženu i tek rođeno dete, kao prepreke na putu svog duhovnog usavršavanja. Nekoliko vekova kasnije, Isus je pozivao svoje sledbenike da naprave slične „žrtve“.
Današnja stvarnost galopirajuće katastrofe u velikoj meri je posledica odnosa religije i politike, ali, još važnije, prihvatanja putanje civilizacije kao nečeg neminovnog. Upravo je osećanje „neminovnosti“ navelo ljude iz VI veka pre n. e. da prihvate lažna rešenja religija aksijalnog doba; danas, to isto sećanje neminovnosti čini ljude nemoćnim pred ruinama koje ih zatiču na svim frontovima. Posle svega što se desilo u ovih 2500 godina, možda smo shvatili da udaljavanje od zajednice i zemlje nije rešenje već uzrok naših nevolja.
Autentična spiritualnost ima ogroman značaj za našu povezanost sa zemljom. Da bismo stekli prvo, moramo ponovo osvojiti ovo drugo. Sve ono što nam zaklanja put predstavlja tačnu meru našeg osiromašenja. Da li još uvek imamo dovoljno mašte, snage i odlučnosti da obnovimo celovitost koja nam je nekada pripadala po rođenju?
\begin{flushright}
\emph{Green Anarchy} br. 22, 2006.
\end{flushright}
% begin final page
\clearpage
% if we are on an odd page, add another one, otherwise when imposing
% the page would be odd on an even one.
\ifthispageodd{\strut\thispagestyle{empty}\clearpage}{}
% new page for the colophon
\thispagestyle{empty}
\begin{center}
Anarhistička biblioteka
\smallskip
Anti-Copyright
\bigskip
\includegraphics[width=0.25\textwidth]{logo-yu}
\bigskip
\end{center}
\strut
\vfill
\begin{center}
John Zerzan
Gvozdeni stisak civilizacije: aksijalno doba
Pojava velikih religija i širenje dominacije
2006.
\bigskip
John Zerzan, „The Iron Grip of Civilization: The Axial Age“, \emph{Green Anarchy} br. 22, 2006. J. Zerzan, \emph{Twilight of the Machines}, Feral House, LA, 2008, str. 27–37.
Preveo Aleksa Golijanin, 2008. Preuzeto iz Džon Zerzan, \emph{Sumrak mašina}, Službeni glasnik, Beograd, 2009, str. str. 60–78.
\bigskip
\textbf{anarhisticka-biblioteka.net}
\end{center}
% end final page with colophon
\end{document}
|
https://www.dpmms.cam.ac.uk/~twk/Rings.tex
|
cam.ac.uk
|
CC-MAIN-2022-33
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2022-33/segments/1659882571483.70/warc/CC-MAIN-20220811164257-20220811194257-00657.warc.gz
| 633,309,386
| 34,899
|
\documentclass[12pt,a4paper]{article}
\usepackage{amssymb,amsmath}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{convention}[theorem]{Convention}
\newtheorem{fact}[theorem]{Fact}
\newcommand{\supp}{\operatorname{supp}}
\newcommand{\im}{\operatorname{im}}
\begin{document}
\title{Rings and Modules\\Old Syllabus for O4}
\author{T.~W.~K\"{o}rner}
\maketitle
\begin{footnotesize}
\noindent
{\bf Small print}
The syllabus for the course is defined by
the Faculty Board Schedules (which are minimal for lecturing
and maximal for examining).
\emph{Please note that, throughout, ring means commutative ring with
one.}
I should {\bf very much} appreciate being told
of any corrections or possible improvements
and might even part with a small reward to the
first finder of particular errors. This document
is written in \LaTeX2e and stored in the file labelled
\verb+~twk/1B/Rings.tex+ on emu in (I hope) read permitted form.
My e-mail address is \verb+twk@dpmms+.
\end{footnotesize}
\tableofcontents
\section{Rings}\label{start rings} The same ideas and proofs occur
in the study of the integers (number theory),
polynomials (leading to algebraic geometry),
parts of the theory of matrices and in the
theory of Abelian groups. They may be unified by
using the theory of commutative rings and modules
following a programme laid out by Emmy Noether and others.
We start by looking at commutative rings with one.
\begin{definition}\label{Definition of ring}
We say that $(R,+,.)$ is a
\emph{commutative ring with a one} if
(i) $(R,+)$ is an Abelian group.
(ii) $a(bc)=(ab)c$ for all $a,b,c\in R$. [Associative law of
multiplication.]
(iii) $a(b+c)=ab+ac$, $(b+c)a=ba+ca$ for all $a,b,c\in R$.
[Distributive law.]
(iv) There exists a $1\in R$ such that $1a=a1=a$ for all
$a\in R$. [Existence of a multiplicative identity.]
(v) $ab=ba$ for all $a,b\in R$. [Commutative law of
multiplication.]
\end{definition}
Rules (iii) and (iv) could be shortened using rule (v).
We usually write $0$ for the identity of the group $(R,+)$
and call $0$ the zero of $R$.
Rule (iv) is made easier to use by the following simple
remark.
\begin{lemma}[Uniqueness of multiplicative identities]
If $(M,.)$ is an object with multiplication
and $1,1'\in M$ are identities in the sense that
\[1a=a1=a\ \text{and}\ 1'a=a1'=a\ \text{for all $a\in M$,}\]
then $1=1'$.
\end{lemma}
Thus $R$ has a unique multiplicative identity 1.
(We shall usually refer to 1 as `one'.
It is sometimes called `the unit element of $R$'
but the word `unit' means something different
in the context of this course, see Definition~\ref{unit}.)
There are important examples of \emph{non-commutative}
rings (that is systems obeying all the rules
in Definition~\ref{Definition of ring}
except (v) the commutative law of multiplication)
such as the set of $n\times n$ matrices with the
usual addition and multiplication $[n\geq 2]$.
However, there are many beautiful
results which are only true for commutative rings.
Rule (iv) (the existence of a one)
is less important. It gives some of our theorems
and proofs a more elegant form but commutative
rings without one are not
much harder to deal with.
\emph{In this course we shall only deal with
commutative rings with $1$ and `ring' will mean
`commutative ring with $1$'.}
Rings have many of the properties of the `ordinary
number systems' with which we are familiar from
school. The integers ${\mathbb Z}$ with the usual
operations form one of the most important examples.
Note that the equation $2m=1$ has no solution
in ${\mathbb Z}$ (in other words 2 has no multiplicative
inverse). The system $({\mathbb Z}_{n},+,\times)$ of the integers
modulo $n$ is another example. (The reader is certainly
familiar with this system but definition freaks
will find a neat definition using ring theory
in Definition~\ref{modular arithmetic}.)
Note that in ${\mathbb Z}_{12}$
\[\text{$3\neq 0$ and $4\neq 0$ yet $3\times4=0$}\]
(we call $3$ and $4$ divisors of zero) and
\[\text{$2\neq 6$ yet $2\times 3=6\times 3$}\]
(thus we can not use cancellation to get from $a\times b=a\times c$
to $b=c$). In ${\mathbb Z}_{81}$ we have $3\neq 0$, $3^{2}\neq 0$,
$3^{3}\neq 0$ yet $3^{4}=0$ (we say that $3$ is nilpotent).
These examples suggest that when dealing with rings we
should first try methods and ideas which work for
`ordinary number systems' but be prepared to modify
or, if the worst comes to the worst, abandon those
parts which depend on division or cancellation.
However we have access to another fertile source
of inspiration.
We have already met two examples of abstract algebraic
systems:- groups and vector spaces. Techniques and
ideas which were useful for these are likely to be
useful for rings.
Here are a few definitions and results along familiar lines.
\begin{definition} Let $(R,+,.)$ be a ring. If
$S$ is a subset of $R$ such that
(i) $a-b\in S$ and $ab\in S$ whenever $a,b\in S$,
(ii) $1\in S$,
\noindent
then we call $S$ a subring of $R$.
\end{definition}
(Condition (ii) excludes the possibility $S=\{0\}$.)
\begin{lemma} Let $(R,+,.)$ be a ring and $S$ subring of $R$.
Then $S$ equipped with the addition and multiplication
inherited from $R$ is itself a ring.
\end{lemma}
\begin{lemma}\label{ring direct} Let $(A,+_{A},\times_{A})$ and
$(B,+_{B},\times_{B})$ be rings. If we define addition
and multiplication on $A\times B$ by
\begin{align*}
(a_{1},b_{1})+(a_{2},b_{2})=&(a_{1}+_{A}a_{2},b_{1}+_{B}b_{2})\\
(a_{1},b_{1})\times(a_{2},b_{2})a=&
(a_{1}\times_{A}a_{2},b_{1}\times_{B}b_{2})
\end{align*}
then $(A\times B,+,\times)$ is a ring.
\end{lemma}
We often write $A\oplus B$ for the ring just defined and
call it the external direct sum.
\begin{definition} Let $R$ and $S$ be rings
with multiplicative identities $1_{R}$ and $1_{S}$.
We say that a map $\alpha:R\rightarrow S$ is a homomorphism
(more precisely a ring homomorphism) if
(i) $\alpha(r_{1}+r_{2})=\alpha(r_{1})+\alpha(r_{2})$,
\ $\alpha(r_{1}r_{2})=\alpha(r_{1})\alpha(r_{2})$ for
all $r_{1},r_{2}\in R$
(ii) $\alpha(1_{R})=1_{S}$.
\end{definition}
(Condition (ii) excludes the possibility $\alpha(r)=0$
for all $r\in R$.)
\begin{lemma} Let $R$ and $S$ be rings and
$\alpha:R\rightarrow S$ a homomorphism. Then
$\alpha(R)$ is a subring of $S$.
\end{lemma}
We often write $\im\alpha=\alpha(R)$ and
call it the image of $\alpha$.
\begin{definition} Let $R$ and $S$ be rings and
$\alpha:R\rightarrow S$ a homomorphism. If $\alpha$
is a bijection we say that $\alpha$ is an isomorphism
(more exactly a ring isomorphism) and that
$R$ and $S$ are isomorphic. We write
$R\stackrel{\alpha}{\cong} S$ ($R$ is isomorphic to $S$
by the map $\alpha$) and $R\cong S$ ($R$ is isomorphic to $S$).
\end{definition}
\begin{lemma} Isomorphism is an equivalence relation.
That is
(i) $R\cong R$.
(ii) If $R\cong S$, $S\cong T$ then $R\cong T$.
(iii) If $R\cong S$ then $S\cong R$.
\end{lemma}
\section{Ideals, quotients and the
isomorphism theorem}\label{quotients}
In many ways subrings are less important for ring theory
than ideals.
\begin{definition} Let $(R,+,.)$ be a ring. If
$I$ is a non-empty subset of $R$ such that
(i) $a-b\in I$ whenever $a,b\in I$,
(ii) $ab\in I$ whenever $a\in R$ and $b\in I$,
\noindent
then we call $I$ an ideal of $R$.
\end{definition}
We observe that $I$ is a subgroup of $(R,+)$ the ring $R$ considered
as an Abelian group under addition. We take over from
group theory the idea of a coset
\[r+I=\{r+s:s\in I\}\]
and observe that the first part of the proof of
Lagrange's theorem shows that the cosets form a
disjoint cover of $R$.
\begin{lemma} Let $I$ be an ideal of a ring $R$. Then
(i) $\bigcup_{r\in R}(r+I)=R$.
(ii) If $r,s\in R$ then either $(r+I)\cap(s+I)=\emptyset$
or $r+I=s+I$.
\end{lemma}
The remarkable thing is that we can define addition
and multiplication of cosets in a natural way.
\begin{lemma}
If $I$ is an ideal of a ring $R$ and
\[r_{1}+I=r_{2}+I,\ s_{1}+I=s_{2}+I\]
then
\[(r_{1}+s_{1})+I=(r_{2}+s_{2})+I,\ r_{1}s_{1}+I=r_{2}s_{2}+I.\]
\end{lemma}
\begin{definition}\label{quotient operations}
If $I$ is an ideal of a ring $R$
we write $R/I$ for the set of cosets of $I$ and define
addition and multiplication on $R/I$ by
\[(r+I)+(s+I)=(r+s)+I,\ (r+I)(s+I)=rs+I.\]
\end{definition}
\begin{lemma} If $I$ is an ideal of a ring $R$ then
$R/I$ with addition and multiplication as in the
previous definition is a ring.
\end{lemma}
We call $R/I$ a quotient ring.
The idea of a quotient ring gives a clean definition
of arithmetic modulo $m$.
\begin{lemma} If $m\in{\mathbb Z}$ then
\[m{\mathbb Z}=\{mr:r\in{\mathbb Z}\}\]
is an ideal of ${\mathbb Z}$.
\end{lemma}
\begin{definition}\label{modular arithmetic}
If $m\geq 2$ we write
\[{\mathbb Z}_{m}={\mathbb Z}/m{\mathbb Z}.\]
\end{definition}
The reader will readily identify ${\mathbb Z}/m{\mathbb Z}$
for all $m\in{\mathbb Z}$.
The next example warns us to stick to
Definition~\ref{quotient operations}.
\begin{example} The set $I=\{0,2\}$ is an ideal of the
ring ${\mathbb Z}_{4}$. We have
\[(0+I)(0+I)=0+I\]
but $\{rs:r,s\in I\}=\{0\}\neq I$.
\end{example}
Quotient rings as closely linked with homomorphisms.
\begin{definition} If $R$ and $S$ are rings and
$\phi:R\rightarrow S$ is a homomorphism we write
\[\ker\phi=\phi^{-1}(0)=\{r\in R:\phi(r)=0\}\]
and call $\ker\phi$ the kernel of $\phi$.
\end{definition}
\begin{lemma} Suppose that
$R$ and $S$ are rings and
$\phi:R\rightarrow S$ is a homomorphism. Then
(i) $\ker\phi$ is an ideal of $R$.
(ii) $\phi(r)=s$ has a solution $r\in R$ if and only if
$s\in \im\phi$.
(iii) If $\phi(r)=s$ then $\phi(r')=s$ if and only if
$r'\in r+\ker\phi$.
\end{lemma}
We have just shown that every kernel of a homomorphism
is an ideal. The next remark shows that every ideal is
the kernel of a homomorphism.
\begin{lemma} Let $I$ be an ideal of the ring $R$.
Then the map $\pi:R\rightarrow R/I$ given by
\[\pi(r)=r+I\]
is a homomorphism with kernel $I$.
\end{lemma}
The machinery is now in place to state and prove
our first key theorem.
\begin{theorem}[The isomorphism theorem] Suppose that
$R$ and $S$ are rings and
$\phi:R\rightarrow S$ is a homomorphism. Then
\[R/\ker\phi\cong\im\phi.\]
\end{theorem}
\section{Integral domains, fields and fractions} The
fact that we can not necessarily cancel or divide in rings
means that they are too general for many purposes.
\begin{definition}
A ring $(D,+,.)$ is called an integral domain
if, whenever $ab=0$, we can deduce that $a=0$ or $b=0$.
\end{definition}
\begin{definition}
A ring $({\mathbb F},+,.)$ is called a field if
$({\mathbb F}\setminus\{0\},.)$ is an Abelian group.
\end{definition}
Thus a ring $({\mathbb F},+,.)$ is a field if, whenever $a\in {\mathbb F}$
and $a\neq 0$ we can find $a^{-1}$ with $aa^{-1}=1$.
The element $a^{-1}$ (unique by a simple argument from
elementary group theory) is called the multiplicative
inverse of $a$.
\begin{lemma}(i) If $(D,+,.)$ is an integral domain
and $ab=ac$ with $a\neq 0$ then $b=c$.
(ii) Every field is an integral domain.
(iii) Every subring of an integral domain
is an integral domain.
\end{lemma}
Lemma~\ref{illegal} below
is not in the printed syllabus but this has
not deterred examiners from setting it in the past.
We need definitions which, important though they are
in a more general context, are only included here
in order to allow us to state the lemma.
\begin{definition} (i) We say that
an ideal $I$ of a ring $R$ is \emph{maximal} if
$I\neq R$ but if $J$ is an ideal with $J\supseteq I$
and $J\neq I$ then $J=R$.
(ii) We say that an ideal $P$ in a ring $R$ is \emph{prime}
if $ab\in P$ implies $a\in P$ or $b\in P$.
\end{definition}
\begin{lemma}\label{illegal}
Suppose that $I$ is an ideal in a ring $R$.
(i) $I$ is maximal if and only if $R/I$ is a field.
(ii) $I$ is prime if and only if $R/I$ is an integral domain.
\end{lemma}
We already know quite a lot of fields including
${\mathbb R}$, ${\mathbb C}$ and ${\mathbb Q}$.
We also know some finite fields.
\begin{lemma} (i) If $p$ is a prime then
${\mathbb Z}_{p}$
is a field.
(ii) If $m$ is not a prime then ${\mathbb Z}_{m}$
is not an integral domain. $[m\geq 2]$
\end{lemma}
We digress briefly to discuss \emph{characteristics}. If $R$
is a ring, $n$ a strictly positive integer
and $a$ an element of $R$
let us write
\[na=\underbrace{a+a+\dots+a}_{n},\]
$(-n)a=-na$ and $0a=a$.
\begin{lemma}\label{characteristic one}
Let $R$ be a ring with multiplicative identity
$1_{R}$.
(i) The map $\theta:{\mathbb Z}\rightarrow R$ given by
$\theta(m)=m1_{R}$ is a homomorphism.
(ii) The set $\im\theta$ of all elements of the form
$m1_{R}$ is isomorphic to ${\mathbb Z}$ or ${\mathbb Z}_{n}$
for some $n\geq 2$.
\end{lemma}
\begin{definition}\label{characteristic}
With the notation of Lemma~\ref{characteristic one},
if $\im\theta$ is isomorphic to ${\mathbb Z}_{n}$ we
say that $R$ has \emph{characteristic} $n$.
If $\im\theta$ is isomorphic to ${\mathbb Z}$ we
say that $R$ has \emph{characteristic} $\infty$
(or, in some texts \emph{characteristic} $0$).
\end{definition}
There is another way of viewing this idea.
\begin{lemma} If $A$ is a subset of a ring $R$ then there
is a smallest subring $B$ containing $A$. (In other words
there exists a subring $B$ of $R$ such that
$B\supseteq A$ and if $C$ is any subring of $R$
with $C\supseteq A$ then $C\supseteq B$.)
\end{lemma}
We call $B$ the ring generated by $A$. If $A=\emptyset$
so that $B$ is the smallest ring in $R$ we call $B$ the
\emph{prime subring} of $R$. (Here prime is used as in `primal scream',
the first or underlying scream.)
\begin{lemma} With the notation of Lemma~\ref{characteristic one},
$\im\theta$ is the smallest subring of $R$. Thus the
primal ring of $R$ is isomorphic to ${\mathbb Z}$ or ${\mathbb Z}_{n}$
for some $n\geq 2$.
\end{lemma}
It is natural to identify the prime subring with
${\mathbb Z}$ or ${\mathbb Z}_{n}$ and write $m=\theta(m)=m1_{R}$.
The notion of characteristic is most useful when applied to
integral domains.
\begin{lemma}\label{characteristic two}
(i) The characteristic of an integral domain
is either a prime or $\infty$.
(ii) The prime subring of an integral domain
may be identified with ${\mathbb Z}$ or ${\mathbb Z}_{p}$
where $p$ is a prime.
(iii) If $(R,+,.)$ is an integral domain then every non-zero
element of the additive group $(R,+)$ has order the
characteristic of the integral domain.
\end{lemma}
Later on we shall see that polynomials
provide important examples of integral domains which are not
fields. For the moment the only
obviously interesting example we know of an integral
domain which is not a field is ${\mathbb Z}$. However this
is such an important example that it justifies by itself
all the work we shall do in the remainder of this section.
From the point of view of late nineteenth century mathematics
we shall be showing that the rationals can be constructed from
the integers. `God created the integers, all the rest is the work
of man.' As a bonus we find that the same proof
gives the more modern sounding result that
`every integral domain can be embedded in a field'.
(From the point of view of the `plain man' we are just
describing fractions with a great deal of caution.)
\begin{lemma}\label{fraction one} If $(D,+,.)$ is an integral domain
write $D^{*}=D\setminus\{0\}$. The relation $\sim$ defined on
$D\times D^{*}$ by
\[(r_{1},s_{1})\sim(r_{2},s_{2})\ \text{if}\ r_{1}s_{2}=r_{2}s_{1}\]
is an equivalence relation.
If $(r_{1},s_{1})\sim(r_{2},s_{2})$ and
$(u_{1},v_{1})\sim(u_{2},v_{2})$ then
\[(r_{1}v_{1}+s_{1}u_{1},s_{1}v_{1})\sim
(r_{2}v_{2}+s_{2}u_{2},s_{2}v_{2})
\ \text{and}
\ (r_{1}u_{1},s_{1}v_{1})\sim (r_{2}u_{2},s_{2}v_{2}).\]
\end{lemma}
\begin{lemma}\label{fraction two} Continuing with the
assumptions and notation of Lemma~\ref{fraction one} let
us write ${\mathbf k}$ for the set $D/\sim$ of equivalence
classes
\[\frac{r}{s}=\{(r',s')\in D\times D^{*}:(r',s')\sim (r,s)\}.\]
Then we may define addition and multiplication on ${\mathbf k}$
by
\[\frac{r}{s}+\frac{u}{v}=\frac{rv+su}{sv}\ \text{and}
\ \frac{r}{s}\frac{u}{v}=\frac{ru}{sv}.\]
With this addition and multiplication, $({\mathbf k},+,.)$
is a field.
If we define $\theta:D\rightarrow {\mathbf k}$ by
\[\theta(r)=\frac{r}{1}\]
then $\theta$ is an injective homomorphism and so
$\tilde{D}=\im\theta$ is a subring of ${\mathbf k}$
isomorphic to $D$.
\end{lemma}
It is natural to identify $\tilde{D}$ with $D$ by writing
\[r=\frac{r}{1}\]
for each $r\in D$. We call ${\mathbf k}$ the field of fractions
of $D$.
We have thus characterised integral domains.
\begin{lemma}\label{embed isomorphically}
A ring $D$ is an integral domain
if and only if it is isomorphic to a subring of a field.
\end{lemma}
If we use the natural identification of $\tilde{D}$ with $D$
we can restate Lemma~\ref{embed isomorphically} in a more
striking manner.
\begin{lemma}\label{embed}
A ring $D$ is an integral domain
if and only if it embeds in a field.
\end{lemma}
The naturalness of our construction is emphasised by the
Lemma~\ref{small field} below. We need a preliminary remark.
\begin{lemma} If $A$ is a subset of a field ${\mathbb F}$ then there
is a smallest subfield $B$ containing $A$. (In other words
there exists a subfield $B$ of ${\mathbb F}$ such that
$B\supseteq A$ and if $C$ is any subfield of ${\mathbb F}$
with $C\supseteq A$ then $C\supseteq B$.)
\end{lemma}
We call $B$ the field generated by $A$. If $A=\emptyset$
so that $B$ is the smallest field in $R$ we call $B$ the
\emph{prime subfield} of $R$.
\begin{lemma}\label{small field}
Suppose that $({\mathbb F},+,.)$ is a field
and $D$ a subring of ${\mathbb F}$.
Let $Q$ be the smallest subfield of ${\mathbb F}$ containing $D$.
Then there is an isomorphism
$\phi:Q\rightarrow {\mathbf k}$ such that
$\phi(r)=\dfrac{r}{1}$ for all $r\in D$.
\end{lemma}
Lemma~\ref{characteristic two}~(ii) tells us that the
prime subring of a field
may be identified either with ${\mathbb Z}$ or ${\mathbb Z}_{p}$
where $p$ is a prime. If the prime subring is ${\mathbb Z}_{p}$
then it is also a field and so the prime subfield of ${\mathbb F}$.
If the prime subring is ${\mathbb Z}$ we may use
Lemma~\ref{small field} to identify the prime subfield.
\begin{lemma} The prime subfield of a field
may be identified in a natural manner
with ${\mathbb Q}$ or ${\mathbb Z}_{p}$
where $p$ is a prime.
\end{lemma}
So far as the syllabus is concerned this concludes the
section. What follows is easy but not on the syllabus.
If we start with $D={\mathbb Z}$ the construction above yields
${\mathbf k}={\mathbb Q}$ as a field. But mathematicians are
also interested in order. Recall that there is
a relation $>$ on ${\mathbb Z}$. We say that
$a>b$ if $b-a>0$. The properties of $>$ follow from the
following rules
(A) If $a\in{\mathbb Z}$ then exactly one of the following
is true: $a=0$ or $a>0$ or $-a>0$.
(B) If $a,b\in{\mathbb Z}$, $a>0$ and $b>0$ then $a+b>0$ and $ab>0$.
\begin{lemma}\label{order fractions 1}
Let $D={\mathbb Z}$ in Lemma~\ref{fraction one}.
If $(r_{1},s_{1})\sim(r_{2},s_{2})$
and $r_{1}s_{1}>0$ then $r_{2}s_{2}>0$.
\end{lemma}
\begin{lemma}\label{order fractions 2}
Let $D={\mathbb Z}$ in Lemma~\ref{fraction two}.
Then we may define a relation $>$ on ${\mathbf k}={\mathbb Q}$
by the conditions
\[\frac{r}{s}>\frac{u}{v}\ \ \text{if}
\ \ \frac{r}{s}-\frac{u}{v}>0\]
and
\[\frac{r}{s}>0\ \ \text{if}\ \ rs>0.\]
The following results hold
(A) If $a\in{\mathbb Q}$ then exactly one of the following
is true: $a=0$ or $a>0$ or $-a>0$.
(B) If $a,b\in{\mathbb Q}$, $a>0$ and $b>0$ then $a+b>0$ and $ab>0$.
\end{lemma}
In the language of the analysis course C9, ${\mathbb Q}$
is an ordered field.
\section{Unique factorisation, Euclidean and
principal ideal domains} In this section I shall give a rather
cold blooded and abstract treatment of factorisation in rings.
Historically the subject was an exciting and confusing
one. There are several theorems in number theory and elsewhere,
in particular the Wiles-Taylor theorem
(formerly Fermat's last theorem),
which looked easy to prove provided `the obvious factorisation
theorem holds' and very distinguished mathematicians
fell into the trap of assuming that which is obvious is true.
On the other hand when unique factorisation did indeed hold,
it provided a very powerful tool. We give a simple example
by proving an elegant theorem of Fermat (Theorem~\ref{Fermat})
via unique factorisation
at the end of this section.
There are two immediate problems, the first obvious and easily
overcome, the second less so. The easy problem is illustrated
when we try to extend the unique factorisation theorem from
${\mathbb N}$ (which is, of course, not a ring) to the ring
${\mathbb Z}$. We observe that
\[-15=(-3)\times 5=3\times(-5)\]
and that
\[15=(-3)\times(-5)=3\times 5\]
so some restatement of the theorem is necessary. We
set up the machinery to deal with this in the next
definition and the lemma that follows.
\begin{definition}\label{unit} Let $R$ be a ring. We say that $u\in R$
is a \emph{unit} if there exists an $v\in R$ such that
$uv=1$. (Thus $u$ is a unit if it has a multiplicative inverse).
We say that $r$ and $s$ are \emph{associates} if there exists
a unit $u$ with $r=su$.
\end{definition}
We extend a standard notation of elementary
number theory to any ring $R$. If $a,b,c\in R$
and $a=bc$ we say that `$b$ divides $a$' and write $b|a$.
\begin{lemma} (i) Consider a ring $R$.
The relation $r$ is an associate of $s$ is
an equivalence relation on $R$.
(ii) Consider an integral domain $D$.
Two elements $a,b\in D$ are associates if and
only if $a|b$ and $b|a$.
\end{lemma}
As examples we note that all non-zero elements in a field are
units and so all pairs of non-zero elements are associates.
In ${\mathbb Z}$ the units are $1$ and $-1$ and the only associate
of $n$ is $-n$.
The second problem is clearly marked by the two definitions
that follow together with Example~\ref{irreducible not prime}
\begin{definition} Let $R$ be a ring. We say that $q\in R$
is \emph{irreducible} if it is not a unit
and whenever $a|q$ then $a$ is either
a unit or an associate of $q$.
\end{definition}
\begin{definition} Let $R$ be a ring. We say that $p\in R$
is \emph{prime} if it is neither $0$ nor a unit
and whenever $p|ab$ $[a,b\in R]$ then
$p|a$ or $p|b$.
\end{definition}
\begin{lemma} Any prime is irreducible.
\end{lemma}
Unfortunately there exist rings in which not all irreducible
elements are prime.
\begin{example}\label{irreducible not prime} Let
\[r=\{n+m\surd(-5):n,m\in{\mathbb Z}\}\]
and let $N:R\rightarrow{\mathbb Z}^{+}$ be given by
\[N(n+m\surd(-5))=|n+m\surd(-5)|^{2}=n^{2}+5m^{2}.\]
(i) $R$ is a subring of ${\mathbb C}$ so an integral domain.
(ii) $N(ab)=N(a)N(b)$ for all $a,b\in R$.
(iii) The units of $R$ are $1$ and $-1$.
(iv) $6=2\times3=(1+\surd(-5))\times(1-\surd(-5))$.
(v) The elements $2$, $3$, $(1+\surd(-5))$ and $(1-\surd(-5))$
are irreducible.
\end{example}
In the development of the theory of factorisation for ${\mathbb Z}$
(strictly speaking for ${\mathbb N}$, which is not a ring)
carried
out in Course~C3 we showed that every irreducible element
is prime by using Bezout's theorem.
Fortunately there exist a large class of integral domains
for which something rather close to Bezout's theorem
holds --- the so called \emph{principal ideal domains}.
\begin{definition} If $R$ is a ring we say that an
ideal $I$ of $R$ is \emph{principal} if it is generated
by a single element $a$, in other words
\[I=aR=\{ar:r\in R\}.\]
We also write $I=(a)$.
\end{definition}
\begin{definition} An integral domain $D$ is said to
be a \emph{principal ideal domain} if every
ideal $I$ of $D$ is principal.
\end{definition}
\begin{lemma}\label{unique factors 1}
In a principal ideal domain every
irreducible element is prime.
\end{lemma}
\begin{lemma}\label{unique factors 2}
In a principal ideal domain every
element which is neither a unit nor $0$
is the product of a finite number of irreducible elements.
\end{lemma}
Once we have Lemmas~\ref{unique factors 1}
and~\ref{unique factors 2} the same easy, if slightly
tedious, arguments that we used to prove unique factorisation
for the integers in Course~C3 give us a
unique factorisation theorem for principal ideal domains.
\begin{theorem}\label{unique factorisation}
Let $D$ be a principal ideal domains.
(i) If $r\in D$ is non-zero we can find a unit $u$
and irreducible elements $a_{1}$, $a_{2}$, \dots $a_{n}$
such that
\[r=ua_{1}a_{2}\dots a_{n}.\]
(ii) Suppose that $u$ and $v$ are units and
$a_{1}$, $a_{2}$, \dots $a_{n}$, $b_{1}$, $b_{2}$, \dots $b_{m}$
are irreducible with
\[ua_{1}a_{2}\dots a_{n}=vb_{1}b_{2}\dots b_{m}.\]
Then $m=n$ and \underline{by renumbering} we can ensure that
$a_{j}$ and $b_{j}$ are associates for all $1\leq j\leq n$.
\end{theorem}
I said that principal ideal domains are common but
I have given no technique for proving that a domain is a
principal ideal domain. Not surprisingly, one way is
to seek an analogue of Euclid's algorithm from
Course~C3.
\begin{definition} We say that an integral domain $D$
is a \emph{Euclidean domain} if we can find a function
$\phi:D\setminus\{0\}\rightarrow{\mathbb Z}^{+}$
(called a Euclidean
function) such that
(i) if $a|b$ then $\phi(a)\leq \phi(b)$,
(ii) given $a\in R$ and $b\in R$ with $b\neq 0$ we can find
$q$ and $r$ such that $a=qb+r$ and either $r=0$ or
$\phi(r)<\phi(b)$.
\end{definition}
\begin{lemma} If $D$ is a Euclidean domain with Euclidean
function $\phi$ then $u$ is a unit of $D$ if and only
if $u\neq 0$ and $\phi(u)=\phi(1)$.
\end{lemma}
\begin{theorem} Every Euclidean domain is a principal
ideal domain.
\end{theorem}
We are now in position to give the reader a genuinely novel
example of a domain with unique factorisation.
\begin{example}[The Gaussian integers] Consider
\[R=\{n+mi:n,m\in{\mathbb Z}\}\]
and let $\phi:R\rightarrow{\mathbb Z}^{+}$ be given by
\[\phi(n+mi)=|n+mi|^{2}=n^{2}+m^{2}.\]
(i) $R$ is a subring of ${\mathbb C}$ so an integral domain
(called the Gaussian integers).
(ii) $\phi$ is a Euclidean function, so $R$ is a Euclidean
domain.
\end{example}
It is quite hard to give examples of a principal ideal
domains which are not Euclidean (presumably, not because
they are uncommon but because it
is hard to show that no Euclidean function could
possibly exist). However, they exist and are given, or at least
referenced, in the heavier algebra texts.
The remainder of this section is not on the syllabus.
In it we use factorisation in the Gaussian integers
to prove a theorem of Fermat.
\begin{theorem}[Fermat]\label{Fermat} We work in ${\mathbb N}$.
An odd prime $p$ can expressed as the sum
of the squares of two integers
\[p=n^{2}+m^{2}\]
if and only if $p$ is of the form $4N+1$ for some integer
$N$.
\end{theorem}
The only if part is easy, but to prove the if part
we need the following lemma on Gaussian integers.
\begin{lemma} We work in ${\mathbb N}$ except in part (i).
Suppose that $p$ is a prime such that we can find integers
$x$ and $y$ and an integer $c$ coprime to $p$
such that $x^{2}+y^{2}=cp$. Then
(i) $p$ is not a prime for the Gaussian integers,
(ii) there exist integers $n$ and $m$ such that $p=n^{2}+m^{2}$.
\end{lemma}
Combining this with the following simple consequence
of Wilson's theorem (Course C3) we obtain Fermat's theorem
(Theorem~\ref{Fermat}).
\begin{lemma} Suppose that $p$ is of the form $4N+1$ for some
integer $N$.
(i) We can solve the congruence $x^{2}\equiv -1 \mod{p}$.
(ii) We can find an integer $x$ with $1\leq x\leq p/2$
such that $x^{2}+1^{2}\equiv 0 \mod{p}$.
\end{lemma}
\section{Polynomials over rings}\label{start polynomials}
The definition of
polynomials over rings is complicated by the phenomenon
illustrated in the next example.
\begin{example} Let $f:{\mathbb Z}_{2}\rightarrow{\mathbb Z}_{2}$
be defined by $f(x)=x^{2}+x$. Then $f(x)=0$ for all $x$.
\end{example}
We must thus decide whether to define a polynomial by
its values (which is what an analyst would do)
or by its coefficients. As algebraists we decide
to define it by its coefficients and enshrine our
choice in the following definition.
\begin{definition} The polynomial ring $R[X]$ over $R$
is the collection of sequences
\[{\mathbf r}=(r_{0},r_{1},r_{2},\dots)\]
where each $r_{j}\in R$ and only finitely many of the
$r_{j}$ are non-zero. We define
\[
{\mathbf r}+{\mathbf s}=(r_{0}+s_{0},r_{1}+s_{1},r_{2}+s_{2},\dots)
\]
and
\[{\mathbf r}{\mathbf s}={\mathbf t}\]
where $t_{j}=\sum_{k=0}^{j}r_{j}s_{k-j}$.
\end{definition}
Neither the next lemma nor its proof present any surprises.
\begin{lemma}\label{polynomials over ring}
The polynomial ring $R[X]$ over $R$
is a ring.
\end{lemma}
Finally we remove the mask of the mysterious stranger
and write
\[{\mathbf r}=\sum_{j=0}^{\infty}r_{j}X^{j}=\sum_{j=0}^{N}r_{j}X^{j}\]
where $N$ is any integer sufficiently large that $r_{j}=0$
for all $j\geq N$.
Of course, the $X^{j}$ are simple place
holders (we call $X$ an `indeterminate').
If we want to talk about the value of a polynomial
we need a simple homomorphism (the pont evaluation map).
\begin{lemma}[Point evaluation] If $x\in R$ the map
$\delta_{x}:R[X]\rightarrow R$ given by
\[\delta_{x}\left(\sum_{j=0}^{N}r_{j}X^{j}\right)
=\sum_{j=0}^{N}r_{j}x^{j}\]
is a homomorphism.
\end{lemma}
As might be expected, we write $\delta_{x}p=p(x)$.
The degree of a polynomial is defined in the obvious manner.
\begin{definition} If
\[p(X)=\sum_{j=0}^{N}r_{j}X^{j}\]
and $r_{N}\neq 0$ then we say that $p$ has degree $N$
and write $\partial p=N$. If $p=0$ we write $\partial p=-\infty$.
\end{definition}
In this course we confine ourselves to polynomials over
integral domains.
\begin{lemma}\label{polynomials over domains}
If $D$ is an integral domain then
so is the polynomial ring $D[X]$.
\end{lemma}
\begin{lemma} If $p$ and $q$ are polynomials over an integral
domain then
(i) $\partial(p+q)\leq\max(\partial p,\partial q)$,
(ii) $\partial(pq)=\partial p+\partial q$.
\end{lemma}
If we restrict ourselves still further to fields we can use
a very powerful result.
\begin{theorem}[Euclidean division]
If $a$ and $b$ are polynomials over a field ${\mathbb F}$
and $b\neq 0$ then we can find polynomials $q$ and $r$
such that $a=qb+r$ and $\partial r<\partial a$.
\end{theorem}
As an immediate corollary we have a key result.
\begin{lemma}\label{fields and principals}
The polynomial ring over a field is
a Euclidean domain and so a principal ideal domain.
\end{lemma}
Notice that Lemma~\ref{fields and principals} does not
extend even to such a well behaved integral domain
as ${\mathbb Z}$.
\begin{example} The ideal generated by $2$ and $X$ is
not principal in ${\mathbb Z}$.
\end{example}
In the next section we shall see how this problem can be
partially overcome by embedding the integral domain
in its quotient field. A rather trivial example of
this technique is used to derive Lemma~\ref{ring roots} from
Lemma~\ref{field roots}~(iii) below.
\begin{lemma}\label{field roots}
Let us work in the ring of polynomials
over a field ${\mathbb F}$.
(i) If $p$ is a polynomial
and $p(a)=0$ for some $a\in {\mathbb F}$ then
we can find a polynomial $q$ such that
$p(X)=(X-a)q(X)$.
(ii) If $p$ is a polynomial
and $p(a_{1})=p(a_{2})=\dots =p(a_{m})=0$
for some distinct $a_{1},a_{2},\dots,a_{m}\in {\mathbb F}$ then
we can find a polynomial $q$ such that
\[p(X)=(X-a_{1})(X-a_{2})\dots (X-a_{m})q(X).\]
(iii) A polynomial of degree $n$ has at most $n$ zeros
in ${\mathbb F}$.
\end{lemma}
\begin{lemma}~\label{ring roots}
Suppose that $D$ is an integral domain and $p$ is a polynomial
in $D[X]$ of degree $n\geq 0$. Then there are at most n distinct
solutions of $p(x)=0$ with $x\in D$.
\end{lemma}
So far as the syllabus is concerned this concludes the
section. What follows is easy but not on the syllabus.
Suppose we consider the particular field ${\mathbb R}$.
We know that the polynomials on ${\mathbb R}$ form an integral domain
but in this special case we can also define an order.
If $p(X)=\sum_{j=0}^{n}a_{j}X^{j}$ with $a_{n}\neq 0$
we say that $p>0$ if $a_{n}>0$. If $p$ is the zero polynomial
we say that $p\ngtr 0$. The following two rules are easy to check.
(A) If $p\in {\mathbb R}[X]$ then exactly one of the following
is true: $p=0$ or $p>0$ or $-p>0$.
(B) If $p,q\in{\mathbb R}[X]$, $p>0$ and $q>0$
then $p+q>0$ and $pq>0$.
\noindent If $p,q\in{\mathbb R}[X]$ we write $p>q$
if $p-q>0$.
Exactly as Lemmas~\ref{order fractions 1}
and~\ref{order fractions 2}
we can extend this order to the field of quotients.
\begin{lemma} Let $D={\mathbb R}[X]$ in Lemma~\ref{fraction one}.
If $(r_{1},s_{1})\sim(r_{2},s_{2})$
and $r_{1}s_{1}>0$ then $r_{2}s_{2}>0$.
\end{lemma}
\begin{lemma} Let $D={\mathbb R}[X]$ in Lemma~\ref{fraction two}.
Then we may define a relation $>$ on ${\mathbf k}={\mathbb K}$
by the conditions
\[\frac{r}{s}>\frac{u}{v}\ \ \text{if}
\ \ \frac{r}{s}-\frac{u}{v}>0\]
and
\[\frac{r}{s}>0\ \ \text{if}\ \ rs>0.\]
The following results hold
(A) If $a\in{\mathbb K}$ then exactly one of the following
is true: $a=0$ or $a>0$ or $-a>0$.
(B) If $a,b\in{\mathbb K}$, $a>0$ and $b>0$ then $a+b>0$ and $ab>0$.
\end{lemma}
In the language of the analysis course C9, ${\mathbb K}$
is an ordered field but of a type rather different
from ${\mathbb Q}$ and ${\mathbb R}$.
Remember that ${\mathbb Q}$ and ${\mathbb R}$ obeyed the
axiom of Archimedes. `If $a,b>0$ then we can find an
$n\in {\mathbb Z}^{+}$ such that
\[na=\underbrace{a+a+\dots+a}_{n}>b\text{.'}\]
However, in ${\mathbb K}$, we have $X,1>0$ yet
\[n=n1=\underbrace{1+1+\dots+1}_{n}\ngtr X\]
for all $n$.
In a more striking, but equivalent, formulation
\[\frac{1}{n}>\frac{1}{X}\]
for all $n\in{\mathbb Z}$ with $n\geq 1$.
Thus we have an ordered field containing ${\mathbb Z}$
for which $1/n\nrightarrow 0$. Ordered fields like
${\mathbb K}$ which do not obey the axiom of Archimedes
are called non-Archimedean.
\section{Unique factorisation for polynomials }\label{start Galois}
Once we have a definition for the
ring $R[X]$ of polynomials over a ring $R$ it is easy to define
the ring $R[X_{1},X_{2},\dots,X_{n}]$ of polynomials
in $n$ indeterminates $X_{1}$, $X_{2}$, \dots, $X_{n}$
by using the inductive definition
\[R[X_{1},X_{2},\dots,X_{k+1}]=R[X_{1},X_{2},\dots,X_{k}][X_{k+1}].\]
It is not hard to see that this abstract definition
corresponds to our intuitive picture of polynomials
in several variables provided that we define
the polynomial by its coefficients rather than its values.
The typical element of $R[X_{1},X_{2},\dots,X_{n}]$
can be written
\[P(X_{1},X_{2},\dots,X_{n})
=\sum_{i_{1}=1}^{N}\sum_{i_{2}=1}^{N}\dots\sum_{i_{n}=1}^{N}
a_{i_{1},i_{2},\dots,i_{n}}X^{i_{1}}X^{i_{2}}\dots X^{i_{n}}\]
and addition, multiplication and point evaluation
\[P(x_{1},x_{2},\dots,x_{n})
=\sum_{i_{1}=1}^{N}\sum_{i_{2}=1}^{N}\dots\sum_{i_{n}=1}^{N}
a_{i_{1},i_{2},\dots,i_{n}}x^{i_{1}}x^{i_{2}}\dots x^{i_{n}}\]
for $x_{1},x_{2},\dots,x_{n}\in R$. The details which
echo the previous section are just as trivial here
as they were there and I shall omit them.
Simple induction using Lemma~\ref{polynomials over ring}
and Lemma~\ref{polynomials over domains} gives
the appropriate version of those lemmas.
\begin{lemma}
If $R$ is ring then so is $R[X_{1},X_{2},\dots,X_{n}]$.
\end{lemma}
\begin{lemma}
If $D$ is an integral domain then so is
$D[X_{1},X_{2},\dots,X_{n}]$.
\end{lemma}
Unfortunately, although
Lemma~\ref{fields and principals} tells us
that the polynomial ring ${\mathbb F}[X]$
over a field ${\mathbb F}$ is
a Euclidean domain and so a principal ideal domain
this result does not extend to polynomials in several
indeterminates.
\begin{example} If ${\mathbb F}$ is a field and
we work in the ring ${\mathbb F}[X_{1},X_{2}]$ then the ideal generated
by $X_{1}$ and $X_{2}$ is not principal.
\end{example}
In spite of this, it turns out that unique factorisation
still holds for
${\mathbb F}[X_{1},X_{2},\dots,X_{n}]$.
If we reflect on how we might prove this, it seems
natural to use induction on $n$. In order to
set out the induction it is natural to make the
following definition based on
the statement of Theorem~\ref{unique factorisation}
\begin{definition}\label{unique factorisation domain}
Let $D$ be an integral domain. We say that
$D$ is a \emph{unique factorisation domain}
if the following two statements hold.
(i) If $r\in D$ is non-zero we can find a unit $u$
and irreducible elements $a_{1}$, $a_{2}$, \dots $a_{n}$
such that
\[r=ua_{1}a_{2}\dots a_{n}.\]
(ii) Suppose that $u$ and $v$ are units and
$a_{1}$, $a_{2}$, \dots $a_{n}$, $b_{1}$, $b_{2}$, \dots $b_{m}$
are irreducible with
\[ua_{1}a_{2}\dots a_{n}=vb_{1}b_{2}\dots b_{m}.\]
Then $m=n$ and \underline{by renumbering} we can ensure that
$a_{j}$ and $b_{j}$ are associates for all $1\leq j\leq n$.
\end{definition}
The following point should be noted.
\begin{lemma} In a unique factorisation domain every
irreducible is a prime (so the two terms are synonymous).
\end{lemma}
Our aim would be achieved if we could
prove the following theorem.
\begin{theorem}\label{key to unique}
If $D$ is a unique factorisation domain
then so is $D[X]$.
\end{theorem}
Simple induction gives the next result.
\begin{theorem}
If $D$ is a unique factorisation domain
then so is $D[X_{1},X_{2},\dots,X_{n}]$.
\end{theorem}
By Theorem~\ref{unique factorisation} every principal ideal
domain is a unique factorisation domain and we have a
very strong result.
\begin{theorem}
If $D$ is a principal ideal domain
then $D[X_{1},X_{2},\dots,X_{n}]$ is a unique factorisation
domain.
\end{theorem}
How might we prove Theorem~\ref{key to unique}? Consider
the special case when $D={\mathbb Z}$. We know nothing
about ${\mathbb Z}[X]$ but we do know that ${\mathbb Z}$
embeds naturally in its field of fractions ${\mathbb Q}$
and that unique factorisation holds for ${\mathbb Q}[X]$
(by Theorem~\ref{unique factorisation}). Since
${\mathbb Z}[X]$ embeds naturally in ${\mathbb Q}[X]$
we can proceed as follows. Suppose we have a polynomial
$6X^{3}+24X^{2}+24X+6$ in ${\mathbb Z}[X]$. We may not be able
to factorise it in ${\mathbb Z}[X]$ but we can certainly
factorise it in ${\mathbb Q}[X]$. Take one such factorisation
\[6X^{3}+24X^{2}+24X+6=\frac{42}{25}\left(
\frac{5}{2}X+\frac{5}{2}\right)
\left(\frac{10}{7}X^{2}+\frac{30}{7}X+\frac{10}{7}\right).\]
By clearing fractions and cancelling (${\mathbb Z}$ is,
after all, the quintessential integer domain) we arrive
at
\[6X^{3}+24X^{2}+24X+6=2.3(X+1)(X^{2}+3X+1)\]
and a little thought shows that if
$(\frac{5}{2}X+\frac{5}{2})$ and
$(\frac{10}{7}X^{2}+\frac{30}{7}X+\frac{10}{7})$ were
irreducible in ${\mathbb Q}[X]$ then $(X+1)$ and
$(X^{2}+3X+1)$ are irreducible in ${\mathbb Z}[X]$.
Although the proof of Theorem~\ref{key to unique} given
below is quite complicated it is my belief that any one
seeking to develop the idea just given into a cast
iron proof of the uniqueness of factorisation for
${\mathbb Z}[X]$ would be lead
almost inevitably to something like it. One the proof
is written down it is a simple matter to replace
${\mathbb Z}$ by a general unique factorisation domain.
\begin{definition} Let $A$ be a subset of a ring $R$, such that
$A$ contains
a non-zero element.
We say that $a$ is a highest common factor of $A$
if
(i) $a|x$ for all $x\in A$,
(ii) if $a'|x$ for all $x\in A$ then $a'|a$.
\end{definition}
\begin{lemma} Any finite subset $A$ of a unique factorisation domain
such that $A$ contains
a non-zero element has a highest common factor.
\end{lemma}
In fact the following is true though we shall not use it.
\begin{lemma} Any subset $A$ of a unique factorisation domain
such that $A$ contains
a non-zero element has a highest common factor.
\end{lemma}
In what follows we work under the following standing hypothesis.
\noindent{\bf Standing hypothesis}
\emph{We have a unique factorisation
domain $D$ embedded in its field of fractions $F$.
We use the natural embeddings of $D$ in $F$, $F$ in $F[X]$,
$D[X]$ in $F[X]$ and $D$ in $D[X]$.}
We say that a polynomial $p(X)=\sum_{j=1}^{n}a_{j}X^{j}$ in $D[X]$
is \emph{primitive} if $1$ is a highest common factor
of $\{a_{j}:0\leq j\leq n\}$. We observe that any
$q\in D[X]$ can be written as $q=\gamma p$ with $\gamma\in D$
and $p$ primitive.
\begin{lemma} Under our standing hypothesis,
(i) The units of $D[X]$ are precisely the units of $D$.
(ii) Any $q\in F[X]$ can be written as $q=\gamma p$
with $\gamma\in F$ and $p$ a primitive polynomial in $D[X]$.
(iii) If $p,p'$ are primitive polynomials in $D[X]$ and
$\gamma p=\gamma' p'$ for some $\gamma,\gamma'\in F$
then $p$ and $p'$ are associates in $D[X]$, that is
there exists a unit $\epsilon\in D$ such that $p=\epsilon p'$.
\end{lemma}
\begin{lemma} Under our standing hypothesis, if $p$ and
$q$ are primitive polynomials in $D[X]$ so is $pq$.
\end{lemma}
\begin{lemma}[Gauss' lemma] Under our standing hypothesis,
a polynomial $p\in D[X]$
is irreducible if and only if it is either (a) an irreducible
element of $D$ or (b) it is primitive in $D[X]$ and irreducible
in $F[X]$.
\end{lemma}
\begin{theorem}\label{key to unique 1} Under our standing hypothesis,
$D[X]$ is a unique factorisation domain.
\end{theorem}
Theorem~\ref{key to unique 1} is just Theorem~\ref{key to unique}
so we are done. We cease working under the standing hypothesis.
The reader may suspect that it is hard to establish if a
particular polynomial is irreducible.
She is right\footnote{At least, as far as
human beings are concerned. There is an algorithm
which will always work and computer algebra
programs can handle quite complicated cases.}.
One useful tool is due to Eisenstein. We give it for
${\mathbb Q}[X]$ though it can be generalised.
\begin{lemma}[Eisenstein's criterion] Suppose that
\[P(X)=a_{0}+a_{1}X+a_{2}X^{2}+\dots+a_{n}X^{n}\]
is a polynomial in ${\mathbb Z}[X]$ (i.e. $P$ has integral
coefficients). If there exists a prime number $p$
such that $p\negmedspace\not| a_{n}$,
$p|a_{n-1}$, $p|a_{n-2}$, \dots, $p|a_{0}$
but $p^{2}\negmedspace\not| a_{0}$,
then $P$ is irreducible over ${\mathbb Q}[X]$.
\end{lemma}
As an example of how it used consider the following.
\begin{lemma}\label{cyclotomic}
If $p$ is prime then $1+X+X^{2}+\dots+X^{p-1}$
is irreducible over ${\mathbb Q}[X]$.
\end{lemma}
The trick here is to make the substitution $Y=X-1$ and to
base our algebra on the recollected
formula
\[1+x+x^{2}+\dots+x^{p-1}=\frac{x^{n}-1}{x-1}=\frac{(y-1)^{p}-1}{y},\]
from the days before we did abstract algebra.
The formula
\begin{align*}
(X-1)(X^{3}+X^{2}+X+1)&=X^{4}-1\\
&=(X^{2}-1)(X^{2}+1)\\
&=(X-1)(X+1)(X^{2}+1)
\end{align*}
shows us that $(X^{3}+X^{2}+X+1)=(X+1)(X^{2}+1)$
and suggests how to prove the converse.
\begin{lemma} If $n$ is composite then $1+X+X^{2}+\dots+X^{n-1}$
is not irreducible over ${\mathbb Q}[X]$.
\end{lemma}
\section{Fields and their simple extensions} We already know that
it may be useful to embed a field in a larger field.
Not all polynomials are soluble in ${\mathbb R}$ but
they are in the larger field ${\mathbb C}$. In this
section we study other extensions.
We begin with a couple of examples.
\begin{example}\label{example extension}
Consider ${\mathbb Q}$ as a subfield of
${\mathbb C}$.
(i) Let $\gamma$ be a transcendental number.
Then ${\mathbb Q}(\gamma)$ the smallest subfield of ${\mathbb C}$
containing ${\mathbb Q}$ and $\gamma$ is isomorphic
to the field of fractions of ${\mathbb Q}[X]$.
(ii) Let $\omega$ be a root of $z^{2}+z+1=0$ in ${\mathbb C}$.
Then each element of ${\mathbb Q}(\omega)$
the smallest subfield of ${\mathbb C}$
containing ${\mathbb Q}$ and $\omega$ may be written in
exactly one way as $a+b\omega$
with $a,b\in{\mathbb Q}$.
\end{example}
Of course, we may not be in the happy position of
Example~\ref{example extension} and find our extension
`ready made' as a subfield of some larger field.
\begin{definition} We say that $L$ is an \emph{extension}
of a field $K$ if there is an injective homomorphism
$\phi:K\rightarrow L$ (i.e. if $K$ is isomorphic
to a subfield of $L$).
\end{definition}
Having made this definition we shall usually
ignore it and treat $K$ as a subfield of $L$
with the natural identification $k=\phi(k)$ for
$k\in K$. However, there are one or two points
where we need to act more cautiously.
\begin{definition} We say that $L$ is a \emph{simple extension}
of a field $K$ if
we can find an element $u\in L$ such that $u$ and $K$
generate $L$. We write $L=K(u)$.
\end{definition}
We now see that choices of Example~\ref{example extension}
are, in some sense, typical.
\begin{definition} Suppose that $L$ is a simple extension
of $K$ with $L=K(u)$. If $u$ satisfies a polynomial
equation
\[u^{n}+a_{n-1}u^{n-1}+a_{n-2}u^{n-2}+\dots+a_{0}=0\]
with $a_{j}\in K$ we say that $u$ is \emph{algebraic}
and that $L=K(u)$ is an \emph{algebraic extension}
of $K$. If not we say that $u$ is \emph{transcendental}
and that $L=K(u)$ is a \emph{transcendental extension}
of $K$.
\end{definition}
\begin{lemma}\label{from transcendental}
If $K(u)$ is a transcendental extension
of a field $K$ then $K(u)$ is isomorphic to ${\mathbf k}$
the field of fractions of $K[X]$ under the natural isomorphism
$\theta:{\mathbf k}\rightarrow K(u)$ which has $\theta(a)=a$
for all $a\in K$ and $\theta (X)=u$.
\end{lemma}
The more interesting case of algebraic extension is dealt
with in a series of simple but important lemmas.
\begin{lemma}\label{zero of irreducible}
If $K(u)$ is an algebraic extension
of a field $K$ then $u$ is the zero of one and only
one monic irreducible polynomial $p$ in $K[X]$.
If $q\in K[X]$ and $q(u)=0$ then $q=hp$ for some
$h\in K[X]$ (that is $q$ is in the ideal $(p)$ generated
by $p$).
\end{lemma}
\begin{definition} With the notation and hypotheses of
Lemma~\ref{zero of irreducible} we say that $p$
is the \emph{minimal polynomial} of $u$. If $p$
has degree $n$ we say that
$u$ has \emph{degree over} $K$ of value n. We
also write $[u:K]=n$.
\end{definition}
\begin{lemma} With the notation and hypotheses of
Lemma~\ref{zero of irreducible} the mapping
$\phi:K[X]\rightarrow K(u)$ given by
\[\phi(f)=f(u)\]
is a surjective homomorphism with kernel $(p)$.
\end{lemma}
\begin{lemma}\label{to generated} With the notation and hypotheses of
Lemma~\ref{zero of irreducible} $K(u)$ is isomorphic
to $K[X]/(p)$. Thus every algebraic extension of $K$
is isomorphic to the quotient of $K[X]$ by the ideal
generated by some irreducible polynomial.
\end{lemma}
It is interesting to ask what happens to $p$ when we
factorise it in $K(u)[X]$. Since $p(u)=0$ we know that
$X-u$ is a factor of $p(X)$
(by the `remainder theorem' Lemma~\ref{field roots}~(i))
so $p$ will have linear factors. We shall discuss this
in detail in the next section but for the moment
we just give an example to show that, even in $K(u)[X]$,
$p$ may not factorise completely into linear factors.
\begin{example}\label{two extensions}
Consider ${\mathbb Q}$ as a subfield of
${\mathbb C}$. Let $p\in{\mathbb Q}[X]$ be given by
$p(X)=X^{4}-3$.
(i) The polynomial $p$ is monic and
irreducible over ${\mathbb Q}[X]$.
(ii) If $L$ is the field generated by ${\mathbb Q}$
and $3^{1/4}$ (the positive fourth root of $3$
then $L={\mathbb Q}(3^{1/4})$
and $p(3^{1/4})=0$. In ${\mathbb Q}(3^{1/4})$,
$p$ factors into irreducibles as
\[p(X)=(X-3^{1/4})(X+3^{1/4})(X^{2}+3^{1/2}).\]
(iii) If $L$ is the field generated by ${\mathbb Q}$
and $3^{1/4}i$
then $L={\mathbb Q}(3^{1/4}i)$
and $p(3^{1/4}i)=0$. In ${\mathbb Q}(3^{1/4}i)$,
$p$ factors into irreducibles as
\[p(X)=(X-3^{1/4}i)(X+3^{1/4}i)(X^{2}-3^{1/2}).\]
\end{example}
We complete the unstarred part of
this section with another simple but useful
observation.
\begin{lemma} (i) If $K$ is a subfield of $L$ then
$L$ can be considered as a vector space of $K$ in
a natural manner.
(ii) If $L$ is a transcendental extension of $K$ then
$L$ is infinite dimensional as a vector space over $K$.
(iii) If $L=K(u)$ and $u$ is algebraic of degree $n$
then $L$ has dimension $n$ as a vector space over $K$.
The elements $1$, $u$, \dots, $u^{n-1}$ form a basis
for $L$.
\end{lemma}
If $K$ is a subfield of $L$ we write $[L:K]$ for the dimension
(possibly $\infty$) of $L$ as a vector space over $K$.
We call $[L:K]$ the degree of $L$ over $K$.
\begin{lemma}[Tower law] If $K$ is a subfield of $L$
and $L$ is a subfield of $M$ then $[M:K]=[M:L][L:K]$.
\end{lemma}
The rest of this section is not on the syllabus and, even
if time allows to be covered, will only be sketched.
Details may be found in the opening chapters
of most texts on Galois theory (e.g. Chapter~6
of~\cite{Garling}).
We know that we stand on the shoulders of giants.
The only question to be answered is whether we see
any further. Our work so far enables us to solve
two geometric problems that the Greeks were unable
to solve. Both deal with ruler and compass constructions.
The Greeks asked which constructions were possible
with a ruler and compass alone. More prosaicly,
but essentially equivalently we ask which points
$(x,y)\in{\mathbb R}^{2}$
can be constructed starting from $(0,0)$ and $(0,1)$
using ruler and compass alone.
\begin{lemma}\label{ruler} Consider a ruler and compass construction
starting from $(0,0)$ and $(0,1)$ in which the point
$(x_{j},y_{j})$ is obtained at the $j$th step.
If we write $R_{0}={\mathbb Q}$ and $R_{j}=R_{j-1}(x_{j})(y_{j})$
(that is $R_{j}$ is the smallest subfield of ${\mathbb R}^{2}$
containing $R_{j-1}$, $x_{j}$ and $y_{j}$) then
$[R_{j},R_{j-1}]$ takes the value 1 or 2. Thus, by the
tower law, $[R_{j},{\mathbb Q}]=2^{r}$ for some integer
$r\geq 0$.
\end{lemma}
\begin{theorem}[The Delian problem] (i) The polynomial
$X^{3}-2=0$ is irreducible over ${\mathbb Q}$.
(ii) If in Lemma~\ref{ruler} we have $(x_{j},,y_{j})=(0,2^{1/3})$
then $[R_{j},{\mathbb Q}]$ must be divisible by 3.
(iii)We can not construct
the point $(0,2^{1/3})$ by ruler and compass construction
starting from $(0,0)$ and $(0,1)$.
(iv) It is impossible using ruler and compass alone
to construct a cube whose volume is double that of
a cube of given edge.
\end{theorem}
There are many people for whom only the useful is worthwhile.
Hogben dismisses Plato, Eudoxus and Euclid as men who
who treated `mathematics as a respectable form of relaxation
for the opulently idle'. Even Kline in his magisterial
history \emph{Mathematical Thought from Ancient to Modern
Times}~\cite{Kline}
sometimes reminds one of a school teacher in charge
of a class of brilliant pupils who will persist in chasing
the butterflies of pure mathematics rather than applying
themselves to the stern task of understanding the real world.
`Come on master Gauss stop looking at those cyclotomic
polynomials --- you have three orbits to compute before
bedtime!' Even if they understand the thrill of seeing
a problem solved that has baffled mankind for 2000 years
they see that thrill as a sinful diversion.
According to a story current in antiquity the Delians,
suffering from pestilence, sent to the oracle
who told
them to double the size of a particular cubic altar
to Apollo. They did as they
were told by doubling the length of each of its sides.
When the plague continued they consulted Plato
who explained that the god wished his altar doubled
in volume (preserving the cubic shape). The god,
continued Plato, demanded this not because he wanted
or needed such an altar but in order to censure the
Greeks for their indifference to mathematics and lack
of respect for geometry. The gods no longer punish
societies which reject the pursuit of knowledge for its own
sake quite so directly but perhaps such societies punish
themselves.
\begin{theorem}[The trisection problem] (i) We can construct
the point
$(\cos\pi/3,\sin\pi/3)$ by ruler and compass construction
starting from $(0,0)$ and $(0,1)$.
(ii) If we could trisect every angle by ruler and compass construction
we could construct $(\cos\pi/9,\sin\pi/9)$
by ruler and compass construction
starting from $(0,0)$ and $(0,1)$.
(iii) If $\gamma=\cos\pi/9$ then $4\gamma^{3}-3\gamma-\frac{1}{2}=0$.
If $\tau=2\gamma$ then $\tau^{3}-3\tau-1=0$.
(iv) The polynomial
$X^{3}-3X-1=0$ is irreducible over ${\mathbb Q}$.
(v)We can not
trisect every angle by a ruler and compass construction.
\end{theorem}
The credit for these two theorems goes to Wantzel.
Possibly if he had done something romantic like being killed in
a duel mathematicians would have had the courtesy to attach
his name to his theorems.
Suppose we could prove the following theorem.
\begin{theorem}[Lindeman]\label{Lindeman}
The number $\pi$ is transcendental.
\end{theorem}
Then we would be able to solve a third great problem of
antiquity.
\begin{theorem}[Impossibility of circle squaring]
(i) It is impossible that $\pi\in R_{j}$.
(ii) We cannot construct a square of area equal to a given
circle by a ruler and compass construction.
\end{theorem}
There are now fairly short proofs of Theorem~\ref{Lindeman}
(see, for example, Ian Stewart's beautiful \emph{Galois
Theory}~\cite{Stewart} Chapter~6)
but, so far as I know, no easy ones.
If we consider a regular polygon with $n$ sides
inscribed in the unit circle in such a way that one vertex
is at $(0,1)$ we see that the vertices are at points $(x_{r},y_{r})$
given by $x_{r}+iy_{r}=\omega^{r}$ where $\omega=\exp(2\pi i/n)$
(so the $\omega^{r}$ are the $r$th roots of unity.
The constructibility of a regular polygon with n sides
by a ruler and compass construction is thus closely linked to
the polynomial
\[X^{n}-1=(X-1)(1+X+X^{2}+\dots+X^{n-1})\]
and so to the \emph{cyclotomic polynomial}
$1+X+X^{2}+\dots+X^{n-1}$.
In particular, though we shall not do it,
it is not hard to get from Lemma~\ref{cyclotomic}
to the statement that the regular $p$-gon (with $p$ a
prime) is only constructible by a ruler and compass construction
if $p-1$ is a power of $2$. As a very young man, Gauss
showed the reverse (if $p-1$ is a power of $2$
the regular $p$-gon is constructible). It is said that
it was this discovery that decided him on a mathematical
career. The details of the mathematics involved may be
found in~\cite{Stewart}, Chapter~17.
\section{Splitting fields of polynomials} In
Lemmas~\ref{from transcendental} to~\ref{to generated} we derived
the properties of simple extensions but took the simple
extensions as given. Clearly, there always exists a transcendental
extension of a given field $K$ since the field of fractions
of $K[X]$ is such an extension. Moreover,
Lemma~\ref{from transcendental} tells us that (up to
isomorphism) this extension is unique.
Does there always exist an algebraic extension
corresponding to a given irreducible polynomial
and is it unique (up to
isomorphism)?
The obvious way forward is pointed out by Lemma~\ref{to generated}.
\begin{lemma}\label{simple extension} If $K$ is a field
and $p$ is irreducible in $K[X]$
then $L=K[X]/(p)$ is a field containing (an isomorphic copy of)
$K$. We can find $u\in L$ such that $L=K(u)$ is
simple algebraic extension of $K$ and
$X-u$ is a factor of $p(X)$ in $L$.
\end{lemma}
The only problem here is to show that $K[X]/(p)$
is a field and this follows
from the analogue of Bezout's theorem for principal ideal
domains. Uniqueness is simple.
\begin{lemma} Suppose that $K$ is a field and
$p$ is irreducible in $K[X]$. If
$K(u_{1})$ and $K(u_{2})$ are simple algebraic extensions
of $K$ such that $X-u_{j}$ is a factor of $p(X)$ in $K(u_{j})$
then there is an isomorphism
$\theta:K(u_{1})\rightarrow K(u_{2})$ with
$\theta(a)=a$ for $a\in K$ and $\theta(u_{1})=u_{2}$.
\end{lemma}
Thus in Example~\ref{two extensions} we know without
further computation that
${\mathbb Q}(3^{1/4})\cong{\mathbb Q}(3^{1/4}i)$.
Repeated use of Lemma~\ref{simple extension} gives
the theorem which the last section lead us to expect.
\begin{theorem} If $K$ is a field and $p\in K[X]$
there exists a field $L$ containing (an isomorphic
copy of) $K$ such that $[L:K]<\infty$ and we can find
$A\in K$, $\alpha_{1},\alpha_{2},\dots,\alpha_{n}\in L$
such that
\[p(X)=A(X-\alpha_{1})(X-\alpha_{2})\dots(X-\alpha_{n})\]
\end{theorem}
We say that $p$ \emph{splits} over $L$. In order to
obtain a uniqueness result we need to tighten up
the conditions of the theorem.
\begin{definition} If $K$ is a subfield of the field
$L$ and $p\in K[X]$ we say that $L$ is a splitting
field for $p$ over $K$ if
(i) $p$ factorises into linear factors
\[p(X)=A(X-\alpha_{1})(X-\alpha_{2})\dots(X-\alpha_{n})\]
over $L$.
(ii) If $p$ factorises into linear factors over a subfield
$L'$ of $L$ then $L'=L$.
\end{definition}
Observe that condition (ii) can be replaced by
the statement $L=K(\alpha_{1},\alpha_{2},\dots,\alpha_{n})$
the field generated by $K$, $\alpha_{1}$, $\alpha_{2}$,
\dots $\alpha_{n-1}$ and $\alpha_{n}$.
The uniqueness theorem is now easy to state.
\begin{theorem}\label{split unique}
Suppose that $K$ is a field and
$p\in K[X]$. If $L$ and $L'$ are splitting fields
of $p$ then there is an isomorphism $\theta:L\rightarrow L'$
with $\theta(a)=a$ for all $a\in K$.
\end{theorem}
There may be many different ways to go from $K$ to a splitting
field by adjoining roots and
Theorem~\ref{split unique} is slightly harder to prove
than might be expected.
The following lemma contains the key idea.
\begin{lemma} Let $K$ be a field, $p\in K[X]$
and let $L$ be a splitting field for $p$ over $K$.
Suppose that $L'$ is a field containing a subfield
$K'$ isomorphic to $K$ under the
isomorphism $i$ such that $i(p)$ splits in $L'$.
(Here, if $p(X)=\sum_{r=0}^{n}a_{r}X^{r}$ we write
$i(p)(X)=\sum_{r=0}^{n}i(a_{r})X^{r}$.)
Then there is an injective homomorphism
$j:L\rightarrow L'$ such that $j|_{K}=i$.
\end{lemma}
This is as far as we shall go with the study of splitting
fields but the following remark (which is not on the syllabus)
seems worth making. We need results on countability
from course~C3.
\begin{lemma} (i) If $K$ is a countable subfield of $L$
and $[L:K]<\infty$ then $L$ is countable.
(ii) If $K$ is a countable field we can find a countable
field $L$ containing (an isomorphic copy of) $K$ such that
every polynomial $p\in K[X]$ splits in $L[X]$.
(iii) If $K$ is a countable field we can find countable
fields $K_{j}$ with
\[K=K_{0}\subseteq K_{1}\subseteq K_{2}\subseteq\dots\]
with $K_{j-1}$ a subfield of $K_{j}$ such that
every polynomial $p\in K_{j-1}[X]$ splits in $K_{j}[X]$.
(iv) If $K$ is a countable field we can find a countable
field $L$ containing (an isomorphic copy of) $K$ such that
every polynomial $p\in L[X]$ factors completely into
linear factors.
\end{lemma}
The same idea gives the following more striking result.
\begin{lemma} There is a countable subfield ${\mathbb F}$
of ${\mathbb C}$ with ${\mathbb F}\supseteq{\mathbb Q}$
such that every polynomial in ${\mathbb F}[X]$ has a root
in ${\mathbb F}$.
\end{lemma}
Thus, from the point of view of a dyed in the wool algebraist,
the construction of the uncountable field ${\mathbb C}$
in order to have the fundamental theorem of algebra is
a reckless extravagance.
\section{Finite fields}\label{finite fields}
In this short but interesting section
we find all finite fields explicitly.
Our first step is already substantial.
\begin{lemma}\label{count finite}
If ${\mathbb F}$ is a finite field then
${\mathbb F}$ has characteristic $p$ a prime (that is
${\mathbb F}$ has prime field (an isomorphic copy of)
${\mathbb Z}_{p}$). The field ${\mathbb F}$ has $p^{n}$
elements where $[{\mathbb F}:{\mathbb Z}_{p}]=n$.
\end{lemma}
The second step is also remarkable.
\begin{lemma}\label{order finite} Let $({\mathbb F},+,.)$ be a field.
If $G$ is a finite subgroup of the multiplicative
group $({\mathbb F}\setminus\{0\},.)$ then
$G$ is a cyclic group.
\end{lemma}
Notice that this result applies to general fields.
The reader should identify all possible $G$ in the cases
${\mathbb F}={\mathbb C}$ and ${\mathbb F}={\mathbb R}$.
Our proof depends on a simple result from the theory
of commutative groups.
\begin{lemma} If $G$ is a finite Abelian group there exists
an integer $N$ and an element $h$ such that
(i) $g^{N}=e$ for all $g\in G$,
(ii) $h$ has order exactly $N$.
\end{lemma}
Combining Lemmas~\ref{count finite} and~\ref{order finite},
we see that all finite fields have a very simple structure.
\begin{theorem}\label{structure}
If ${\mathbb F}$ is a finite field
then ${\mathbb F}$ is (isomorphic to) the splitting
field of $X^{p^{n}-1}-1$ over ${\mathbb Z}_{p}$
for some prime $p$ and some integer $n\geq 1$.
\end{theorem}
(We can refer to \emph{the} splitting field since
Theorem~\ref{split unique} tells us that splitting fields
are unique up to isomorphism.)
Theorem~\ref{structure} tells us the structure of
a given finite field, if it exists, but does not
tell us if such a field exists. To obtain existence
results we need to investigate the polynomial
$X^{p^{n}-1}-1\in Z_{p}[X]$. We use a general result
on repeated roots.
\begin{lemma} Let $K$ be a field. Suppose
that $p(X)=\sum_{j=0}^{n}a_{j}X^{j}\in K[X]$
splits over $K$.
Then $p$ has $(X-a)^{2}$ as a factor for some $a\in K$
if and only if the formal derivative
\[p'(X)=\sum_{j=1}^{n}ja_{j}X^{j}\]
and $p[X]$ have a non-trivial common factor.
\end{lemma}
\begin{lemma} Let $K$ be a field of characteristic $p$ a prime.
If $X^{p^{n}-1}-1$ splits over $K$ then all the linear
factors are distinct.
\end{lemma}
Our results look nicer when stated in terms of
$X^{p^{n}}-X$.
\begin{theorem}\label{structure unique}
If $p$ is a prime and $n$ an integer the splitting
field of $X^{p^{n}}-X$ over ${\mathbb Z}_{p}$
contains $p^{n}$ elements consisting of the
$p^{n}$ distinct roots of $X^{p^{n}}-X$.
\end{theorem}
We have now proved existence and uniqueness so we may
make the following definition.
\begin{definition} The finite field of order $p^{n}$
($p$ prime, $n\geq 1$) is called the \emph{Galois field}
of order $p^{n}$ and written $\mathbf{GF} (p^{n})$.
\end{definition}
This triumph completes that part of this section which is
on the syllabus. However (strictly off the syllabus) we
must admit that the triumph is not quite as complete
as it appears. Observe that Lemma~\ref{order finite}
tells us that the non-zero elements of
$\mathbf{GF} (p^{n})$ form a cyclic group
generated by a single element $x$ say.
As temporary notation let us call $x$ a
multiplicative generator of $\mathbf{GF} (p^{n})$.
Surely, we can not claim to understand $\mathbf{GF} (p^{n})$
unless we have some short algorithm for finding a
multiplicative generator for it. So far as I know,
no such algorithm has been found.
Of course since
$\mathbf{GF} (p^{n})$ is finite, exhaustive search will
eventually turn up such a generator. We note also that quite
a large proportion of the
elements of $\mathbf{GF} (p^{n})$ must be
multiplicative generators (can you make this
statement more precise?) so properly
random trial and error\footnote{The
ghastly modern educationalist's jargon seeks to replace
`trial and error'
by `trial and improvement' but here the failure of a guess
results in no improvement.} will rapidly find a
multiplicative generator $x$ with arbitrarily low probability
of failure. Let us choose a basis
$u_{1},u_{2},\dots,u_{n}$
for
$\mathbf{GF} (p^{n})$ as a vector space over ${\mathbb Z}_{p}$.
We then have
\[x^{r}=a_{1}(r)u_{1}+a_{2}(r)u_{2}+\dots+a_{n}(r)u_{n}.\]
The $n$-tuple in
\[\mathbf{a}_{r}=(a_{1}(r),a_{2}(r),\dots,a_{n}(r))\]
thus runs through each element of
${\mathbb Z}_{p}\setminus\{\boldsymbol{0}\}$
exactly once as $r$ runs from $0$ to $p^{n}-1$.
In a telepathy experiment, Albert and Bertha are placed in separate
sealed rooms. The experiment has already been running
for a time $5N$ minutes where $N$ is unknown to them.
A bell rings each $5$ minutes and (supposing it
to be $5r$ minutes since they entered the room)
they are asked to guess
an $n$-tuple of integers
$\mathbf{a}_{r+N}=(a_{1}(r+N),a_{2}(r+N),\dots,a_{n}(r+N))$ with
$0\leq a_{j}(r+N)\leq p-1$. If one of them guesses right
he or she is told so and presented with a paper star.
Bertha has the advantage that she knows how $\mathbf{a}_{r}$
is constructed and in particular knows $x$.
It is easy to see that initially Albert and Bertha
can only guess at random but that \emph{once Bertha
has guessed right} she can lock in and give the
correct answer each time.
One way of trying to hide a radio signal is to spread it
as a large number of weak signals at different frequencies
and to change the choice of frequencies at regular intervals.
Of course the enemy may make a lucky choice of listening
frequencies and catch a brief part of the signal but
the change of frequencies should stymie him. On the other hand,
our own side may not be able to keep their timekeepers
sufficiently synchronised with the transmitter during long
periods of silence. We begin to see how military men and
others might develop a deep interest in Galois fields.
\section{Modules} The theory of vector spaces is a
well developed and powerful one. We have seen examples of its
use in this course in Lemma~\ref{count finite} which helped
us classify finite fields and in the definition of the
degree $[L:K]$ of an extension which helped resolve
the classical ruler and compass problems. From time
to time we come across structures like the `lattice'
${\mathbb Z}^{2}$ which have a vector space `flavour'
without being vector spaces. It is thus natural to
seek a theory which generalises the notion of a vector space
though though we may expect the development of such a
theory to be more intricate and the general results
to be less neat.
We proceed in the obvious way by replacing `field'
by `ring' in the definition of a vector space.
\begin{definition} Let $R$ be a ring. We say that
$(M,R,+,.)$ is a module over $R$ if the following is
conditions hold.
(i) $(M,+)$ is an Abelian group.
(ii) There is a map $\theta:R\times M\rightarrow M$
written $\theta(r,\mathbf{m})=r\mathbf{m}$ such that
\ \ (a) $r(\mathbf{m}_{1}+\mathbf{m}_{2})
=r\mathbf{m}_{1}+r\mathbf{m}_{2}$,
\ \ (b) $(r_{1}+r_{2})\mathbf{m}=
r_{1}\mathbf{m}+r_{2}\mathbf{m}$,
\ \ (c) $(r_{1}r_{2})\mathbf{m}=
(r_{1}(r_{2}\mathbf{m})$,
\ \ (d) $1\mathbf{m}=\mathbf{m}$,
\noindent
for all $r,r_{1},r_{2}\in R$ and
$\mathbf{m},\mathbf{m}_{1},\mathbf{m}_{2}\in M$.
\end{definition}
We say that $M$ is a module over $R$. Since the syllabus
requires it to be explicitly stated, we remark that
a vector space over a field ${\mathbb F}$ is automatically
a module over ${\mathbb F}$.
We have an immediate pleasant surprise.
\begin{lemma} Let $(G,+)$ be a commutative group.
If we write
\[na=\underbrace{a+a+\dots+a}_{n},\]
$(-n)a=-na$ and $0a=a$ $[a\in G]$ then $G$ is a
module over ${\mathbb Z}$.
\end{lemma}
However, this example shows us that the behaviour
of modules, even over very nice rings, is very different from
that of vector spaces. (Precisians will worry that
not all the terms in the next example have been defined,
everybody else will welcome early warning of trouble.)
\begin{example} Let $C_{6}$ be the cyclic group generated
by $[1]$ and write $n[1]=[n]$. Then if we take $C_{6}$
as a module over ${\mathbb Z}$,
$\{[1]\}$ is a minimal
generating set but so is $\{[2],[3]\}$.
\end{example}
This should be contrasted with the theory of finite dimensional
vector spaces where every minimal generating set
(in the language of Course~P1, every minimal spanning
set) has the same number of elements. The reader
may care to reflect on the importance of \emph{division}
in the proof of the Steinitz replacement lemma. For the
moment we note that results which involve the notion
of basis or dimension explicitly or implicitly are
unlikely to carry over from vector spaces to general modules.
Our next example is not surprising.
\begin{lemma} If $S$ is a subring of a ring $R$ then $R$ is
a module over $S$ with module multiplication defined
to be ring multiplication in $R$. In particular $R$
is a module over itself.
\end{lemma}
Our final introductory example may seem a little strange
but much of the strangeness will vanish on reflection.
\begin{lemma}\label{endomorphism}
Let $V$ be a vector space over a field
${\mathbb F}$ and let $\alpha$ be an endomorphism of $V$
(that is a linear map from $V$ to $V$). Then
$V$ is a module over the ring of polynomials
${\mathbb F}[X]$
with module multiplication defined by the following rule.
If $p(X)=\sum_{j=0}^{n}a_{j}X^{j}$ and $v\in V$ then
$pv=p(\alpha)v$, that is
\[pv=a_{0}v+a_{1}\alpha(v)+a_{2}\alpha^{2}(v)+\dots
+a_{n}\alpha^{n}(v).\]
\end{lemma}
The reader should note the implied convention $\alpha^{0}=\iota$.
She should then examine the definition when
${\mathbb F}={\mathbb C}$ and $\alpha$ is the linear map
given, in turn, by the matrices
\[\begin{pmatrix}0&0\\0&0\end{pmatrix},
\ \begin{pmatrix}1&0\\0&0\end{pmatrix},
\ \begin{pmatrix}1&0\\0&2\end{pmatrix},
\ \begin{pmatrix}2&0\\0&2\end{pmatrix},
\ \begin{pmatrix}0&1\\0&0\end{pmatrix}.\]
If the situation described in Lemma~\ref{endomorphism}
holds we talk of \emph{the ${\mathbb F}[X]$ module constructed
from $V$ via $\alpha$}.
It is natural to ask whether a concept so general that it
includes both Abelian groups and the effect of polynomials
of a given endomorphism on a vector space is not too
general to produce interesting mathematics. The object of the
last part of this course is to produce a theorem
on modules (Theorem~\ref{first decomposition theorem})
so powerful
that it gives both a complete classification of
finite Abelian groups and of endomorphisms on
finite dimensional vector spaces over ${\mathbb C}$.
Before moving directly to this topic we first produce
some standard algebraic definitions, theorems and constructions
parallelling those already produced in our studies of groups,
vector spaces and rings.
\begin{definition} If $M$ and $N$ are modules over a ring
$R$ we say that $\phi:M\rightarrow N$ is a
\emph{(module) homomorphism} if
\[\phi(r_{1}m_{1}+r_{2}m_{2})=
r_{1}\phi(m_{1})+r_{2}\phi(m_{2})\]
for all $r_{1},r_{2}\in R$ and $m_{1},m_{2}\in M$.
If $\phi$ is a bijection we say that it is a
\emph{(module) isomorphism} and that $M$ and $N$
are \emph{isomorphic}.
\end{definition}
\begin{definition} If $(M,R,+,.)$ is a module over a ring
$R$ we say that a subset $N$ of $M$
is a \emph{submodule} if $N$ is a subgroup of $(M,+)$
and $rn\in N$ whenever $r\in R$ and $n\in N$.
\end{definition}
The process of quotienting is familiar from our work with
rings in Section~\ref{quotients} which we shall
follow almost exactly.
Since $N$ is a subgroup of $(M,+)$ we may work
with cosets $u+N$ of $N$.
\begin{lemma} Let $N$ be a submodule of a module $M$
over a ring $R$. Then
(i) $\bigcup_{u\in M}(u+N)=M$.
(ii) If $u,v\in M$ then either $(u+N)\cap(v+N)=\emptyset$
or $u+N=v+N$.
\end{lemma}
\begin{lemma}
If $N$ is a submodule of a module $M$ over a ring $R$ and
\[u_{1}+N=u_{2}+N,\ v_{1}+I=v_{2}+I\]
then
\[(u_{1}+v_{1})+I=(u_{2}+v_{2})+I,\ ru_{1}+I=ru_{2}+I\]
for all $r\in R$.
\end{lemma}
\begin{definition}\label{quotient operations 2}
If $N$ is a submodule of a module $M$ over a ring $R$
we write $M/N$ for the set of cosets of $N$ and define
addition and multiplication on $M/N$ by
\[(u+N)+(v+N)=(u+v)+N,\ r(u+N)=ru+N.\]
\end{definition}
\begin{lemma} If $N$ is a submodule of a module $M$ over a
ring $R$ then
$M/N$ with module addition and multiplication as in the
previous definition is a module over $R$.
\end{lemma}
We call $M/N$ a quotient module.
We continue along the sequence of Section~\ref{quotients}.
\begin{definition} If $M$ and $N$ are modules over
a ring $R$ and
$\phi:M\rightarrow N$ is a homomorphism we write
\[\ker\phi=\phi^{-1}(0)=\{r\in R:\phi(r)=0\}\]
and call $\ker\phi$ the kernel of $\phi$.
\end{definition}
\begin{lemma} If $M$ and $N$ are modules over
a ring $R$ and
$\phi:M\rightarrow N$ is a homomorphism then
(i) $\ker\phi$ is a submodule of $M$.
(ii) $\phi(u)=v$ has a solution $u\in M$ if and only if
$v\in \im\phi$.
(iii) If $\phi(u)=v$ then $\phi(u')=v$ if and only if
$u'\in u+\ker\phi$.
\end{lemma}
\begin{lemma} Let $N$ be an submodule of a module $M$
over a ring $R$.
Then the map $\pi:M\rightarrow M/N$ given by
\[\pi(u)=u+N\]
is a homomorphism with kernel $N$.
\end{lemma}
\begin{theorem}[The isomorphism theorem for modules]
Suppose that
$M$ and $N$ are modules over a ring $R$ and
$\phi:R\rightarrow S$ is a homomorphism. Then
\[R/\ker\phi\cong\im\phi.\]
\end{theorem}
We have followed the same path to obtain the same isomorphism
theorem for rings and modules. There is a similar result for
groups (but the key notion is that of a \emph{normal
subgroup} that is of a subgroup $H$ of a group $G$
such that $g^{-1}Hg=H$ for all $g\in G$). Clearly
we ought to seek some `master theorem' from which
all these results could be derived. Such concerns
are the subject of \emph{Universal Algebra} and
its younger cousin \emph{Category Theory}.
In the context of the present course, most readers will
find the generalisation of vector spaces to modules
sufficiently hard without seeking to study a
concept of `algebraic system' which will include
objects with a single non-commutative multiplication
(groups), objects with two commutative multiplications
linked by a distributive law (rings) and products
of such objects with further links (modules).
The research supervisor of the great probabilist Feller
told him that the best mathematics consists of the
general embedded in the concrete. Feller claimed that
it was some years before he realised this was not
an anti-militarist slogan. Most mathematicians would agree
with Feller's supervisor. Unfortunately they would
differ widely on the proportion of general and
concrete required and still more widely on what, precisely,
is general and what concrete.
\section{Linear relations in modules} So far, the results
we have proved on modules have had a general algebraic
flavour. However, we deliberately
chose the axioms for modules to echo those for vector spaces
and from now on we shall try to exploit that fact.
\begin{lemma} If $M$ is a module over a ring $R$ and $A$
a non empty subset of $M$ then the set $N$ of elements
\[\sum_{j=1}^{k}r_{j}a_{j}\]
with $r_{j}\in R$, $a_{j}\in A$ and $k$ a positive integer
is a submodule of $M$. If $N'$ is any submodule of $M$
with $N'\supseteq A$ then $N'\supseteq N$.
\end{lemma}
We call $N$ the submodule generated by $A$.
\begin{definition} If $M$ is a module over
a ring $R$ and $M$ generated by a single element $m$
we say that $M$ is a \emph{cyclic module}
and write $M=Rm$.
\end{definition}
If $M_{1}$, $M_{2}$, \dots, $M_{n}$ are submodules of
module $M$ we write $M_{1}+M_{2}+\dots+M_{n}$ for
the submodule generated by $\bigcup_{r=1}^{n}M_{r}$.
We recall from vector space theory that direct sums are
more useful than sums.
\begin{definition} If $M$ is a module over a ring $R$
and $M_{1}$, $M_{2}$, \dots, $M_{n}$ are submodules of
$M$ we say that $M_{1}+M_{2}+\dots+M_{n}$ is
a \emph{direct sum} (more specifically an
\emph{internal direct sum}) of $M_{1}$, $M_{2}$, \dots, $M_{n}$
and write
\[M_{1}+M_{2}+\dots+M_{n}=M_{1}\oplus M_{2}\oplus\dots\oplus M_{n}\]
if the only solution to the equation
$m_{1}+m_{2}+\dots+m_{n}=0$ with $m_{j}\in M_{j}$ $[j=1,2,\dots n]$
is $m_{j}=0$ $[j=1,2,\dots n]$.
\end{definition}
\begin{lemma} Let $M$ be a module over a ring $R$
and $M_{1}$, $M_{2}$, \dots, $M_{n}$ submodules of
$M$. The following conditions are equivalent.
(i) $M_{1}+M_{2}+\dots+M_{n}$ is a direct sum.
(ii) $(\sum_{i\neq j}M_{i})\cap M_{j}=\{0\}$ for each
$1\leq j\leq n$.
(iii) Each $m\in M_{1}+M_{2}+\dots+M_{n}$ can be written
in only one way as $m=\sum_{j=1}^{n}m_{j}$ with
$m_{j}\in M_{j}$ $[j=1,2,\dots n]$.
\end{lemma}
We can also define an \emph{external direct sum}
(analogous to the direct sum of rings in Lemma~\ref{ring direct}).
\begin{lemma} Let $M_{1}$, $M_{2}$, \dots, $M_{n}$
be modules over a ring $R$. If we define addition
and module multiplication on $\prod_{j=1}^{n}M_{j}$ by
\begin{align*}
(m_{1},m_{2},\dots,m_{n})+(m'_{1},m'_{2},\dots,m'_{n})
&=(m_{1}+m'_{1},m_{2}+m'_{2},\dots,m_{n}+m'_{n})\\
r(m_{1},m_{2},\dots,m_{n})&=(rm_{1},rm_{2},\dots,rm_{n})
\end{align*}
for $m_{j},m'_{j}\in M_{j}$, $r\in R$ then
$\prod_{j=1}^{n}M_{j}$ is a module over $R$.
\end{lemma}
We write $M_{1}\oplus M_{2}\oplus\dots\oplus M_{n}$
for the ring just defined and
call it the \emph{external direct sum}. If the
$M_{j}$ are all submodules of the same module $M$
then there is a natural isomorphism between the
internal and external direct sums and no problems arise
if we identify the two objects.
We shall need the following simple result.
\begin{lemma} If $M_{1}$ and $M_{2}$ are submodules
of a module $M$ over a ring $R$ and $M_{1}+M_{2}$
is a direct sum then
\[(M_{1}\oplus M_{2})/M_{2}\cong M_{1}.\]
\end{lemma}
Our programme in the final part of the course is to show
that reasonably well behaved modules $M$ over
reasonably well behaved rings can be written
as the direct sum $M_{1}\oplus M_{2}\oplus\dots\oplus M_{n}$
of submodules $M_{j}$ each of which is well behaved
(in particular cyclic, so that $M_{j}=Rm_{j}$).
To place this programme in context, note that that one of the
fundamental theorems of vector space theory can be
written as follows.
\begin{theorem} If $V$ is module over a field ${\mathbb F}$
generated by a finite set then
\[V=V_{1}\oplus V_{2}\oplus\dots\oplus V_{n}\]
where each submodule $V_{j}$ is cyclic
(and is isomorphic to ${\mathbb F}$ as a module
over ${\mathbb F}$). Further, the number $n$ is
an invariant of $V$ (that is, every such decomposition
requires exactly $n$ submodules of the stated type).
\end{theorem}
We cannot evade consideration of one of the most striking
ways that a module like ${\mathbb Z}_{7}$ or
${\mathbb Z}_{21}$ over ${\mathbb Z}$ differs from a vector space.
\begin{lemma}\label{order ideal}
Let $M$ be a module over a ring $R$. If
$m\in M$ the set
\[{\mathbf o}(m)=\{r\in R:rm=0\}\]
is an ideal of $R$.
\end{lemma}
\begin{definition} (i) We call the ideal ${\mathbf o}(m)$
defined in Lemma~\ref{order ideal} the \emph{order ideal}
of $m$.
(ii) If ${\mathbf o}(m)\neq\{0\}$ we say that $m$
is a \emph{torsion element}.
(iii) If a module has no non-zero torsion elements we
say that it is \emph{torsion free}.
\end{definition}
\begin{lemma} If $M$ is a module over $R$ and $T$ is the set
of torsion elements in $M$ then $T$ is a submodule of
$M$ and $M/T$ is a torsion free module.
\end{lemma}
We adopt a definition of linear independence which
is taken directly from vector spaces.
\begin{definition} If $M$ is a module over $R$ we
say that elements $m_{1}$, $m_{2}$, \dots, $m_{n}$
are \emph{linearly independent} if the equation
\[\sum_{j=1}^{n}r_{j}m_{j}=0\]
with $r_{j}\in R$ $[j=1,2,\dots,n]$ only has the
solution $r_{1}=r_{2}=\dots=r_{n}=0$.
\end{definition}
The next definition parallels the idea of a basis
for a vector space
\begin{definition} If $M$ is a module over $R$
generated by
linearly independent elements $m_{1}$, $m_{2}$, \dots, $m_{n}$
we say that the elements form a \emph{basis} for $M$
and that they \emph{generate $M$ freely}. We say
that $M$ is a \emph{finitely generated free module}.
\end{definition}
(More generally $M$ is \emph{freely generated} if it has a subset
$X$ which generates $M$ and is such that any non-empty finite
subset of $X$ is linearly independent. We shall not make use
of this idea.)
\begin{lemma} If $M$ is a module over $R$
and $m_{1}$, $m_{2}$, \dots, $m_{t}\in M$
the following four statements are equivalent.
(i) The elements $m_{1}$, $m_{2}$, \dots, $m_{t}$ form a basis
for $M$.
(ii) Any element $m$ of $M$ can be written in one and only
one way as
\[m=\sum_{j=1}^{t}r_{j}m_{j}\]
with $r_{j}\in R$.
(iii) The elements $m_{1}$, $m_{2}$, \dots, $m_{t}$
generate $M$ and the following condition holds.
If $N$ is an $R$ module and $n_{j}\in N$ then there exists
a homomorphism $\phi:M\rightarrow N$ with $\phi(m_{j})=n_{j}$
$[1\leq j\leq t]$.
(iv) Each $m_{j}$ is torsion free (i.e. not a torsion
element) and
\[M=m_{1}R\oplus m_{2}R\oplus\dots\oplus m_{t}R.\]
\end{lemma}
Algebraists would prefer to use condition (iii) or something
like it as the definition of freely generated since it chimes in
with their predeliction for \emph{universal objects}.
The following remark is more or less obvious.
\begin{lemma} The module $M$ over a ring $R$ is freely
generated by $t$ elements if and only if
\[M\cong \underbrace{R\oplus R\oplus R\oplus\dots\oplus R}_{t}.\]
\end{lemma}
The next remark is almost as obvious but will play a key
role in the proof
of our module decomposition theorem
(Theorem~\ref{first decomposition theorem}).
\begin{lemma}\label{finitely generated image}
If a module $M$ over a ring $R$ is finitely
generated then we can find a finitely generated free module
$F$ and an injective homomorphism $\phi:F\rightarrow M$.
(In other words, every finitely generated module is the image
of some finitely generated free module.)
\end{lemma}
In the case of a cyclic module, Lemma~\ref{finitely generated image}
can be sharpened.
\begin{lemma} Suppose $M$ is a cyclic module over a ring $R$
generated by $m$. Then
\[M\cong R/{\mathbf{o}(m)}.\]
In particular two cyclic modules over $R$ are isomorphic
if and only if their generating elements have the same
order ideal.
\end{lemma}
Thus if $M$ is a cyclic module generated by $m$ it is
natural to call $\mathbf{o}(m)$ the order ideal of $M$.
\section{Matrices and modules} There is no problem in
extending the notion of an $r\times s$ matrix together
with the definitions of matrix addition, matrix multiplication
and so forth from fields to rings.
\begin{lemma} Let $M$ and $N$ be finitely generated
free modules over a ring $R$. Suppose that $M$ has basis
$m_{1}$, $m_{2}$, \dots, $m_{r}$ and that $N$
has basis
$n_{1}$, $n_{2}$, \dots, $n_{s}$. Then there is
bijection $\alpha\leftrightarrow A$ between
homomorphisms $\alpha:M\rightarrow N$ and
$r\times s$ matrices $A=(a_{ij})$ over $R$ given by
\[\alpha(m_{j})=\sum_{i=1}^{s}a_{ij}n_{i}.\]
\end{lemma}
I repeat my warning that generalising results from
vector spaces is the natural way forward but that
we must act as though we were walking on eggs.
The care required may not be obvious to the reader
who looks only at the theorems we \emph{do prove}
but will be obvious to anyone who asks about
the theorems we \emph{do not prove}.
\begin{quotation}
`Is there any other point to which you would wish to
draw my attention?' `To the curious incident of the
dog in the night-time.' `The dog did nothing
in the night-time.' `That was the curious incident.'
remarked Sherlock Holmes.
\end{quotation}
\begin{definition} We say that an $s\times s$ matrix $A$
over $R$ is invertible if there exists an $s\times s$
matrix $\tilde{A}$ with $A\tilde{A}=\tilde{A}A=I$.
\end{definition}
The standard uniqueness argument
shows that $\tilde{A}$, if it exists, is unique.
\begin{lemma} The product of $s\times s$ invertible matrices
is itself invertible. (Thus the $s\times s$ invertible matrices
over $R$ form a group.)
\end{lemma}
\begin{example} The matrix
\[\begin{pmatrix}a&b\\c&d\end{pmatrix}\]
over ${\mathbb Z}$ is invertible if and only if $ad-bc=\pm 1$.
\end{example}
\begin{lemma} Suppose that
$M$ is a finitely generated free module
over a ring $R$ and that $M$ has basis
$m_{1}$, $m_{2}$, \dots, $m_{s}$. If $A=(a_{ij})$ is an
$s\times s$ invertible matrix $A$
over $R$ and
\[m_{j}^{*}=\sum_{i=1}^{s}a_{ij}m_{i}\]
then $m_{1}^{*}$, $m_{2}^{*}$, \dots, $m_{s}^{*}$
is also a basis for $M$.
\end{lemma}
When we dealt with matrices over fields we used elementary
row and column operations and their associated matrices.
We can do the same thing here. First let us set out the
corresponding elementary $s\times s$ matrices.
(i) $F_{ij}$ is the matrix obtained from the identity matrix
by interchanging row $i$ and row $j$.
(ii) $G_{i}(u)$ is the matrix obtained from the identity matrix
by multiplying row $i$ by the unit $u$.
(iii) $H_{ij}(r)$ is the matrix obtained from the identity matrix
by adding $r$ times row $j$ to row $i$ $[i\neq j, r\in R]$.
(iv) $\bar{H}_{ij}(r)$ is the matrix obtained from the identity matrix
by adding $r$ times column $j$ to column $i$ $[i\neq j, r\in R]$.
\noindent We shall not use $G_{i}(u)$ but we include it for
completeness. Observe that $\bar{H}_{ij}(r)=H_{ji}(r)$.
Exactly as in the field case we have the following
easy remarks.
\begin{lemma} (i) The effect of pre-multiplying a matrix of the
appropriate size
\ \ (1) by $F_{ij}$ is to interchange row $i$ and row $j$,
\ \ (2) by $G_{i}(u)$ is to multiply row $i$ by the unit $u$,
\ \ (3) by $H_{ij}(r)$ is to add $r$ times row $j$ to row $i$.
(ii) The effect of post-multiplying a matrix of the
appropriate size
\ \ (1) by $F_{ij}$ is to interchange column $i$ and column $j$,
\ \ (2) by $G_{i}(u)$ is to multiply column $i$ by the unit $u$,
\ \ (3) by $\bar{H}_{ij}(r)$ is to add $r$ times column $j$ to column $i$.
(iii) The matrices $F_{ij}$, $G_{i}(u)$, $H_{ij}(r)$ and
$\bar{H}_{ij}(r)$ are all invertible.
\end{lemma}
When we worked over fields we where able to reduce matrices to
very special forms by pre- and post-multiplication by
invertible matrices.
\begin{definition} Let $A$ and $B$ be $s\times t$ matrices
over a ring $R$. We say that $A$ and $B$ are equivalent
if we can find an invertible $s\times s$ matrix $P$ and
an invertible $t\times t$ matrix $Q$ such that
$B=PAQ$.
\end{definition}
\begin{lemma} (i) Equivalence of matrices is an equivalence
relation.
(ii) Let $M$ and $N$ be finitely generated
free modules over a ring $R$. Suppose that $M$ has basis
$m_{1}$, $m_{2}$, \dots, $m_{s}$ and that $N$
has basis
$n_{1}$, $n_{2}$, \dots, $n_{t}$. Suppose that the
homomorphism $\alpha:M\rightarrow N$ corresponds
to the matrix $A$ for these bases. If $A$ is equivalent
to $B$ then we can find bases
$m_{1}^{*}$, $m_{2}^{*}$, \dots, $m_{s}^{*}$ for $M$
and $n_{1}^{*}$, $n_{2}^{*}$, \dots, $n_{t}^{*}$ for $N$ such that
$\alpha:M\rightarrow N$ corresponds
to the matrix $B$ for these bases.
\end{lemma}
We can not do very much over general rings
but we can do a great deal
over Euclidean domains.
\begin{lemma} If $A$ is a non-zero
$s\times t$ matrix over a Euclidean
domain we can find a sequence of elementary row and
column operations which reduce $A$ to a matrix
$B$ with $b_{i1}=0$ for $2\leq i\leq s$,
$b_{1j}=0$ for $2\leq j\leq t-1$ and $b_{11}$ dividing
every element $b_{ij}$ of $B$.
\end{lemma}
\begin{lemma}\label{canonical lemma}
If $A$ is a
$s\times t$ matrix over a Euclidean
domain we can find a sequence of elementary row and
column operations which reduce $A$ to a matrix $D$
with $d_{ij}=0$ for $i\neq j$ (that is $D$ is diagonal)
and $d_{ii}|d_{(i+1)(i+1)}$ for all $1\leq i\leq \min(s,t)-1$.
\end{lemma}
We restate Lemma~\ref{canonical lemma} as a theorem.
\begin{theorem}\label{canonical theorem} If $A$ is a
$s\times t$ matrix over a Euclidean
domain then $A$ is equivalent to a diagonal matrix $D$
with $d_{ii}|d_{(i+1)(i+1)}$ for all $1\leq i\leq \min(s,t)-1$.
\end{theorem}
This result is ultimately due to Henry Smith who
proved it for integer valued matrices. Smith
was a major pure mathematician at a time and
place (19th century Oxford) not particularly
propitious for such a talent. He seems to have been valued
more as a good College and University man than
for anything else\footnote{He even supervised on
Sunday afternoon, telling his students that
`It was lawful on the Sabbath day to pull an ass
out of the ditch'.}.
In the next section we obtain
the module decomposition theorem
(Theorem~\ref{first decomposition theorem})
as a direct consequence of Theorem~\ref{canonical theorem}
but for the moment we just note a simple corollary.
\begin{lemma} Let $M$ be a finitely generated
free module over a Euclidean domain
then all bases of $M$ contain the same number
of elements.
\end{lemma}
We call the number of elements in a basis of $M$ the
\emph{rank} of $M$.
There are two important remarks to make.
(1) The results which we obtain for Euclidean domains can be
extended with a little more work to principal ideal
domains. The details are given in~\cite{Hartley}
Chapters~7 and~8. However all our applications will
be to Euclidean domains. (I remarked earlier on the
difficulty of finding simple examples of principal ideal
domains which are not Euclidean.)
There is a further point. Our applications will be
to modules over a domain $R$ where $R$ is
${\mathbb Z}$ and ${\mathbb C}[X]$.
For both of these the Euclidean function $\phi$ is such
that given $a\in R$ and a non-zero $b\in R$ there
is an \emph{algorithm} for finding $c,r\in R$
such that $a=cb+r$ and $\phi(r)<\phi(b)$.
The proof of Theorem~\ref{canonical theorem} is thus
\emph{algorithmic}, that is we can actually \emph{calculate}
$P$, $Q$ invertible and $D$ of the correct form such that
$PAQ=D$. We are thus not doing abstract algebra but concrete
algebra which can be (and is) programmed for electronic
computers.
(2) We shall not give general uniqueness theorems corresponding
to our general decomposition theorems. Such results will
again be found in~\cite{Hartley} Chapters~7 and~8.
They are not very hard but a 24~hour course cannot contain
everything. In the concrete examples that we give
uniqueness will be more or less obvious.
\section{The module decomposition theorems} We are now within
sight of our module decomposition theorems.
We need three preliminary lemmas. The first is a simple
consequence of Lemma~\ref{order ideal}.
\begin{lemma} If $M$ is a cyclic module over a principal
ideal domain $D$ then $M\cong D/(d)$ for some $d\in D$.
If $D/(d)\cong D/(d')$ then $d$ and $d'$ are associates.
\end{lemma}
We say that $M$ is \emph{of order} $d$.
The second requires a little work.
\begin{lemma} Every submodule $G$ of a
finitely generated free module
$F$ over a principal ideal domain $D$ is itself a
finitely generated free module.
The rank of $G$ is no greater than the rank of $F$.
\end{lemma}
The third is routine abstract algebra.
\begin{lemma} Let $M$ be the internal direct sum
\[M=M_{1}\oplus M_{2}\oplus \dots \oplus M_{s}\]
of submodules $M_{i}$. Suppose $N_{i}$ is a submodule
of $N_{i}$ for each $i$ and $N=N_{1}+N_{2}+\dots+N_{s}$.
If $\nu$ is the natural homomorphism $\nu:M\rightarrow M/N$
then
\[M/N=\nu(M)=
\nu(M_{1})\oplus \nu(M_{2})\oplus \dots \oplus \nu(M_{s})\]
and $\nu(M_{i})\cong M_{i}/N_{i}$.
\end{lemma}
Theorem~\ref{canonical theorem} now gives us our first
decomposition theorem.
\begin{theorem}[Basic module decomposition theorem]%
\label{first decomposition theorem} If $M$
is a finitely generated module over a Euclidean domain $D$
then $M$ may be written as an internal direct sum
\[M=M_{1}\oplus M_{2}\oplus \dots \oplus M_{s}\]
where $M_{i}$ is a non-trivial cyclic submodule of
order $d_{i}$ $[1\leq i\leq s]$ and $d_{i}|d_{i+1}$
$[1\leq i\leq s-1]$.
\end{theorem}
Let us note the following consequences.
\begin{lemma} If $M$
is a finitely generated module over a Euclidean domain $D$
then $M=T\oplus F$ where $T$ is the torsion submodule and
$F$ is a finitely generated free module.
\end{lemma}
\begin{lemma} If $M$
is a finitely generated torsion free
module over a Euclidean domain $D$
then $M$ is a finitely generated free module.
\end{lemma}
Turning from the general to the concrete we obtain
a structure theorem for finitely generated Abelian groups.
\begin{theorem}\label{structure group}
If $G$ is a finitely generated Abelian group
then (as a group)
\[G\cong{\mathbb Z}_{d_{1}}\oplus{\mathbb Z}_{d_{2}}
\dots\oplus{\mathbb Z}_{d_{r}}\oplus{\mathbb Z}^{t}\]
where $d_{i}|d_{i+1}$ $[1\leq i\leq r-1]$.
\end{theorem}
(Note that this result can be stated entirely in group theoretic
terms.)
\begin{lemma} (We work with groups and group isomorphism.)
(i) If ${\mathbb Z}^{t}\cong{\mathbb Z}^{t'}$ then $t=t'$.
(ii) If
\[{\mathbb Z}_{d_{1}}\oplus{\mathbb Z}_{d_{2}}
\dots\oplus{\mathbb Z}_{d_{r}}
\cong
{\mathbb Z}_{d_{1}'}\oplus{\mathbb Z}_{d_{2}'}
\dots\oplus{\mathbb Z}_{d_{r}'}\]
with $d_{i}'|d_{i+1}'$ $[1\leq i\leq r'-1]$
and $d_{i}|d_{i+1}$ $[1\leq i\leq r-1]$ then
$r=r'$ and $d_{i}'=d_{i}$ for $1\leq i\leq r$.
(iii) The decomposition in Theorem~\ref{structure group}
is unique.
\end{lemma}
Notice that we have provided an algorithm which presented with
generators for an Abelian group together with relations between
them can decide if the largest group compatible with these relations
is finite or infinite. It has been shown (though the proof is
book length) that no such algorithm can exist for the
non-Abelian case that is there exists no computer program
which presented with
generators for a group together with relations between
them can decide if the largest group compatible with these relations
is finite or infinite. (This subject is known as the
\emph{word problem for groups}.)
Of course, the group ${\mathbb Z}_{6}$ can be decomposed still
further as
${\mathbb Z}_{6}={\mathbb Z}_{2}\oplus{\mathbb Z}_{3}$.
This fact suggests that we develop our decomposition theorem,
Theorem~\ref{first decomposition theorem},
as follows. Recall that a Euclidean domain is a principal
ideal domain and so a unique factorisation domain.
Our main result echos the Chinese remainder theorem.
\begin{lemma} Let $M$ be a cyclic module of order $d$
over a principal ideal domain $D$. If $d$ has the
prime factorisation
$d=up_{1}^{\alpha_{1}}p_{2}^{\alpha_{2}}\dots p_{s}^{\alpha_{s}}$
with $u$ a unit, the $p_{i}$ non-associate primes and
$\alpha_{i}\geq 1$ then
\[M=M_{1}\oplus M_{2}\oplus\dots\oplus M_{s}\]
where $M_{j}$ is cyclic of order $p_{j}^{\alpha_{j}}$.
\end{lemma}
Cyclic modules of order $p^{\alpha}$ with $p$ a prime are called
primary modules.
\begin{theorem}[Primary decomposition theorem]%
\label{primary decomposition theorem} If $M$
is a finitely generated module over a Euclidean domain $D$
then $M$ may be written as an internal direct sum
\[M=M_{1}\oplus M_{2}\oplus \dots \oplus M_{s}\]
where $M_{i}$ are primary modules or free cyclic modules.
\end{theorem}
It is worth noting that no further splitting is possible.
\begin{definition} A non-trivial module over a ring $R$
is called indecomposable if whenever $M=M_{1}\oplus M_{2}$
with $M_{1}$, $M_{2}$ submodules then either $M_{1}=\{0\}$
or $M_{2}=\{0\}$.
\end{definition}
\begin{lemma} (i) A primary module over a principal
ideal domain is indecomposable.
(ii) A free cyclic module over an integral domain is indecomposable.
\end{lemma}
Theorem~\ref{primary decomposition theorem} immediately
gives a structure theorem for finitely generated Abelian groups.
\begin{theorem}\label{fine structure group}
If $G$ is a finitely generated Abelian group
then (as a group)
\[G\cong{\mathbb Z}_{p_{1}^{\alpha_{1}}}
\oplus{\mathbb Z}_{p_{2}^{\alpha_{2}}}
\dots\oplus{\mathbb Z}_{p_{r}^{\alpha_{r}}}\oplus{\mathbb Z}^{t}\]
where $p_{i}$ is a prime and $\alpha_{i}\geq 1$ $[1\leq i\leq r]$.
If we add the condition $p_{i}^{\alpha_{i}}\leq p_{i+1}^{\alpha_{i+1}}$
the decomposition is unique.
\end{theorem}
The following example shows that things are not so simple for
non-finitely generated Abelian groups (and so, certainly, for modules
in general) as one might at first imagine.
\begin{example} (i) Consider the Abelian group ${\mathbb Q}$.
Any non-trivial finitely generated subgroup
is generated by a single element and is thus isomorphic
to ${\mathbb Z}$. However ${\mathbb Q}$ is not finitely generated.
(ii) Consider the Abelian group ${\mathbb Q}/{\mathbb Z}$.
Any non-trivial finitely generated subgroup is a finite
cyclic group. However ${\mathbb Q}/{\mathbb Z}$
is not finitely generated.
\end{example}
Since a finite Abelian group is automatically finitely generated
we have a complete classification of all finite Abelian
groups.
\begin{theorem}\label{finite structure group}
If $G$ is a finite Abelian group
then
\[G\cong{\mathbb Z}_{p_{1}^{\alpha_{1}}}
\oplus{\mathbb Z}_{p_{2}^{\alpha_{2}}}
\dots\oplus{\mathbb Z}_{p_{r}^{\alpha_{r}}}\]
where $p_{i}$ is a prime and $\alpha_{i}\geq 1$ $[1\leq i\leq r]$.
If we add the condition $p_{i}^{\alpha_{i}}\leq p_{i+1}^{\alpha_{i+1}}$
the decomposition is unique.
\end{theorem}
The rest of this section is very much off the syllabus
but gives a striking application of
Theorem~\ref{finite structure group}.
We write
\[{\mathbb T}=\{\lambda\in{\mathbb C}:|\lambda|=1\}\]
and note that ${\mathbb T}$ is an Abelian group under
multiplication. We write $D_{n}$ for the subgroup
of ${\mathbb T}$ defined by
\[D_{n}=\{\omega\in{\mathbb T}:\omega^{n}=1\}.\]
(Thus $D_{n}$ is the multiplicative group
of $n$th roots of unity.)
We observe that $D_{n}$ is group isomorphic to ${\mathbb Z}_{n}$.
\begin{definition} If $G$ is a finite Abelian group and
$\chi:G\rightarrow{\mathbb T}$ is a group homomorphism
we say that $\chi$ is a \emph{character} of $G$.
\end{definition}
\begin{lemma} The collection $\hat{G}$ of characters
of a finite group $G$ form an Abelian
group under the multiplication
rule $(\chi_{1}\chi_{2})(g)=\chi_{1}(g)\chi_{2}(g)$.
\end{lemma}
We call $\hat{G}$ the \emph{dual group} of $G$.
Once we have the classification theorem for finite Abelian
groups we can use the following easy result to give
a corresponding classification for their dual groups.
\begin{lemma} If
\[G={\mathbb Z}_{p_{1}^{\alpha_{1}}}\oplus{\mathbb Z}_{p_{2}^{\alpha_{2}}}
\dots\oplus{\mathbb Z}_{p_{r}^{\alpha_{r}}}\]
with $p_{s}$ is a prime and $\alpha_{s}\geq 1$ $[1\leq s\leq r]$
then we may identify $\hat{G}$ with
$D_{p_{1}^{\alpha_{1}}}\oplus D_{p_{2}^{\alpha_{2}}}\oplus
\dots\oplus D_{p_{r}^{\alpha_{r}}}$ as follows.
If
\[{\boldsymbol\omega}=(\omega_{1},\omega_{2},\dots,\omega_{r})
\in D_{p_{1}^{\alpha{1}}}\oplus D_{p_{2}^{\alpha{2}}}\oplus
\dots\oplus D_{p_{r}^{\alpha{r}}}\]
and
\[{\mathbf n}=(n_{1},n_{2},\dots,n_{r})\in
{\mathbb Z}_{p_{1}^{\alpha_{1}}}\oplus{\mathbb Z}_{p_{2}^{\alpha_{2}}}
\dots\oplus{\mathbb Z}_{p_{r}^{\alpha_{r}}}\]
then
\[{\boldsymbol\omega}({\mathbf n})=\prod_{s=1}^{r}\omega_{s}^{n_{s}}.\]
\end{lemma}
We shall only make use of the following consequences.
\begin{lemma} If $G$ is a finite Abelian group then $\hat{G}$
is a finite group with the same number of elements. If $g\in G$
there exists a $\chi\in \hat{G}$ with $\chi(g)\neq 0$.
\end{lemma}
\begin{lemma}\label{delta function}
Let $G$ be a finite Abelian group with $N$ elements.
If $g\in G$ but $g\neq e$ then
\[\sum_{\chi\in\hat{G}}\chi(g)=0.\]
If $g=e$
\[\sum_{\chi\in\hat{G}}\chi(g)=N.\]
\end{lemma}
If $G$ is a finite Abelian group let us write
$C(G)$ for the set of functions $f:G\rightarrow{\mathbb C}$.
If $f,h\in C(G)$ we write
\[\langle f,h\rangle =|G|^{-1}\sum_{x\in G}f(x)h(x)^{*}\]
where $|G|$ is the number of elements of $G$ and $z^{*}$
denotes the complex conjugate of $z$.
\begin{lemma} If $G$ is a finite Abelian group then $C(G)$
equipped with the usual pointwise addition and scalar
multiplication is a vector space over ${\mathbb C}$.
The operation $\langle \ ,\ \rangle$ is an inner product
on $C(G)$. The characters of $G$ form an orthonormal
basis for $G$.
\end{lemma}
It is thus natural to write
\[\hat{f}(\chi)=\langle f,h\rangle,\]
and call $\hat{f}:\hat{G}\rightarrow{\mathbb C}$
the \emph{Fourier transform} of an $f\in C(G)$.
Lemma~\ref{delta function} gives us the required
representation theorem.
\begin{lemma}
If $G$ is a finite Abelian group and $f\in C(G)$ then
\[f=\sum_{\chi\in\hat{G}}\hat{f}(\chi)\chi.\]
\end{lemma}
This small but perfectly formed Fourier theory for finite Abelian
groups is used in number theory and machine computation.
Even more importantly it suggests that we should
look at Fourier theory in the context of groups
and this gives rise to \emph{representation theory}
both for finite non-Abelian groups and for
infinite groups satisfying reasonable `continuity'
conditions.
\section{Applications to endomorphisms}
Throughout this section $V$ will be a finite dimensional
vector space over a field
${\mathbb F}$ and $\alpha$ an endomorphism of $V$.
We recall from Lemma~\ref{endomorphism}
that $V$ is a module over the ring of polynomials
${\mathbb F}[X]$
with module multiplication defined by
$pv=p(\alpha)v$. We observe that
${\mathbb F}[X]$ is a Euclidean domain. Further if
$V$ has basis $e_{1}$, $e_{2}$, \dots $e_{n}$ as vector
space then $e_{1}$, $e_{2}$, \dots $e_{n}$
generate $V$ as a module (though, of course they may not
be linearly independent when $V$ is considered as a module).
We note that every $v\in V$ is a torsion element.
We can thus apply our module decomposition theorem
(Theorem~\ref{first decomposition theorem}).
Translated into the language of vector spaces it
takes the following form.
\begin{lemma}\label{on to vectors} Let $V$ be a finite dimensional
vector space over a field
${\mathbb F}$ and $\alpha$ an endomorphism of $V$.
Then $V$ may be expressed a the direct sum of subspaces
\[V=V_{1}\oplus V_{2}\oplus \dots \oplus V_{s}\]
where each $V_{i}$ is associated with a monic polynomial
$P_{i}\in {\mathbb F}[X]$ of degree $n_{i}$
and a vector $v_{i}$ as follows.
(i)$'$ Vectors of the form $\alpha^{k}v_{i}$ span $V_{i}$.
(ii) We have $P_{i}(\alpha)(v)=0$ for all $v\in V_{i}$.
(iii) If $P\in {\mathbb F}[X]$ and
$P(\alpha)(v)=0$ for all $v\in V_{i}$ then $P_{i}|P$.
(iv) $P_{i}|P_{i+1}$ for all
$1\leq i\leq s-1$.
\end{lemma}
We can immediately improve the form of this result.
\begin{theorem}\label{canonical matrix start}
As for Lemma~\ref{on to vectors} but with
(i)$'$ replaced by
(i) $v_{i}$, $\alpha(v_{i})$, $\alpha^{2}(v_{i})$
\dots, $\alpha^{n_{i}-1}(v_{i})$ is a basis for $V_{i}$.
\end{theorem}
It is worth noting that the subspace $V_{i}$ are
\emph{invariant} in the sense that $\alpha(V_{i})\subseteq V_{i}$.
Forgetting about modules for the moment and
working entirely in standard vector space theory we can translate
Theorem~\ref{canonical matrix start} into statement about matrices
by choosing the obvious basis for $V$.
\begin{theorem}[Rational canonical form]\label{Rational canonical form}
Let $V$ be a finite
dimensional
vector space over a field
${\mathbb F}$ and $\alpha$ an endomorphism of $V$.
Then there is basis for $V$ such that $\alpha$ has matrix
$A$ (relative to this basis) which consists of zeros
except for $s$ blocks consisting of $n_{i}\times n_{i}$
square matrices $A_{i}$ $[1\leq i\leq s]$
down the diagonal satisfying the following
conditions. Each
\[A(i)=\begin{pmatrix}
0&0&0&\cdots&0&0&0&-a_{0}(i)\\
1&0&0&\cdots&0&0&0&-a_{1}(i)\\
0&1&0&\cdots&0&0&0&-a_{2}(i)\\
\vdots&\vdots&\vdots&&\vdots&\vdots&\vdots&\vdots\\
0&0&0&\cdots&0&1&0&-a_{n_{i}-2}(i)\\
0&0&0&\cdots&0&0&1&-a_{n_{i}-1}(i)\end{pmatrix}\]
and, if we write
\[P_{i}(X)=X^{n_{i}}+\sum_{k=0}^{n_{i}-1}a_{k}X^{k},\]
we have $P_{i}|P_{i+1}$ for all
$1\leq i\leq s-1$.
\end{theorem}
\begin{definition} An $n\times n$ matrix of the form
\[A=\begin{pmatrix}
0&0&0&\cdots&0&0&0&-a_{0}\\
1&0&0&\cdots&0&0&0&-a_{1}\\
0&1&0&\cdots&0&0&0&-a_{2}\\
\vdots&\vdots&\vdots&&\vdots&\vdots&\vdots&\vdots\\
0&0&0&\cdots&0&1&0&-a_{n-2}\\
0&0&0&\cdots&0&0&1&-a_{n-1}\end{pmatrix}\]
is called the \emph{companion matrix} of the
monic polynomial
\[p(X)=X^{n}+\sum_{k=0}^{n-1}a_{k}X^{k}.\]
\end{definition}
\begin{lemma} If $A$ is the companion matrix of
a monic polynomial $P$ then
\[P(X)=\det(XI-A).\]
(N.B. we have here a relation between coefficients
with $X$ an indeterminate.) In other words
$P$ is the characteristic polynomial of $A$.
\end{lemma}
We can now grasp some of the implications of our
results on endomorphisms.
\begin{theorem}
Let $V$ be a finite
dimensional
vector space over a field
${\mathbb F}$ and $\alpha$ an endomorphism of $V$.
Let $p_{i}$ $[1\leq i\leq s]$ be the polynomials
which appear in Theorems~\ref{canonical matrix start}
and~\ref{Rational canonical form}.
(i) $\prod_{i=1}^{s}p_{i}$ is the characteristic polynomial
of $A$ (and so of $\alpha$).
(ii) The polynomial $p_{s}$ is the minimal polynomial
(more exactly the minimal annihilating polynomial) of
$\alpha$ (and so of $A$). In other words
$p_{s}(\alpha)=0$ and if $q\in {\mathbb F}[X]$
satisfies $q(\alpha)=0$ then $p_{s}|q$.
\end{theorem}
Incidentally we have proved the Cayley Hamilton theorem
for general fields. (The proof via triangular
matrices in Course~P1 only works for ${\mathbb C}$
though we can deduce the result for real matrices by considering them
as complex matrices.)
\begin{theorem}[Cayley Hamilton] If
$V$ is a finite
dimensional
vector space over a field
${\mathbb F}$ and $\alpha$ an endomorphism of $V$
then $\alpha$ satisfies its own characteristic equation.
\end{theorem}
We can also prove that the rational canonical decomposition is indeed
canonical.
\begin{lemma} The matrix in Theorem~\ref{Rational canonical form}
is uniquely determined by the given conditions.
\end{lemma}
What about the Primary Decomposition Theorem
(Theorem~\ref{primary decomposition theorem})?
Working along the same lines as
Theorem~\ref{canonical matrix start},
we obtain the following result.
\begin{lemma}~\label{matrices and irreducibles}
Let $V$ be a finite dimensional
vector space over a field
${\mathbb F}$ and $\alpha$ an endomorphism of $V$.
Then $V$ may be expressed a the direct sum of subspaces
\[V=V_{1}\oplus V_{2}\oplus \dots \oplus V_{s}\]
where each $V_{i}$ is associated with a monic polynomial
$P_{i}\in {\mathbb F}[X]$ of degree $n_{i}$
and a vector $v_{i}$ as follows.
(i) $v_{i}$, $\alpha(v_{i})$, $\alpha^{2}(v_{i})$
\dots, $\alpha^{n_{i}-1}(v_{i})$ is a basis for $V_{i}$.
(ii) We have $P_{i}(\alpha)(v)=0$ for all $v\in V_{i}$.
(iii) If $P\in {\mathbb F}[X]$ and
$P(\alpha)(v)=0$ for all $v\in V_{i}$ then $P_{i}|P$.
(iv) $P_{i}$ is a power of an irreducible polynomial
(that is $P_{i}=Q_{i}^{m_{i}}$ where $Q_{i}$ is irreducible
and $m_{i}\geq 1$).
\end{lemma}
Even such a simple field as ${\mathbb R}$ has both linear
and quadratic irreducible polynomials and even rather
weighty tomes on algebra do not seek any use for
Lemma~\ref{matrices and irreducibles} in this case.
However if the field is \emph{complete}, that is
every polynomial has a root, then the only irreducible
polynomials are linear and we get a relatively simple
result.
\begin{theorem}~\label{Jordan decomposition}
Let $V$ be a finite dimensional
vector space over a complete field
${\mathbb F}$ and $\alpha$ an endomorphism of $V$.
Then $V$ may be expressed a the direct sum of subspaces
\[V=V_{1}\oplus V_{2}\oplus \dots \oplus V_{s}\]
where each $V_{i}$ is associated with a polynomial
$(X-\lambda_{i})^{n_{i}}\in{\mathbb F}[X]$
and a vector $w_{i}$ as follows.
(i) $w_{i}$, $(\alpha-\lambda_{i}\iota)w_{i}$,
$(\alpha-\lambda_{i}\iota)^{2}w_{i}$,
\dots, $(\alpha-\lambda_{i}\iota)^{n_{i}-1}w_{i}$
form a basis for $V_{i}$.
(ii) We have $(\alpha-\lambda_{i}\iota)^{n_{i}}(v)=0$
for all $v\in V_{i}$.
(iii) If $P\in {\mathbb F}[X]$ and
$P(\alpha)(v)=0$ for all $v\in V_{i}$ then $(X-\lambda_{i})^{n_{i}}|P$.
\end{theorem}
As with Theorem~\ref{canonical matrix start}
the obvious choice of basis for $V$
gives us a theorem about matrices. We write
$J(\lambda,n)$ for the $n\times n$ matrix
with $\lambda$'s down the diagonal, $1$'s immediately
below and zero every where else so that
\[J(\lambda,n)=\begin{pmatrix}
\lambda&0&0&\cdots&0&0&0&0\\
1&\lambda&0&\cdots&0&0&0&0\\
0&1&\lambda&\cdots&0&0&0&0\\
\vdots&\vdots&\vdots&&\vdots&\vdots&\vdots&\vdots\\
0&0&0&\cdots&0&1&\lambda&0\\
0&0&0&\cdots&0&0&1&\lambda\end{pmatrix}\ .\]
We call $J(\lambda,n)$ a Jordan matrix.
\begin{theorem}[Jordan normal form]\label{Jordan normal form}
Let $V$ be a finite
dimensional
vector space over a complete field
${\mathbb F}$ and $\alpha$ an endomorphism of $V$.
Then there is basis for $V$ such that $\alpha$ has matrix
$A$ (relative to this basis) which consists of zeros
except for Jordan matrices $J(\lambda_{i},n_{i})$ $[1\leq i\leq s]$
down the diagonal.
\end{theorem}
Standard vector space techniques complete the result.
\begin{lemma} The matrix associated with $\alpha$ in
Theorem~\ref{Jordan normal form} is unique up to
reordering the diagonal blocks.
\end{lemma}
Two and a half years ago in Course~C1 we noted that the matrix
\[\begin{pmatrix} 0&1\\0&0\end{pmatrix}\]
showed that not all square matrices are diagonalisable
even over ${\mathbb C}$. By ad hoc techniques we showed that
any $2\times 2$ matrix was conjugate to a matrix
of the form
\[\begin{pmatrix} \lambda&1\\0&\lambda\end{pmatrix}
\ \text{or}\ \begin{pmatrix} \lambda&0\\0&\mu\end{pmatrix}.\]
We noted that these forms were particularly useful
in the study of differential equations.
We complete the course by giving the full solution
of the problem of classifying square matrices
under conjugation
over any complete field and, in particular, over ${\mathbb C}$.
\begin{theorem}[Jordan normal form for matrices]
If $A$ is a $n\times n$ matrix over a complete field
then we can find an invertible $n\times n$ matrix $P$
such that $J_{A}=PAP^{-1}$ consists of zeros
except for Jordan matrices $J(\lambda_{i},n_{i})$ $[1\leq i\leq s]$
down the diagonal. The matrix $J_{A}$
so associated with $A$ is unique up to
reordering the diagonal blocks.
\end{theorem}
\section{Reading and further reading} Not all theorems in mathematics
are hard to prove though some are. I would hope that
the reader will be able to prove many of the results
in the notes as exercises. Where she cannot, the
results on rings, integral domains and factorisation
(sections~\ref{start rings} to~\ref{start polynomials})
will be found in the standard algebra texts in her
College library and in the book of Hartley and Hawkes
\emph{Rings, Modules and Linear Algebra}~\cite{Hartley}.
I have tried
(but not very hard and with only partial success) to
follow the notation of Hartley and Hawkes. Whichever
text she follows she should note that our decision to
use ring to mean \emph{commutative ring with 1} is
not standard.
The material in sections~\ref{start Galois} to~\ref{finite fields}
belong to Galois theory. Garling's
\emph{A Course in Galois Theory}~\cite{Garling} is,
not surprisingly, very much in tune with the approach adopted
in Cambridge but, again, most of the standard algebra texts
cover the material. The book of Hartley and Hawkes
covers the remainder of the course on modules and their
decomposition theorems. (Since we aim to get to the
decomposition theorems as fast as possible and we do
not deal with uniqueness, Hartley and Hawkes contains
somewhat more material. Since most British algebraists
under the age of 50 learnt their module theory from
Hartley and Hawkes the close relation between book
and syllabus is no accident.)
Turning specifically to some of the more general algebra
texts we note that Volume~1 of Cohn's \emph{Algebra}~\cite{Cohn}
covers most of the material including modules is
a typically efficient manner. Those who like to proceed
from the general to the particular will find their
tastes catered for in MacLane and Birkhoff's
\emph{Algebra}~\cite{MacLane}.
Those who prefer the other direction will also
prefer Birkhoff and MacLane's
\emph{Introduction to Modern Algebra}~\cite{Birkhoff}
but this covers much less of the course. The syllabus
also commends Fraleigh's
\emph{A First Course in Modern Algebra}~\cite{Fraleigh}
but,
I must confess that like many American textbooks it
reminds me of the vegetables in an American supermarket,
whose splendid appearance does not compensate for
their bland taste. In any case the reader will do better to
browse through several general texts rather than concentrate on one.
The reader who wants to learn more about the topics
treated in the course is in an unusually fortunate position.
Most mathematicians treat textbook writing in the same way
that lawyers treat drafting legal documents and
believe that, once they have covered
every possible contingency in the most precise
manner possible, their job is done.
However, Ian Stewart's (yes, the man you saw on TV)
first book \emph{Galois Theory}~\cite{Stewart} is
a brilliantly written text on a fascinating subject
and a pleasure to read. He joined David Tall to write
\emph{Algebraic Number Theory}~\cite{Tall} which
gives the concrete number theory which partners
our abstract treatment of factorisation.
Kline's
\emph{Mathematical Thought from Ancient to Modern Times}
provides a picture of mathematical progress from antiquity
and thus a context for this course, and indeed the whole Tripos.
\begin{thebibliography}{9}
\bibitem{Birkhoff} G.~Birkhoff and S.~MacLane
\emph{A Survey of Modern Algebra} (3rd Ed)
Macmillan, New York, 1965.
\bibitem{Cohn} P.~M.~Cohn
\emph{Algebra} (2nd Ed) Vol 1, Wiley, 1982.
\bibitem{Fraleigh} J.~B.~Fraleigh
\emph{A First Course in Modern Algebra}
(5th Ed) Addison-Wesley, 1989.
\bibitem{Garling} D.~J.~H.~Garling
\emph{A Course in Galois Theory} CUP, 1986.
\bibitem{Hartley} B.~Hartley and T.~O.~Hawkes
\emph{Rings, Modules and Linear Algebra}
Chapman and Hall, 1970.
\bibitem{Kline} M.~Kline
\emph{Mathematical Thought from Ancient to Modern Times}
OUP, 1972.
\bibitem{MacLane} S.~MacLane and G.~Birkhoff
\emph{Algebra} (2nd Ed) Macmillan, New York, 1979.
\bibitem{Stewart} I.~Stewart
\emph{Galois Theory} Chapman and Hall, 1973.
\bibitem{Tall} I.~Stewart and D.~Tall
\emph{Algebraic Number Theory} Chapman and Hall, 1979.
\end{thebibliography}
\end{document}
|
https://dlmf.nist.gov/34.7.E2.tex
|
nist.gov
|
CC-MAIN-2018-26
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2018-26/segments/1529267859766.6/warc/CC-MAIN-20180618105733-20180618125733-00276.warc.gz
| 617,060,760
| 787
|
\[\sum_{j_{12}\,j_{34}}(2j_{12}+1)(2j_{34}+1)(2j_{13}+1)(2j_{24}+1)\begin{%
Bmatrix}j_{1}&j_{2}&j_{12}\\
j_{3}&j_{4}&j_{34}\\
j_{13}&j_{24}&j\end{Bmatrix}\begin{Bmatrix}j_{1}&j_{2}&j_{12}\\
j_{3}&j_{4}&j_{34}\\
j^{\prime}_{13}&j^{\prime}_{24}&j\end{Bmatrix}=\delta_{j_{13},j^{\prime}_{13}}%
\delta_{j_{24},j^{\prime}_{24}}.\]
|
https://nhorton.people.amherst.edu/sleuth/chapter09.Rnw
|
amherst.edu
|
CC-MAIN-2022-49
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2022-49/segments/1669446710777.20/warc/CC-MAIN-20221130225142-20221201015142-00117.warc.gz
| 471,849,050
| 4,737
|
\documentclass[11pt]{article}
\usepackage[margin=1in,bottom=.5in,includehead,includefoot]{geometry}
\usepackage{hyperref}
\usepackage{language}
\usepackage{alltt}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
%% Now begin customising things. See the fancyhdr docs for more info.
\chead{}
\lhead[\sf \thepage]{\sf \leftmark}
\rhead[\sf \leftmark]{\sf \thepage}
\lfoot{}
\cfoot{Statistical Sleuth in R: Chapter 9}
\rfoot{}
\newcounter{myenumi}
\newcommand{\saveenumi}{\setcounter{myenumi}{\value{enumi}}}
\newcommand{\reuseenumi}{\setcounter{enumi}{\value{myenumi}}}
\pagestyle{fancy}
\def\R{{\sf R}}
\def\Rstudio{{\sf RStudio}}
\def\RStudio{{\sf RStudio}}
\def\term#1{\textbf{#1}}
\def\tab#1{{\sf #1}}
\usepackage{relsize}
\newlength{\tempfmlength}
\newsavebox{\fmbox}
\newenvironment{fmpage}[1]
{
\medskip
\setlength{\tempfmlength}{#1}
\begin{lrbox}{\fmbox}
\begin{minipage}{#1}
\vspace*{.02\tempfmlength}
\hfill
\begin{minipage}{.95 \tempfmlength}}
{\end{minipage}\hfill
\vspace*{.015\tempfmlength}
\end{minipage}\end{lrbox}\fbox{\usebox{\fmbox}}
\medskip
}
\newenvironment{boxedText}[1][.98\textwidth]%
{%
\begin{center}
\begin{fmpage}{#1}
}%
{%
\end{fmpage}
\end{center}
}
\newenvironment{boxedTable}[2][tbp]%
{%
\begin{table}[#1]
\refstepcounter{table}
\begin{center}
\begin{fmpage}{.98\textwidth}
\begin{center}
\sf \large Box~\expandafter\thetable. #2
\end{center}
\medskip
}%
{%
\end{fmpage}
\end{center}
\end{table} % need to do something about exercises that follow boxedTable
}
\newcommand{\cran}{\href{http://www.R-project.org/}{CRAN}}
\title{The Statistical Sleuth in R: \\
Chapter 9}
\author{
Kate Aloisio\and Ruobing Zhang \and Nicholas J. Horton\thanks{Department of Mathematics, Amherst College, [email protected]}
}
\date{\today}
\begin{document}
\maketitle
\tableofcontents
%\parindent=0pt
<<pvalues, echo=FALSE, message=FALSE>>=
print.pval = function(pval) {
threshold = 0.0001
return(ifelse(pval < threshold, paste("p<", sprintf("%.4f", threshold), sep=""),
ifelse(pval > 0.1, paste("p=",round(pval, 2), sep=""),
paste("p=", round(pval, 3), sep=""))))
}
@
<<setup0, include=FALSE, cache=FALSE>>=
opts_chunk$set(
dev="pdf",
fig.path="figures/",
fig.height=3,
fig.width=4,
out.width=".72\\textwidth",
fig.keep="high",
fig.show="hold",
fig.align="center",
prompt=TRUE, # show the prompts; but perhaps we should not do this
comment=NA # turn off commenting of ouput (but perhaps we should not do this either
)
@
<<setup,echo=FALSE,message=FALSE>>=
require(Sleuth2)
require(mosaic)
trellis.par.set(theme=col.mosaic()) # get a better color scheme
set.seed(123)
# this allows for code formatting inline. Use \Sexpr{'function(x,y)'}, for exmaple.
knit_hooks$set(inline = function(x) {
if (is.numeric(x)) return(knitr:::format_sci(x, 'latex'))
x = as.character(x)
h = knitr:::hilight_source(x, 'latex', list(prompt=FALSE, size='normalsize'))
h = gsub("([_#$%&])", "\\\\\\1", h)
h = gsub('(["\'])', '\\1{}', h)
gsub('^\\\\begin\\{alltt\\}\\s*|\\\\end\\{alltt\\}\\s*$', '', h)
})
showOriginal=FALSE
showNew=TRUE
@
\section{Introduction}
This document is intended to help describe how to undertake analyses introduced as examples in the Second Edition of the \emph{Statistical Sleuth} (2002) by Fred Ramsey and Dan Schafer.
More information about the book can be found at \url{http://www.proaxis.com/~panorama/home.htm}.
This
file as well as the associated \pkg{knitr} reproducible analysis source file can be found at
\url{http://www.amherst.edu/~nhorton/sleuth}.
This work leverages initiatives undertaken by Project MOSAIC (\url{http://www.mosaic-web.org}), an NSF-funded effort to improve the teaching of statistics, calculus, science and computing in the undergraduate curriculum. In particular, we utilize the
\pkg{mosaic} package, which was written to simplify the use of R for introductory statistics courses. A short summary of the R needed to teach introductory statistics can be found in the mosaic package vignette (\url{http://cran.r-project.org/web/packages/mosaic/vignettes/MinimalR.pdf}).
To use a package within R, it must be installed (one time), and loaded (each session). The package can be installed using the following command:
<<install_mosaic,eval=FALSE>>=
install.packages('mosaic') # note the quotation marks
@
Once this is installed, it can be loaded by running the command:
<<load_mosaic,eval=FALSE>>=
require(mosaic)
@
This
needs to be done once per session.
In addition the data files for the \emph{Sleuth} case studies can be accessed by installing the \pkg{Sleuth2} package.
<<install_Sleuth2,eval=FALSE>>=
install.packages('Sleuth2') # note the quotation marks
@
<<load_Sleuth2,eval=FALSE>>=
require(Sleuth2)
@
We also set some options to improve legibility of graphs and output.
<<eval=TRUE>>=
trellis.par.set(theme=col.mosaic()) # get a better color scheme for lattice
options(digits=3)
@
The specific goal of this document is to demonstrate how to calculate the quantities described in Chapter 9: Multiple Regression using R.
\section{Effects of light on meadowfoam flowering}
Do different amounts of light affect the growth of meadowfoam (a small plant used to create seed oil)? This is the question addressed in case study 9.1 in the \emph{Sleuth}.
\subsection{Data coding, summary statistics and graphical display}
We begin by reading the data and summarizing the variables.
<<>>=
summary(case0901)
favstats(Flowers ~ Intens | Time, data=case0901)
@
A total of \Sexpr{nrow(case0901)} meadowfoam plants were included in this data. There were \Sexpr{length(unique(case0901[,"Time"]))*length(unique(case0901[, "Intens"]))} treatment groups - \Sexpr{length(unique(case0901[, "Intens"]))} light intensities at each of the \Sexpr{length(unique(case0901[,"Time"]))} timing levels (Display 9.2, page 237 of the \emph{Sleuth}).
The following code generates the scatterplot of the average number of flowers per
plant versus the applied light intensity for each of the 12 experimental units akin to Display 9.3 on page 238.
<<tidy=FALSE>>=
xyplot(Flowers ~ Intens, groups=Time, type=c("p", "r", "smooth"),
data=case0901, auto.key=TRUE,
xlab="light intensity (mu mol/m^2/sec)", ylab="average number of flowers")
@
\subsection{Multiple linear regression model}
We next fit a multiple linear regression model that specifies parallel regression lines for the mean number of flowers as a function of light intensity as interpreted on page 237.
<<>>=
lm1 = lm(Flowers ~ Intens+Time, data=case0901)
summary(lm1)
confint(lm1, level=.95) # 95% confidence intervals
@
We can also fit a multiple linear regression with an interaction between light intensity and timing of its initiation as shown in Display 9.14 (page 256) and interpreted on page 237.
<<>>=
lm2 = lm(Flowers ~ Intens*Time, data=case0901)
summary(lm2)
@
\section{Why do some mammals have large brains?}
What characteristics predict large brains in mammals? This is the question addressed in case study 9.2 in the \emph{Sleuth}.
\subsection{Data coding and summary statistics}
We begin by reading the data and summarizing the variables.
<<>>=
case0902 = transform(case0902, logbrain = log(Brain))
case0902 = transform(case0902, logbody = log(Body))
case0902 = transform(case0902, loggest = log(Gestation))
case0902 = transform(case0902, loglitter = log(Litter))
summary(case0902)
@
A total of \Sexpr{nrow(case0902)} mammals were included in this data. The average values of brain weight, body weight, gestation length, and litter size for each of the species were calculated and presented in
Display 9.4 (page 239 of the \emph{Sleuth}).
\subsection{Graphical presentation}
The following displays a simple (unadorned) pairs plot, akin to Display 9.10 on page 252.
<<fig.height=8, fig.width=8>>=
pairs(case0902[c("Brain", "Body", "Gestation", "Litter")])
@
We can make it fancier if we like.
<<>>=
panel.hist = function(x, ...)
{
usr = par("usr"); on.exit(par(usr))
par(usr = c(usr[1:2], 0, 1.5) )
h = hist(x, plot=FALSE)
breaks = h$breaks; nB = length(breaks)
y = h$counts; y = y/max(y)
rect(breaks[-nB], 0, breaks[-1], y, col="cyan", ...)
}
panel.lm = function(x, y, col=par("col"), bg=NA,
pch=par("pch"), cex=1, col.lm="red", ...)
{
points(x, y, pch=pch, col=col, bg=bg, cex=cex)
ok = is.finite(x) & is.finite(y)
if (any(ok))
abline(lm(y[ok] ~ x[ok]))
}
@
Below is a somewhat fancier pairs plot.
<<tidy=FALSE,fig.height=9, fig.width=9>>=
pairs(~ Brain+Body+Gestation+Litter,
lower.panel=panel.smooth, diag.panel=panel.hist,
upper.panel=panel.lm, data=case0902)
@
Here is an even fancier pairs plot using the log-transformed variables, akin to Display 9.11 on page 253.
<<tidy=FALSE, fig.height=9, fig.width=9>>=
pairs(~ logbrain+logbody+loggest+loglitter,
lower.panel=panel.smooth, diag.panel=panel.hist,
upper.panel=panel.lm, data=case0902)
@
The following displays a jittered scatterplot of log brain weight as a function of log litter size, akin to Display 9.12 on page 254.
<<fig.height=6, fig.width=8>>=
xyplot(logbrain ~ jitter(loglitter), data=case0902)
@
Below displays a jittered scatterplot using the original data on a log-transformed axis, akin to Display 9.12 on page 254.
<<fig.height=8, fig.width=8>>=
xyplot(Brain ~ jitter(Litter), scales=list(y=list(log=TRUE),
x=list(log=TRUE)), data=case0902)
@
The following displays a jittered scatterplot using the original data stratified by body weight on a log-transformed axis, akin to Display 9.13 on page 255.
<<tidy=FALSE,fig.height=6, fig.width=10>>=
case0902$weightcut = cut(case0902$Body, breaks=c(0, 2.1, 9.1, 100, 4200),
labels=c("Body Weight: 0kg to 2.1kg","Body Weight: 2.1kg to 9.1kg",
"Body Weight: 9.1kg to 100kg", "Body Weight: 100 to 4,200"))
xyplot(Brain ~ jitter(Litter) | weightcut,
scales=list(y=list(log=TRUE), x=list(log=TRUE)), type=c("p", "r"),
data=case0902)
@
\subsection{Multiple linear regression model}
The following model is interpreted on page 238 and shown in Display 9.15 (page 256).
<<>>=
lm1 = lm(logbrain ~ logbody+loggest+loglitter, data=case0902)
summary(lm1)
@
\end{document}
|
https://www.zentralblatt-math.org/matheduc/en/?id=166478&type=tex
|
zentralblatt-math.org
|
CC-MAIN-2019-47
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2019-47/segments/1573496670948.64/warc/CC-MAIN-20191121180800-20191121204800-00225.warc.gz
| 1,029,638,287
| 1,021
|
\input zb-basic
\input zb-matheduc
\iteman{ZMATH 2000c.01687}
\itemau{Gfeller, Mary K.}
\itemti{Mathematical MIAs.}
\itemso{Sch. Sci. Math. 99, No. 2, 57-59 (1999).}
\itemab
Discusses what is important in teaching and learning mathematics, mathematics curriculum, types of mathematical knowledge, and reform movements in these areas. (ERIC)
\itemrv{~}
\itemcc{D33}
\itemut{}
\itemli{doi:10.1111/j.1949-8594.1999.tb17448.x}
\end
|
http://porocila.imfm.si/2007/fiz/uvod.tex
|
imfm.si
|
CC-MAIN-2020-29
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2020-29/segments/1593655906934.51/warc/CC-MAIN-20200710082212-20200710112212-00085.warc.gz
| 108,905,714
| 1,915
|
\oddelek{ODDELEK ZA FIZIKO}
\thispagestyle{empty}
\naslov{PROJEKTI}
V letu 2007 smo člani oddelka delovali v naslednjih projektih:
\begin{seznam}
\projektDomaci {J1-6516}{Denis Arčon} {Študij eno- in dvodimenzionalnih antiferomagnetov s spinsko energijsko režo}{}
\projektDomaci {J1-6033}{Zvonko Jagličić} {Študij magnetizma v novih kompleksnih materialih}{}
\projektDomaci {L2-6207}{Janko Lužnik} {Nov način merjenja temperature v posebnih pogojih z metodo JKR}{}
\projektDomaci {M1-0010}{Zvonko Trontelj} {Jedrska kvadrupolna resonanca dušika kot selektivna metoda za detekcijo eksplozivov}{}
\projektDomaci {M1-0107}{Zvonko Trontelj} {Spremljanje staranja nitroceluloznih pogonskih sredstev}{}
\projektDomaci {M1-0216}{Tomaž Apih} {Hitra dvokanalna NQR/NMR detekcija trdnih in tekočih eksplozivov}{}
\projektDomaci {VSENZORJI, 631-43/2007-66}{Robert Blinc} {Kalijev magneto-optičnoi senzor - KMOS}{}
\projektDomaci {TP MIR 12}{Boštjan Bregar} {JKR detektor za nedestruktivno detekcijo zemejskih min in improviziranih eksplozivnih naprav}{}
\projektDomaci {Center odlič\-no\-sti}{Slobodan Žumer} {Kompleksni materiali za nove tehnologije}{}
\end{seznam}
Sodelovali smo v naslednjih mednarodnih projektih:
\begin{seznam}
\projektMednarodni {Zvonko Jagličić}
{Sinteza in fizikalne lastnosti magnetnih nanodelcev in polikristalnih materialov}{}
{dvostranski s Srbijo in Črno Goro}
\projektMednarodni {Zvonko Trontelj}
{Povezava nanodimenzijske magnetike z biologijo: nova tehnika za detekcijo, manipulacijo in kontrolo biološko zanimivih komponent na celičnem nivoju}{}
{dvostranski z ZDA}
\projektMednarodni {Zvonko Trontelj} {NQR demining} {koordinator IJS}{NATO Science for Peace Programme SfP 978007}
\end{seznam}
\newpage
\naslov{PATENTI}
V letu 2007 smo prijavili en evropski
\begin{seznam}
\projektDomaci{št. prijave 08\ 000\ 923.6}
{R.~Blinc, Z.~Trontelj, J.~Lužnik, T.~Apih, J.~Seliger, G.~Lahajnar}{Polarization enhanced two-channel NQR/NMR detection of solid and liquid explosives using multi-pulse sequences}
{}
\end{seznam}
in dva slovenska patenta
\begin{seznam}
\projektDomaci{št. prijave P-200700014}
{R.~Blinc, Z.~Trontelj, J.~Lužnik, T.~Apih, J.~Seliger, G.~Lahajnar}
{Polarizacijsko ojačana dvo-kanalna NQR/NMR (PO NQR/NMR) detekcija trdnih in tekočih eksplozivov ob uporabi multi-pulznih sekvenc}
{}
\projektDomaci{št. prijave P-200700193}
{J.~Lužnik, J.~Pirnat, Z.~Trontelj}
{Merilnik temperature in temperaturnih gradientov v majhnih vzorcih z metodo jedrske kvadrupolne resonance}
{}
\end{seznam}
\naslov{MLADI RAZISKOVALCI}
V okviru Oddelka sta se v letu 2007 usposabljala dva mlada raziskovalca:
\begin{seznam}
\mladiRazisDoma {Jernej Slanovec} {Z. Jagličić, štipendist Iskre EMECO}
\mladiRazisDoma {Marko Jagodič} {Z. Jagličić}
\end{seznam}
|
https://www.zentralblatt-math.org/matheduc/en/?id=66361&type=tex
|
zentralblatt-math.org
|
CC-MAIN-2019-51
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2019-51/segments/1575540527620.19/warc/CC-MAIN-20191210123634-20191210151634-00449.warc.gz
| 930,313,987
| 1,194
|
\input zb-basic
\input zb-matheduc
\iteman{ZMATH 2002e.04400}
\itemau{Shaughnessy, J. Michael; Pfannkuch, Maxine}
\itemti{How faithful is old faithful? Statistical thinking: a story of variation and prediction.}
\itemso{Math. Teach. (Reston) 95, No. 4, 252-259 (2002).}
\itemab
The authors of this article have found that data sets from the Old Faithful geyser in Yellowstone Park furnish a rich context for introducing such important aspects of statistical thinking as the central role of variation and the importance of asking our students what they would predict. In this article, we first discuss the context of the data, next present a classroom exploration of the data, and then discuss the nature of statistical thinking as it pertains to this Old Faithful data set. (orig.)
\itemrv{~}
\itemcc{K70}
\itemut{}
\itemli{}
\end
|
http://ftp.t.ring.gr.jp/archives/text/CTAN/macros/latex/contrib/reledmac/examples/1-tabular.tex
|
ring.gr.jp
|
CC-MAIN-2020-10
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2020-10/segments/1581875143695.67/warc/CC-MAIN-20200218120100-20200218150100-00401.warc.gz
| 59,466,402
| 1,144
|
\documentclass{article}
\usepackage[osf,p]{libertinus}
\usepackage{microtype}
\usepackage[pdfusetitle,hidelinks]{hyperref}
\usepackage[english, main=italian]{babel}
\babeltags{english = english}
\usepackage[series={A,B},noend,noeledsec,noledgroup]{reledmac}
\firstlinenum{1}
\linenumincrement{1}%
\begin{document}
\begin{english}
\date{}
\title{Tabulars with reledmac}
\maketitle
\begin{abstract}
This file provides example of using tabular environments with \emph{reledmac}.
We use \verb+edtabularl+, \verb+edtabularc+ and \verb+edtabularr+, with marginal, critical and familiar notes. We also use optional arguments of \verb+\pstart+.
\end{abstract}
\end{english}
\beginnumbering
\pstart[\section{Left align}]
\begin{edtabularl}
linea prima & linea prima\ledouternote{sidenote l} \\
linea secunda & linea secunda\footnoteA{familiar footnote A.} \\
linea tertia & linea \edtext{tertia}{\Afootnote{critical note A}} \\
linea quarta & linea \edtext{quarta}{\Bfootnote{critical note B}} \\
linea quinta & linea quinta\footnoteB{familiar footnote B.} \\
linea sexta & linea sexta
\end{edtabularl}
\pend
\pstart[\section{Center align}]
\begin{edtabularc}
linea prima & linea prima\ledouternote{sidenote c} \\
linea secunda & linea secunda\footnoteA{familiar footnote A.} \\
linea tertia & linea \edtext{tertia}{\Afootnote{critical note A}} \\
linea quarta & linea \edtext{quarta}{\Bfootnote{critical note B}} \\
linea quinta & linea quinta\footnoteB{familiar footnote B.} \\
linea sexta & linea sexta
\end{edtabularc}
\pend
\pstart[\section{Right align}]
\begin{edtabularr}
linea prima & linea prima\ledouternote{sidenote r} \\
linea secunda & linea secunda\footnoteA{familiar footnote A.} \\
linea tertia & linea \edtext{tertia}{\Afootnote{critical note A}} \\
linea quarta & linea \edtext{quarta}{\Bfootnote{critical note B}} \\
linea quinta & linea quinta\footnoteB{familiar footnote B.} \\
linea sexta & linea sexta
\end{edtabularr}
\pend
\endnumbering
\end{document}
|
https://ctan.math.washington.edu/tex-archive/info/examples/PSTricks_6_de/25-07-2.ltx
|
washington.edu
|
CC-MAIN-2022-27
|
text/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2022-27/segments/1656104244535.68/warc/CC-MAIN-20220703134535-20220703164535-00198.warc.gz
| 230,257,086
| 1,309
|
%%
%% Ein Beispiel der DANTE-Edition
%%
%%
%% Copyright (C) 2010 Herbert Voss
%%
%% It may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%%
%% See http://www.latex-project.org/lppl.txt for details.
%%
%%
%% ====
% Show page(s) 1
%%
\documentclass[]{exaarticle}
\pagestyle{empty}
\setlength\textwidth{352.81416pt}
\setlength\parindent{0pt}
\StartShownPreambleCommands
\usepackage{pst-map2dII,graphicx}
\StopShownPreambleCommands
\begin{document}
\psset{path=pst-geo/dataII}
\resizebox{.8\linewidth}{!}{\begin{pspicture*}(-7,-75)(10,-55)
\psframe(-7,-75)(10,-55)
\psset{xunit=25,yunit=25,level=50,type=8,latitude0=48.85,longitude0=2.316667}
\WorldMapII[maillage=true,linewidth=0.75\pslinewidth,limiteL=190,borders=true]
\input{capitales.tex} \input{villesFrance.tex}
\pnodeMap(20,35){MerMed} \rput{15}(MerMed){\shortstack{MER\\MÉDITERANNÉE}}
\pnodeMap(35,43){MerNoire}\rput{15}(MerNoire){\shortstack{MER\\NOIRE}}
\pnodeMap(-15,50){OceanAtlan}\rput{80}(OceanAtlan){OCÉAN ATLANTIQUE}
\pnodeMap(4,56){MerNoire} \rput(MerNoire){\shortstack{Mer\\du\\Nord}}
\end{pspicture*}}
\end{document}
|
https://www.zentralblatt-math.org/matheduc/en/?id=36959&type=tex
|
zentralblatt-math.org
|
CC-MAIN-2019-47
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2019-47/segments/1573496670601.75/warc/CC-MAIN-20191120185646-20191120213646-00229.warc.gz
| 1,024,918,430
| 2,402
|
\input zb-basic
\input zb-matheduc
\iteman{ZMATH 2009b.00135}
\itemau{Otto, Barbara; Perels, Franziska; Schmitz, Bernhard}
\itemti{The correlation of parental behavior with the self-regulative learning of elementary school students. (Zum Zusammenhang des Elternverhaltens mit dem selbstregulierten Lernen von Grundsch\"ulern.)}
\itemso{Psychol. Erzieh. Unterr. 55, No. 4, 288-300 (2008).}
\itemab
Zusammenfassung (DIPF): Aufbauend auf Befunden zum Einfluss von Elternverhalten auf die schulische Leistung von Kindern war es Zielsetzung dieser Studie, den Zusammenhang von schulbezogenen Elternvariablen sowohl mit dem selbstregulierten Lernen als auch mit der Lernleistung von Grundsch\"ulern zu untersuchen. An der Studie nahmen 179 Sch\"uler der vierten Jahrgangsstufe mit ihren Eltern teil. Zur Erfassung des Lernverhaltens sowie der Wahrnehmung der schulbezogenen Elternvariablen (vor allem Unterst\"utzungsverhalten bei den Hausaufgaben) wurde ein Sch\"ulerfragebogen eingesetzt. Zur Erfassung schulischer Leistungen bearbeiteten alle Sch\"uler dar\"uber hinaus einen Leistungstest zum mathematischen Probleml\"osen. Auf Seiten der Eltern wurde zur Selbsteinsch\"atzung der schulbezogenen Variablen ebenfalls ein Fragebogen eingesetzt. Sch\"uler- und Elternfragebogen waren bezogen auf die zu erfassenden Elternvariablen parallelisiert. Mit Hilfe von Korrelations- und Regressionsanalysen wurden sowohl der Zusammenhang zwischen Eltern- und Sch\"ulervariablen als auch der Einfluss der famili\"aren Lernsituation auf das Lernverhalten der Sch\"uler ermittelt. Die parallelisierte Erfassung der Elternvariablen auf Sch\"uler- und Elternebene erm\"oglichte die genannten Analysen hinsichtlich Fremd- und Selbstwahrnehmung. Die Ergebnisse deuten darauf hin, dass das Modellverhalten der Eltern entgegen den Erwartungen keinen signifikanten Zusammenhang mit den Sch\"ulervariablen aufweist, w\"ahrend vor allem die Beziehungsqualit\"at als bedeutsamer Pr\"adiktor f\"ur das Lernverhalten und die Leistung der Sch\"uler angesehen werden kann. (ZPID).
\itemrv{~}
\itemab
Summary: With regard to results concerning the influence of parents' behavior on the academic performance of their children, the aim of our study was to examine the correlation between -parental variables and self-regulative learning as well as the learning efficiency of elementary students. A total of 179 4th graders and their parents participated in our study. To assess the students' learning behavior as well as the perceived school-oriented behavior of their parents, the 4th graders had to fill out a questionnaire. Besides this questionnaire, they also worked on a mathematical problem-solving test. Parents were asked about their school oriented behavior by means of a questionnaire. Both the pupils' and the parents' questionnaires were paralleled and oriented around the collecting of the parental variables. Analyses of correlations as well as regression analyses were conducted to analyze the relationship between parental and student variables. Besides, we examined the influence of the learning situa-tion at home on the learning behavior of students. As expected, the results show significant correlations between parental support of autonomy and children's self-regulated learning and mathematical problem-solving. Additionally the quality of the parent-child-relationship in homework situations has an important impact on children's learning. The results indicate that the parental modelling unexpectedly did not have a significant correlation with students variables, whereas the quality of the parent-child-relationship could be seen as an important predictor of students' learning behavior and performance.
\itemrv{~}
\itemcc{C62 C72 C32 C42 D62}
\itemut{Parents, self-regulation, self-regulated learning, mathematical problem solving, primary school; empirical investigations Eltern, Selbstregulation, selbstreguliertes Lernen, mathematisches Probleml\"osen, Grundschule}
\itemli{}
\end
|
https://theanarchistlibrary.org/library/mikhail-bakunin-fragment-on-life-and-spirit.tex
|
theanarchistlibrary.org
|
CC-MAIN-2021-25
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-25/segments/1623487620971.25/warc/CC-MAIN-20210615084235-20210615114235-00131.warc.gz
| 500,418,601
| 5,637
|
\documentclass[DIV=12,%
BCOR=10mm,%
headinclude=false,%
footinclude=false,%
fontsize=11pt,%
twoside,%
paper=210mm:11in]%
{scrartcl}
\usepackage[noautomatic]{imakeidx}
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{verbatim}
\usepackage[shortlabels]{enumitem}
\usepackage{tabularx}
\usepackage[normalem]{ulem}
\def\hsout{\bgroup \ULdepth=-.55ex \ULset}
% https://tex.stackexchange.com/questions/22410/strikethrough-in-section-title
% Unclear if \protect \hsout is needed. Doesn't looks so
\DeclareRobustCommand{\sout}[1]{\texorpdfstring{\hsout{#1}}{#1}}
\usepackage{wrapfig}
% avoid breakage on multiple <br><br> and avoid the next [] to be eaten
\newcommand*{\forcelinebreak}{\strut\\*{}}
\newcommand*{\hairline}{%
\bigskip%
\noindent \hrulefill%
\bigskip%
}
% reverse indentation for biblio and play
\newenvironment*{amusebiblio}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newenvironment*{amuseplay}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newcommand*{\Slash}{\slash\hspace{0pt}}
% http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\PassOptionsToPackage{hyphens}{url}\usepackage[hyperfootnotes=false,hidelinks,breaklinks=true]{hyperref}
\usepackage{bookmark}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setmainfont{LinLibertine_R.otf}[Script=Latin,%
Ligatures=TeX,%
Path=/usr/share/fonts/opentype/linux-libertine/,%
BoldFont=LinLibertine_RB.otf,%
BoldItalicFont=LinLibertine_RBI.otf,%
ItalicFont=LinLibertine_RI.otf]
\setmonofont{cmuntt.ttf}[Script=Latin,%
Ligatures=TeX,%
Scale=MatchLowercase,%
Path=/usr/share/fonts/truetype/cmu/,%
BoldFont=cmuntb.ttf,%
BoldItalicFont=cmuntx.ttf,%
ItalicFont=cmunit.ttf]
\setsansfont{cmunss.ttf}[Script=Latin,%
Ligatures=TeX,%
Scale=MatchLowercase,%
Path=/usr/share/fonts/truetype/cmu/,%
BoldFont=cmunsx.ttf,%
BoldItalicFont=cmunso.ttf,%
ItalicFont=cmunsi.ttf]
\newfontfamily\englishfont{LinLibertine_R.otf}[Script=Latin,%
Ligatures=TeX,%
Path=/usr/share/fonts/opentype/linux-libertine/,%
BoldFont=LinLibertine_RB.otf,%
BoldItalicFont=LinLibertine_RBI.otf,%
ItalicFont=LinLibertine_RI.otf]
\let\chapter\section
% global style
\pagestyle{plain}
\usepackage{indentfirst}
% remove the numbering
\setcounter{secnumdepth}{-2}
% remove labels from the captions
\renewcommand*{\captionformat}{}
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\KOMAoption{captions}{belowfigure,nooneline}
\addtokomafont{caption}{\centering}
\deffootnote[3em]{0em}{4em}{\textsuperscript{\thefootnotemark}~}
\addtokomafont{disposition}{\rmfamily}
\addtokomafont{descriptionlabel}{\rmfamily}
\frenchspacing
% avoid vertical glue
\raggedbottom
% this will generate overfull boxes, so we need to set a tolerance
% \pretolerance=1000
% pretolerance is what is accepted for a paragraph without
% hyphenation, so it makes sense to be strict here and let the user
% accept tweak the tolerance instead.
\tolerance=200
% Additional tolerance for bad paragraphs only
\setlength{\emergencystretch}{30pt}
% (try to) forbid widows/orphans
\clubpenalty=10000
\widowpenalty=10000
% given that we said footinclude=false, this should be safe
\setlength{\footskip}{2\baselineskip}
\title{Fragment on life and spirit}
\date{September 4, 1837}
\author{Mikhail Bakunin}
\subtitle{}
% https://groups.google.com/d/topic/comp.text.tex/6fYmcVMbSbQ/discussion
\hypersetup{%
pdfencoding=auto,
pdftitle={Fragment on life and spirit},%
pdfauthor={Mikhail Bakunin},%
pdfsubject={},%
pdfkeywords={Life; spirit; Libertarian Labyrinth}%
}
\begin{document}
\thispagestyle{empty}
\strut\vskip 2em
\begin{center}
{\usekomafont{title}{\huge Fragment on life and spirit\par}}%
\vskip 1em
\vskip 2em
{\usekomafont{author}{Mikhail Bakunin\par}}%
\vskip 1.5em
{\usekomafont{date}{September 4, 1837\par}}%
\end{center}
\vskip 3em
\par
Yes, life is sheer happiness; to live means to understand, to understand life; evil does not exist, all is good; only limitation is evil, the limitation of the spiritual vision. Everything that exists is the life of the spirit, everything is penetrated by the spirit, nothing exists apart from the spirit. The spirit is absolute knowledge, absolute liberty, absolute love, and especially absolute felicity. The natural man, like everything that is natural, is the finite and limited moment of that absolute life. He is still not free, but he contains the potential for unlimited liberty, for unlimited felicity. That potential resides in the consciousness. Man is the conscious creature. The consciousness is the emancipation, the return of the spirit from the infinite and from limited definition into its infinite essence. The degree of consciousness of the man is his degree of liberty, his degree of humanity, of love, and consequently, his degree of happiness. The side of his liberty, of his consciousness is good, happiness. His limited, unconscious side is evil, misfortune. Evil and misfortune only exist for the finite, limited consciousness, and yet that some consciousness contains the possibility and the necessity of emancipation. So evil does not exist and all is good; life is sheer happiness.
Hegel said that only thought distinguishes the man from the animal. That difference is infinite, and it makes man an independent, eternal creature. The natural individual is subject to the same implacable necessity, to the same slavery all everything that is natural. He is a mortal creature; he is a slave; he is nothing even as an individual. He has reality only in the species and is subject to the necessary laws of that species. But consciousness frees him from that necessity, renders him independent, free and eternal. Man in himself is always free and eternal, as a consciousness, as a concept of that spirit that will develop in his life. But for himself, he can be in part a slave; he can be a finite man. The finite man is the one who is still not entirely imbued with the spirit of independence, the one in whom there still persists some spontaneous aspects that the spirit has still not illuminated. It is these aspects that make him finite, by limiting the horizon of his spiritual eye; now, every limitation is evil, misfortune, separation from God. The dark sides of the man hinder him, prevent him from merging with God, making him a slave of contingency. Chance is the lie, the shadow; chance does not exist in a life that is real and true; everything in that life is holy necessity, divine grace. Chance is powerless in the face of true reality; only the shadows, only the interests and the ghostly desires of the man are subject to chance. Chance hampers the liberty of the finite man; chance is the dark, somber side of his life. Consciousness is emancipation from [natural] spontaneity, the illumination by the spirit of human nature. The less conscious the man, the more he is subject to chance; the more conscious he is, the more he is independent from it. Only the ghostly is killed by chance, and the ghostly must die. The shadows is destroyed by the shadow, and therein resides the liberation of the man.
Everything lives; everything is animated by the spirit. Reality is only dead for the dead eye. Reality is the eternal life of God. The thoughtless man also lives in that reality, but he is not conscious of it, for him everything is dead, he sees death everywhere because his consciousness has still not come into being. The more living the man is, the more he is imbued with the spirit of independence, the more reality is living for him, the more it is close to him. What is real is rational. The spirit is the absolute power, the source of all power. Reality is its life, and everywhere reality is all-powerful as will and thing of the spirit. The finite man is cut off from God; he is cut off from reality by the shadows, by his defect of immediacy; for him reality and good are not identical; for him good and evil are separated. He can be a moral man, he is not a religious man, and because he is a slave of reality, he fears it, he hates it. Whoever hates reality and does not know it hates and does not know God. Reality is the divine will. In poetry, in religion and finally in philosophy is accomplished the great act of the reconciliation of man with God. The religious man feels, believes that the divine will is the absolute, unique good, and he says: “Let they will be done”, he says that, although he does not understand the reason why the divine will is in reality the real happiness and why it is uniquely in it that finite satisfaction exists. The moral point of view is the division of good from evil, the separation of man from God, and consequently from reality. For him evil is as essential as good. He fears evil, he is troubled, and a ceaseless struggle between good and evil, between happiness and misfortune takes place within him. Evil does not exist for the religious man: for him it is the shadow, the death, the limitation vanquished by the revelation of the Christ. The religious man feels his individual powerlessness, because he knows that all power comes from God, and he awaits illumination, grace from Him. Grace purifies the man of the influence of the shadow, it disperses the fog that separates him from the sun.
Philosophy, as the independent development and purification of thought, is a human science, for it issues directly from man and it is a divine science because it contains the power of grace: human purification from the phantoms and its union with God. The man who has traversed all three of these spheres of development and education is a perfect man, and all-powerful; for him, reality is the absolute good, the divine will is his conscious will.
Genius is the living consciousness of contemporary reality.
\hairline
A great deal of time has passed since the idea came to me to record here the facts of my inner life. My soul has undergone many upheavals, and I have nearly fallen again. No, I am still not sufficiently illuminated by the truth; I still do not possess enough love to prevent myself from observing myself, from giving myself up to all impressions indiscriminately. There are still many obscure sides in me and these aspects still make it impossible for me to obtain uninterrupted harmony. I still know moments of desiccation, of coldness, and in these moments I must be firm; I must consider them passing instances of illness and I must study the proper means of destroying them.
Next year, in the spring, I will go abroad. — It is essential; it is time to leave indeterminacy behind and make a decision. To this end, I must prepare myself 1) morally and 2) materially: at present, I am reading the Phenomenology.
\hairline
Nature does not pass, it contains the entire totality of the negation, time is within it and not outside it, so it has no power over it, it performs as a power over the realizations and the realities of nature, isolated and subjective, which are one-sided and do not contain the notion of totality of the negation; that is why time is all-powerful over them, they are born of time and unfold in time. The human personality, the human subject, as an isolated realization of nature, is subject to that same law of time, they pass in the same manner. But it contains the entire totality of the negation, as an entirely abstract equality Self = Self [Moi = Moi], and in that equality they are outside of time and time is within them; it manifests its power over the contingent and non-corresponding definitions of that pure equality, and in that regard, time is the abstract basis of the external life of nature as well as the internal life of the Spirit. And it seems to me that the isolated realizations of nature concern the totality of nature in exactly the same manner as the contingent, unilateral qualities or definitions of the subject concern the pure subject.
% begin final page
\clearpage
% if we are on an odd page, add another one, otherwise when imposing
% the page would be odd on an even one.
\ifthispageodd{\strut\thispagestyle{empty}\clearpage}{}
% new page for the colophon
\thispagestyle{empty}
\begin{center}
The Anarchist Library
\smallskip
Anti-Copyright
\bigskip
\includegraphics[width=0.25\textwidth]{logo-en}
\bigskip
\end{center}
\strut
\vfill
\begin{center}
Mikhail Bakunin
Fragment on life and spirit
September 4, 1837
\bigskip
Retrieved on 24\textsuperscript{th} April 2021 from \href{https://www.libertarian-labyrinth.org/bakunin-library/fragment-on-life-and-spirit-1837/}{www.libertarian-labyrinth.org}
\bigskip
\textbf{theanarchistlibrary.org}
\end{center}
% end final page with colophon
\end{document}
% No format ID passed.
|
http://dlmf.nist.gov/36.5.E20.tex
|
nist.gov
|
CC-MAIN-2018-05
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2018-05/segments/1516084887054.15/warc/CC-MAIN-20180118012249-20180118032249-00463.warc.gz
| 90,642,565
| 620
|
\[f(-u,X)=\dfrac{X^{2}}{12w}+4w^{3}-2w^{2},\]
|
https://charm.cs.illinois.edu/gerrit/gitweb?p=charm.git;a=blob_plain;f=doc/netfem/manual.tex;hb=258bd13fd3c6a01a800cc171f7f74fd1ac61000b
|
illinois.edu
|
CC-MAIN-2021-49
|
text/plain-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-49/segments/1637964363465.47/warc/CC-MAIN-20211208083545-20211208113545-00570.warc.gz
| 218,062,373
| 5,403
|
\documentclass[10pt]{article}
\usepackage{../pplmanual}
\input{../pplmanual}
\makeindex
\title{\charmpp\\ NetFEM\\ Manual}
\version{1.0}
\credits{
The initial version of \charmpp{} NetFEM Framework was developed
by Orion Lawlor in 2001.
}
\begin{document}
\maketitle
\section{Introduction}
NetFEM was built to provide an easy way to visualize
the current state of a finite-element simulation, or any
parallel program that computes on an unstructured mesh.
NetFEM is designed to require very little effort to add
to a program, and connects to the running program over
the network via the network protocol CCS (Converse Client/Server).
\section{Compiling and Installing}
NetFEM is part of \charmpp{}, so it can be downloaded
as part of charm. To build NetFEM, just build FEM normally,
or else do a make in charm/net-linux/tmp/libs/ck-libs/netfem/.
To link with NetFEM, add \kw{-module netfem} to your
program's link line. Note that you do {\em not} need to use
the FEM framework to use NetFEM.
The netfem header file for C is called ``netfem.h'',
the header for fortran is called `netfemf.h'.
A simple example NetFEM program is in
charm/pgms/charm++/fem/simple2D/.
A more complicated example is in
charm/pgms/charm++/fem/crack2D/.
\section{Running NetFEM Online}
Once you have a NetFEM program, you can run it and view
the results online by starting the program with CCS enabled:
\begin{verbatim}
foo.bar.edu> ./charmrun ./myprogram +p2 ++server ++server-port 1234
\end{verbatim}
``++server-port'' controls the TCP port number to use for CCS---here,
we use 1234. Currently, NetFEM only works with one chunk per
processor---that is, the -vp option cannot be used.
To view the results online, you then start the NetFEM client,
which can be downloaded for Linux or Windows from
\begin{verbatim}
http://charm.cs.uiuc.edu/research/fem/netfem/
\end{verbatim}
Enter the name of the machine running charmrun and
the TCP port number into the NetFEM client---for example,
you might run:
\begin{verbatim}
netfem foo.bar.edu:1234
\end{verbatim}
The NetFEM client will then connect to the program,
download the most recent mesh registered with
\kw{NetFEM\_POINTAT}, and display it.
At any time, you can press the ``update'' button
to reload the latest mesh.
\section{Running NetFEM Offline}
Rather than using CCS as above, you can register your meshes
using \kw{NetFEM\_WRITE}, which makes the server write out
binary output dump files. For example, to view timestep 10,
which is written to the ``NetFEM/10/`` directory, you'd
run the client program as:
\begin{verbatim}
netfem NetFEM/10
\end{verbatim}
In offline mode, the ``update'' button fetches the next
extant timestep directory.
\section{NetFEM with other Visualization Tools}
You can use a provided converter program to convert the offline NetFEM files into an XML format compatible with the powerful offline visualization tool ParaView(\url{http://paraview.org}). The converter is located in .../charm/src/libs/ck-libs/netfem/ParaviewConverter/. Build the converter by simply issuing a ``make'' command in that directory(assuming NetFEM already has been built).
Run the converter from the parent directory of the "NetFEM" directory to be converted. The converter will generate a directory called ``ParaViewData'', which contains subdirectories for each timestep, along with a ``timestep''directory for index files for each timestep. All files in the ParaViewData directory can be opened by ParaView. To open all chunks for a given timestep, open the desired timestep file in ``ParaViewData/timesteps''. Also, individual partition files can also be opened from ``ParaViewData / $<$timestep$>$ / $<$partition\_num$>$''.
\section{Interface Basics}
You publish your data via NetFEM by making a series of
calls to describe the current state of your data.
There are only 6 possible calls you can make.
\kw{NetFEM\_Begin} is the first routine you call.
\kw{NetFEM\_End} is the last routine to call. These
two calls bracket all the other NetFEM calls.
\kw{NetFEM\_Nodes} describes the properties of the
nodes, or vertices of the domain. \kw{NetFEM\_Elements}
describes the properties of your elements (triangles,
tetrahedra, etc.). After making one of these calls,
you list the different data arrays associated with your
nodes or elements by making calls to \kw{NetFEM\_Scalar}
or \kw{NetFEM\_Vector}.
For example, a typical finite element simulation might
have a scalar mass and vector position, velocity, and net force
associated with each node; and have a scalar stress value
associated with each element. The sequence of NetFEM calls
this application would make would be:
\begin{verbatim}
NetFEM_Begin
NetFEM_Nodes -- lists position of each node
NetFEM_Vector -- lists velocity of each node
NetFEM_Vector -- lists net force on each node
NetFEM_Scalar -- lists mass of each node
NetFEM_Elements -- lists the nodes of each element
NetFEM_Scalar -- lists the stress of each element
NetFEM_End
\end{verbatim}
\begin{figure}[h]
\begin{center}
\includegraphics[width=5in]{fig/example}
\end{center}
\caption{These arrays, typical of a finite element analysis
program, might be passed into NetFEM.}
\label{fig:example}
\end{figure}
\section{Simple Interface}
The details of how to make each call are:
\prototype{NetFEM\_Begin}
\function{NetFEM NetFEM\_Begin(int source, int step, int dim, int flavor);}
\function{integer function NetFEM\_Begin(source,step,dim,flavor)}
\args{integer, intent(in) :: source,step,dim,flavor}
Begins describing a single piece of a mesh. Returns a handle
that is used for each subsequent call until \kw{NetFEM\_End}.
This call, like all NetFEM calls, is collective---every processor
should make the same calls in the same order.
\uw{source} identifies the piece of the mesh---use FEM\_My\_partition
or CkMyPe.
\uw{step} identifies which version of the mesh this is---for example,
you might use the timestep number. This is only used to identify the
mesh in the client.
\uw{dim} is the number of spatial dimensions. For example, in a 2D
computation, you'd pass dim==2; in a 3D computation, dim==3.
The client currently only supports 2D or 3D computations.
\uw{flavor} specifies what to do with the data. This can
take the value \kw{NetFEM\_POINTAT}, which is used in online visualization,
and specifies that NetFEM should only keep a pointer to your data
rather than copy it out of your arrays. Or it can take the value
\kw{NetFEM\_WRITE}, which writes out the data to files named
``NetFEM/\uw{step}/\uw{source}.dat'' for offline visualization.
\prototype{NetFEM\_End}
\function{void NetFEM\_End(NetFEM n);}
\function{subroutine NetFEM\_End(n)}
\args{integer, intent(in) :: n}
Finishes describing a single piece of a mesh, which
then makes the mesh available for display.
\prototype{NetFEM\_Nodes}
\function{void NetFEM\_Nodes(NetFEM n,int nNodes,const double *loc,const char *name);}
\function{subroutine NetFEM\_Nodes(n,nNodes,loc,name)}
\args{integer, intent(in) :: n, nNodes}
\args{double precision, intent(in) :: loc(dim,nNodes) }
\args{character*(*), intent(in) :: name}
Describes the nodes in this piece of the mesh.
\uw{n} is the NetFEM handle obtained from \kw{NetFEM\_Begin}.
\uw{nNodes} is the number of nodes listed here.
\uw{loc} is the location of each node. This must be double-precision
array, laid out with the same number of dimentions as passed to
\kw{NetFEM\_Begin}. For example, in C the location of a 2D
node $n$ is stored in loc[2*n+0] (x coordinate) and loc[2*n+1]
(y coordinate). In Fortran, location of a node $n$ is stored
in loc(:,n).
\uw{name} is a human-readable name for the node locations
to display in the client. We recommend also including the location
units here, for example "Position (m)".
\prototype{NetFEM\_Elements}
\function{void NetFEM\_Elements(NetFEM n,int nElements,int nodePerEl,const int *conn,const char *name);}
\function{subroutine NetFEM\_Elements(n,nElements,nodePerEl,conn,name)}
\args{integer, intent(in) :: n, nElements, nodePerEl}
\args{integer, intent(in) :: conn(nodePerEl,nElements) }
\args{character*(*), intent(in) :: name}
Describes the elements in this piece of the mesh.
Unlike \kw{NetFEM\_Nodes}, this call can be repeated
if there are different types of elements (For example,
some meshes contain a mix of triangles and quadrilaterals).
\uw{n} is the NetFEM handle obtained from \kw{NetFEM\_Begin}.
\uw{nElements} is the number of elements listed here.
\uw{nodePerEl} is the number of nodes for each element.
For example, a triangle has 3 nodes per element; while
tetrahedra have 4.
\uw{conn} gives the index of each element's nodes. Note
that when called from C, the first node is listed in
\uw{conn} as 0 (0-based node indexing), and element $e$'s
first node is stored in conn[e*nodePerEl+0].
When called from Fortran, the first node is listed as 1
(1-based node indexing), and element $e$'s first node is
stored in conn(1,e) or conn((e-1)*nodePerEl+1).
\uw{name} is a human-readable name for the elements
to display in the client. For example, this might be
"Linear-Strain Triangles".
\prototype{NetFEM\_Vector}
\function{void NetFEM\_Vector(NetFEM n,const double *data,const char *name);}
\function{subroutine NetFEM\_Vector(n,data,name)}
\args{integer, intent(in) :: n}
\args{double precision, intent(in) :: data(dim,lastEntity) }
\args{character*(*), intent(in) :: name}
Describes a spatial vector associated with each node or element
in the mesh. Attaches the vector to the most recently listed
node or element. You can repeat this call several times to
describe different vectors.
\uw{n} is the NetFEM handle obtained from \kw{NetFEM\_Begin}.
\uw{data} is the double-precision array of vector values.
The dimensions of the array have to match up with the node
or element the data is associated with--in C, a 2D element $e$'s
vector starts at data[2*e]; in Fortran, element $e$'s
vector is data(:,e).
\uw{name} is a human-readable name for this vector data.
For example, this might be "Velocity (m/s)".
\prototype{NetFEM\_Scalar}
\function{void NetFEM\_Scalar(NetFEM n,const double *data,int dataPer,const char *name);}
\function{subroutine NetFEM\_Scalar(n,data,dataPer,name)}
\args{integer, intent(in) :: n, dataPer}
\args{double precision, intent(in) :: data(dataPer,lastEntity) }
\args{character*(*), intent(in) :: name}
Describes some scalar data associated with each node or element
in the mesh. Like \kw{NetFEM\_Vector}, this data is attached
to the most recently listed node or element and this call
can be repeated. For a node or element, you can make the
calls to \kw{NetFEM\_Vector} and \kw{NetFEM\_Scalar} in any order.
\uw{n} is the NetFEM handle obtained from \kw{NetFEM\_Begin}.
\uw{data} is the double-precision array of values.
In C, an element $e$'s scalar values start at data[dataPer*e];
in Fortran, element $e$'s values are in data(:,e).
\uw{dataPer} is the number of values associated with each
node or element. For true scalar data, this is 1; but
can be any value. Even if dataPer happens to equal the number
of dimensions, the client knows that this data does not
represent a spatial vector.
\uw{name} is a human-readable name for this scalar data.
For example, this might be "Mass (Kg)" or "Stresses (pure)".
\section{Advanced ``Field'' Interface}
This more advanced interface can be used if you
store your node or element data in arrays of C structs or
Fortran TYPEs. To use this interface, you'll have to
provide the name of your struct and field. Each
``field'' routine is just an extended version of
a regular NetFEM call described above, and can be
used in place of the regular NetFEM call.
In each case, you pass a description of your field
in addition to the usual NetFEM parameters.
In C, use the macro ``NetFEM\_Field(theStruct,theField)''
to describe the FIELD. For example, to describe
the field ``loc'' of your structure named ``node\_t'',
\begin{verbatim}
node\_t *myNodes=...;
..., NetFEM\_Field(node\_t,loc), ...
\end{verbatim}
In Fortran, you must pass as FIELD the byte offset from the start
of the structure to the start of the field,
then the size of the structure. The FEM "foffsetof" routine,
which returns the number of bytes between its arguments,
can be used for this. For example, to describe the field
``loc'' of your named type ``NODE'',
\begin{verbatim}
TYPE(NODE), ALLOCATABLE :: n(:)
..., foffsetof(n(1),n(1)%loc),foffsetof(n(1),n(2)), ...
\end{verbatim}
\prototype{NetFEM\_Nodes\_field}
\function{void NetFEM\_Nodes\_field(NetFEM n,int nNodes,FIELD,const void *loc,const char *name);}
\function{subroutine NetFEM\_Nodes\_field(n,nNodes,FIELD,loc,name)}
A FIELD version of \kw{NetFEM\_Nodes}.
\prototype{NetFEM\_Elements\_field}
\function{void NetFEM\_Elements\_field(NetFEM n,int nElements,int nodePerEl,FIELD,int idxBase,const int *conn,const char *name);}
\function{subroutine NetFEM\_Elements\_field(n,nElements,nodePerEl,FIELD,idxBase,conn,name)}
A FIELD version of \kw{NetFEM\_Elements}.
This version also allows you to control the starting node
index of the connectivity array---in C, this is normally 0;
in Fortran, this is normally 1.
\prototype{NetFEM\_Vector\_field}
\function{void NetFEM\_Vector\_field(NetFEM n,const double *data,FIELD,const char *name);}
\function{subroutine NetFEM\_Vector\_field(n,data,FIELD,name)}
A FIELD version of \kw{NetFEM\_Vector}.
\prototype{NetFEM\_Scalar\_field}
\function{void NetFEM\_Scalar\_field(NetFEM n,const double *data,int dataPer,FIELD,const char *name);}
\function{subroutine NetFEM\_Scalar(n,data,dataPer,FIELD,name)}
A FIELD version of \kw{NetFEM\_Scalar}.
\end{document}
|
http://www.emis.de/journals/JIS/VOL7/Snellman/snellman2.tex
|
emis.de
|
CC-MAIN-2018-05
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2018-05/segments/1516084892802.73/warc/CC-MAIN-20180123231023-20180124011023-00659.warc.gz
| 447,729,042
| 12,803
|
\documentclass[12pt,reqno]{amsart}
\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amscd}
\usepackage{amsthm}
\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}
\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}
\usepackage{color}
\usepackage{fullpage}
\usepackage{float}
\usepackage{psfig}
\usepackage{graphics,amsmath,amssymb}
\usepackage{amsfonts}
\usepackage{latexsym}
\usepackage{epsf}
\usepackage{eepic}
%\usepackage{amsthm,amssymb}
%\usepackage{moreverb}
%\usepackage[xdvi]{graphicx}
\usepackage{enumerate}
\usepackage{xspace}
%\usepackage{a4wide}
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.5in}
\setlength{\textheight}{8.9in}
\newcommand{\seqnum}[1]{\href{http://www.research.att.com/cgi-bin/access.cgi/as/~njas/sequences/eisA.cgi?Anum=#1}{\underline{#1}}}
\newcommand{\Nat}{{\mathbb{N}}}
\newcommand{\Z}{{\mathbb{Z}}}
\newcommand{\C}{{\mathbb{C}}}
\newcommand{\R}{{\mathbb{R}}}
\newcommand{\Q}{{\mathbb{Q}}}
\newcommand{\CompOf}[2]{#1 \vDash #2}
\newcommand{\PartitionOf}[2]{#1 \vdash #2}
\newcommand{\NumParts}[1]{\langle #1 \rangle}
\newcommand{\w}[1]{{\lvert #1 \rvert}}
\newcommand{\card}[1]{{\lvert #1 \rvert}}
\newcommand{\Partitions}{\mathcal{P}}
\newcommand{\tdeg}[1]{{\lvert #1 \rvert}}
\newcommand{\pseudoconcave}{super-concave\xspace}
\newcommand{\concave}{concave\xspace}
%\newcommand{\pseudoconcave}{concave\xspace}
%\newcommand{\concave}{integrally closed\xspace}
\begin{document}
\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}
\begin{center}
\vskip 1cm{\LARGE\bf Enumeration of Concave Integer Partitions}
\vskip 1cm
\large
Jan Snellman and Michael Paulsen\\
Department of Mathematics\\
Stockholm University\\
SE-10691 Stockholm, Sweden \\
\href{[email protected]}{\tt [email protected]}
\end{center}
\vskip .3 in
\centerline{\bf Abstract}
\begin{quote}
An integer partition \(\PartitionOf{\lambda}{n}\) corresponds, via
its Ferrers diagram, to an artinian monomial ideal \(I \subset
\C[x,y]\) with \(\dim_\C \C[x,y]/I = n\). If \(\lambda\) corresponds
to an integrally closed ideal we call it \emph{\concave}. We study
generating functions for the number of \concave partitions,
unrestricted or with at most \(r\) parts.
\end{quote}
\vskip .3in
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{lemma}{Lemma}[section]
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\newtheorem{example}[definition]{Example}
\theoremstyle{remark}
\newtheorem{remark}[definition]{Remark}
\theoremstyle{plain}
%\newtheorem{lemma}[definition]{Lemma}
%\newtheorem{claim}[definition]{Claim}
%\newtheorem{proposition}[definition]{Proposition}
%\newtheorem{theorem}[definition]{Theorem}
%\newtheorem{cor}[definition]{Corollary}
%\newtheorem{corollary}[definition]{Corollary}
%\newtheorem{conjecture}[definition]{Conjecture}
%\newtheorem{question}[definition]{Question}
\newcommand{\set}[1]{\left\{{#1}\right\}}
\newcommand{\vek}[1]{{\boldsymbol{#1}}}
\newcommand\setsuchas[2]{\left\{{#1}\,\vrule\,{#2}\,\right\}}
% \begin{document}
% \title{Enumeration of concave integer partitions}
% \author{Jan Snellman}
% \address{Department of Mathematics\\
% Stockholm University\\
% SE-10691 Stockholm, Sweden}
% \email{[email protected]}
% \author{Michael Paulsen}
% \begin{abstract}
% An integer partition \(\PartitionOf{\lambda}{n}\) corresponds, via
% its Ferrers diagram, to an artinian monomial ideal \(I \subset
% \C[x,y]\) with \(\dim_\C \C[x,y]/I = n\). If \(\lambda\) corresponds
% to an integrally closed ideal we call it \emph{\concave}. We study
% generating functions for the number of \concave partitions,
% unrestricted or with at most \(r\) parts.
% \end{abstract}
%
%
% \maketitle
%
\begin{section}{\concave partitions}
By an \emph{integer partition} \(\lambda = (\lambda_1, \lambda_2,
\lambda_3,\dots)\)
we mean a weakly decreasing sequence of non-negative integers, all
but finitely many of which are zero. The non-zero elements are
called the \emph{parts} of the partition. When writing a partition,
we often will only write the parts; thus \((2,1,1,0,0,0,\dots)\) may
be written as \((2,1,1)\).
We write
\(r=\NumParts{\lambda}\)
for the number of parts of \(\lambda\), and \(n=\w{\lambda}=\sum_{i}
\lambda_i\); equivalently, we write \(\PartitionOf{\lambda}{n}\)
if \(n=\w{\lambda}\). The set of all partitions is denoted by
\(\Partitions\), and the set of partitions of \(n\) by
\(\Partitions(n)\). We put
\(\card{\Partitions(n)}=p(n)\). By subscripting any of the above
with \(r\) we
restrict to partitions with at most \(r\) parts.
We will use the fact that \(\Partitions\) forms a monoid
under component-wise addition.
For an integer partition \(\PartitionOf{\lambda}{n}\) we define its
\emph{Ferrer's diagram} \(F(\lambda) = \setsuchas{(i,j) \in \Nat^2}{i
< \lambda_{j+1}}\). In figure~\ref{fig:exejkonk} the black dots
comprise the Ferrer's diagram of the partition \(\mu=(4,4,2,2)\).
Then \(F(\lambda)\) is a finite \emph{order ideal}
in the partially ordered set \((\Nat^2,\le)\), where \((a,b) \le
(c,d)\) iff \(a \le c\) and \(b \le d\). In fact, integer partitions
correspond precisely to finite order ideals in this poset.
The complement \(I(\lambda)=\Nat^2 \setminus F(\lambda)\) is a
monoid ideal in the additive monoid \(\Nat^2\). Recall that for a
monoid ideal \(I\) the \emph{integral closure} \(\bar{I}\) is
\begin{equation}
\label{eq:intcl}
\setsuchas{\vek{a}}{ \ell \vek{a} \in I \text{ for some } \ell > 0}
\end{equation}
and that \(I\)
is \emph{integrally closed} iff it is equal to its integral closure.
\begin{definition}\label{def:ic}
The integer partition \(\lambda\) is \emph{\concave} iff
\(I(\lambda)\) is integrally closed. We denote by
\(\bar{\lambda}\) the unique partition such that
\(I(\bar{\lambda})= \overline{I(\lambda)}\).
\end{definition}
Now let \(R\) be the complex monoid ring of \(\Nat^2\).
We identify \(\Nat^2\) with the set of commutative monomials in the
variables \(x,y\), so that
\(R\simeq \C[x,y]\). Then a monoid ideal \(I \subset \Nat^2\)
corresponds to the monomial ideal \(J\) in \(R\) generated by the monomials
\(\setsuchas{x^iy^j}{(i,j) \in I}\). Furthermore, since the monoid
ideals of the form \(I(\lambda)\) are precisely those with finite
complement to \(\Nat^2\), those monoid ideals will correspond to
monomial ideals \(J \subset R\) such that \(R/J\) has a finite
\(\C\)-vector space basis (consisting of images of those monomials
not in \(J\)). By abuse of notation, such monomial ideals are called
\emph{artinian}, and the \(\C\)-vector space dimension of \(R/J\) is
called the \emph{colength} of \(J\).
We get in this way a bijection between
\begin{enumerate}
\item integer partitions of \(n\),
\item order ideals in \((\Nat^2,\le)\) of cardinality \(n\),
\item monoid ideals in \(\Nat^2\) whose complement has cardinality
\(n\), and
\item monomial ideals in \(R\) of colength \(n\).
\end{enumerate}
Recall that if \(\mathfrak{a}\) is an ideal in the
commutative unitary ring \(S\), then the \emph{integral closure}
\(\bar{\mathfrak{a}}\) consists of all \(u \in S\) that fulfill some
equation of the form
\begin{equation}
\label{eq:iceq}
s^n + b_1s^{n-1} + \dots + b_n=0, \qquad b_i \in \mathfrak{a}^i
\end{equation}
Then \(\mathfrak{a}\) is always contained in its integral closure,
which is an ideal. The ideal \(\mathfrak{a}\) is said to be
\emph{integrally closed} if it coincides with its integral closure.
Note that this notion is \textbf{different} from the integral closure
of \(\mathfrak{a}\) as a \textbf{subring} of \(S\). On the other
hand, one can show\footnote{See for instance \cite[chapter 6.6]{Vas:Com}} that
the integral closure of the Rees algebra \(S[\mathfrak{a}t]
\subseteq S[t]\) is equal to the graded subring
\begin{displaymath}
S + \bar{\mathfrak{a}}t + \cdots + \overline{\mathfrak{a}^n}t^n + \cdots
\end{displaymath}
For the special case \(S=R\), we have that the integral closure of a
monomial ideal is again a monomial ideal, and that the latter monomial
ideal corresponds to the integral closure of the monoid ideal
corresponding to the former monomial ideal
\cite{CR:IM, V:MonAlg}. Hence, we have a bijection between
\begin{enumerate}
\item \concave integer partitions of \(n\),
\item integrally closed monoid ideals in \(\Nat^2\) whose complements
have cardinality
\(n\), and
\item integrally closed monomial ideals in \(R\) of colength \(n\).
\end{enumerate}
Fr{\"o}berg and Barucci \cite{Froeberg:Finco}
studied the growth of the number of ideals of colength \(n\)
in certain rings, among them local noetherian rings of dimension 1.
Studying the growth of the number of monomial
ideals of colength \(n\) in \(R\) is, by the above, the same as
studying the partition function \(p(n)\). In this article, we will
instead study the growth of the number of integrally closed monomial
ideals in \(R\), that is, the number of \concave partitions of \(n\).
\begin{figure}[bt]
\setlength{\unitlength}{0.75 cm}
\begin{picture}(15,5)
\put(0,0){\line(1,0){5.5}}
\put(0,0){\line(0,1){5}}
\multiput(-0.12,-0.135)(1,0){4}{$\bullet$}
\multiput(-0.12,0.855)(1,0){4}{$\bullet$}
\multiput(-0.12,1.855)(1,0){2}{$\bullet$}
\multiput(-0.12,2.855)(1,0){2}{$\bullet$}
\multiput(-0.196,3.87)(1,0){6}{$\times$}
\multiput(1.814,2.87)(1,0){4}{$\times$}
\multiput(1.814,1.87)(1,0){4}{$\times$}
\multiput(3.814,0.87)(1,0){2}{$\times$}
\multiput(3.814,-0.13)(1,0){2}{$\times$}
\put(10,0){\line(1,0){5.5}}
\put(10,0){\line(0,1){5}}
\multiput(9.88,-0.135)(1,0){4}{$\bullet$}
\multiput(9.88,0.855)(1,0){3}{$\bullet$}
\multiput(9.88,1.855)(1,0){2}{$\bullet$}
\multiput(9.88,2.855)(1,0){1}{$\bullet$}
\multiput(9.804,3.87)(1,0){6}{$\times$}
\multiput(10.814,2.87)(1,0){5}{$\times$}
\multiput(11.814,1.87)(1,0){4}{$\times$}
\multiput(12.814,0.87)(1,0){3}{$\times$}
\multiput(13.814,-0.13)(1,0){2}{$\times$}
\end{picture}
\caption{\(\mu\) and \(\bar{\mu}\)} \label{fig:exejkonk}
\end{figure}
%\begin{figure}[t]
%\setlength{\unitlength}{0.75 cm}
%\begin{picture}(6,5)
% \put(0,0){\line(1,0){5.5}}
% \put(0,0){\line(0,1){5}}
% \multiput(-0.05,-0.15)(1,0){4}{$\bullet$}
% \multiput(-0.05,0.85)(1,0){4}{$\bullet$}
% \multiput(-0.05,1.85)(1,0){2}{$\bullet$}
% \multiput(-0.05,2.85)(1,0){2}{$\bullet$}
% \path(4,0)(0,4)
% \multiput(-0.18,3.9)(1,0){5}{$\times$}
% \multiput(1.82,2.9)(1,0){4}{$\times$}
% \multiput(0.82,3.9)(0.82,3.9){1}{$\times$}
% \multiput(1.82,1.9)(1.82,1.9){1}{$\times$}
% \multiput(1.82,3.9)(1.82,3.9){1}{$\times$}
% \multiput(2.82,1.9)(2.82,1.9){1}{$\times$}
% \multiput(2.82,2.9)(2.82,2.9){1}{$\times$}
% \multiput(2.82,3.9)(2.82,3.9){1}{$\times$}
% \multiput(3.82,-0.12)(3.82,-0.12){1}{$\times$}
% \multiput(3.82,0.9)(3.82,0.9){1}{$\times$}
% \multiput(3.82,1.9)(3.82,1.9){1}{$\times$}
% \multiput(3.82,2.9)(3.82,2.9){1}{$\times$}
% \multiput(3.82,3.9)(3.82,3.9){1}{$\times$}
% \multiput(4.82,-0.12)(4.82,-0.12){1}{$\times$}
% \multiput(4.82,0.9)(4.82,0.9){1}{$\times$}
% \multiput(4.82,1.9)(4.82,1.9){1}{$\times$}
% \multiput(4.82,2.9)(4.82,2.9){1}{$\times$}
% \multiput(4.82,3.9)(4.82,3.9){1}{$\times$}
%\end{picture}
%\caption{\(\mu\) and \(\bar{\mu}\)} \label{fig:exejkonk}
%\end{figure}
\end{section}
\begin{section}{Inequalities defining \concave partitions}
It is in general a hard problem to compute the integral closure of
an ideal in a commutative ring. However, for monomial ideals in a
polynomial ring, the following theorem, which can be found in
\cite[Exercise 4.23]{Ebud:View} or in \cite{CR:IM, V:MonAlg}, makes
the problem feasible.
\begin{theorem}\label{thm:convex}
Let \(I \subset \Nat^2\) be a monoid ideal, and regard \(\Nat^2\)
as a subset of \(\Q^2\) in the natural way. Let
\(\mathrm{conv}_\Q(I)\) denote the convex hull of \(I\) inside
\(\Q^2\).
Then the integral closure of \(I\) is given by
\begin{equation}
\label{eq:latticep}
\mathrm{conv}_\Q(I) \cap \Nat^2
\end{equation}
\end{theorem}
\begin{example}
The partition \(\mu=(4,4,2,2)\) corresponds to the monoid ideal
\[((0,4),(2,2),(4,0)),\]
which has integral closure
\[((0,4),(1,3),(2,2),(3,1),(4,0)).\]
It follows that \(\overline{\mu}=(4,3,2,1)\).
In figure~\ref{fig:exejkonk} we have drawn the lattice points belonging
to \(F(\mu)\) as dots, and the lattice points belonging to
\(I(\lambda)\) as crosses.
\end{example}
The above theorem gives the following characterization of
\concave partitions:
\begin{lemma}\label{lemma:concaveChar}
Let \(\lambda=(\lambda_1,\lambda_2,\lambda_3,\dots)\) be a
partition. Then \(\lambda\) is \concave iff
for all positive integers \(i < j < k\),
\begin{equation}
\label{eq:konkav}
\lambda_j < 1+ \lambda_i \frac{k-j}{k-i} + \lambda_k
\frac{j-i}{k-i}
\end{equation}
or, equivalently, if
\begin{equation}
\label{eq:konkavhom}
\lambda_i (j-k) + \lambda_j (k-i) + \lambda_k (i-j) < k-i
\end{equation}
\end{lemma}
Since all quantities involved are integers, \eqref{eq:konkavhom} is
equivalent to
\begin{equation}
\label{eq:konkavhom2}
\lambda_i (k-j) + \lambda_j (i-k) + \lambda_k (j-i) \ge i-k+1
\end{equation}
\end{section}
\begin{section}{Generating functions for \pseudoconcave partitions}
We will enumerate \concave partitions by considering another class of
partitions which is more amenable to enumeration, yet is close to
that of \concave partitions.
\begin{definition}\label{def:almostconcave}
Let \(\lambda=(\lambda_1,\lambda_2,\lambda_3,\dots)\) be a
partition. Then \(\lambda\) is \emph{\pseudoconcave} iff
for all positive integers \(i < j < k\),
\begin{equation}
\label{eq:pkonkav}
\lambda_i (k-j) + \lambda_j (i-k) + \lambda_k (j-i) \ge 0
\end{equation}
\end{definition}
The reader should note that it is actually a
\emph{stronger} property to be \pseudoconcave than to be \concave.
Unlike the latter property, it is not
necessarily preserved by conjugation: the partition \((2)\) is
\pseudoconcave, hence \concave, but its conjugate \((1,1)\) is \concave
but not \pseudoconcave.
\begin{theorem}\label{thm:pseudoconcave}
Let \(\lambda=(\lambda_1,\lambda_2,\lambda_3,\dots)\) be a
partition, and let \(\mu =(\mu_1,\mu_2,\mu_3,\dots)\) be its
conjugate, so that \(\card{\setsuchas{j}{\mu_j=i}} = \lambda_i -
\lambda_{i+1}\) for all \(i\).
Then the following are equivalent:
\begin{enumerate}[(i)]
\item \label{it:ps}
\(\lambda\) is \pseudoconcave,
\item \label{it:sv}
for all positive \(\ell\),
\begin{equation}
\label{eq:asc}
-\lambda_\ell +2\lambda_{\ell+1} - \lambda_{\ell+2} \le 0
\end{equation}
\item \label{it:asc}
for all positive \(\ell\),
\begin{equation}
\label{eq:asc2}
\lambda_{\ell+1} -\lambda_\ell \ge \lambda_{\ell+2} -
\lambda_{\ell+1}
\end{equation}
\item \label{it:sfp}
\(\card{\setsuchas{k}{\mu_{k}=i}} \geq
\card{\setsuchas{k}{\mu_{k}=j}}\) whenever \(i \leq j\).
\end{enumerate}
\end{theorem}
\begin{proof} \eqref{it:ps} \(\iff\) \eqref{it:sv}:
Let \(\vek{e}_i\) be the vector with 1 in the \(i\)'th coordinate
and zeros elsewhere, let \(\vek{f}_j=-\vek{e}_j + 2\vek{e}_{j+1}
-\vek{e}_{j+2}\), and let \(\vek{t}_{i,j,k} =
(j-k) \vek{e}_i + (k-i)\vek{e}_j + (j-i)\vek{e}_k\).
Clearly, \eqref{eq:pkonkav} is equivalent with
\(\vek{t}_{i,j,k} \cdot \lambda \le 0\), and
\eqref{eq:asc} is equivalent with
\(\vek{f}_{j} \cdot \lambda \le 0\).
We have that \(\vek{f}_{\ell} = \vek{t}_{\ell,\ell+1,\ell+2}\).
Conversely, we claim that \(\vek{t}_{i,j,k}\)
is a positive linear combination of different \(\vek{f}_{\ell}\).
From this claim, it follows
that if \(\lambda\) fulfills \eqref{eq:asc} for all \(\ell\)
then \(\lambda\) is \pseudoconcave.
We can without loss of generality assume that \(i=1\).
Then it is easy to verify that
\begin{equation}
\label{eq:poslincomb}
\vek{t}_{1,j,k} = \sum_{\ell=1}^{j-2} \ell (k-j)\vek{f}_{\ell}
+ \sum_{\ell=j-1}^{k-2} \ell (j-1)(k-\ell - 1) \vek{f}_{\ell}
\end{equation}
\eqref{it:sv} \(\iff\) \eqref{it:asc} \(\iff\) \eqref{it:sfp} :
This is obvious.
\end{proof}
The \emph{difference operator} \(\Delta\) is defined on partitions by
\begin{equation}
\label{eq:delta}
\Delta(\lambda_1,\lambda_2,\lambda_3,\dots) = (\lambda_1 -
\lambda_2, \lambda_2 - \lambda_3, \lambda_3-\lambda_4,\dots)
\end{equation}
We get that the \emph{second order difference operator} \(\Delta^2\)
is given by
\begin{multline}
\label{eq:delta2}
\Delta^2(\lambda_1,\lambda_2,\lambda_3,\dots) =
\Delta(\Delta(\lambda_1,\lambda_2,\lambda_3,\dots)) = \\
= (\lambda_1 - 2\lambda_2 + \lambda_3, \lambda_2 - 2\lambda_3 +
\lambda_4, \lambda_3 - 2\lambda_4 + \lambda_5, \dots)
\end{multline}
\begin{corollary}
The \pseudoconcave partitions are precisely those with non-negative
second differences.
\end{corollary}
\begin{definition}
Let \(p_{sc}(n)\) denote the number of \pseudoconcave partitions of
\(n\), and \(p_{sc}(n,r)\) denote the number of \pseudoconcave
partitions of
\(n\) with at most \(r\) parts.
Let similarly \(p_{c}(n)\) and \(p_{c}(n,r)\)
denote the number of \concave partitions of \(n\),
and the number of \concave partitions of
\(n\) with at most \(r\) parts, respectively.
For a partition \(\lambda=(\lambda_1,\lambda_2,\dots)\) let
\(\vek{x}^\lambda= x_1^{\lambda_1} x_2^{\lambda_2} \cdots\),
and define
\begin{equation}
\label{eq:PS}
\begin{split}
PS(\vek{x}) &= \sum_{\lambda \text{ \pseudoconcave}} \vek{x}^\lambda\\
PS_r(x_1,\dots,x_r) &= PS(x_1,x_2,\dots,x_r,0,0,0,\dots)
= \sum_{\substack{\lambda \text{ \pseudoconcave}\\
\lambda_{r+1}=0}} \vek{x}^\lambda \\
PC(\vek{x}) &= \sum_{\lambda \text{ \concave}} \vek{x}^\lambda\\
PC_r(x_1,\dots,x_r) &= PC(x_1,x_2,\dots,x_r,0,0,0,\dots)
= \sum_{\substack{\lambda \text{ \concave}\\
\lambda_{r+1}=0}} \vek{x}^\lambda
\end{split}
\end{equation}
\end{definition}
Partitions with non-negative second differences have been studied by
Andrews \cite{Andrews:MM2}, who proved that there are as many such
partitions of \(n\) as
there are partitions of \(n\) into triangular numbers.
Canfield et al \cite{CCH:RandomPart} have studied partitions with
non-negative \(m\)'th differences. Specializing their results to the
case \(m=2\), we conclude:
\begin{theorem}\label{thm:nonnegsecdiff}
Let \(n,r\) be denote positive integers.
\begin{enumerate}[(i)]
\item There is a bijection between
partitions of \(n\) into triangular numbers and \pseudoconcave
partitions.
\item The multi-generating function for \pseudoconcave partitions is
given by
\begin{equation}
\label{eq:psgen}
\begin{split}
PS(\vek{x}) &= \frac{1}{ \prod_{i=1}^\infty \left(1 - \prod_{j=1}^i
x_j^{1+i-j}\right)}\\
&=
1 +
x_{{1}} +
{x_{{1}}}^{2} +
{x_{{1}}}^{3} +
{x_{{1}}}^{4} +
{x_{{1}}}^{2}x_{{2}} +
{x_{{1}}}^{5} +
{x_{{1}}}^{4}x_{{2}} +
{x_{{1}}}^{3}x_{{2}} + \dots
\end{split}
\end{equation}
\item The multi-generating function for \pseudoconcave partitions with at
most \(r\) parts is
given by
\begin{equation}
\label{eq:psgenrp}
PS_r(x_1,x_2,\dots,x_r) =
\frac{1}{ \prod_{i=1}^r \left(1 - \prod_{j=1}^i
x_j^{1+i-j}\right)}
\end{equation}
\item
The generating function for \pseudoconcave partitions is
\begin{equation}
\label{eq:psgenspec}
PS(t) = \sum_{n=0}^\infty p_{sc}(n)t^n =
\prod_{i=1}^\infty \frac{1}{ 1 - t^{\frac{i(i+1)}{2}}}
\end{equation}
and the one for \pseudoconcave partitions with at most \(r\) parts
is
\begin{equation}
\label{eq:psgenspecrp}
PS_r(t) = \sum_{n=0}^\infty p_{sc}(n,r)t^n =
\prod_{i=1}^r \frac{1}{ 1 - t^{\frac{i(i+1)}{2}}}
\end{equation}
\item The proportion of \pseudoconcave partitions with
at most \(r\) parts among all partitions with at most \(r\) parts
is
\begin{equation}
\label{eq:prop}
\frac{r!}{\prod_{i=1}^r \frac{i(i+1)}{2}}.
\end{equation}
\item As \(n \to \infty\),
\begin{equation}
\label{eq:psas}
\begin{split}
p_{sc}(n) \sim c n^{-3/2} \exp(3C n^{1/3})\\
C = 2^{-1/3} \left[\zeta (3/2)\Gamma(3/2)\right]^{2/3}, \quad
c = \frac{\sqrt{3}}{12}\,\left ({\frac {C}{\pi }}\right )^{3/2}
\end{split}
\end{equation}
\end{enumerate}
\end{theorem}
The sequence \(\bigl(p_{sc}(n)\bigr)_{n=0}^\infty\) is identical to
sequence
\htmladdnormallink{A007294}{http://www.research.att.com/projects/OEIS?Anum=007294}
in OEIS \cite{Sloane}.
We have submitted the sequences
\(\bigl(p_{sc}(n,r)\bigr)_{n=0}^\infty\), for \(r=3,4\), in
OEIS \cite{Sloane}, as
\htmladdnormallink{A086159}{http://www.research.att.com/projects/OEIS?Anum=086159}
and
\htmladdnormallink{A086160}{http://www.research.att.com/projects/OEIS?Anum=086160}.
The sequence for \(r=2\) was already in the database, as
\htmladdnormallink{A008620}{http://www.research.att.com/projects/OEIS?Anum=008620}.
\begin{subsection}{Other appearances of \pseudoconcave partitions in
the literature}
The bijection between partitions into triangular numbers and
partitions with non-negative second difference is mentioned in
\htmladdnormallink{A007294}{http://www.research.att.com/projects/OEIS?Anum=007294}
in OEIS \cite{Sloane}, together with a reference to Andrews
\cite{Andrews:MM2}. That sequence has been contributed by Mira
Bernstein and Roland Bacher;
we thank Philippe Flajolet for drawing our attention to it.
Gert Almkvist \cite{Almkvist:partitions} gives an asymptotic
analysis of \(p_{sc}(n)\) which is finer than \eqref{eq:psas}.
Another derivation of the generating functions above can found in a
forthcoming paper ``Partition Bijections, a Survey'' \cite{Pak:Survey}
by Igor Pak. He observes that the set of
\pseudoconcave partitions with at most \(r\) parts consists of the
lattice points of the unimodular cone spanned by the vectors
\(v_0=(1,\dots,1)\) and \(v_i =(i-1,i-2,\dots,1,0,0,\dots)\) for \(1
\le i \le r\).
Corteel and Savage \cite{PCInEq} calculate rational generating functions for
classes of partitions defined by linear homogeneous inequalities. This
applies to \pseudoconcave partitions, but not directly to concave partitions,
since the inequalities \eqref{eq:konkavhom} defining them are inhomogeneous.
\end{subsection}
\end{section}
\begin{section}{Generating functions for \concave partitions}
Recall that a \concave partition
\(\vek{\lambda}=(\lambda_1,\lambda_2,\dots)\) fulfills
\eqref{eq:konkavhom2}, and that conversely, every sequence of
non-negative integers which is eventually zero and fulfills
\eqref{eq:konkavhom2} gives a \concave partition. If we fix a
positive integer \(r\), then we need only finitely many of the
inequalities in \eqref{eq:konkavhom2}: we can take those indexed
by \(i < j < k < r+2\), together with the non-negativity
conditions \(\lambda_i \ge 0\).
Hence, there is a matrix
\(A\) with \(r\) columns, and whose rows are indexed by tuples
\((i,j,k)\) with \(k \le r+1\), so that
a \concave partition with at most \(r\) parts
corresponds to a solution to
\begin{equation}
\label{eq:b}
A\vek{\lambda} \ge \vek{b}, \qquad \vek{\lambda} \in \Nat^r,
\end{equation}
whereas a \pseudoconcave partition with at most \(r\) parts
corresponds to a solution to
\begin{equation}
\label{eq:A}
A\vek{\lambda} \ge \vek{0}, \qquad \vek{\lambda} \in \Nat^r.
\end{equation}
We let \(\mathcal{K} = \setsuchas{\alpha \in \R^r}{A\alpha \ge \vek{b},
\vek{\alpha} \ge \vek{0}}\),
\(\mathcal{P} = \setsuchas{\alpha \in \R^r}{A\alpha \ge \vek{0},
\vek{\alpha} \ge \vek{0}}\). Then \(\mathcal{P}\) is a rational
polyhedron in the positive orthant. Since the RHS vector
\(\vek{b}\) is non-positive, \(\mathcal{P}\) contains its recession
cone \(\mathcal{K}\). The solutions to \eqref{eq:A} and
\eqref{eq:b} are precisely \(\mathcal{KI}=\mathcal{K} \cap \Nat^r\) and
\(\mathcal{PI}=\mathcal{P} \cap \Nat^r\), and the generating functions of
these two sets of lattice points are precisely \(PS_r\) and \(PC_r\).
\begin{example}
If \(r=3\) and if we order the 3-subsets of
\(\{1,2,3,4\}\) as \(123\), \(124\), \(134\), \(234\) then
\begin{displaymath}
A =
\begin{pmatrix}
1 & -2 & 1 \\
2 & -3 & 0 \\
1 & 0 & -3 \\
0 & 1 & -2
\end{pmatrix},
\qquad
\vek{b} = (-1,-2,-2,-1)^t.
\end{displaymath}
\(\mathcal{K}\) is the cone generated by the rays \((1,0,0)\),
\((2,1,0)\), and \((3,2,1)\), whereas \(\mathcal{P}\)
is the Minkowski sum of \(\mathcal{K}\) and the
polytope which is the convex hull of
\((0,0,0)\),
\(( 0, 0, 1/2\),
\(( 0, 1/3, 2/3)\),
\(( 0, 1/2, 0)\),
\(( 0, 2/3, 1/3)\),
\(( 0, 2/3, 2/3)\). So \(\mathcal{P}\) is a rational polyhedron
but not a lattice polyhedron.
\end{example}
\begin{lemma}\label{lemma:sameden}
The generating function \(PC_r(x_1,\dots,x_r)\) is a rational
function with the same denominator as \(PS_r(x_1,\dots,x_r)\),
and with a numerator which evaluates to 1 at
\((1,\dots,1)\). In other words,
\begin{equation}\label{eq:PCr}
PC_r(x_1,\dots,x_r) =
\frac{Q_r(x_1,\dots,x_r)}
{\prod_{i=1}^r \left( 1 - \prod_{j=1}^i
x_j^{1+i-j}\right)}, \quad Q_r(1,\dots,1)=1.
\end{equation}
\end{lemma}
\begin{proof}
This can be obtained from the corresponding result for linear
diophantine \emph{equalities}\footnote{See \cite[Corollary
3.8]{Stanley:CombCom} and the paragraph immediately following
it} by adding slack-variables and then specializing the
corresponding formal variables to 1. We give the outline of a
self-contained proof.
By Gordan's lemma\footnote{Gordan's lemma says the lattice
points in a finitely generated rational cone in the positive
orthant constitute a normal affine semigroup, see
\cite[Proposition 6.1.2]{BrunsHerzog:CM}}, \(\mathcal{KI}\) is a finitely
generated affine semigroup. In fact, it has a unique finite minimal
generating set, called its \emph{Hilbert basis}.
Furthermore, \(\mathcal{PI}\) is a
module over \(\mathcal{KI}\), by which we mean that
\(\mathcal{KI} + \mathcal{PI} \subseteq \mathcal{PI}\).
Now let \(R=\C[\mathcal{KI}]\) be the semigroup ring on
\(\mathcal{KI}\), i.e. the \(\C\)-vector space spanned by all
monomials \(\setsuchas{\vek{x}^\vek{\alpha}}{\vek{\alpha} \in
\mathcal{KI}}\).
We define
\begin{equation}
\label{eq:monmult}
\vek{x}^\vek{\alpha}
\vek{x}^\vek{\beta} = \vek{x}^{\vek{\alpha} + \vek{\beta}},
\end{equation}
and
extend this multiplication by linearity to all of \(R\), turning
it into a \(r\)-multigraded, noetherian \(\C\)-algebra.
Similarly, we define \(M\) to be the
\(\C\)-linear span of monomials corresponding to points in \(\mathcal{PI}\).
\eqref{eq:b}. The multiplication \eqref{eq:monmult} gives \(M\)
the structure of \(r\)-multigraded \(R\)-module.
Since \(\mathcal{KI}\) is a finitely generated affine
semigroup, \(R\) is a finitely generated \(\C\)-algebra. Since
it is a subring of \(\C[x_1,\dots,x_r]\), it is an integral domain.
The Hilbert series of \(R\) is \(PS_r\), and the Hilbert series
of \(M\) is \(PC_r\).
Now note that since
there is some \(\gamma \in \Nat^r\) such that \(\mathcal{PI} +
\gamma \subseteq \mathcal{KI}\), it follows that \(M\) is isomorphic as an
\(R\)-module to the ideal \(\vek{x}^\gamma M \subseteq
R\). Consequently, \(M\) is
a finitely generated torsion-free module over \(R\), of rank
1. Its annihilator is
zero, so \(M\) has the same dimension as \(R\).
It follows from standard commutative
algebra\footnote{See \cite[Theorem 2.3]{Stanley:CombCom},
and note that \(M\) is \(\Nat^r\)-graded rather than
\(\Z^r\)-graded} that the Hilbert series of \(R\) and \(M\)
are rational, of the form
\begin{displaymath}
\frac{N_R(x_1,\dots,x_r)}
{\prod_{i=1}^s (1-\vek{x}^{\vek{\alpha}_i})}
\qquad \text{ and } \qquad
\frac{N_M(x_1,\dots,x_r)}
{\prod_{i=1}^s (1-\vek{x}^{\vek{\alpha}_i})},
\end{displaymath}
where the \(\vek{\alpha}_i\)'s are the elements of a
basis of \(\mathcal{KI}\), and the polynomials \(N_R\) and
\(N_M\) have rational coefficients. Since we know the Hilbert
series of \(R\), we conclude that the vectors
\((i,i-1,\dots,0,\dots,0)\), for \(1 \le i \le r\), form a
basis for \(\mathcal{KI}\).
Furthermore\footnote{See
\cite{BrunsHerzog:CM} , exercise 4.4.12},
\(N_R(1,\dots,1)=1\) , and \(N_M(1,\dots,1) = \textrm{rank}(M)=1\).
The ring \(R\) is Cohen-Macaulay, hence\footnote{See again
\cite{BrunsHerzog:CM} , exercise 4.4.12} all coefficients
of \(N_R(t,\dots,t)\) are non-negative. As calculated in
\eqref{eq:Qrt}, the polynomials \(N_M(t,\dots,t)\) have some negative
coefficients for \(r=2,3,4\), so \(M\) is not Cohen-Macaulay in
general.
\end{proof}
We can say something more about the numerators:
\begin{theorem}\label{thm:pcoco}
Let \(r\) be a fixed positive integer. Then
\begin{enumerate}[(A)]
\item The multigenerating function of \concave partitions with at
most \(r\) parts is given by \eqref{eq:PCr},
where \(Q_r(x_1,\dots,x_r)\) is a polynomial with
integer coefficients such that
all exponent vectors of the monomials that occur
in \(Q_r\) are weakly decreasing.
\item
The generating function for \concave partitions with at most
\(r\) parts is given by
\begin{equation}
\label{eq:concgenf}
PC_r(t) = \sum_{n=0}^\infty p_{c}(n,r)t^n =
\frac{Q_r(t)}{\prod_{i=1}^r \left( 1 -
t^{\frac{i(i+1)}{2}}\right)}
\end{equation}
where \(Q_r(1)=1\), and the numerator has degree strictly smaller than
\(r^3/6 + r^2/2 + r/3\).
\item \(p_{c}(n,r) \sim p_{sc}(n,r)\) as \(n \to \infty\).
\item The proportion of concave partitions with
at most \(r\) parts among all partitions with at most \(r\) parts
is the same as the proportion of \pseudoconcave partitions with
at most \(r\) parts among all partitions with at most \(r\)
parts, namely
\begin{equation}
\label{eq:prop2}
\frac{r!}{\prod_{i=1}^r \frac{i(i+1)}{2}}.
\end{equation}
\item \(Q_r(x_1,\dots,x_r)=Q_{r+1}(x_1,\dots,x_r,0)\).
\item
\begin{equation}
\label{eq:PC}
PC(\vek{x}) =
\frac{Q(\vek{x})}
{\prod_{i=1}^\infty \left( 1 - \prod_{j=1}^i
x_j^{1+i-j}\right)}
\end{equation}
where \(Q(\vek{x})\) is a formal power series with the property
that for each \(\ell\),
\(Q(x_1,\dots,x_\ell,0,0,\dots)=Q_\ell(x_1,\dots,x_\ell)\); in
other words,
\begin{displaymath}
Q = 1 + \sum_{i=1}^\infty \left(Q_i - Q_{i-1}\right)
\end{displaymath}
\end{enumerate}
\end{theorem}
\begin{proof}
All monomials in
\begin{displaymath}
\prod_{i=1}^r \left( 1 - \prod_{j=1}^i
x_j^{1+i-j}\right)
\end{displaymath}
have weakly decreasing exponent vectors, as have all monomials in
the power series \(PC_r(x_1,\dots,x_r)\). Summing weakly
decreasing exponent vectors gives weakly decreasing exponent
vectors, so all exponent vectors in \(Q_r(x_1,\dots,x_r)\) are
weakly decreasing.
If we specialize \(x_1=x_2=\dots = x_r = t\) we get
\begin{displaymath}
PC_r(t) =
\frac{Q_r(t)}{\prod_{i=1}^r \left( 1 -
t^{\frac{i(i+1)}{2}}\right)}, \qquad
PS_r(t) = \frac{1}{\prod_{i=1}^r \left( 1 -
t^{\frac{i(i+1)}{2}}\right)}.
\end{displaymath}
Thus \(Q_r(1) =1\),
and we conclude that
\(p_{c}(n,r) \sim p_{sc}(n,r)\) as \(n \to
\infty\).
Furthermore, from Stanley's ``grey book''
\cite[Theorem 4.6.25]{Stanley:En1} we have that the rational
function \(PC_r(t,\dots,t)\) is of degree \(<0\). The degree of
the denominator is
\begin{displaymath}
\sum_{i=1}^r \frac{i(i+1)}{2} =
\frac{r^3}{6} + \frac{r^2}{2} + \frac{r}{3}
\end{displaymath}
so \(Q_r(t)\) have smaller degree than that.
If \((\lambda_1,\dots,\lambda_r,\lambda_{r+1})\) is a
\concave partition, then so is
\((\lambda_1,\dots,\lambda_r,0)\);
it follows that \(Q_{r+1}(x_1,\dots,x_r,0) =Q_r(x_1,\dots,x_r)\).
The assertion about \(PC(\vek{x})\) follows by passing to the
limit.
\end{proof}
By generating all concave partitions of \(n\) with at most \(r\)
parts, up to a large \(n\), we have calculated that
\begin{equation}
\label{eq:Qr}
\begin{split}
Q_1(\vek{x}) &= 1 \\
Q_2(\vek{x}) & =1 + x_1x_2 - x_1^2x_2\\
Q_3(\vek{x}) & =Q_2(\vek{x}) + x_3\left({x_{{1}}}^{5}{x_{{2}}}^{3} -
{x_{{1}}}^{4}{x_{{2}}}^{3} - 2\,{x_{{1}}}^{3}
{x_{{2}}}^{2} + {x_{{1}}}^{2}{x_{{2}}}^{2} + x_{{1}}x_{{2}}
\right)
\end{split}
\end{equation}
and that
\begin{equation}
\label{eq:Qrt}
\begin{split}
Q_1(t) &= 1\\
Q_2(t) & = 1+t^2-t^3\\
Q_3(t) &= 1+t^2+t^5-2t^6-t^8+t^9\\
Q_4(t) &=
1 + t^2 + t^4 + t^5-t^6-t^7 + 2t^9-2t^{10}-t^{11}-2t^{12} +
\\ &+
2t^{13}-t^{14}-t^{15} + t^{16} + t^{17} + t^{18}-t^{19}
\end{split}
\end{equation}
We have also used the package LinDiophanthus \cite{LinDiophantus} by Doron
Zeilberger to verify our results.
By generating all concave partitions of \(n\) for \(n \le 20\)
we have calculated that
\begin{multline}
\label{eq:PC2}
PC(t)=\sum_{n=0}^\infty p_c(n)t^n =
1+ t + 2 t^2 + 3 t^3 + 4 t^4 + 7 t^5 + 9 t^6 + 11 t^7 +
\\ +17t^8 +23 t^9 + 28 t^{10} + 39 t^{11} + 48 t^{12}
+ 59 t^{13} + 79 t^{14} +
\\ + 100 t^{15} + 121 t^{16}
+152 t^{17} + 185 t^{18} + 225 t^{19} + 280 t^{20} + O(t^{21})
\end{multline}
Based on \eqref{eq:Qrt}, we conjecture that
\begin{equation}
\label{eq:PC3}
PC(t) = \frac{1 + t^2 + O(t^3)}{\prod_{i=1}^\infty \left( 1 -
t^{\frac{i(i+1)}{2}}\right)}
\end{equation}
We also conjecture that \(\log p_c(n)\) grows as
\(n^{1/3}\), i.e. approximately as fast as \pseudoconcave
partitions.
The sequences \(\bigl(p_c(n)\bigr)_{n=0}^\infty\) are in the OEIS
\cite{Sloane} as
\htmladdnormallink{A084913}{http://www.research.att.com/projects/OEIS?Anum=084913}.
The sequences \(\bigl(p_c(n,r)\bigr)_{n=0}^\infty\)
are
\htmladdnormallink{A086161}{http://www.research.att.com/projects/OEIS?Anum=086161},
\htmladdnormallink{A086162}{http://www.research.att.com/projects/OEIS?Anum=086162},
and
\htmladdnormallink{A086163}{http://www.research.att.com/projects/OEIS?Anum=086163}
for \(r=2,3,4\).
\end{section}
\begin{thebibliography}{10}
\bibitem{Almkvist:partitions}
Gert Almkvist.
\newblock Asymptotics of various partitions.
\newblock manuscript.
\bibitem{Andrews:MM2}
George~E. Andrews.
\newblock Mac{M}ahon's partition analysis. {II}. {F}undamental theorems.
\newblock {\em Ann. Comb.}, 4(3-4):327--338, 2000.
\newblock Conference on Combinatorics and Physics (Los Alamos, NM, 1998).
\bibitem{Froeberg:Finco}
Valentina Barucci and Ralf Fr{\"o}berg.
\newblock On the number of ideals of finite colength.
\newblock In {\em Geometric and combinatorial aspects of commutative algebra
(Messina, 1999)}, volume 217 of {\em Lecture Notes in Pure and Appl. Math.},
pages 11--19. Dekker, New York, 2001.
\bibitem{BrunsHerzog:CM}
Winfried Bruns and J{\"u}rgen Herzog.
\newblock {\em Cohen-{M}acaulay rings}.
\newblock Cambridge University Press, Cambridge, 1993.
\bibitem{CCH:RandomPart}
Rod Canfield, Sylvie Corteel, and Pawel Hitczenko.
\newblock Random partitions with non-negative {$r$}-th differences.
\newblock {\em Adv. in Appl. Math.}, 27(2-3):298--317, 2001.
\newblock Special issue in honor of Dominique Foata's 65th birthday
(Philadelphia, PA, 2000).
\bibitem{PCInEq}
S.~Corteel and C.~D. Savage.
\newblock Partitions and compositions defined by inequalities.
\newblock math.CO/0309110.
\bibitem{Ebud:View}
David Eisenbud.
\newblock {\em Commutative {A}lgebra with a {V}iew {T}oward {A}lgebraic
{G}eometry}, volume 150 of {\em Graduate {T}exts in {M}athematics}.
\newblock Springer {V}erlag, 1995.
\bibitem{Pak:Survey}
Igor Pak.
\newblock Partition bijections, a survey.
\newblock {\em Ramanujan Journal}, to appear.
\bibitem{CR:IM}
Veronica~Crispin Quinonez.
\newblock Integrally closed monomial ideals and powers of ideals.
\newblock Technical report, Stockholm University, 2002.
\bibitem{Sloane}
Neil J.~A. Sloane.
\newblock The on-line encyclopedia of integer sequences.
\newblock {\url{http://www.research.att.com/~njas/sequences/index.html}}.
\bibitem{Stanley:CombCom}
Richard~P. Stanley.
\newblock {\em Combinatorics and {C}ommutative {A}lgebra}, volume~41 of {\em
Progress in {M}athematics}.
\newblock Birkh{\"a}user, 2 edition, 1996.
\bibitem{Stanley:En1}
Richard~P. Stanley.
\newblock {\em Enumerative combinatorics. {V}ol. 1}.
\newblock Cambridge University Press, Cambridge, 1997.
\newblock With a foreword by Gian-Carlo Rota, Corrected reprint of the 1986
original.
\bibitem{Vas:Com}
Wolmer~V. Vasconcelos.
\newblock {\em Computational {M}ethods in {C}ommutative {A}lgebra and
{A}lgebraic {G}eometry}.
\newblock Algorithms and {C}omputations in {M}athematics. Springer Verlag,
1998.
\bibitem{V:MonAlg}
R.~Villarreal.
\newblock {\em Monomial {A}lgebras}.
\newblock Marcel {D}ekker, 2001.
\bibitem{LinDiophantus}
Doron Zeilberger.
\newblock Lindiophantus.
\newblock \url{http://www.math.temple.edu/~zeilberg/}, 2001.
\newblock Program for calculating multi-generating functions for solution sets
of systems of diophantine equations.
\end{thebibliography}
\bigskip
\hrule
\bigskip
\noindent 2000 {\it Mathematics Subject Classification}:
Primary 05A17; Secondary 13B22.
\noindent \emph{Keywords:}
integer partitions, monomial ideals, integral closure.
\bigskip
\hrule
\bigskip
\noindent (Concerned with sequences
\seqnum{A007294},
\seqnum{A086159},
\seqnum{A086160},
\seqnum{A008620},
\seqnum{A084913},
\seqnum{A086161},
\seqnum{A086162},
\seqnum{A086163}.)
\bigskip
\hrule
\bigskip
\vspace*{+.1in}
\noindent
Received October 6 2003;
revised version received February 11 2004.
Published in {\it Journal of Integer Sequences}, February 11 2004.
\bigskip
\hrule
\bigskip
\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{http://www.math.uwaterloo.ca/JIS/}.
\vskip .1in
\end{document}
\end{document}
|
https://mhb.hs-emden-leer.de/latex/Jakiel/Design_und_Betrieb_von_Turbomaschinen_PO2018.tex
|
hs-emden-leer.de
|
CC-MAIN-2021-25
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-25/segments/1623488539764.83/warc/CC-MAIN-20210623165014-20210623195014-00364.warc.gz
| 357,902,766
| 2,274
|
\documentclass[10pt]{article}
%\usepackage{german,a4wide,graphicx,fancyhdr,avant}
\usepackage{german,a4wide,graphicx,fancyhdr,helvet}
\usepackage{longtable}
\usepackage{tabularx}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
%\usepackage[utf8]{inputenc}
\usepackage[hyphens]{url}
\parindent0pt
\renewcommand{\rmdefault}{\sfdefault}
\renewcommand{\arraystretch}{1.5}
%\input{hyphenation}
\addtolength{\textwidth}{2cm}
\addtolength{\oddsidemargin}{-1cm}
\addtolength{\evensidemargin}{-1cm}
\begin{document}
\vspace*{-2cm}
\addcontentsline{toc}{section}{WPM Design und Betrieb von Turbomaschinen}
%\begin{longtable}{|l|p{0.7\textwidth}|}
\begin{tabularx}{\textwidth}{|X|p{0.64\textwidth}|}
\hline
%\textbf{Studiengang} & 1MaMb\\ \hline
\textbf{Modulbezeichnung}
%(eng.) % !!!Englische!!!
& \textbf{Design und Betrieb von Turbomaschinen}
%(!!!Englische!!!)
\\ \hline
\textbf{Semester} & WPM\\ \hline
\textbf{ECTS-Punkte (Dauer)} & 5 (1 Semester)\\ \hline
\textbf{Art} & Wahlpflichtmodul Anlagentechnik und Konstruktionstechnik\\ \hline
%\textbf{Sprache(n)} & !!!Modulsprache!!!\\ \hline
%\textbf{ECTS-Punkte} & 5\\ \hline
%\textbf{Studentische Arbeitsbelastung} & 60,90\\ \hline
\textbf{Studentische Arbeitsbelastung} & 60 h Kontaktzeit + 90 h Selbststudium\\ \hline
\textbf{Voraussetzungen (laut MPO)} & \\ \hline
\textbf{Empf.\ Voraussetzungen} & \\ \hline
\textbf{Verwendbarkeit} & MaMb\\ \hline
\textbf{Prüfungsform und -dauer} & Klausur 2h oder mündliche Prüfung, mündliche Präsentation und schriftliche Dokumentation\\ \hline
\textbf{Lehr- und Lernmethoden} & Vorlesung\\ \hline
\textbf{Modulverantwortlicher} & C. Jakiel\\ \hline
%\textbf{ModulverantwortlicherLang} & C. Jakiel\\ \hline
\multicolumn{2}{|p{0.97\textwidth}|}{
\textbf{Qualifikationsziele}\newline
Die Studierenden kennen die Grundsätze des Design- bzw. Entwicklungsprozesses von Turbomaschinen (Strömungsmaschinen), wie z.B. Pumpen, Ventilatoren, Kompressoren und Turbinen, und ihres Kernelements Stufe. Dazu haben sie sich ein prinzipielles Verständnis für die wichtigsten Einflussgrößen, Optimierungsziele und Randbedingungen bei Auslegung und Optimierung der beschaufelten und unbeschaufelten Stufenkomponenten erarbeitet. Durch Anwendung dieser Kenntnisse und mit Unterstützung moderner Design- und Simulationsmethoden sind sie in der Lage, eine einfache Stufenauslegung durchzuführen und die Performance abzuschätzen.
}
\\ \hline
\multicolumn{2}{|p{0.97\textwidth}|}{
\textbf{Lehrinhalte}\newline
Design- und Entwicklungsziele, techno-ökonomische Anforderungen;
Physikalische Anforderungen / Grenzen z. B. aus den Bereichen Aerodynamik, Hydro- bzw. Thermodynamik, Mechanik (Integrität), Rotordynamik, Konstruktion, Werkstoffe, Fertigung;
Definition und Beschreibung von Schaufel- und Kanalgeometrie;
Bedeutsame Strömungseffekte und Verluste, Einflüsse auf Wirkungsgrad und Betriebskennfeld;
Designphasen sowie Auslegungs- und Simulationswerkzeuge;
Durchführung einer Beispielauslegung.
}
\\ \hline
\multicolumn{2}{|p{0.97\textwidth}|}{
\textbf{Literatur}\newline
Bohl, W.: Strömungsmaschinen 2: Berechnung und Konstruktion, 8. Auflage, Kamprath-Reihe, Vogel Verlag, Würzburg, 2013
Whitfield, A., Baines, N.C.: Design of Radial Turbomachines, Pearsons Education Ltd, UK, 1990
}
\\ \hline
\end{tabularx}
\vspace*{-1.5pt}
\begin{tabularx}{\textwidth}{|p{0.3\textwidth}|X|c|}
\hline
\multicolumn{3}{|c|}{\textbf{Lehrveranstaltungen}}\\ \hline
\textbf{Dozent} & \textbf{Titel der Lehrveranstaltung} & \textbf{SWS}\\ \hline
C. Jakiel & Design und Betrieb von Turbomaschinen & 4\\ \hline
%!!!Dozent1!!! & !!!Titel1!!! & !!!SWS1!!!\\ \hline
%!!!Dozent2!!! & !!!Titel2!!! & !!!SWS2!!!\\ \hline
%!!!Dozent3!!! & !!!Titel3!!! & !!!SWS3!!!\\ \hline
%!!!Dozent4!!! & !!!Titel4!!! & !!!SWS4!!!\\ \hline
%!!!Dozent5!!! & !!!Titel5!!! & !!!SWS5!!!\\ \hline
\end{tabularx}
\end{document}
|
https://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/biblatex-contrib/biblatex-chem/biblatex-chem-angew.tex
|
utah.edu
|
CC-MAIN-2022-33
|
application/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2022-33/segments/1659882572833.78/warc/CC-MAIN-20220817001643-20220817031643-00021.warc.gz
| 198,687,634
| 1,309
|
%% ---------------------------------------------------------------
%% biblatex-chem --- A set of biblatex implementations of
%% chemistry-related bibliography styles
%% Maintained by Joseph Wright
%% E-mail: [email protected]
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% ---------------------------------------------------------------
%%
\providecommand{\stylename}{angew}
\providecommand{\styledescription}{%
This package provides a style for \pkg{biblatex} which follows the
guidelines of \emph{Angewandte Chemie}. The citation style is numeric
and unsorted. The bibliography style follows the pattern of the layout
used in the journal.
}
\input{biblatex-chem-common.tex}
%%
%% Copyright (C) 2010-2014,2016-2019,2021 by
%% Joseph Wright <[email protected]>
%%
%% It may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License (LPPL), either version 1.3c of
%% this license or (at your option) any later version. The latest
%% version of this license is in the file:
%%
%% http://www.latex-project.org/lppl.txt
%%
%% This work is "maintained" (as per LPPL maintenance status) by
%% Joseph Wright.
%%
%% This work consists of the files biblatex-chem.bib,
%% biblatex-chem.tex,
%% biblatex-chem-acs.tex,
%% biblatex-chem-angew.tex,
%% biblatex-chem-biochem.tex,
%% biblatex-chem-common.tex,
%% biblatex-chem-rsc.tex,
%% chem-acs.bbx,
%% chem-acs.cbx,
%% chem-angew.bbx,
%% chem-angew.cbx,
%% chem-biochem.bbx,
%% chem-biochem.cbx,
%% chem-rsc.bbx and
%% chem-rsc.cbx,
%% and the derived files biblatex-chem.pdf,
%% biblatex-chem-acs.pdf,
%% biblatex-chem-angew.pdf,
%% biblatex-chem-biochem.pdf and
%% biblatex-chem-rsc.pdf.
%%
%%
%% End of file `biblatex-chem-angew.tex'.
|
http://porocila.imfm.si/2009/mat/clani/pozar.tex
|
imfm.si
|
CC-MAIN-2020-29
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2020-29/segments/1593657143354.77/warc/CC-MAIN-20200713064946-20200713094946-00350.warc.gz
| 112,195,094
| 1,298
|
\clan {Rok Požar}
%--------------------------------------------------------
% A. objavljene znanstvene monografije
%--------------------------------------------------------
%\begin{skupina}{A}
%\disertacija
% {NASLOV}
% {UNIVERZA}
% {FAKULTETA}
% {ODDELEK}
% {KRAJ} {DRZAVA} {LETO}
%\magisterij
% {NASLOV}
% {UNIVERZA}
% {FAKULTETA}
% {ODDELEK}
% {KRAJ} {DRZAVA} {LETO}
%\monografija
% {AVTORJI}
% {NASLOV}
% {ZALOZBA}
% {KRAJ} {DRZAVA} {LETO}
%\end{skupina}
% Ni podatkov za to sekcijo
%--------------------------------------------------------
% B. raziskovalni clanki sprejeti v objavo v znanstvenih
% revijah in v zbornikih konferenc
%--------------------------------------------------------
%\begin{skupina}{B}
%\sprejetoRevija
% {AVTORJI}
% {NASLOV}
% {REVIJA}
%\sprejetoZbornik
% {AVTORJI}
% {NASLOV}
% {KONFERENCA}
% {KRAJ} {DRZAVA} {MESEC} {LETO}
%\end{skupina}
% Ni podatkov za to sekcijo
%--------------------------------------------------------
% C. raziskovalni clanki objavljeni v znanstvenih revijah
% in v zbornikih konferenc
%--------------------------------------------------------
%\begin{skupina}{C}
%\objavljenoRevija
% {AVTORJI}
% {NASLOV}
% {REVIJA} {LETNIK} {LETO} {STEVILKA} {STRANI}
%\objavljenoZbornik
% {AVTORJI}
% {NASLOV}
% {KONFERENCA}
% {KRAJ} {DRZAVA} {MESEC} {LETO}
% {ZBORNIK} {STRANI}
%\end{skupina}
% Ni podatkov za to sekcijo
%--------------------------------------------------------
% D. urednistvo v znanstvenih revijah in zbornikih
% znanstvenih konferenc
%--------------------------------------------------------
%\begin{skupina}{D}
%\urednikRevija
% {OPIS}
% {REVIJA}
%\urednikZbornik
% {OPIS}
% {KONFERENCA}
% {KRAJ} {DRZAVA} {MESEC} {LETO}
%\end{skupina}
% Ni podatkov za to sekcijo
%--------------------------------------------------------
% E. organizacija mednarodnih in domacih znanstvenih
% srecanj
%--------------------------------------------------------
%\begin{skupina}{E}
%\organizacija
% {OPIS}
% {KONFERENCA}
% {KRAJ} {DRZAVA} {MESEC} {LETO}
%\end{skupina}
% Ni podatkov za to sekcijo
%--------------------------------------------------------
% F. vabljena predavanja na tujih ustanovah in
% mednarodnih konferencah
%--------------------------------------------------------
%\begin{skupina}{F}
%\predavanjeUstanova
% {NASLOV}
% {OPIS}
% {USTANOVA}
% {KRAJ} {DRZAVA} {MESEC} {LETO}
%\predavanjeKonferenca
% {NASLOV}
% {OPIS}
% {KONFERENCA}
% {KRAJ} {DRZAVA} {MESEC} {LETO}
%\end{skupina}
% Ni podatkov za to sekcijo
%--------------------------------------------------------
% G. aktivne udelezbe na mednarodnih in domacih
% konferencah
%--------------------------------------------------------
%\begin{skupina}{G}
%\konferenca
% {NASLOV}
% {KONFERENCA}
% {KRAJ} {DRZAVA} {MESEC} {LETO}
%\end{skupina}
% Ni podatkov za to sekcijo
%--------------------------------------------------------
% H. strokovni clanki
%--------------------------------------------------------
%\begin{skupina}{H}
%\clanekRevija
% {AVTORJI}
% {NASLOV}
% {REVIJA} {LETNIK} {LETO} {STEVILKA} {STRANI}
%\clanekZbornik
% {AVTORJI}
% {NASLOV}
% {KONFERENCA}
% {KRAJ} {DRZAVA} {MESEC} {LETO}
% {ZBORNIK} {STRANI}
%\end{skupina}
% Ni podatkov za to sekcijo
%--------------------------------------------------------
% I. razno
%--------------------------------------------------------
%\begin{skupina}{I}
%\razno
% {OPIS}
%\end{skupina}
% Ni podatkov za to sekcijo
%--------------------------------------------------------
% tuji gosti
%--------------------------------------------------------
%\begin{seznam}
%\gost {IME} {TRAJANJE} {USTANOVA} {KRAJ} {DRZAVA} {MESEC} {LETO} {POVABILO}
%\end{seznam}
%--------------------------------------------------------
% gostovanja
%--------------------------------------------------------
%\begin{seznam}
%\gostovanje {IME} {TRAJANJE} {USTANOVA} {KRAJ} {DRZAVA} {MESEC} {LETO}
%\end{seznam}
|
http://www.econ2.jhu.edu/people/ccarroll/papers/cstwMPC/cstwMPC.tex
|
jhu.edu
|
CC-MAIN-2019-04
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2019-04/segments/1547583659677.17/warc/CC-MAIN-20190118025529-20190118051529-00622.warc.gz
| 293,249,407
| 40,983
|
% !TeX spellcheck = en_GB
\RequirePackage[dep]{snapshot}
\documentclass[12pt,titlepage]{econtex}
\input cstw.tex
\usepackage{econtexSetup}\usepackage{econtexShortcuts} % Reads in various definitions, macros, etc
\renewcommand{\ptyLev}{\ensuremath{Z}} % Z for productivity
\renewcommand{\urate}{\ensuremath{\mho}}
\renewcommand{\erate}{\ensuremath{\cancel{\urate}}}
\usepackage{booktabs,rotating}
\newcommand{\tablenotessize}[1]{\footnotesize{#1}} % Size of notes in tables
\newlength{\defbaselineskip}
\setlength{\defbaselineskip}{\baselineskip}
\newcommand{\setlinespacing}[1]%
{\setlength{\baselineskip}{#1 \defbaselineskip}}
\newcommand{\oneandhalfspacing}{\setlength{\baselineskip}{1.5 \defbaselineskip}}
\definecolor{jirkasblue}{rgb}{0.2,0.2,0.7}
\definecolor{Cerulean}{rgb}{0,0.48,0.652}
\definecolor{Purple}{rgb}{0.5,0,0.5}
\definecolor{Lime}{rgb}{0.52,0.706,0}
\definecolor{Red}{rgb}{1,0,0}
\newcommand{\jemph}[1]{{\color{Red}#1}}
\newcommand{\bemph}[1]{{\color{jirkasblue}#1}}
\newcommand{\jbemph}[1]{{\textbf{\color{jirkasblue}#1}}}
\hypersetup{colorlinks=true,
pdfauthor={Christopher D. Carroll <[email protected]>, Jiri Slacalek<[email protected]>, Kiichi Tokuoka <[email protected]>, Matthew White <[email protected]>},
pdftitle={The Distribution of Wealth and the Marginal Propensity to Consume},
pdfsubject={Consumption Dynamics; Wealth Inequality; Marginal Propensity to Consume},
pdfkeywords={MPC, inequality, heterogeneity, consumption, dynamics, microfoundations},
pdfproducer = {LaTeX with hyperref and thumbpdf},
pdfcreator = {pdflatex}
}
\begin{verbatimwrite}{./\jobname.title}
The Distribution of Wealth and the Marginal Propensity to Consume
\end{verbatimwrite}
\begin{document}\large
\title{The Distribution of Wealth and \\ the Marginal Propensity to Consume \\ \medskip {\small {\it As published in \href{http://onlinelibrary.wiley.com/doi/10.3982/QE694/}{Quantitative Economics (2017)}}} }
\author{
{\small Christopher Carroll\authNum} % \\ {\small JHU}
\and
{\small Jiri Slacalek\authNum} % \\ {\small ECB}
\and
{\small Kiichi Tokuoka\authNum} % \\ {\small MoF, Japan}
\and
{\small Matthew N. White\authNum} % \\ {\small U of Delaware}
}
\keywords{Wealth Distribution, Marginal Propensity to Consume, Heterogeneity, Inequality}
\jelclass{D12, D31, D91, E21}
\date{June 3, 2017}
\maketitle
\begin{abstract}\large
In a model calibrated to match micro- and macroeconomic evidence on household income dynamics, we show that a modest degree of heterogeneity in household preferences or beliefs is sufficient to match empirical measures of wealth inequality in the U.S.\ The hegerogeneity-augmented model's predictions are consistent with microeconomic evidence that suggests that the annual marginal propensity to consume (MPC) is much larger than the roughly 0.04 implied by commonly-used macroeconomic models (even ones including some heterogeneity). The high MPC arises because many consumers hold little wealth despite having a strong precautionary motive. Our model also plausibly predicts that the aggregate MPC can differ greatly depending on how the shock is distributed across households (depending, e.g., on their wealth, or employment status).
\end{abstract}
\begin{small}
\parbox{\textwidth}{
\begin{center}
\begin{tabbing}
\texttt{Archive:~} \= \= \url{http://econ.jhu.edu/people/ccarroll/papers/cstwMPC.pdf} \kill \\ % This line establishes the locations of the tabs, but is not printed because of the \kill directive
\texttt{~~~~PDF:~} \> \> \url{http://econ.jhu.edu/people/ccarroll/papers/cstwMPC.pdf} \\
\texttt{~Slides:~} \> \> \url{http://econ.jhu.edu/people/ccarroll/papers/cstwMPC-Slides.pdf} \\
\texttt{~~~~Web:~} \> \> \url{http://econ.jhu.edu/people/ccarroll/papers/cstwMPC/} \\
\texttt{~BibTeX:~} \> \> \url{http://econ.jhu.edu/people/ccarroll/papers/cstwMPC.bib} \\
\texttt{Archive:~} \> \> \url{http://econ.jhu.edu/people/ccarroll/papers/cstwMPC.zip}
\\\texttt{~~~~~~~~~} \> \> {\it (Complete replication archive; online appendix is in LaTeX directory)}
\end{tabbing}
\end{center}
}
\end{small}
\begin{authorsinfo}
\name{
Carroll: Department of Economics, Johns Hopkins University, Baltimore, MD, \url{http://econ.jhu.edu/people/ccarroll/}, email: \href{mailto:[email protected]}{\texttt{[email protected]}}
}
\name{
Slacalek: DG Research, European Central Bank, 60640 Frankfurt am Main, Germany, \url{http://www.slacalek.com/}, email: \href{mailto:[email protected]}{\texttt{[email protected]}}
}
\name{
Tokuoka: Ministry of Finance, 3-1-1 Kasumigaseki, Chiyoda-ku, Tokyo 100-8940, Japan, email: \href{mailto:[email protected]}{\texttt{[email protected]}}
}
\name{
White: Department of Economics, University of Delaware, Newark, DE 19702, \url{http://www.lerner.udel.edu/faculty-staff/matthew-n-white/}, email: \href{mailto:[email protected]}{\texttt{[email protected]}}
}
\end{authorsinfo}
\thanks{We thank Michael Ehrmann, Dirk Krueger, Jonathan Parker, Giorgio Primiceri, Karl Schmedders, Gianluca Violante, the referees and numerous seminar audiences for helpful comments. The views presented in this paper are those of the authors, and should not be attributed to the European Central Bank or the Japanese Ministry of Finance. This paper is a revision of \href{https://www.ecb.europa.eu/pub/pdf/scpwps/ecbwp1655.pdf}{\texttt{this}} one; a new section of the paper extends the original analysis to the case of a life cycle model, and Matthew White has joined as a coauthor.}
\thispagestyle{empty}
\titlepagefinish
\pagebreak\newpage
%\oneandhalfspacing
\section{Introduction}\label{sec:Intro}
In capitalist economies, wealth is unevenly distributed. Recent waves of
the triennial U.S.\ {\it Survey of Consumer Finances}, for example, have
consistently found the top 1 percent of households holding about a
third of total wealth, with the bottom 60 percent owning essentially no net wealth.\footnote{%
More specifically, in the 1998--2007 waves of the \emph{Survey of Consumer Finances}
the fraction of total net wealth owned by the wealthiest 1 percent of households ranges between 32.4 and 34.4 percent,
while the bottom 60 percent of households held roughly 2--3 percent of wealth.
The statistics from the 2010 and 2013 SCF show even somewhat greater concentration, but may partly reflect temporary asset
price movements associated with the Great Recession (see also \cite{brickerEtAl:topWealth} and \cite{szWIneq}). Corresponding statistics from the recently released
\emph{Household Finance and Consumption Survey} show that similar (though sometimes a bit lower) degree of wealth inequality holds also across many European countries (see \cite{cstMPCxc}).}
Such inequality could matter for macroeconomics if households with
different amounts of wealth respond differently to the same aggregate
shock. Indeed, microeconomic studies (reviewed in section~\ref{ssEmpirics}) have often found that the annual
marginal propensity to consume out of one-time income shocks
(henceforth, `the MPC') is substantially larger for low-wealth than for high-wealth
households. In the presence of such microeconomic heterogeneity, the
aggregate size of, say, a fiscal shock is not sufficient to compute
the shock's effect on spending; that effect will depend on how the
shock is {\it distributed} across categories of households with different
MPCs.
To assess how much these considerations matter quantitatively, we
solve a macroeconomic model with a household-specific income process
that includes a fully permanent shock and a transitory
shock.\footnote{The income process is calibrated using evidence from
the large empirical microeconomics literature. Of course, we are
not the first to have solved a model with transitory and permanent
shocks; nor the first to attempt to model the MPC; see below for a
literature review. Our paper's joint focus on the distribution of
wealth and the MPC, however, is novel (so far as we
know).}$^{,}$\footnote{The empirical literature typically finds that
highly persistent (and possibly truly permanent) shocks account for
a large proportion of the variation in income across households.
For an extensive literature review, see \cite{cstKS}.} While inclusion of the permanent component improves the fit of the wealth distribution (as shown in \cite{cstKS}), this `identical preferences and beliefs' model still falls short of matching the degree of wealth inequality in the data, because wealth inequality greatly exceeds (permanent) income inequality. Consequently, we allow for the possibility that households differ in their preferences (like impatience, proxying for many characteristics including age, optimisim, and risk aversion) or, equivalently, that they differ in their beliefs about the path of future aggregate productivity growth. (Given the disagreement between leading growth experts like~\cite{gordonFutureGrowth} and~\cite{fjFutureGrowth}, differences in households' views about future productivity growth cannot be fairly judged to reflect ignorance or irrationality, but could instead be characterized as reflecting inherent `optimism' or `pessimism.') We show that quite modest heterogeneity in preferences (or optimism/pessimism)
is sufficient to allow the model to match the wealth distribution remarkably well.\footnote{Specifically, the annual
discount factors between agents in our economy differ from the mean by around 0.02; this is a modest difference compared to empirical studies which typically find a ``tremendous variability in the
estimates'' of the discount factor (\cite{frederickLoewensteinODonogue:discountReview}, p.\ 377), which can lie basically anywhere between 0 and slightly above 1.}
Within our simulated economy we investigate the aggregate MPC and its distribution across households. The aggregate MPC predicted by our model is large (compared to benchmark Representative Agent models) -- around 0.2 -- because many consumers in the model hold little wealth and have a strong precautionary motive. This value of the MPC is consistent with (but at the low end of) the extensive microeconomic evidence, whose range of credible estimates we characterize at being between 0.2 and 0.6. This finding sharply contrasts with the MPC of roughly 0.04 implied by the certainty-equivalent permanent income hypothesis and by commonly-used macroeconomic models (even ones including some heterogeneity, such as the baseline \citet{ksHetero} model), in which most consumers typically inhabit only the flat (low MPC) part of the consumption function.
In a further experiment, we recalibrate our model so that it matches
the degree of inequality in \emph{liquid financial assets,} rather
than total net worth. Because the holdings of liquid financial assets
are substantially more heavily concentrated close
to zero than holdings of net worth, the model's implied
aggregate MPC then increases to roughly 0.4, well into the middle of the
range of empirical estimates of the MPC. Consequently, the aggregate MPC in our models is an order of magnitude larger than in
models in which households are well-insured and barely react to transitory shocks.
Our models also plausibly imply that the aggregate MPC can differ greatly depending on how the shock is
distributed across households. For example, low-wealth and unemployed households have much larger spending propensities than high-wealth and
employed ones.
Our main contribution is that we capture jointly the distribution of wealth and distribution of the MPCs in a tractable way using modest preference heterogeneity. More broadly, our analysis demonstrates the quantitative importance of household heterogeneity for macroeconomic dynamics. The implication of our model is that matching the wealth distribution is key for a model to reproduce a realistic distribution of spending propensities, or an aggregate MPC.
Ours is not the first paper to incorporate heterogeneity in
impatience. \citet{ksHetero}, for example, postulated that the discount factor
takes one of three values and that agents anticipate that their
discount factor might change between these values (which they
interpreted as reflecting inheritance between dynastic generations
with different preferences). While this `KS-Hetero' model (as we call
it in our comparisons below) also matches the wealth distribution
better than their model without heterogeneity (`KS' below), it does not increase
the aggregate MPC nearly enough to match the microeconomic
evidence---only to around 0.10. In contrast to our preferred model, most households in the `KS-Hetero' model inhabit the flat portion of
the consumption function, where the MPC is low. Moreover, the
consumption function in their model exhibits less concavity in the relevant parts of the wealth distribution.
We also demonstrate that the quantitative conclusions of our setup
hold when we adopt a framework with overlapping generations of
households with realistically calibrated life cycles. In
particular, in the life-cycle setup the models with little
impatience heterogeneity continue to match the wealth distribution
similarly well. In addition, the life-cycle models imply a similar
size of the aggregate MPC and its distribution across households as
the perpetual youth models.
In the models with aggregate shocks, we can explicitly ask questions like ``how does the
aggregate MPC differ in a recession compared to an expansion'' or even
more complicated questions like ``does the MPC for poor households
change more than for rich households over the business cycle?'' To address these questions, we compare the business-cycle implications of two alternative modeling
treatments of aggregate shocks. In the
first version, aggregate shocks follow the Friedmanesque structure
of our microeconomic shocks-- all shocks are either fully permanent or
fully transitory. In the second version, the aggregate economy
alternates between periods of boom and bust, as in \cite{ksHetero}.
We show that neither the mean of the MPC nor the
distribution of MPCs changes much when the economy switches from one
state to the other.\footnote{In the first version, the aggregate MPC essentially does not vary over the business cycle because aggregate shocks are small compared to the magnitude of idiosyncratic shocks. Although intuition suggests that the second version has more potential to exhibit cyclical
fluctuations in the MPC, because aggregate shocks are correlated with idiosyncratic shocks, this turns out to be the case only for the poorest income quintile.} To the extent that either specification of aggregate shocks is a
correct description of reality, the result is encouraging because it
provides reason to hope that microeconomic empirical evidence
about the MPC obtained during normal, nonrecessionary times may still
provide a good guide to the effects of
stimulus programs for policymakers confronting extreme
circumstances like those of the Great Recession.\footnote{This is an
interesting point because during the episode of the Great Recession
there was some speculation that even if empirical evidence suggested
high MPCs out of transitory shocks during normal times, tax cuts
might be ineffective in stimulating spending because prudence might
diminish the MPC of even taxpayers who would normally respond to
transitory income shocks with substantial extra spending. While
that hypothesis could still be true, it is not consistent with the
results of our models.}
The rest of the paper is structured as follows. The next section
explains the relation of our paper's modeling strategy to (some of)
the vast related literature. Section~\ref{sec:Model} lays out two variants of the
baseline, perpetual youth model---without and with heterogeneity in the rate of time
preference---and explores how these models perform in capturing the
degree of wealth inequality in the data. Section~\ref{sec:MPC}
compares the MPC's in these models to those in the
\citet{ksHetero} model and investigates how the aggregate MPC varies
over the business cycle. Section~\ref{sec:LCM} shows that the quantitative conclusions about the MPC carry over into the setup with overlapping generations, and section~\ref{sec:Conclusion} concludes.
\section{Relation to the Literature}
\subsection{Theory}
Our modeling framework builds on the heterogeneous-agents model of \cite{ksHeteroPort,ksHetero}. Following \cite{cstKS}, we accommodate transitory-and-permanent-shocks microeconomic income process that is a
modern implementation of ideas dating back to \cite{friedmanATheory} (see section~\ref{sec:PlausibleAggModel}).
% Because directly adding permanent shocks to income would produce an ever-widening cross-sectional distribution of
% permanent income, we adopt the perpetual youth model of \cite{blanchardFinite}: Dying agents are replaced with newborns
% whose permanent income is equal to the mean level of permanent income
% in the population, so that a set of agents with
% dispersed values of permanent income is replaced with newborns with
% the same (population-mean) permanent income.
A large literature starting with \cite{zeldesStochastic} has studied life
cycle models in which agents face permanent (or highly persistent) and
transitory shocks; a recent example that reflects the state of the art
is \cite{kaplanInequality}. For the most part, that literature has been focused
on microeconomic questions like the patterns of consumption and saving
(or, recently, inequality) over the life cycle, rather than
traditional macroeconomic questions like the average MPC (though
recent work by \cite{kvStim}, discussed in detail below, does grapple
with the MPC). Life cycle models of this kind are formidably complex, which probably
explains why they have not (to the best of our knowledge) yet been
embedded in a dynamic general equilibrium context like that of
the \cite{ksHetero} type, which would permit the study of questions
like how the MPC changes over the business cycle. However, in section~\ref{sec:LCM} we present a life cycle model, which documents that our quantitative conclusions about the size of the MPC and its distribution
across households continue to hold in a framework with overlapping generations.
A separate extensive literature has investigated various mechanisms (including preference heterogeneity, transmission of bequests and human
capital across generations, entrepreneurship, and high earnings risk for the top earners) to match the empirical wealth distribution; see \cite{deNardi2015} for a recent review.
Perhaps closest to our paper in modeling structure is the work of
\cite{castaneda}. That paper constructs a microeconomic income
process with a degree of serial correlation and a structure for the
transitory (but persistent) income shocks engineered to match
some key facts about the cross-sectional distributions of income and
wealth in microeconomic data. But the income process that those
authors calibrated does not resemble the microeconomic evidence on
income dynamics, because the extremely rich households are assumed to face
unrealistically high probability (roughly 10 percent) of a very bad and persistent income shock.
Further, \cite{castaneda} did not examine the implications of their model for the
aggregate MPC, perhaps because the MPC in their setup depends on the distribution of
the deviation of households' actual incomes from their
(identical) stationary level. That distribution, however, does
not have an easily measurable empirical counterpart.%
\footnote{%
\cite{heathcote_fiscalPolicy} uses an income process similar to \cite{castaneda} to calibrate an economy which matches the empirical wealth heterogeneity and has the aggregate MPC of 0.29, also thanks to households which are credit-constrained.
}
One important difference between the benchmark version of our model and
most of the prior literature is our incorporation of heterogeneous
time preference rates as a way of matching the portion of wealth
inequality that cannot be matched by the dispersion in permanent
income. A first point to emphasize here is that we find that quite mild
heterogeneity in impatience is sufficient to let the
model capture the extreme dispersion in the empirical distribution of
net wealth: It is
enough that all households have a (quarterly) discount factor roughly
between 0.98 and 0.99. This needed theoretical difference is small compared to differences found in empirical studies which typically find huge disagreement when trying to measure the discount factor: Empirical estimates can lie almost anywhere between 0 and
slightly above 1; see
\cite{frederickLoewensteinODonogue:discountReview}.
Furthermore, our interpretation is that our framework parsimoniously
captures in a single parameter (the time preference rate) a host of
other kinds of heterogeneity that are undoubtedly important in
reality (including expectations of income growth and mortality over the life cycle, heterogeneous risk preferences, intrinsic degrees of optimism or pessimism,
and differential returns to saving). The sense in which our model `captures' these forms of
heterogeneity is that, {\it for the purposes of our question} about
the aggregate MPC, the crucial implication of many forms of
heterogeneity is simply that they will lead households to target different wealth positions which are associated with different MPCs.
%Since our baseline model captures the distribution of wealth and the distribution of permanent income already, it is not clear that {\it for the purposes of computing MPCs}, much would be gained by the additional realism obtained by generating wealth heterogeneity through several channels of heterogeneity rather than focusing on just one.
Partially motivated by concerns about heterogeneity through other channels, in section~\ref{sec:Sensitivity} we investigate the sensitivity of our results with respect to the
calibrated risk aversion, income growth, asset returns, and uncertainty. We find that the implied aggregate MPCs robustly exceed 0.2, while the estimated distribution of discount factors and model fit are largely unaffected by the alternative parameters. To the extent that including
heterogeneity in these parameters (rather than varying them for the entire population) would affect MPCs by leading different households to
end up at different levels of wealth, we would argue that our model captures
the key outcome (the wealth distribution) that is needed for deriving
implications about the MPC.\footnote{%
\cite{deNardi2015}, section~4 discusses mechanisms to generate realistic wealth heterogeneity, also focusing on various forms of preference heterogeneity. Discount factor heterogeneity seems to be the most widespread, although other mechanisms were also proposed, e.g., preference for bequests, habit formation or ``capitalist spirit.'' Discount factor heterogeneity seems to be a more powerful mechanism than e.g., heterogeneity in risk aversion. A new paper by \cite{cozzi2012} shows it is also possible to match the wealth distribution with heterogeneity in the CRRA coefficient $\rho$. However, the lognormal distribution he assumes for $\rho$ imposes that some households have a very high risk aversion and his calibration of $\beta\approx0.88$ is very low.} We further support this point quantitatively in the life cycle framework of section~\ref{sec:LCM}, which includes additional dimensions of heterogeneity but yields comparable results.
We think of our setup with preference heterogeneity as a simple tool to illustrate
how wealth heterogeneity matters for macroeconomic outcomes. The key point of this paper is that this tool can generate realistic MPCs---in the aggregate and across households---in contrast to many other models that fail to do so.
\subsection{Empirics} \label{ssEmpirics}
In our preferred model, because many households are slightly
impatient and therefore hold little wealth, they are not able to
insulate their spending even from transitory shocks very well. In that model, when
households in the bottom half of the wealth distribution receive a
one-off \$1 in income, they consume up to 50 cents of this windfall in
the first year, ten times as much as the corresponding annual MPC in the
baseline Krusell--Smith model. For the population as a whole, the
aggregate annual MPC out of a common transitory shock ranges between
about 0.2 and about 0.4, depending on whether we target our model to match the empirical distribution
of net worth or of liquid assets.%\footnote{Because the holdings of liquid financial and
% retirement assets are substantially more heavily concentrated close
% to zero than holdings of net worth, the aggregate MPC in an economy
% calibrated to the former measure of wealth is considerably higher.
% }
\begin{sidewaystable} \large
\caption{Empirical Estimates of the Marginal Propensity to Consume (MPC) out of Transitory Income}
\label{table:mpcLit}
\begin{minipage}{\textwidth}
\input ./mpcLit
\tablenotessize{Notes: $^{\star}$: The horizon for which consumption response is calculated is typically 3 months or 1 year.
The papers which estimate consumption response over the horizon of 3 months typically suggest that the response
thereafter is only modest, so that the implied cumulative MPC over the full year is not much higher than over the first three months.
$^{\ddagger}$:~elasticity.
\citet{brodaParker:stimulus2008} report the five-month cumulative MPC of 0.0836--0.1724 for the consumption goods in their dataset. However, the Homescan/NCP data they use only covers a subset of total PCE, in particular grocery and items bought in supercenters and warehouse clubs.
We do not include the studies of the 2001 tax rebates, because our interpretation of that event is that it reflected a permanent tax cut that was not perceived by many households until the tax rebate checks were received. While several studies have examined this episode, e.g., \citet{shapiroSlemrod:AER03}, \citet{jpsTax}, \citet{aslCredit} and \citet{misraSurico:heteroResponses}, in the absence of evidence about the extent to which the rebates were perceived as news about a permanent versus a transitory tax cut, any value of the MPC between zero and one could be justified as a plausible interpretation of the implication of a reasonable version of economic theory (that accounts for delays in perception of the kind that undoubtedly occur).}
\end{minipage}
\end{sidewaystable}
While the MPCs from our models are roughly an order of
magnitude larger than those implied by off-the-shelf representative
agent models (about 0.02 to 0.04), they are in line with the large and
growing empirical literature estimating the marginal propensity to
consume summarized in Table~\ref{table:mpcLit} and reviewed
extensively in \citet{jpCResponse}.\footnote{See also \citet{pseIncDistributionAndC}.}
Various authors have
estimated the MPC using quite different household-level datasets, in
different countries, using alternative measures of consumption and
diverse episodes of transitory income shocks; our reading of the
literature is that while a couple of papers find MPCs near zero, most estimates of the aggregate MPC range between
0.2 and 0.6,\footnote{Here and henceforth, when we use the term MPC
without a timeframe, we are referring to the {\it annual} MPC; that
is, the amount by which consumption is higher over the year
following a transitory shock to income. This corresponds to the
original usage by \cite{keynes:generaltheory} and
\cite{friedmanATheory}.} considerably exceeding the low values
implied by representative agent models or the standard framework of
\citet{ksHeteroPort,ksHetero}.
Our work also supplies a rigorous rationale for the conventional
wisdom that the effects of an economic stimulus are particularly
strong if it is targeted to poor individuals and to the unemployed.
For example, our simulations imply that a tax-or-transfer stimulus targeted on the
bottom half of the wealth distribution or the unemployed is 2--3
times more effective in increasing aggregate spending than a
stimulus of the same size concentrated on the rest of the
population. This finding is in line with the recent estimates of
\citet{bppInequality}, \citet{brodaParker:stimulus2008},
\citet{leth-petersen:liquidity} and
\citet{jappelliPistaferri_FPMPC}, who report that households with
little liquid wealth and without high past income react particularly
strongly to an economic stimulus.\footnote{Similar results are reported in \citet{jpsTax} and
\citet{aslCredit}. \citet{bps:familyLaborS}
estimate that older, wealthier households tend to use their assets
more extensively to smooth spending. However, much of the empirical
work (e.g., \citet{souleles:responseToReaganCuts},
\citet{misraSurico:heteroResponses} or \citet{psjmStim}) does not
find that the consumption response of low-wealth or liquidity
constrained households is statistically significantly higher,
possibly because of measurement issues regarding credit
constraints/liquid wealth and lack of statistical power. In fact, \citet{misraSurico:heteroResponses} report a U-shaped profile of the estimated MPC across income: Households with high levels of mortgage debt also have a large spending propensity. Our model cannot fully capture this finding given the lack of choice between liquid and illiquid assets and a meaningful accumulation of debt. We leave these points for future research.}
Recent work by \citet{kvStim} models an economy with
households who choose between a liquid and an illiquid asset, which is
subject to significant transaction costs. Their economy features a
substantial fraction of wealthy hand-to-mouth consumers, and
consequently---like ours---responds strongly to a fiscal stimulus. In
many ways their analysis is complementary to ours. While our setup
does not model the choice between liquid and illiquid assets, theirs
does not include transitory idiosyncratic (or aggregate) income
shocks. A prior literature (all the way back to
\cite{deatonLiqConstr,deatonUnderstandingC}) has shown that the presence of
transitory shocks can have a very substantial impact on the MPC (a
result that shows up in our model), and the vast empirical literature cited
below (including the well-measured tax data in \cite{dhprvInequality})
finds that such transitory shocks are quite large. Economic
stimulus payments (like those studied by
\cite{brodaParker:stimulus2008}) are precisely the kind of transitory
shock for which we are interested in households' responses, and so arguably a
model like ours that explicitly includes transitory shocks (calibrated to micro
evidence on their magnitude) is likely to yield more plausible
estimates of the MPC when a shock of the kind explicitly
incorporated in the model comes along (per
\cite{brodaParker:stimulus2008}).
A further advantage of our framework is that it is consistent with the
evidence that suggests that the MPC is higher for low-net-worth
households. In the KV framework, among households of a given age, the
MPC will vary strongly with the degree to which a household's assets
are held in liquid versus illiquid forms, but the relationship of the
MPC to the household's total net worth is less clear.
Finally, our perpetual youth model is a full rational expectations dynamic
macroeconomic model, while their model does not incorporate aggregate
shocks. Our framework is therefore likely to prove more adaptable to
general purpose macroeconomic modeling.
On the other hand, given the substantial differences we find in MPCs
when we calibrate our model to match liquid financial assets versus
when we calibrate it to match total net worth (reported below), the
differences in our results across differing degrees of wealth
liquidity would be more satisfying if we were able to explain them in
a formal model of liquidity choice. For technical reasons, the KV model of liquidity is not appropriate to our
problem; given the lack of agreement in the profession about how to
model liquidity, we leave that goal for future work (though
preliminary experiments with modeling liquidity have persuaded us that
the tractability of our model will make it a good platform for further
exploration of this question).
\section{Modeling Wealth Heterogeneity: The Role of Shocks and Preferences}\label{sec:Model}
This section describes our income process and the key features of our perpetual youth modeling framework.\footnote{\citet{cstKS} provides further technical details of
the setup.} Here, we allow for
heterogeneity in time preference rates, and estimate the extent of
such heterogeneity by matching the model-implied distribution of
wealth to the observed distribution.\footnote{The key
differences between \citet{cstKS} and this paper are that the former
includes neither aggregate FBS shocks nor heterogeneity in
impatience. Also, \citet{cstKS} does not investigate the
implications of various models for the marginal propensity to
consume.}${}^{, }$\footnote{Terminologically, in the first setup (called
`$\Discount$-Point' below) households have {\it ex ante} the same
preferences and differ {\it ex post} only because they get hit with
different shocks; in the second setup (called `$\Discount$-Dist'
below) households are heterogeneous both {\it ex ante} (due to different
discount factors) and {\it ex post} (due to different discount factors and
different shocks). }
\subsection{The `Friedman/Buffer Stock' Income Process}\label{sec:PlausibleAggModel}
A key component of our model is the labor income process, which closely resembles the verbal description of \citet{friedmanATheory} which has been used extensively in the literature on buffer stock saving;\footnote{A large empirical literature has found that variants of this specification capture well the key features of actual household-level income processes; see \citet{topelSeniority}, \citet{carroll:brookings}, \citet{mgCovariance}, \citet{sty:consumption}, \citet{lmpWageRisk}, \cite{dhprvInequality}, and many others (see Table~1 in \citet{cstKS} for a summary).} we therefore refer to it as the Friedman/Buffer Stock (or `FBS') process.
Household income $\yLev_t$ is determined by the interaction of the aggregate wage rate $\Wage_{t}$ and two idiosyncratic components, the permanent component $\pRat_t$ and the transitory shock~$\tshk_t$:
\begin{eqnarray}
\label{eq:tshk} \label{eq:yLev}
\yLev_{t} & = & \pRat_{t} \tshk_{t} \Wage_{t}. \notag
\end{eqnarray}
The permanent component follows a geometric random walk:
\begin{eqnarray}
\label{eq:FBSperm}
\pRat_{t} & = & \pRat_{t-1} \pshk_{t},
\end{eqnarray}
where the Greek letter {\it psi} mnemonically indicates the mean-one white noise {\it p}ermanent {\it s}hock to {\it i}ncome,
$\Ex_{t}[\pshk_{t+n}]=1~\forall~n>0$. The transitory component is:
\begin{eqnarray}
\tshk_{t\iSub} &=&\mu \text{ with probability $\mho_{t}$}, \label{eq:unemployed} \\
&=&(1-\tau_{t})\labor\tShkEmp_{t\iSub}\text{ with probability $1-\mho_{t}$}, \label{eq:employed}
\end{eqnarray}
where $\mu>0$ is the unemployment insurance payment when unemployed,
$\tau_t$ is the rate of tax collected to
pay unemployment benefits, $\labor$ is time worked per employee and $\tShkEmp_t$ is white noise. (This specification
of the unemployment insurance system is taken from the special issue of the the \cite{jedc_ksVolume} on solution methods for the Krusell--Smith model.)
In our preferred version of the model, the aggregate wage rate
\begin{eqnarray}
\Wage_{t} &=&(1-\kapShare)\ptyLev_{t}(\KLev_{t}/\labor\LLev_{t})^{\kapShare}, \label{eq:wagerate}
\end{eqnarray}
is determined by productivity $\ptyLev_{t}$ ($=1$), capital $\KLev_{t}$, and the aggregate supply of effective labor $\LLev_{t}$. The latter is again driven by two aggregate shocks:
\begin{eqnarray}
\LLev_{t}&=&P_{t} \TShk_{t}, \label{eq:aggrTemp}\\
P_{t}&=&P_{t-1} \PShk_{t}, \label{eq:aggrPerm}
\end{eqnarray}
where $P_{t}$ is aggregate permanent productivity, $\PShk_{t}$ is the aggregate permanent shock and $\TShk_{t}$ is the aggregate transitory shock.\footnote{Note that $\PShk$ is the capitalized
version of the Greek letter $\pShk$ used for the idiosyncratic
permanent shock; similarly (though less obviously), $\TShk$ is the
capitalized $\tshk$.}
Like $\pShk_{t}$ and $\tShkEmp_{t}$, both $\PShk_{t}$ and $\TShk_{t}$ are assumed to
be iid log-normally distributed with mean one.
Alternative specifications have been estimated in the extensive
literature, and some authors argue that a better description of income
dynamics is obtained by allowing for an MA(1) or MA(2) component in
the transitory shocks, and by substituting AR(1) shocks for Friedman's
``permanent'' shocks. The relevant AR and MA coefficients have
recently been estimated by \cite{dhprvInequality} using a much higher-quality
(and larger) data source than any previously available for the U.S.:
IRS tax records. The authors' point estimate for the size of the
AR(1) coefficient is 0.98 (that is, very close to 1). Our view is that nothing
of great substantive consequence hinges on whether the coefficient is 0.98 or 1.\footnote{%
Simulations have also convinced us that even if the true coefficient is 1, a coefficient of 0.98
might be estimated as a consequence of the bottom censorship of the tax data caused by the
fact that those whose income falls below a certain threshold do not owe any tax.}$^{,}$\footnote{See \cite{cstKS} for further discussion of these issues.}
For modeling purposes, however, our task is considerably simpler both
technically and to communicate to readers when we assume that the
``persistent'' shocks are in fact permanent.
%\subsection*{Comparison to the KS Income Process}
This FBS aggregate income process differs substantially from that in the seminal paper of \citet{ksHetero},
which assumes that the level of aggregate productivity has a first-order Markov structure, alternating between two states:
$\ptyLev_{t}=1+\bigtriangleup ^{\ptyLev}$ if the aggregate state is
good and $\ptyLev_{t}=1-\bigtriangleup ^{\ptyLev}$ if it is bad;
similarly, $\LLev_{t}=1-\mho_{t}$ (unemployment rate) where $\mho_{t}=\mho^{g}$ if the state is
good and $\mho_{t}=\mho^{b}$ if bad. The idiosyncratic and aggregate shocks are thus correlated; the law of large numbers implies that the number of unemployed individuals is $\mho^{g}$ and $\mho^{b}$ in good and bad times, respectively.
The KS process for aggregate productivity shocks has little empirical
foundation because the two-state Markov process is not flexible enough
to match the empirical dynamics of unemployment or aggregate income
growth well. In addition, the KS process---unlike income measured in the
data---has low persistence. Indeed, the KS process appears to have been intended by the
authors as an illustration of how one might incorporate business
cycles in principle, rather than a serious candidate for an empirical
description of actual aggregate dynamics.
In contrast, our assumption that the structure of aggregate shocks
resembles the structure of idiosyncratic shocks is valuable not only
because it matches the data well, but also because it makes the model
easier to solve. In particular, the elimination of the `good' and
`bad' aggregate states reduces the number of state variables to two
(individual market resources $\mRat_{t\iSub}$ and aggregate capital $K_{t}$)
after normalizing the model appropriately. Employment status is not a
state variable (in eliminating the aggregate states, we also shut down
unemployment persistence, which depends on the aggregate state in the
KS model). As a result, given parameter values, solving the model with
the FBS aggregate shocks is much faster than solving the model with the
KS aggregate shocks.\footnote{As before, the main thing the household
needs to know is the law of motion of aggregate capital, which can
be obtained by following essentially the same solution method as in
\citet{ksHetero} (see Appendix~D of \citet{cstKS} (ECB working paper) for details).}
Because of its familiarity in the literature, we present in section~\ref{ss:BusinessCycle}
comparisons of the results obtained using both alternative descriptions
of the aggregate income process. Nevertheless, our preference is for
the FBS process, not only because it yields a much more tractable model
but also because it much more closely replicates empirical aggregate dynamics
that have been targeted by a large applied literature.
\begin{comment}
Our aim is to improve on the KS process for aggregate productivity shocks, which has little empirical
foundation; indeed, it appears to have been intended by the authors as
an illustration of how one might incorporate business cycles in
principle, rather than a serious candidate for an empirical
description of actual aggregate dynamics. We
introduce an aggregate income process that is considerably more
tractable than the KS aggregate process and is also a much closer
match to the aggregate data. We regard the version of our model with
this new income process as the `preferred' version for use as a
starting point for future research.
The models we have investigated in section~\ref{sec:MPC} contained the KS process for aggregate productivity shocks; we will now allow for aggregate shocks that have an analogous structure to the idiosyncratic shocks, consisting of the temporary and the permanent component.
The aggregate production function is the same as equation
(\ref{eq:outputPF}), but following \citet{cstStickyC},
the aggregate state (good or bad) no longer exists in this model
($\ptyLev_{t}=1$).
\end{comment}
\subsection{Homogeneous Impatience: The `$\Discount$-Point' Model} \label{subsec:homoImp}
The economy consists of a continuum of households of mass one distributed on the unit interval, each of which maximizes expected discounted utility from
consumption,
\begin{equation*}
\max\, \Ex_t\sum_{n=0}^{\infty}(\PLives\Discount)^{n}\uFunc(\cLev_{t+n})
\end{equation*}
for a CRRA utility function
$\uFunc(\bullet)=\bullet^{1-\CRRA}/(1-\CRRA)$\footnote{Substitute $\uFunc(\bullet) = \log(\bullet)$ for $\CRRA = 1$.
} where $\PLives$ is the probability of survival for a period, and $\Discount$ is the geometric discount factor. The household consumption functions $\{\cFunc_{t+n}\}_{n=0}^\infty$ satisfy:\\
\together{
\begin{eqnarray}
\valfn(\mRat_{t\iSub})&=&\underset{\cFunc_{t}}{\max } ~~ \uFunc(\cFunc_{t\iSub}(\mRat_t))+\Discount \PLives \Ex_{t}\left[ \pshk
_{t+1\iSub}^{1-\CRRA}\valfn(\mRat_{t+1\iSub})
\right] \label{eq:hetdecisionprobnashk}\\
\notag &\text{s.t.}&\\
\wEndRat_{t\iSub} &=&\mRat_{t\iSub}-\cFunc_{t}(\mRat_t), \label{indconst2}\\
\kRat_{t+1\iSub} &=&\wEndRat_{t\iSub}/(\PLives \pshk_{t+1\iSub}), \label{indconst3}
\\
\mRat_{t+1\iSub} &=&(\daleth +\rProd_t)\kRat_{t+1\iSub}+\tshk_{t+1\iSub}, \label{indconst4} \\
\wEndRat_{t\iSub} &\geq &0, \label{indconst5} %\\ \notag \rProd &=&\kapShare\ptyLev(\KLev/\labor\LLev)^{\kapShare-1},
\end{eqnarray}}
where the variables are divided by the level of permanent income $\pLev_{t\iSub}=\pRat_{t\iSub} \Wage$, so that when aggregate shocks are shut down the only state variable is (normalized) cash-on-hand
$\mRat_{t\iSub}$.\footnote{Again see \citet{cstKS} for details.}
Households die with a constant probability $\PDies \equiv 1-\PLives $ between
periods. Following \cite{blanchardFinite}, the wealth
of those who die is distributed among survivors proportional to their wealth; newborns start earning the mean level of income. \citet{cstKS} show that a stable cross-sectional distribution of wealth exists if $\,\,\PLives \Ex[\pshk^{2}] < 1$.
Consequently, the effective discount factor is $\Discount \PLives$ (in
(\ref{eq:hetdecisionprobnashk})). The effective interest
rate is $(\daleth +\rProd)/\PLives$, where $\daleth =1-\delta$ denotes the depreciation factor for capital and $\rProd$ is the interest rate (which here is time-invariant and thus has no time subscript).%\footnote{Below we allow time-varying interest rates implied by the aggregate dynamics of $K_{t}$; for simplicity, the reader can think of the model here as a small open economy, and the model below as a closed economy.}
The production function is Cobb--Douglas:
\begin{equation}
\ptyLev \KLev^{\kapShare}(\labor\LLev)^{1-\kapShare}, \label{eq:outputPF}
\end{equation}
where $\ptyLev$ is aggregate productivity, $\KLev$ is capital, $\labor$ is time worked per employee and $\LLev$ is employment. The wage rate and the interest rate are equal to the marginal product of labor and capital, respectively.
As shown in \eqref{indconst2}--\eqref{indconst4}, the evolution of household's market resources $\mRat_{t}$ can be broken up into three steps:
\begin{enumerate}
\item Assets at the end of the period are equal to market resources minus
consumption:
\begin{equation*}
\wEndRat_{t}=\mRat_{t}-\cRat_{t}.
\end{equation*}
\item Next period's capital is determined from this period's assets via
\begin{equation*}
\kRat_{t+1}=\wEndRat_{t}/(\PLives \pshk_t).
\end{equation*}
\item
Finally, the transition from the beginning of
period $t+1$ when capital has not yet been used to produce output, to the
middle of that period when output has been produced and incorporated into
resources but has not yet been consumed is:
\begin{eqnarray*}
\mRat_{t+1} &=&(\daleth +\rProd_t)\kRat_{t+1}+\tshk_{t+1}.
\end{eqnarray*}
\end{enumerate}
Solving the maximization \eqref{eq:hetdecisionprobnashk}--\eqref{indconst5} gives the optimal consumption rule. A target wealth-to-permanent-income ratio exists if a death-modified version of \citet{BufferStockTheory}'s `Growth Impatience
Condition' holds (see Appendix~C of \citet{cstKS} (ECB working paper) for derivation):
\begin{eqnarray}
\frac{(\Rfree_t\beta)^{1/\CRRA}\Ex[\pShk^{-1}]\PLives}{\PGro} & < & 1, \label{eq:GIC}
\end{eqnarray}
where $\Rfree_t=\daleth +\rProd_t$, and $\PGro$ is labor productivity growth (the growth rate of permanent income).
\subsection{Calibration}
\begin{table} \large
\caption{Parameter Values and Steady State of the Perpetual Youth Models}
\label{table:ParamsAll}
\begin{minipage}{\textwidth}
\input ./ParamsAll
\tablenotessize{Notes: The models are calibrated at the quarterly frequency, and the steady state values are calculated on a quarterly basis.}
\end{minipage}
\end{table}
We calibrate the standard elements of the model using the parameter
values used for the papers in the special issue of the \citet{jedc_ksVolume}
devoted to comparing solution methods for the KS model (the parameters
are reproduced for convenience in
Table~\ref{table:ParamsAll}). The model is calibrated at the quarterly frequency.
We calibrate the FBS income process as follows. The variances of
idiosyncratic components are taken from \citet{carroll:brookings}
because those numbers are representative of the large subsequent empirical literature
all the way through the new paper by \cite{dhprvInequality} whose point estimate of the
variance of the permanent shock almost exactly matches the calibration in
\cite{carroll:brookings}. The variances of idiosyncratic components lie in the upper part of the range spanned by empirical estimates.\footnote{For a fuller survey, see \citet{cstKS}, which documents that the income
process described in section~\ref{sec:PlausibleAggModel} fits
cross-sectional variance in the data much better than alternative
processes which do not include a permanent, or at least a highly persistent, component.} However, we believe our values are reasonable also because the standard model omits expenditure shocks (such as a sudden shock to household's medical expenses or durable goods).%
\footnote{When we alternatively set the quarterly standard deviation of transitory shocks to 0.1 (instead of the value of 0.2 implied by Table~\ref{table:ParamsAll}), the results below change only little (e.g., under the FBS aggregate income process, the average MPC for the economy calibrated to liquid assets is
$
\input ../Code/Mathematica/Results/MPCDistSevenAltParamsWithAggPermShocksLiqFinPlsRet.tex $
(instead of
$
\input ../Code/Mathematica/Results/MPCDistSevenWithAggPermShocksLiqFinPlsRet.tex
$).}${}^{, }$
\footnote{Table~\ref{table:ParamsAll} calibrates variances of idiosyncratic income components based on annual data, as we have not been able to find any literature that models income
dynamics at a frequency higher than annual and simultaneously matches
the annual data that are the object of most scholarly study.
}
The variances of the aggregate component of the FBS income process were estimated as follows, using U.S.\ NIPA labor income, constructed as wages and salaries plus transfers minus personal contributions for social insurance. We first calibrate the signal-to-noise ratio $\varsigma\equiv\sigma_\PShk^2\big/\sigma_\TShk^2$ so that the first autocorrelation of the process, generated using the logged versions of equations \eqref{eq:aggrTemp}--\eqref{eq:aggrPerm}, is 0.96.\footnote{This calibration allows for transitory aggregate shocks, although the results below hold even in a model without transitory aggregate shocks, i.e., for $\sigma_\TShk^2=0$.
}${}^{,}$\footnote{We generate 10,000 replications of a process with 180 observations, which corresponds to 45 years of quarterly observations. The mean and median first autocorrelations (across replications) of such a process with $\varsigma=4$ are 0.956 and 0.965, respectively. In comparison, the mean and median of sample first autocorrelations of a pure random walk are 0.970 and 0.977 (with 180 observations), respectively.}
Differencing equation \eqref{eq:aggrTemp} and expressing the second moments yields
\begin{eqnarray*}
\mathrm{var}\big(\Delta\log\LLev_{t}\big)&=&\sigma_\PShk^2+2\sigma_\TShk^2,\\
&=&(\varsigma+2)\sigma_\TShk^2.
\end{eqnarray*}
Given $\mathrm{var}\big(\Delta\log\LLev_{t}\big)$ and $\varsigma$ we identify
$\sigma_\TShk^2=\mathrm{var}\big(\Delta\log\mathbf\LLev_{t}\big)\big/(\varsigma+2)$ and $\sigma_\PShk^2=\varsigma\sigma_\TShk^2$.
The strategy yields the following estimates: $\varsigma=4$, $\sigma_\PShk^2=4.29\times 10^{-5}$ and
$\sigma_\TShk^2=1.07\times10^{-5}$ (given in Table~\ref{table:ParamsAll}).
This parametrization of the aggregate income process yields income dynamics
that match the same aggregate statstics that are matched by standard
exercises in the real business cycle literature including \citet{jermannProduction},
\citet{bcfHabits}, and
\citet{ckmCritique}. It also fits well the broad
conclusion of the large literature on unit roots of the 1980s, which found that it is virtually impossible to
reject the existence of a permanent component in aggregate
income series (see \citet{stock:Handbook} for a review).
\footnote{The autocorrelation of aggregate output in our model exceeds 0.99.}
\subsection{Wealth Distribution in the `$\Discount$-Point' Model}
To finish calibrating the model, we assume (for now) that all households have an identical
time preference factor $\Discount =\grave{\Discount}$ (corresponding to a point distribution
of $\Discount$) and henceforth call this specification the `$\Discount$-Point' model.
With no aggregate uncertainty, we follow the procedure of the papers in the JEDC volume by backing out the value of $\grave{\Discount}$ for which the steady-state value of the capital-to-output ratio ($\KLev/\YLev$) matches the value
that characterized the steady-state of the perfect foresight version of the model; $\grave{\Discount}$ turns out to be $ \input
../Code/Mathematica/Results/Beta.tex $ (at a quarterly rate).%
\footnote{%
Our calibration of $\CRRA=1$ follows JEDC. We find, as previous work has found, that $\CRRA$ and $\Discount$ are not sharply identifiable using methods of the kind we employ here. Our approach therefore is to set a value of one parameter ($\CRRA$) and estimate the other conditional on the assumed value of the first. (See section~\ref{sec:Sensitivity} for a sensitivity analysis with respect to several parameters including $\CRRA$.)
}
\citet{cstKS} show that the $\Discount$-Point model matches the empirical wealth distribution
substantially better than the version of the \citet{ksHetero} model analyzed in the \citet{jedc_ksVolume} volume, which we call `KS-JEDC.'\footnote{The key difference between our model described in section~\ref{subsec:homoImp} and the KS-JEDC model is
the income process. In addition, households in the KS-JEDC model do not die. } For example, while the top 1 percent households living in the KS-JEDC model own only 3 percent
of total wealth,\footnote{See the next section for a discussion of the extension of their model in which households experience stochastic changes to their time preference rates; that version implies more wealth at the top.} those living in the $\Discount$-Point are much richer, holding roughly 10
percent of total wealth. This improvement is driven by the presence of the permanent shock to income,
which generates heterogeneity in the level of wealth because, while all households have the same
target wealth/permanent income {\it ratio}, the equilibrium dispersion in the level of permanent
income leads to a corresponding equilibrium dispersion in the level of wealth.
Figure~\ref{CumWLevSCFCastanedaAndDistSevenNoAggShockPlot}
illustrates these results by plotting the wealth Lorenz curves
implied by alternative models. Introducing the FBS shocks into the
framework makes the Lorenz curve for the KS-JEDC model move roughly
one third of the distance toward the data from the 2004 \emph{Survey of
Consumer Finances,}%
\footnote{%
For the empirical measures of wealth we target the data from 2004 (and include only households with positive net worth). The wealth distribution in the data was stable until 2004 or so, although it has been shifting
during the housing boom and the Great Recession; the effects of these shifts on our estimates of
$\Discount$ and $\nabla$ are negligible.
}
to the dashed curve labeled $\Discount$-Point.
\begin{figure}
\caption{Distribution of Net Worth (Lorenz Curve)---Perpetual Youth Model}
\label{CumWLevSCFCastanedaAndDistSevenNoAggShockPlot}
% \CDCFig{CumWLevSCFCastanedaAndDistSevenNoAggShockPlot}
%\CDCFig{CumWLevSCFCastanedaAndDistSevenNoAggShockLRPlot} % show two sub figures side by side
\includegraphics[width=1.00\textwidth]{./CumWLevSCFCastanedaAndDistSevenNoAggShockLRPlot}
% \CDCFig{CumWLevSCFCastanedaAndDistSevenNoAggShockTBPlot} % show two sub figures top and bottom
\footnotesize Notes: The solid curve shows the distribution of net worth in the 2004 \emph{Survey of Consumer Finances}. KS-Hetero is from \citet{ksHetero}.
\end{figure}
However, the wealth heterogeneity in the $\Discount$-Point model essentially just replicates heterogeneity in permanent income (which accounts for most of the heterogeneity in total income); for example the Gini coefficient for permanent income measured in the \emph{Survey of Consumer Finances} of roughly 0.5 is similar to that for wealth generated in the $\Discount$-Point model. Since the empirical distribution of wealth (which has the Gini coefficient of around 0.8) is considerably more unequal than the distribution of income (or permanent income), the setup only captures part of the wealth heterogeneity in the data, especially at the top.
\begin{comment}
Comparison of the relevant values in Table~\ref{table:ParamsAll} makes clear that the aggregate shocks are in terms of variance 100 times smaller than the idiosyncratic shocks. Consequently, it is no surprise that the key quantitative results of our analysis so far generalize to the framework which includes realistically calibrated aggregate uncertainty. In particular, the two rightmost columns of Table~\ref{table:MPCall} with the MPC breakdowns from the $\Discount$-Dist models with aggregate shocks closely mirror columns~2~and~3, in which these shocks are shut down.
For example, in the net worth case, the aggregate MPC for the model calibrated to the distribution of the net worth is $
\input ../Code/Mathematica/Results/MPCDistSevenWithAggPermShocks.tex
$, while that for the liquid financial and retirement assets case remains much higher at
$
\input ../Code/Mathematica/Results/MPCDistSevenWithAggPermShocksLiqFinPlsRet.tex
$.
%\footnote{As in the net worth case, parameter value are estimated with aggregate shocks turned off
%($(\grave{\Discount}, \nabla)=(
%\input ../Code/Mathematica/Results/BetamiddleLiqFinPlsRet.tex
%,
%\input ../Code/Mathematica/Results/NablaLiqFinPlsRet.tex
%)$).}
\end{comment}
\subsection{Heterogeneous Impatience: The `$\Discount$-Dist' Model}
Because we want a modeling framework that matches the fact
that wealth inequality substantially exceeds income inequality, we
need to introduce an additional source of heterogeneity (beyond heterogeneity in permanent and transitory income). We accomplish this
by introducing heterogeneity in impatience. Each household is now assumed to
have an idiosyncratic (but fixed) time preference factor. We think of
this assumption as reflecting not only actual variation in pure rates
of time preference across people, but also as reflecting other
differences (in age, income growth expectations, investment
opportunities, tax schedules, risk aversion, and other variables) that
are not explicitly incorporated into the model.
To be more concrete, take the example of age. A robust pattern in
most countries is that income grows much faster for young people than
for older people. Our ``death-modified growth impatience condition'' \eqref{eq:GIC}
captures the intuition that people facing faster income growth tend to
act, financially, in a more `impatient' fashion than those facing
lower growth. So we should expect young people to have lower target
wealth-to-income ratios than older people. Thus, what we are
capturing by allowing heterogeneity in time preference factors is
probably also some portion of the difference in behavior that (in
truth) reflects differences in age instead of in pure time preference
factors. Some of what we achieve by allowing heterogeneity in
$\Discount$ could alternatively be introduced into the model if we had
a more complex specification of the life cycle that allowed for
different income growth rates for households of different ages. We make this point quantitatively
in section~\ref{sec:LCM} below, which solves the `$\Discount$-Dist' model in a realistic life cycle framework.
One way of gauging a model's predictions for wealth inequality is to
ask how well it is able to match the proportion of total net worth held
by the wealthiest $20$, $40$, $60$, and $80$ percent of the population.
We follow other papers (in particular \citet{castaneda}) in matching
these statistics.\footnote{\citet{castaneda} targeted various wealth and income
distribution statistics, including net worth held by the top $1$, $5$, $10$, $20$,
$40$, $60$, $80$ percent, and the Gini coefficient.}
% The footnote listed all the (wealth) statistics Castaneda matched. Note that they are matching various income statistics as well.
Our specific approach is to replace the assumption that all households have the same time
preference factor with an assumption that, for some dispersion $\nabla$, time
preference factors are distributed uniformly in the population between
$\grave{\Discount}-\nabla$ and $\grave{\Discount}+\nabla$ (for this reason, the model is referred to as the `$\Discount$-Dist' model). Then,
using simulations, we search for the values of $\grave{\Discount}$ and
$\nabla$ for which the model best matches the fraction of net worth held by the top $20$, $40$, $60$, and $80$ percent of the population, while at the same time matching
the aggregate capital-to-output ratio from the perfect foresight
model. Specifically, defining $w_{i}$ and $\omega _{i}$ as the proportion of total aggregate net worth held by the top $i$ percent in our model and in the data, respectively, we solve the following minimization problem:
\begin{equation}
\{\grave{\Discount}, \nabla\}= \underset{\{{\Discount}, \nabla\}}{\text{argmin} }\Big(\sum_\text{$i=20$, $40$, $60$, $80$}
\big(w_{i}({\Discount}, \nabla)-\omega _{i}\big)^{2}\Big)^{1/2} \label{eq:MinimizationProb}
\end{equation}
subject to the constraint that the aggregate wealth (net worth)-to-output ratio in the model matches the aggregate
capital-to-output ratio from the perfect foresight model ($\KLev_{PF}/\YLev_{PF}$):\footnote{In estimating these parameter values, we approximate the uniform distribution with the following seven points (each with the mass of $1/7$): $\{\grave{\Discount}-3\nabla/3.5$, $\grave{\Discount}-2\nabla/3.5$, $\grave{\Discount}-\nabla/3.5$, $\grave{\Discount}$, $\grave{\Discount}+\nabla/3.5$, $\grave{\Discount}+2\nabla/3.5$, $\grave{\Discount}+3\nabla/3.5\}$. Increasing the number of points further does not notably change the results below. When solving the problem \eqref{eq:MinimizationProb}--\eqref{eq:pfConstraint} for the FBS specification we shut down the aggregate shocks (practically, this does not affect the estimates given their small size).
\label{foot:uniApprox}}
\begin{eqnarray}
\KLev/\YLev & = & \KLev_{PF}/\YLev_{PF}. \label{eq:pfConstraint}
\end{eqnarray}
The solution to this problem is $\{\grave{\Discount}, \nabla\}=\{
\input ../Code/Mathematica/Results/Betamiddle.tex
,
\input ../Code/Mathematica/Results/Nabla.tex
\}$, so that the discount factors are evenly spread roughly between 0.98 and 0.99.\footnote{With these estimates, even the most patient consumers with $\Discount=\grave{\Discount}+3\nabla/3.5$ (see footnote~\ref{foot:uniApprox}) satisfy the death-modified `Growth Impatience Condition' of \eqref{eq:GIC} (a sufficient condition for stationarity of the wealth distribution), derived in Appendix C of \citet{cstKS} (ECB working paper). \label{foot:DMGIC} } We call the optimal value of the objective function \eqref{eq:MinimizationProb} the `Lorenz distance' and use it as a measure of fit of the models.
The introduction of even such a relatively modest amount of time
preference heterogeneity sharply improves the model's fit to the targeted
proportions of wealth holdings, bringing it reasonably in line with the data (Figure~\ref{CumWLevSCFCastanedaAndDistSevenNoAggShockPlot}).%
\footnote{The Lorenz distance falls from almost 40 for the $\Discount$-Dist model to just above 2 for the $\Discount$-Dist model; see Table~\ref{table:MPCall}.}
The
ability of the model to match the targeted moments does not, of
course, constitute a formal test, except in the loose sense that a
model with such strong structure might have been unable to get nearly
so close to four target wealth points with only one free
parameter.\footnote{Because the constraint \eqref{eq:pfConstraint} effectively pins down the discount factor $\grave{\Discount}$
estimated in the minimization problem \eqref{eq:MinimizationProb},
only the dispersion $\nabla$ works to match the four wealth target points.} But the model also sharply improves the fit to locations in
the wealth distribution that were not explicitly targeted; for
example, the net worth shares of the top 10 percent and the top 1
percent are also shown in the figure, and the model performs
reasonably well in matching them.%
\footnote{%
We have examined the results for alternative calibrations of $\CRRA$ (section~\ref{sec:Sensitivity}); unsurprisingly, for larger calibrations of $\CRRA$, $\nabla$ is larger. For example, for $\CRRA=2$, $\nabla$ is a bit more than twice as large. However, implications for the MPC are roughly similar.
}
Of course, \citet{ksHeteroPort,ksHetero} were well aware that their baseline model
provides a poor match to the wealth distribution. In response, they
examined whether inclusion of a form of discount rate heterogeneity
could improve the model's match to the data. Specifically, they
assumed that the discount factor takes one of the three values
$\{0.9858, 0.9894, 0.9930\}$, and that agents anticipate that
their discount factor might change between these values according to a
Markov process. As they showed, the model with this simple form of
heterogeneity did improve the model's ability to match the wealth
holdings of the top percentiles (see Figure~\ref{CumWLevSCFCastanedaAndDistSevenNoAggShockPlot}).\footnote{Indeed, their results show that their model of heterogeneity went a bit too far: it concentrated almost all of the net worth in the top 20 percent of the population. By comparison, our model $\Discount$-Dist does a notably better job matching the data across the entire span of wealth percentiles.}
The reader might wonder why we do not simply adopt the KS
specification of preference heterogeneity, rather than
introducing our own novel (though simple) form of heterogeneity. The
principal answer is that our purpose here is to define a method of
explicitly matching the model to the data via statistical estimation
of a parameter of the distribution of heterogeneity: we let the data
speak flexibly about the extent of the preference heterogeneity
required in the model. Krusell and Smith were not estimating
a distribution in this manner; estimation of their framework would have required
searching for more than one parameter, and possibly as many as three or four. Indeed, had they intended
to estimate parameters, they might have chosen
a method more like ours. Second, having
introduced finite horizons in order to yield an ergodic distribution
of permanent income, it would be peculiar to layer on top of the
stochastic death probability a stochastic probability of changing
one's time preference factor within the lifetime.\footnote{Krusell and Smith
motivated their differing time preference factors as reflecting
different preferences of alternating generations of a dynasty, but
with our finite horizons assumption we have eliminated the dynastic
interpretation of the model.}${}^,$\footnote{\cite{kruegerMitmanPerri:handbookMacro} use our specification of preference heterogeneity to investigate the dynamics of their model economy during the Great Recession.}
Third, our results below show that the Krusell and Smith
specification of discount rate heterogeneity implies a substantially lower aggregate MPC than our $\Discount$-Dist model. Having said all of this, the common
point across the two papers is that a key requirement to make the
model fit the wealth data is a form of heterogeneity that leads different
households to have different target levels of wealth.
\section{The MPC in the Perpetual Youth Model} \label{sec:MPC}
Having constructed a model with a realistic household income process which is able to reproduce steady-state wealth heterogeneity in the data, we now turn on aggregate shocks and investigate the model's implications about relevant macroeconomic questions.
In particular, we ask whether a
model that manages to match the distribution of wealth has similar, or
different, implications from the KS-JEDC or representative agent
models for the reaction of aggregate consumption to an economic
`stimulus' payment.
Specifically, we pose the question as follows. The economy has been
in its steady-state equilibrium leading up to date $t$. Before the
consumption decision is made in that period, the government announces
the following plan: effective immediately, every household in the
economy will receive a one-off `stimulus check' worth some modest
amount (financed by a tax on unborn future
generations).\footnote{This financing scheme, along with the lack of a
bequest motive, eliminates any Ricardian offset that might otherwise
occur.} Our question is: \emph{By how much will aggregate consumption increase?}
\subsection{Matching Net Worth}
In theory, the distribution of wealth across recipients of the stimulus checks has important implications for aggregate MPC out
of transitory shocks to income. To see why, the solid line of Figure~\ref{CFuncDistSevenPointPermAndHistNetWorthPlotFedQuarterly} plots our $\Discount$-Point model's individual
consumption function using the FBS aggregate income process, with the
horizontal axis being cash on hand normalized by the level of
(quarterly) permanent income. Because the households with less normalized cash have higher MPCs, the average MPC is higher when a larger fraction of households has less (normalized) cash on hand.
\begin{figure}
\caption{Empirical Wealth Distribution and Consumption Functions of the
$\Discount$-Point and $\Discount$-Dist Models}
\label{CFuncDistSevenPointPermAndHistNetWorthPlotFedQuarterly}
\CDCFig{CFuncDistSevenPointPermAndHistNetWorthPlotFedQuarterly}
\footnotesize Notes: The solid curve shows the consumption function
for $\Discount$-Point model, and the dashed curves show the consumption functions
for the most patient and the least patient consumers for
$\Discount$-Dist model (under the FBS aggregate process). The histogram shows the empirical distribution of
net worth ($\mRat_{t}$) in the \emph{Survey of Consumer Finances} of 2004.
\end{figure}
There are many more households with little wealth in our $\Discount$-Point model than in the KS-JEDC model, as illustrated by comparison of the dash-dotted and the long-dashing lines in Figure~\ref{CumWLevSCFCastanedaAndDistSevenNoAggShockPlot}. The greater concentration of wealth at the bottom in the $\Discount$-Point model, which mirrors the data (see the histogram in Figure~\ref{CFuncDistSevenPointPermAndHistNetWorthPlotFedQuarterly}), should produce a higher average MPC, given the concave consumption function.
Indeed, the average MPC out of the transitory income (`stimulus check') in our $\Discount$-Point model is $ \input ../Code/Mathematica/Results/MPCPointWithAggShock.tex $ in annual terms (third column of Table~\ref{table:MPCall}),\footnote{The casual usage of the term `the MPC' refers to annual MPC given by $1-(1-\text{quarterly MPC})^4$ (recall again that the models in this paper are calibrated quarterly). We make this choice because existing influential empirical studies (e.g., \citet{souleles:taxrefunds}; \citet{jpsTax}) estimate longer-term MPCs for the amount of extra spending that has occurred over the course of \emph{a year or 9 months} in response to a one unit increase in resources.} about double the value in the KS-JEDC model $( \input ../Code/Mathematica/Results/MPCKSWithAggShock.tex )$ (first column of the table) or the perfect foresight partial equilibrium model with parameters matching our baseline calibration (0.04). Our $\Discount$-Dist model (fourth column of the table) produces an even higher average MPC $( \input ../Code/Mathematica/Results/MPCDistSevenWithAggShock.tex )$, since in the $\Discount$-Dist model there are more households who possess less wealth, are more impatient, and have higher MPCs (Figure~\ref{CumWLevSCFCastanedaAndDistSevenNoAggShockPlot} and dashed lines in Figure~\ref{CFuncDistSevenPointPermAndHistNetWorthPlotFedQuarterly}). However, this is still at best only at the lower bound of empirical MPC estimates, which are typically between $0.2$--$0.6$ or even higher (see Table~\ref{table:mpcLit}).%
\footnote{The MPCs calculated in Table~\ref{table:MPCall} are `theoretical', i.e., based on the slope of the consumption function. Alternatively, we have also calculated the following `discrete' MPCs based on an increase in spending over the next four quarters after the household received an unexpected \$ 1,000 extra in income. The implied MPCs for such calculation are slightly lower than the ones we report, e.g., for the aggregate MPC in the perpetual youth $\Discount$-Dist model we get a value of \input ../Code/Mathematica/Results/MPCAltDistSevenWithAggPermShocks.tex (instead of \input ../Code/Mathematica/Results/MPCDistSevenWithAggPermShocks.tex reported in column~6 of Table~\ref{table:MPCall}).}
\begin{figure}
\caption{Consumption Functions of $\Discount$-Dist and KS-Hetero Models and the Distribution of Cash on Hand}
\label{CFuncKSHeteroAndDistSevenAndHistDataKSHeteroPlot}
\CDCFig{CFuncKSHeteroAndDistSevenAndHistDataKSHeteroPlot}
{\footnotesize Notes: The dashed curve and the solid curve show the consumption functions for the most impatient consumers in $\Discount$-Dist model and the KS-Hetero model under the KS aggregate process, respectively. The consumption functions are for employed consumers in the good aggregate state. The pink (light grey) and blue (dark grey) histograms show the distributions of cash on hand for the most impatient consumers generated by $\Discount$-Dist model and the KS-Hetero model, respectively.}
\end{figure}
Column~3 reports that the Krusell--Smith model with heterogeneous discount rates, `KS-Hetero' has very different implications about marginal propensities than $\Discount$-Dist model. While both models match the empirical wealth distribution, the KS-Hetero model generates a much lower aggregate MPC: 0.09. Figure~\ref{CFuncKSHeteroAndDistSevenAndHistDataKSHeteroPlot} shows the reason for this discrepancy: in the KS-Hetero model, a large fraction of even the most impatient households stay in the region where the consumption function is flat and the MPC is low (see the solid line and the blue (dark grey) histogram). In addition, the heterogeneity in MPCs across wealth--income ratios is substantially lower than in the $\Discount$-Dist model: In the KS-Hetero model households in the bottom 20 \%\ have MPCs of around 0.2, while in the $\Discount$-Dist model almost 0.5.
% \jbemph{Need to discuss why MPCs are low in KS-Hetero.}
To further understand the role of various components of the $\Discount$-Dist model and the differences in the mechanics of the $\Discount$-Dist and the KS-Hetero models we have turned off the permanent $\pshk$ and transitory $\tShkEmp$ income shocks, and the borrowing constraint. We find that turning off transitory shocks does not noticeably affect the MPC. Turning off the permanent shocks \emph{and} allowing for borrowing up to the half of annual permanent income, $\wEndRat_{t\iSub}\geq-2$ (like in the KS-Hetero model) reduces the aggregate MPC from 0.21 to 0.14, each of these two items contributing roughly the same to the decline.\footnote{A setup without the shocks $\pshk$ and $\tShkEmp$ is similar to the KS-Hetero model in that it replicates their idiosyncratic income process. Such setup with a less strict borrowing constraint (like in KS-Hetero) implies an aggregate MPC of 0.14. The remaining differences from KS-Hetero are the specification of aggregate shocks and the nature of $\Discount$ heterogeneity. As columns~4 and 6 in Table~\ref{table:MPCall} show that the aggregate MPC is similar under the FBS or KS aggregate process (0.21 vs.\ 0.23), we believe the residual difference in MPCs is mostly or entirely accounted for by the vastly different assumptions about the distribution of $\Discount$. While the lowest, middle, and highest discrete values of $\Discount$ in our $\Discount$-Dist specification are \textit{very} close to the three KS $\Discount$ values, $(0.9858,0.9894,0.9930)$, about 29\% of our simulated agents have an intermediate $\Discount$ between the lowest and central types; the corresponding percentiles of $\Discount$ in the KS-Hetero model (as well as the 4\% below that) all have $\Discount=0.9894$. As the average MPC is convex in $\Discount$, this relative dispersion of the central mass results in an increased MPC in $\Discount$-Dist relative to KS-Hetero even when idiosyncratic income shocks are shut down and borrowing is allowed. These results are reported in our online appendix.}
% \begin{sidewaystable}
% \input ./MPCall
% \end{sidewaystable}
\begin{sidewaystable}
\caption{Average (Aggregate) Marginal Propensity to Consume in Annual Terms}
\label{table:MPCall}
\begin{minipage}{\textwidth}
\input ./MPCall_LCM
{\footnotesize Notes: Annual MPC is calculated by $1-(1-$\text{quarterly MPC}$)^{4}$. ``Liquid Assets'' refers to liquid financial plus retirement assets. ${}^\ddagger$: Discount factors are uniformly distributed over the interval $[\grave{\Discount}-\nabla,\grave{\Discount}+\nabla]$. ${}^\star$: The Lorenz distance is defined as: $\underset{\{{\beta}, \nabla\}}{\min} \Big(\sum_{i=20, 40, 60, 80}\big(w_{i}({\beta},\nabla)-\omega_{i}\big)^{2}\Big)^{1/2}$ where $w_{i}$ and $\omega_{i}$ are the proportions of total aggregate net worth held by the top $i$ percent in the model and in the data, respectively. }
\end{minipage}
\end{sidewaystable}
%Old version with \text breaks TeX4HT: {\footnotesize Notes: Annual MPC is calculated by $1-(1-$\text{quarterly MPC}$)^{4}$. ``Liquid Assets'' refers to liquid financial plus retirement assets. ${}^\ddagger$: Discount factors are uniformly distributed over the interval $[\grave{\Discount}-\nabla,\grave{\Discount}+\nabla]$. ${}^\star$: The Lorenz distance is defined as: $\underset{\{{\beta}, \nabla\}}{\min}\Big(\sum_\text{$i=20$, $40$, $60$, $80$} \big(w_{i}({\beta},\nabla)-\omega_{i}\big)^{2}\Big)^{1/2}$, where $w_{i}$ and $\omega_{i}$ are the proportions of total aggregate net worth held by the top $i$ percent in the model and in the data, respectively.}
% Excised because Tex4Ht balks on blank lines in figs and tables
%$^{\ddagger}:$ $\grave{\Discount}=
%\input ../Code/Mathematica/Results/Beta.tex
%$.
%$^{\star}:$ $(\grave{\Discount}, \nabla)=(
%\input ../Code/Mathematica/Results/Betamiddle.tex
%,
%\input ../Code/Mathematica/Results/nabla.tex
%)$, which implies $\{\grave{\Discount}-\nabla, \grave{\Discount}+\nabla\}=\{
%\input ../Code/Mathematica/Results/BetaLow.tex
%,
%\input ../Code/Mathematica/Results/BetaHigh.tex
%\}$.
The MPCs are unevenly distributed across households with different wealth--permanent income ratios, ranging from 0.06 for the fifth (wealth--permanent income ratio) quintile to 0.48 for the first quintile, reflecting both the strong nonlinearity of the consumption function (in Figure~\ref{CFuncDistSevenPointPermAndHistNetWorthPlotFedQuarterly}) and preference type ``sorting'' as more patient households have a lower MPC at every wealth ratio and thus have a higher target ratio. Such heterogeneity in the MPC has previously been estimated in several empirical papers (at least to the extent that data are informative about differences in propensities across households).\footnote{%
See \citet{bppInequality}, \citet{brodaParker:stimulus2008}, \citet{leth-petersen:liquidity}, \citet{jappelliPistaferri_FPMPC}, \citet{jpsTax}, \citet{aslCredit} and \citet{bps:familyLaborS}}
The income gradient of the MPC (bottom panel of Table~\ref{table:MPCall}) is much shallower than for the wealth ratio-- only households in the bottom income quintile have considerably higher MPCs (0.35 with KS aggregate shocks) than the rest (around 0.20). This occurs because low income can result from either low transitory or permanent shocks; the former tends to increase the MPC while the latter decreases it. In the $\Discount$-Point model, where almost all households are well insured, the income-MPC gradient is nearly flat, with a slight inverted U-shape. In the $\Discount$-Dist model, about 75\% of households are more impatient than in $\Discount$-Point, and many have a fairly low target wealth ratio; bound by the credit constraint $\wEndRat_t \geq 0$, these households' wealth-to-income ratios are thus more sensitive to low transitory shocks than low permanent shocks, and thus low income is associated with a higher MPC on average.\footnote{The income-MPC gradient in the $\Discount$-Dist columns is the \textit{average} across the seven $\Discount$-types. Though it is flat (or inverted U-shaped) for the more patient types, it is much steeper for less patient types. Note that the gradient is steeper with KS shocks than with FBS shocks, because the former has a greater proportion of less patient households.}
\cite{kaplanViolanteWeidner_wealthyH2M} estimate that roughly a third of U.S. households are hand-to-mouth (in that they spend all their income in every pay-period). Of these households, roughly two thirds are wealthy---they own an illiquid asset---and the rest are poor. Because a state variable in our model is the ratio of wealth to permanent income, it can well be that households with low wealth--permanent income ratios own relatively high wealth (if their permanent income is high). In fact, a tabulartion of the one third of households with the highest MPCs in the $\Discount$-Dist model reveals that these households have quite diverse wealth holdings: half of them are in the bottom wealth quintile, one-third are in the second quintile and about 15 percent are in the third quintile.
Comparison of the fourth and sixth columns of Table~\ref{table:MPCall} makes it clear that for the purpose of
backing out the aggregate MPC, the particular form of the aggregate
income process is not essential; both in qualitative and in
quantitative terms the aggregate MPC and its breakdowns for the KS and
the FBS aggregate income specification lie close to each other. This
finding is in line with a large literature sparked by
\citet{lucasBusinessCycles} about the modest welfare cost of the
aggregate fluctuations associated with business cycles and with the
calibration of Table~\ref{table:ParamsAll}, in which variance of
aggregate shocks is roughly two orders of magnitude smaller than
variance of idiosyncratic shocks.\footnote{Of course, if one consequence of
business cycles is to increase the magnitude of idiosyncratic shocks,
as suggested for example by \cite{mcKayPapp:wageRiskOverBC}, \cite{gosCyclical} and \cite{Blundell:2013tm}, the costs of business cycles could be much larger than in traditional calculations that
examine only the consequences of aggregate shocks.}
\subsection{Matching Liquid Assets}
Thus far, we have been using total household net worth as our measure
of wealth. Implicitly, this assumes that all of the household's debt
and asset positions are perfectly liquid and that, say, a household
with home equity of \$50,000 and bank balances of \$2,000 (and no
other balance sheet items) will behave in every respect similarly to a
household with home equity of \$10,000 and bank balances of \$42,000.
This seems implausible. The home equity is more illiquid (tapping it
requires, at the very least, obtaining a home equity line of credit,
with the attendant inconvenience and expense of appraisal of the house
and some paperwork).
\citet{otsukaIlliquid} formally analyzes the optimization problem of
a consumer with a FBS income process who can invest in an illiquid but
higher-return asset (think housing), or a liquid but lower-return
asset (cash), and shows, unsurprisingly, that the annual marginal propensity
to consume out of shocks to liquid assets is higher than the MPC out
of shocks to illiquid assets. Her results would presumably be even
stronger if she had permitted households to hold much of their wealth in illiquid forms (housing,
pension savings), for example, as a mechanism to overcome self-control problems
(see \citet{laibson:goldeneggs} and many others).\footnote{Indeed, using a model with both a low-return liquid asset and a high-return illiquid asset, \citet{kvStim} have replicated high MPCs observed in the data.} % Alternatively, \citet{thalerMental} and others have argued that households construct `mental accounts' corresponding to different kinds of assets and have distinctly different behaviors (including different MPCs) with respect to similar shocks to different accounts.
These considerations suggest that it may be more plausible, for
purposes of extracting predictions about the MPC out of stimulus
checks, to focus on matching the distribution of liquid financial and retirement assets across households. The inclusion of retirement assets is arguable, %\footnote{Results for more restrictive definitions of liquid assets are available upon request from the authors.}
but a case for inclusion can be made because in the U.S.\ retirement assets such as IRA's and 401(k)'s can be liquidated under a fairly clear rule (e.g., a penalty of $10$ percent of the balance liquidated).
%\begin{table} \large
%\caption{Proportion of Wealth Held by Percentile (in Percent)}
%\label{table:LiqFinPlsRetAssetDist}
%\begin{minipage}{\textwidth}
%\input ./LiqFinPlsRetAssetDist_2
%\tablenotessize{Notes: The data source is the 2004 Survey of Consumer Finances.}
%\end{minipage}
%\end{table}
\begin{figure}
\caption{Empirical Distribution of Liquid Financial
Assets${}+{}$Retirement Assets and Consumption Functions of
$\Discount$-Dist Model}
\label{CFuncDistSevenAndHistNetWorthLiqFinPlsRetPlot}
\CDCFig{CFuncDistSevenAndHistNetWorthLiqFinPlsRetPlot}
\footnotesize Notes: The dashed curves show the consumption functions
for the most patient and the least patient consumers for
$\Discount$-Dist model under the KS aggregate process. The consumption functions are for employed consumers in the good aggregate state. The blue (dark grey) and pink (light grey)
histograms show the empirical distributions of net worth and liquid
financial and retirement assets, respectively, in the \emph{Survey of
Consumer Finances} of 2004.
\end{figure}
When we ask the model to estimate the time preference factors that
allow it to best match the distribution of liquid financial and retirement assets (instead
of net worth),\footnote{We define liquid financial and retirement assets as the sum of transaction accounts (deposits),
CDs, bonds, stocks, mutual funds, and retirement assets. We take the same approach as before: we match
the fraction of liquid financial and retirement assets held by the top $20$, $40$, $60$,
and $80$ percent of the population (in the SCF 2004), while at the
same time matching the aggregate liquid financial and retirement assets-to-income ratio (which is 6.6 in the SCF 2004).}
estimated parameter values are
$\{\grave{\Discount}, \nabla\}=\{
\input../Code/Mathematica/Results/BetamiddleWithAggShocksLiqFinPlsRet.tex ,
\input../Code/Mathematica/Results/NablaWithAggShocksLiqFinPlsRet.tex \}
$
under the KS aggregate income process and the average MPC is
$
\input../Code/Mathematica/Results/MPCDistSevenWithAggShockLiqFinPlsRet.tex
$ (fifth column of the table), which lies at the middle of the
range typically reported in the literature (see
Table~\ref{table:mpcLit}) and is considerably higher than when we
match the distribution of net worth.\footnote{When matching the distribution of liquid financial and retirement assets, we reduce the variance of permanent shocks $\sigma _{\pshk}^{2}$ to $0.01/4$ (from $0.01/(11/4)$ in Table~\ref{table:ParamsAll}) so that even the most patient consumers with $\Discount=\grave{\Discount}+3\nabla/3.5$ satisfy the death-modified `Growth Impatience Condition' (see footnotes~\ref{foot:uniApprox} and \ref{foot:DMGIC}).} This reflects the fact that
matching the more skewed distribution of liquid financial and
retirement assets
(see
Figure~\ref{CFuncDistSevenAndHistNetWorthLiqFinPlsRetPlot}) requires
a wider distribution of the time preference factors, ranging between
0.94 and 0.98, which produces even more
households with little wealth.\footnote{The distribution of liquid financial and retirement assets is more concentrated close to zero than the distribution of net worth, e.g., the top 10 percent of households hold 75 percent of liquid assets and 70 percent of net worth.
%The table also illustrates that both distributions did not change much over time. It is well-known that in aggregate data from the Flow of Funds the ratio of net worth to annual income moves around quite a bit, between 4 and 6.5 in the past 40 years. However, note that these changes (i) are in the flat region of the consumption function and, more important, (ii) are small relative to the cross-sectional dispersion in wealth.
}
The estimated distribution of discount factors lies below that obtained by matching net worth and is considerably more dispersed because of substantially lower median and more unevenly distributed liquid financial and retirement assets (compared to net worth).\footnote{Our value of the survival probability $\PLives=1 -0.00625$ implies that 8 percent of households are older than 100 years. To keep the model consistent we keep them in the economy. However, the results essentially do not change---under the FBS aggregate shocks, the aggregate MPC is
$
\input ../Code/Mathematica/Results/MPCDistSevenWithAggPermShocksLiqFinPlsRetDeathFrAge.tex $
instead of
$
\input ../Code/Mathematica/Results/MPCDistSevenWithAggPermShocksLiqFinPlsRet.tex $---if we alternatively replace the 100-year-olds with newborns (assuming they do not anticipate being replaced). This is reasonable given the small number of such households and given that the consumption function is almost linear at high levels of wealth.
}
\begin{figure}
\caption{Distribution of MPCs Across Households}
\label{MPCdist}
\CDCFig{DistributionsMPCsDistSevenAndKSKSAggShocksPlot}
\end{figure}
Figure~\ref{MPCdist} shows the cumulative distribution functions of
MPCs for the KS-JEDC model and the $\Discount$-Dist models (under the KS aggregate income shocks) estimated to match, first, the empirical distribution of net worth and, alternatively, of liquid
financial and retirement assets.\footnote{We have also solved a version of the model
that matches only ``very liquid assets'' (excluding retirement and other assets that might not be instantly accessible); as would be expected, that exercise produces an even higher average MPC.} The figure illustrates that the MPCs for KS-JEDC model are concentrated tightly around 0.05, which sharply
contrasts with the results for the $\Discount$-Dist models. Because
the latter two models match the empirical wealth distribution, they
imply that a substantial fraction of consumers have very little
wealth.
Table~\ref{table:MPCall} illustrates the distribution of MPCs by wealth, income, and employment status. In contrast to the KS-JEDC model, and to a lesser extent also to the KS-Hetero model, the $\Discount$-Point and in particular $\Discount$-Dist models generate a wide distribution of marginal propensities. Given the considerable concavity of the theoretical consumption function in the relevant region, these results indicate that the aggregate response to a stimulus program will depend greatly upon which households receive the stimulus payments. Furthermore, unlike the results from the baseline KS-JEDC model or from a representative agent model, the results from these simulations are easily consistent with the empirical estimates of aggregate MPCs in Table~\ref{table:mpcLit} and the evidence that households with little liquid wealth and without high past income have high MPCs.\footnote{These studies include \citet{bppInequality}, \citet{brodaParker:stimulus2008}, \citet{leth-petersen:liquidity} and \citet{jappelliPistaferri_FPMPC}.}
\subsection{The MPC over the Business Cycle} \label{ss:BusinessCycle}
Because our models include FBS or KS aggregate shocks, we can investigate how the economy's
average MPC and its distribution across households varies over the business cycle. Table~\ref{table:MPCscenarios} reports
the results for the following experiments with the $\Discount$-Dist models calibrated to the net worth distribution (and compares them to the baseline results from Table~\ref{table:MPCall}). For the model with KS aggregate shocks, in which recessions/expansions can be defined as bad/good realizations of the aggregate state:
\begin{enumerate}
\item `Expansions vs.\ Recessions': $\ptyLev_{t}=1+\bigtriangleup ^{\ptyLev}$ vs.\ $\ptyLev_{t}=1-\bigtriangleup ^{\ptyLev}$.
\item `Entering Recession': Bad realization of the aggregate state directly preceded by a good one: $\ptyLev_{t}=1-\bigtriangleup ^{\ptyLev}$ for which $\ptyLev_{t-1}=1+\bigtriangleup ^{\ptyLev}$.
\end{enumerate}
For the model with FBS aggregate shocks, we consider large bad realizations of the aggregate shock:
\begin{enumerate}
\item `Large Bad Permanent Aggregate Shock': bottom 1 percent of the distribution in the permanent aggregate shock
\item `Large Bad Transitory Aggregate Shock': bottom 1 percent of the distribution in the transitory aggregate shock
\end{enumerate}
\begin{sidewaystable}
\caption{Marginal Propensity to Consume over the Business Cycle}
\label{table:MPCscenarios}
\begin{minipage}{\textwidth}
\input ./MPC_scenarios
\tablenotessize{Notes: Annual MPC is calculated by $1-(1-$\text{quarterly MPC}$)^{4}$. The scenarios
are calculated for the $\Discount$-Dist models calibrated to the net worth distribution. For the KS aggregate shocks, the results are obtained by running the simulation over 1,000 periods, and the scenarios are defined as (i) `Recessions/Expansions': bad/good realization of the aggregate state, $1-\bigtriangleup ^{\ptyLev}$/$1+\bigtriangleup ^{\ptyLev}$; (ii) `Entering Recession': bad realization of the aggregate state directly preceded by a good one: $\ptyLev_{t}=1-\bigtriangleup ^{\ptyLev}$ for which $\ptyLev_{t-1}=1+\bigtriangleup ^{\ptyLev}$. The `baseline' KS results are reproduced from column~4 of Table~\ref{table:MPCall}. For the FBS aggregate shocks, the results are averages over 1,000 simulations, and the scenarios are defined as (i) `Large Bad Permanent Aggregate Shock': bottom 1 percent of the distribution in the permanent aggregate shock; (ii) `Large Bad Transitory Aggregate Shock': bottom 1 percent of the distribution in the transitory aggregate shock. The `baseline' FBS results are reproduced from column~6 of Table~\ref{table:MPCall}.}
\end{minipage}
\end{sidewaystable}
In the KS setup, the aggregate MPC is countercyclical, ranging between 0.22 in expansions and 0.25 in recessions. The key reason for this business cycle variation lies in the fact that aggregate shocks are correlated with idiosyncratic shocks. The movements in the aggregate MPC are driven by the inadequately insured households at the bottom of the distributions of wealth and income. MPCs for rich and employed households essentially do not change over the business cycle. The scenario `Entering Recession' documents that the length of the recession matters, so that initially the MPCs remain close to the baseline values, and increase only slowly as the recession persists.
In the FBS setup, the distribution of the MPC displays very little cyclical variation for both transitory and permanent aggregate shocks. This is because the precautionary behavior of households is driven essentially exclusively by idiosyncratic shocks, as these shocks are two orders of magnitude larger (in terms of variance) and because they are uncorrelated with aggregate shocks.
Of course, these results are obtained under the assumptions that the parameters and expectations in the models are constant, and that the wealth distribution is exogenous. These assumptions are likely counterfactual in events like the Great Recession, during which objects such as expectations about the future income growth or the extent of uncertainty may well have changed.
As Figure~\ref{CFuncDistSevenPointPermAndHistNetWorthPlotFedQuarterly} suggests, the aggregate MPC in our models is a result of an (inter-related) interaction between two objects: The distribution of wealth and the consumption function(s). During the Great Recession, the distribution of net worth shifted very substantially downward. Specifically, \cite{brickerEtAl:SCF2010} document that over the 2007--2010 period median net worth fell 38.8 percent (in real terms).%
\footnote{%
The \emph{Survey of Consumer Finances} also documents that net worth decreased considerably relative to income; for example, the median net worth-to-income ratio declined from 8.5 in 2007 to 5.6 in 2010.
}
\emph{Ceteris paribus,} these dynamics resulted an increase in the aggregate MPC, as the fraction of wealth-poor, high-MPC households rose substantially.
It is also likely that the second object, the consumption function, changed as many of its determinants (such as the magnitude of income shocks%
\footnote{%
See, e.g., \cite{gosCyclical} and \cite{Blundell:2013tm}, and the literature on the `scarring' effect of deep recessions on workers' lifetime income profiles.\\
\cite{cstMPCxc} document that an increase in the variance of transitory income shocks makes the consumption function steeper close to the origin.
}) have not remained unaffected by the recession. And, of course, once parameters are allowed to vary, one needs to address the question about how households form expectations about these parameters. These factors make it quite complex to investigate adequately the numerous interactions potentially relevant for the dynamics of the MPC over the business cycle. Consequently, we leave the questions about the extent of cyclicality of the MPC in more complicated settings for future research.
\subsection{Sensitivity Analysis}\label{sec:Sensitivity}
\begin{figure}
\caption{Sensitivity Analysis: Aggregate Marginal Propensity to Consume}
\label{KappaSensitivity}
\begin{center}
\includegraphics[scale=0.9]{./KappaSensitivity}
\end{center}
\end{figure}
\begin{figure}
\caption{Sensitivity Analysis: Distance Between Simulated \& Actual Lorenz Curves
}
\label{FitSensitivity}
\begin{center}
\includegraphics[scale=0.9]{./FitSensitivity}
\end{center}
\end{figure}
\begin{figure}
\caption{Sensitivity Analysis: Center of Discount Factor Distribution
}
\label{BetaSensitivity}
\begin{center}
\includegraphics[scale=0.9]{./BetaSensitivity}
\end{center}
\end{figure}
\begin{figure}
\caption{Sensitivity Analysis: Width of Discount Factor Distribution
}
\label{NablaSensitivity}
\begin{center}
\includegraphics[scale=0.9]{./NablaSensitivity}
\end{center}
\end{figure}
Because the literature does not agree on the precise values for some of our calibrated parameters, we want to understand the robustness of our results about the fit of the wealth distribution and about the MPC.
We investigated sensitivity to the calibrated parameters by re-estimating the $\Discount$-Dist model while varying one parameter at a time from its baseline value in Table~\ref{table:ParamsAll}; for example, we let the CRRA coefficient $\CRRA$ range between 0.5 and 4. Figures~\ref{KappaSensitivity}--\ref{NablaSensitivity} show the results of the sensitivity analysis for six parameters: risk aversion $\CRRA$, transitory income shock standard deviation $\sigma_\theta$, permanent income shock standard deviation $\sigma_\psi$, unemployment benefit replacement rate $\mu$, gross interest factor $\mathsf{R}$, and the (annual) expected growth rate $g \equiv \Gamma^4 - 1$.\footnote{For this robustness exercise, we shut down aggregate shocks and set an exogenous $\mathsf{R}$.} Overall, our main results are quite robust to alternative parameters, with the aggregate MPC consistently greater than 0.2 and a similar fit to the empirical wealth distribution.
The amount of discount factor heterogeneity needed to fit the Lorenz curve is nearly constant with respect to the calibrated parameters, as shown in Figure~\ref{NablaSensitivity}. The only exceptions are when transitory shocks are much larger than most empirical estimates (three to four times the size of our baseline calibration) or when households are more risk averse. In both cases, households are motivated to hold more precautionary wealth, and thus the model estimates that they have a lower average discount factor to fit the K/Y ratio and lower tail of the wealth distribution (in Figure~\ref{BetaSensitivity}); the width of the $\Discount$ distribution must thus be wider to generate households that hold large amounts of wealth because they nearly violate the Growth Impatience Condition \eqref{eq:GIC}.\footnote{The large estimated $\nabla$ for these parameterizations would be significantly tempered if we relaxed the credit constraint $\wEndRat_t \geq 0$, as the lower range of discount factors $\grave{\Discount} - \nabla$ would not need to be so low to generate households who hold slightly positive wealth. Relaxing the credit constraint would also likely reduce the gradient in the MPC in Figure~\ref{KappaSensitivity}.} With a larger proportion of impatient households, high $\CRRA$ and high $\sigma_\theta$ environments also imply a greater aggregate MPC (in Figure~\ref{KappaSensitivity}), reaching $0.28$ when $\rho=4$ and $0.33$ when $\sigma_\theta = 0.8$.
Varying the interest factor $\mathsf{R}$ has little effect on the estimated width $\nabla$, but a very large effect on the average discount factor $\grave{\Discount}$. The interest and discount factors are very close substitutes in determining target wealth, and thus $\grave{\Discount}$ decreases at a slope of nearly $-1$ with respect to $\mathsf{R}$; the resulting impatient households have a higher MPC. Among the remaining parameters, only higher unemployment benefits $\mu$ (moderately) lower the MPC as uncertainty is reduced. The other considered parameters have little effect on the implied aggregate MPC, the fit of the wealth distribution,\footnote{Very low values of permanent income shock standard deviation $\sigma_\psi$ can lead to worse model fit, as permanent income dispersion does not contribute to wealth dispersion (as in the baseline KS model).} the estimated discount factor $\beta$ and its dispersion $\nabla$. In total, we judge our main results to be quite robust.
\section{The MPC in a Life Cycle Model}\label{sec:LCM}
For ease of exposition and tractability of the aggregate shock processes, the models used in previous sections assume that households have unbounded horizons, with no difference between ``old'' and ``young'' agents. Our qualitative results hold even when households are instead assumed to live out a finite life cycle, with more realistic assumptions about changes in the income process and mortality as the household ages. This section discusses the assumptions used in an overlapping generations life cycle specification and presents analogous results corresponding to the analysis in section \ref{sec:MPC} by re-estimating the \Discount-Point and \Discount-Dist models. In this environment, wealth heterogeneity emerges not only from shocks to permanent and transitory income and differences in discount factors, but also through demographic differences in age and education, via differential mortality and income growth expectations. While these latter factors were abstracted into time preference heterogeneity in our benchmark model, here we model them explicitly to demonstrate the robustness of our results to the simplifying assumptions.
\subsection{Life Cycle of a Household}\label{sec:LifeCycle}
The economy consists of a continuum of expected utility maximizing households with a common CRRA utility function over consumption, $\uFunc(\bullet) = \bullet^{1-\CRRA}/(1-\CRRA)$; each household has a time discount factor $\Discount$. A household enters the economy at time $t$ aged 24 years, endowed with an education level $e \in \{D,HS,C\}$ (for dropout, high school, and college, respectively), an initial permanent income level $\pLev_0$, and a stock of capital $\kLev_0$. Each quarter, the household receives (after tax) income, chooses how much of their market resources to consume and how much to save, and then transitions to the next quarter by facing shocks to mortality and income.
The FBS income process of section~\ref{sec:PlausibleAggModel} translates into the life cycle framework as follows. A household receives a permanent shock to income when transitioning into period $t$, denoted by $\pshk_t$ (along with the age--education-specific average growth factor $\overline{\pshk}_{es}$), as well as an after tax transitory shock $\tshk_t$. The life cycle variant of the income process can be summarized by:
\begin{eqnarray*}
\yLev_t &=& \tshk_t \pLev_t = (1 - \tau)\theta_t \pLev_t,\\
\pLev_t &=& \pshk_t \overline{\pshk}_{es} \pLev_{t-1}.
\end{eqnarray*}
Households that have already lived for $s$ periods have permanent shocks drawn from a lognormal distribution with mean 1 and variance $\sigma^2_{\pshk s}$, and transitory shocks drawn from a lognormal distribution with mean $1/\erate$ and variance $\sigma^2_{\theta s}$ with probability $\erate = (1 - \urate)$ and a degenerate distribution at $\mu$ with probability $\urate$. The prospect of unemployment (at rate $\urate$) is a completely transitory event: unemployment in period $t$ has no effect on the probability of unemployment in period $t + 1$. The non-zero transitory shock when unemployed represents a welfare benefit funded by income taxes, as discussed below. When transitioning from one period to the next, a household with education $e$ that has already lived for $s$ periods faces a $\PDies_{es}$ probability of death. In the main specification, the assets of a household that dies are completely taxed by the government to fund activities outside the model.\footnote{As a further robustness check, we also estimate versions in which the assets of the newly deceased are distributed to a random household, with varying preferences for bequests. In an online appendix we show that under a wide range of parameters governing preferences over bequests, both the overall aggregate marginal propensity to consume and its decompositions by wealth and income are little changed from the original specification.
}
The household's permanent income level will be factored out from the problem, so that the only state variable that affects the choice of optimal consumption is normalized market resources $\mRat_t$. After this normalization, the household's budget transition functions can be described by:
\begin{eqnarray}
\label{LifeCycleConstraint1}
\aRat_t &=& \mRat_t - \cRat_t,\\
\label{LifeCycleConstraint2}
\kRat_{t+1} &=& \aRat_t/\pshk_{t+1},\\
\label{LifeCycleConstraint3}
\mRat_{t+1} &=& (\daleth +\rProd) \kRat_{t+1} + \tshk_{t+1},\\
\label{LifeCycleConstraint4}
\aRat_t &\geq& 0.
\end{eqnarray}
These transition constraints are identical to the perpetual youth model except that capital owned by surviving households does not grow with the inverse survival probability, and income is taxed at a marginal rate $\tau$ depending on the household's age and employment status.
Starting from some terminal age $\overline{s}$ at which $\PDies_{e\overline{s}} = 1$, a household's problem can be solved by backward induction until $s = 0$. At age $\overline{s}$, the household will consume all market resources, generating a consumption function of $\cLev_{e\overline{s}}(\mLev_t,\pLev_t) = \mLev_t = \mRat_t \pLev_t$ and a value function of $V_{e\overline{s}}(\mLev_t,\pLev_t) = \uFunc(\mLev_t) = \pLev_t^{1-\CRRA} \uFunc(\mRat_t)$. At any earlier age, the value function is recursively defined by:
\begin{equation}
\label{eq:LifeCycleValue}
V_{es}(\mLev_t,\pLev_t) = \max_{\cLev_t} \uFunc(\cLev_t) + \Discount \PLives_{es} \Ex_t \left[ V_{es+1}(\mLev_{t+1},\pLev_{t+1})\right] \text{ s.t. \eqref{LifeCycleConstraint1}--\eqref{LifeCycleConstraint4}}.
\end{equation}
To eliminate the permanent income level as a state variable, further define the normalized consumption function as $\cFunc_{es}(\mRat_t) = \cLev_{es}(\mLev_t,\pLev_t)/\pLev_t$ and the normalized value function as $\vFunc_{es}(\mRat_t) = V_{es}(\mLev_t,\pLev_t)/\pLev_t^{1-\CRRA}$. Dividing \eqref{eq:LifeCycleValue} by $\pLev_t^{1-\CRRA}$, the problem is reduced to a single state dimension and can be expressed as:
\begin{eqnarray}\label{eq:LifeCycleValue1}
\vFunc_{es}(\mRat_t) &=& \max_{\cRat_t} \uFunc(\cRat_t) + \Discount \PLives_{es} \Ex_t \left[\pshk_{t+1}^{1-\CRRA} \vFunc_{es+1}(\mRat_{t+1})\right] \text{ s.t. \eqref{LifeCycleConstraint1}--\eqref{LifeCycleConstraint4}},\\
\cFunc_{es}(\mRat_t) &=& \arg\max_{\cRat_t} \uFunc(\cRat_t) + \Discount \PLives_{es} \Ex_t \left[\pshk_{t+1}^{1-\CRRA} \vFunc_{es+1}(\mRat_{t+1})\right] \text{ s.t. \eqref{LifeCycleConstraint1}--\eqref{LifeCycleConstraint4}}. \nonumber
\end{eqnarray}
A standard envelope condition applies in this model, so that $\vFunc_{es}^{\prime}(\mRat_t) = \uFunc^{\prime}(\cFunc_{es}(\mRat_t))$, and the first order condition for the solution to \eqref{eq:LifeCycleValue1} is:
\begin{equation}
\cRat_t^{-\CRRA} = (\daleth +\rProd) \Discount \PLives \Ex_t \left[ (\pshk_{t+1} \cRat_{t+1})^{-\CRRA} \right].
\end{equation}
In this way, the value function need not be tracked or recorded during the solution process, as the age-dependent consumption functions are sufficient.\footnote{In practice, we use the method of endogenous gridpoints, as originally described in \cite{carrollEGM}, to discretize the state space and approximate consumption functions at each age and education level.}
\subsection{Macroeconomic Dynamics}
The analysis in section \ref{sec:MPC} demonstrated that while there is considerable variation in the marginal propensity to consume across income, wealth, and employment status, the MPC does not appreciably change depending on the structure of aggregate shocks to the economy nor to the current macroeconomic state. Moreover, for reasons previously discussed, it is fairly difficult to account for macroeconomic state variables in an overlapping generations model. Rather than expend significant energy on a feature that would yield little of interest, we do not model aggregate shocks in this section but instead focus on the effects of idiosyncratic shocks and household-level dynamics. However, there are some additional macroeconomic features of the model that warrant discussion.
Unlike the perpetual youth model, the economy is now perpetually growing, with each new cohort larger than the last and ongoing technological progress. The expected permanent income growth for a household $\overline{\pshk}_{es}$ comprises the household's own effective labor supply growth plus technological growth. When aggregating wealth, the contribution of a household that has already lived for $s$ quarters is thus discounted by a factor of $(1 + \Gamma)^{-s}$ relative to the youngest cohort, where $\Gamma$ is the technological growth rate. Moreover, older households were born into smaller cohorts relative to the newest generation, so our population weighting scheme scales their contribution by the population growth rate $N$.
As mentioned in section \ref{sec:LifeCycle}, households are subject to a tax rate of $\tau$ depending on their age and employment status. Households are assumed to retire at age 65 (i.e.\ when $s = 164$), captured in the model with an expected permanent growth factor well below 1 at this age.\footnote{The drop in permanent income at retirement depends on the household's education: dropouts' income fall by 44\%, high school graduates by 56\%, and college graduates by 69\%.} Income before retirement is earned through labor, while income after retirement is provided by a pay-as-you-go social security system funded by taxes on the employed. The social security tax rate is calculated as the rate that balances outlays to retired households and tax revenues from the working population:
\begin{equation*}
\tau_{SS} = \frac{\sum_{e \in \{D,HS,C\}} \Big[ \theta_e \overline{\pLev}_{e0} \sum_{t = 164}^{384} \big( ((1 + \Gamma)(1+N))^{-t} \prod_{s=0}^t ( \overline{\pshk}_{es} \PLives_{es} ) \big) \Big]}
{\sum_{e \in \{D,HS,C\}} \Big[ \theta_e \overline{\pLev}_{e0} \sum_{t = 0}^{163} \big( ((1 + \Gamma)(1+N) )^{-t} \prod_{s=0}^t ( \overline{\pshk}_{es} \PLives_{es} ) \big) \Big]}.
\end{equation*}
Here, $\theta_e$ is the proportion of each new generation with education level $e$, and $\overline{\pLev}_{e0}$ is the average permanent income of that education type when they enter the economy at age 24. Note that neither permanent nor transitory shocks are relevant, as they average to unity across a cohort. The tax to fund unemployment benefits is simply the product of the unemployment rate and the benefit replacement rate: $\tau_U = \urate \mu$. Employed households pay a total income tax rate of $\tau = \tau_{SS} + \tau_U$, while unemployed and retired households have $\tau = 0$.
\subsection{Calibration}
Calibrations of the distributional parameters are taken from related estimates in the literature. Average permanent income growth rates $\overline{\pshk}_{es}$ are calculated using the same trajectories as in \cite{Cagetti} for those with less than a high school education, a high school degree, and four or more years of college. The permanent and transitory shock variances are approximated from the results of \cite{SabelhausSong}, with extrapolation for ages 55--64.\footnote{We assume that $\sigma^2_{\pshk} = \sigma^2_{\theta} = 0$ in retirement, so there is no income risk.} Households are assumed to retire at age 65, withdrawing from the labor force and only receiving income from a pay-as-you-go social security system financed by taxes on the working population. Baseline mortality rates at each age are taken from the Social Security Administration's 2010 Actuarial Life Table,\footnote{Following the bulk of related literature, we use women's mortality rates to allow us to simulate households living past the husband's death.} then adjusted by education level using estimates by \cite{BrownLiebmanPollet} and converted to quarterly probabilities;\footnote{For ages 101--120, we use the adjustment for age 100, as this table does not extend to very late ages to which very few people live.} households die with certainty if they reach age 120. The unemployment benefit $\mu$ is set to 0.15 to match \cite{Cagetti}, while the unemployment probability is $\urate = 7\%$, the average rate in the perpetual youth model.
We assume that the population grows at a rate of 1\% annually, while total factor productivity grows at a 1.5\% annual rate; these approximately match long run rates in the United States. Educational attainment rates are set to be fairly consistent with U.S. educational rates over the past twenty years, and average initial permanent (quarterly) income at age 24 for each educational group are roughly calibrated to recent data.\footnote{Precision here is unimportant: after several years of simulation, the initial permanent income differences between types matters much less than their income growth trajectories and idiosyncratic shocks.} Each simulated household is given an initial lognormal shock to permanent income with standard deviation 0.4, approximately matching the total variance of income among young households in the SCF 2004 data. Households begin with a very low wealth to permanent income ratio, drawn uniformly from $\{0.17,0.50,0.83\}$. Other basic parameters are set to match the values used in the perpetual youth model. A summary of the model parameters is provided in Table \ref{table:ParametersLifeCycle}.
\begin{table} \large
\caption{Parameter Values in the Life Cycle Model}
\label{table:ParametersLifeCycle}
\begin{center}
\begin{tabular}{l c c}
\toprule
Description & Parameter & Value \\
\midrule
Coefficient of relative risk aversion & \CRRA & 1 \\
Effective interest rate & $(\rProd - \delta)$ & 0.01 \\
Population growth rate & $N$ & 0.0025 \\
Technological growth rate & $\Gamma$ & 0.0037 \\
Rate of high school dropouts & $\theta_D$ & 0.11 \\
Rate of high school graduates & $\theta_{HS}$ & 0.55 \\
Rate of college graduates & $\theta_C$ & 0.34 \\
Average initial permanent income, dropout & $\overline{\pLev}_{D0}$ & 5000 \\
Average initial permanent income, high school & $\overline{\pLev}_{HS0}$ & 7500 \\
Average initial permanent income, college & $\overline{\pLev}_{C0}$ & 12000 \\
Unemployment insurance payment & $\mu$ & 0.15 \\
Unemployment rate & $\urate$ & 0.07 \\
Labor income tax rate & $\tau$ & 0.0942 \\
\bottomrule
\end{tabular}
\end{center}
\end{table}
\subsection{Aggregate Marginal Propensity to Consume}
Following the same procedure as in the benchmark perpetual youth model, we first assume that all households have the same time preference factor $\grave{\Discount}$, as in the \Discount-Point model. Seeking the value of $\grave{\Discount}$ at which the aggregate capital to income ratio matches that of the perfect foresight version of the perpetual youth model ($\KLev/\YLev=10.26$), we find $\grave{\Discount} = 0.9936$. As before, the simulated distribution of wealth in the \Discount-Point life cycle model matches the empirical distribution considerably better than the KS-JEDC model; indeed, the life cycle model has a somewhat better fit than the perpetual youth model, moving about two thirds of the way from the KS-JEDC's Lorenz curve to the empirical distribution, rather than one third.\footnote{The Lorenz distance declines from 16 for the \Discount-Point model to less than 1 for the \Discount-Dist model.}
The additional wealth heterogeneity arises through differences in households' expectations of the future that were suppressed in the perpetual youth model: income growth rates vary with both education and age (particularly the timing of retirement), while the increasing probability of death plays a key role in older households' target wealth-to-income ratio.
To better fit the distribution of wealth, we again estimate the \Discount-Dist model by minimizing the distance between empirical and simulated shares of wealth, as in \eqref{eq:MinimizationProb}.\footnote{We implicitly assume that the distribution of discount factors is independent from education type. More realistically, individuals with higher discount factors are more likely to remain in school longer. As this would tend to make high income types retain even more assets for the future while low income types will save even less, we would need a narrower range of discount factors to match observed wealth inequality. For this reason and for the sake of simplicity, we ignore this complicating factor.} Estimation reveals that the optimal parameters are $\{\grave{\Discount},\nabla\} = \{0.9814, 0.0182\}$, a wider band of discount factors than in the perpetual youth model. As the life cycle model introduces additional channels of heterogeneity that generate a concentrated distribution of wealth, one might reasonably expect that \textit{less} discount factor heterogeneity is needed to match the empirical Lorenz curve.
\begin{figure}
\caption{Aggregate Capital to Output Ratio by Homogeneous Discount Factor}
\label{KYratioByBeta}
\CDCFig{KYratioByBeta}
\end{figure}
Recall that in the perpetual youth model, consumers must be sufficiently impatient in order to have a target wealth-to-income ratio: The discount factor has to meet the `Growth-Impatience Condition' \eqref{eq:GIC}. When the GIC does not hold, households accumulate wealth without bound.\footnote{Even when the GIC fails, a finite K/Y ratio for the entire economy can exist because households are finitely lived-- they die long before acquiring infinite wealth.} As $\Discount$ increases toward the boundary of the GIC, target wealth rapidly increases toward infinity, so that small differences in $\Discount$ translate into great wealth heterogeneity (shown in Figure \ref{KYratioByBeta}).\footnote{Figure \ref{KYratioByBeta} holds $\mathsf{R}$ fixed at its steady state of 1.01, so it should be interpreted as the $K/Y$ ratio in a small open economy or for a \textit{small subset} of agents with a particular discount factor.} In the finite-horizon life-cycle model, however, no impatience condition is required---households face an increasing mortality rate and thus will target a finite wealth ratio \textit{in a finite number of periods}, no matter how patient they are. Consequently, average wealth is a much flatter function of $\Discount$ and thus the interval needed to match the SCF data is wider.
\begin{figure}
\caption{Distribution of Net Worth (Lorenz Curve)---Life Cycle Model}
\label{LorenzLifecycle}
\CDCFig{LorenzLifecycle}
\footnotesize Notes: The solid curve shows the distribution of net worth in the 2004 \emph{Survey of Consumer Finances}.
\end{figure}
The \Discount-Dist model is able to match the empirical Lorenz curve extremely well for the bottom 85\% of the wealth distribution: the average difference between simulated and actual wealth shares at the levels of interest is less than 0.4\% (Figure~\ref{LorenzLifecycle}). Indeed, the life cycle model matches the low asset holdings of the bottom half of the population significantly better than the perpetual youth model.
However, the wealth share of the top 10\%\ in the life-cycle \Discount-Dist model is somewhat lower than in the data. In contrast, the perpetual youth model matches the Lorenz curve fairly well even in the top tail. This also seems to be a result of the (lack of a) GIC: the lifecycle model does not have households with a very high target wealth ratio and thus cannot generate an extreme concentration of wealth in the top 1\%. This is not a serious deficiency as the consumption function is roughly linear at higher levels of wealth and as we are concerned with the aggregate marginal propensity to consume and the MPC particularly among non-wealthy households.
The right-hand panel of Table \ref{table:MPCall} shows that, across all households, the aggregate (annual) marginal propensity to consume in both the \Discount-Point (0.16) and \Discount-Dist (0.33) models is similar to the corresponding averages in the perpetual youth model.\footnote{When the annual marginal propensity to consume is calculated by simulating the change in consumption over four quarters resulting from an unexpected \$1000 payment to each household, we find an aggregate value of 0.28, substantially the same and confirming the corresponding exercise in the perpetual youth model.}$^{,}$\footnote{Without much comment, we also present estimates of the \Discount-Dist model when matching the empirical distribution of liquid financial and retirement assets rather than net worth, along with subpopulation average MPCs for these models. In each case, the results of the life cycle model align very well with the earlier findings in the perpetual youth setting.} Further, the relationship between wealth-to-permanent income and the MPC is nearly identical to the pattern in the perpetual youth case, with the MPC slowly rising with lower incomes among the wealthier half of the population, and spiking rapidly among the bottom half. However, the gradient of income to MPC is much shallower in the life-cycle model, with the wealthiest 1\% of households' MPC only 20\% less than the poorest half, rather than 50\% less in the benchmark model. This is likely due to confounding effects from life-cycle dynamics: income-poor households are made up of both the young (who have not had time to accumulate income growth) and the retired (whose cohorts began with lower initial permanent income and have experienced the large negative wage growth from retirement).\footnote{%
While the ratio of wealth to permanent income is a very strong determinant of the MPC, the wide distribution of household incomes allows for even wealthy households to have high MPCs. Confirming a similar exercise in the benchmark model, we again find that among the one third of households with the highest MPCs, 51\% are in the lowest wealth quintile, 32\% are in the second wealth quintile, and 14\% are in the middle wealth quintile. Even in a life cycle model in which wealth is highly correlated with both age and the marginal propensity to consume, there is still a significant fraction of ``wealthy hand-to-mouth'' households as found in \cite{kaplanViolanteWeidner_wealthyH2M}.}
\begin{figure}
\caption{Aggregate Marginal Propensity to Consume by Age}
\label{fig:MPCbyAge}
\begin{center}
\CDCFig{MPCbyAge}
\end{center}
\end{figure}
Figure \ref{fig:MPCbyAge} presents the aggregate marginal propensity to consume by age for the entire population, as well as for the most patient and least patient types in the $\Discount$-Dist model. After an initial drop as households build up a minimum buffer stock, the life cycle profile of the MPC takes an inverted U-shape for most $\Discount$ types: rising during the rapid income growth ages of 30--40 before falling as households anticipate their retirement and seek to retain assets to consume in old age. Post retirement, the MPC steadily grows as agents experience an ever increasing mortality risk. The most impatient households, with a quarterly discount factor of about $\beta = 0.9654$, have a significantly higher MPC throughout life as they disfavor saving---they begin saving for retirement less than ten years prior, and quickly deplete their assets if they live beyond age 75 (as evidenced by MPCs approaching 1 at these ages). In contrast, the most patient households show an increasing marginal propensity to consume for their entire lives, though beginning from very low levels.
\section{Conclusion}\label{sec:Conclusion}
We have shown that a model with a realistic microeconomic income
process and modest heterogeneity in time preference rates is able to
match the observed degree of inequality in the wealth distribution.
Because many households in our model accumulate very little wealth,
the aggregate marginal propensity to consume out of transitory income
implied by our model, roughly 0.2--0.4 depending on the measure of
wealth we ask our model to target, is consistent with most of the large estimates of
the MPC reported in empirical studies. Indeed, some of the
dispersion in MPC estimates from the microeconomic literature (where
estimates range up to 0.75 or higher) might be explainable by the
model's implication that there is no such thing as ``the'' MPC---the
aggregate response to a transitory income shock should depend on
details of the recipients of that shock in ways that the existing
literature may not have been sensitive to (or may not have been able
to measure). If some of the experiments reported in the literature
reflected shocks that were concentrated in different regions of the
wealth distribution than other experiments, considerable variation in
empirical MPCs would be an expected consequence of the differences
in the experiments.
Additionally, our work provides researchers with an easier framework
for solving, estimating, and simulating economies with heterogeneous
agents and realistic income processes than has heretofore been
available. Although benefiting from the important insights of \citet{ksHetero},
our framework is faster and easier to solve than the KS model or many of its
descendants, and thus can be used as a convenient building block for
constructing micro-founded models for policy-relevant analysis.
\small
\input econtexBibMake
\end{document}
% Local Variables:
% mode: LaTeX
% TeX-PDF-mode: t
% TeX-parse-self: t
% TeX-auto-save: t
% End:
|
http://porocila.imfm.si/2005/rac/gosti.tex
|
imfm.si
|
CC-MAIN-2020-29
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2020-29/segments/1593655924908.55/warc/CC-MAIN-20200711064158-20200711094158-00534.warc.gz
| 109,423,967
| 1,191
|
\naslov{TUJI GOSTI}
\label{om:gosti}
Oddelek za teoreti\v cno ra\v cunalni\v stvo je v letu 2005 gostil naslednje tuje goste:
\begin{seznam}
\gost {Sergei A.\ Abramov} {13 dni} {Moskovska državna univerza M.~V.~Lo\-mo\-no\-so\-va}
{Moskva} {Rusija} {maj} {2005} {Marka Petkov\v ska}
\gost {Jean-Pierre Demailly} {1 dan} {Institut Fourier} {Grenoble} {Francija} {december}
{2005} {Toma\v{z}a Pisanskega}
\gost {Ante Graovac} {6 dni} {Institut Ruđer Bošković} {Zagreb} {Hrva\v{s}ka}
{december} {2005} {Janeza Žerovnika}
\gost {Peter Gruber} {3 dni} {Technische Universit\"at Wien} {Dunaj} {Avstrija}
{april} {2005} {Toma\v{z}a Pisanskega}
\gost {Adriaan Peeters} {4 dni} {Universiteit Gent} {Gent} {Belgija} {oktober}
{2005} {Toma\v{z}a Pisanskega}
\gost {Andrea Schaerf} {1 dan} {Universit\`a di Udine} {Udine} {Italija}
{februar} {2005} {Janeza Žerovnika}
\gost {Brigitte Servatius} {1 mesec} {Worchester Polytechnic Institute} {Worchester}
{Velika Britanija} {maj--junij} {2005} {Toma\v{z}a Pisanskega}
\gost {Alex Simpson} {3 mesece} {University of Edinburgh} {Edinburgh} {Velika Britanija}
{julij--september} {2005} {Andreja Bauerja}
\end{seznam}
%(AZ)) 29.7.2006 23:49:33
|
http://dlmf.nist.gov/18.9.E16.tex
|
nist.gov
|
CC-MAIN-2016-50
|
application/x-tex
| null |
crawl-data/CC-MAIN-2016-50/segments/1480698543577.51/warc/CC-MAIN-20161202170903-00382-ip-10-31-129-80.ec2.internal.warc.gz
| 73,893,685
| 665
|
\[\frac{d}{dx}\left((1-x)^{\alpha}(1+x)^{\beta}\mathop{P^{(\alpha,\beta)}_{n}\/}%
\nolimits\!\left(x\right)\right)=-2(n+1)(1-x)^{\alpha-1}(1+x)^{\beta-1}\mathop%
{P^{(\alpha-1,\beta-1)}_{n+1}\/}\nolimits\!\left(x\right).\]
|
http://itex.coastal.cheswick.com/itex_server/latex/pg/27775/27775.tex
|
cheswick.com
|
CC-MAIN-2017-17
|
application/x-tex
| null |
crawl-data/CC-MAIN-2017-17/segments/1492917125532.90/warc/CC-MAIN-20170423031205-00298-ip-10-145-167-34.ec2.internal.warc.gz
| 190,876,326
| 65,161
|
\documentclass[12pt]{book}
\usepackage{parskip}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
%% \usepackage{mathptmx} % times roman
%%\usepackage{lucidabr} % lucida bright
\usepackage{pos} % generate iTeX page position data
\usepackage[pdftex,bookmarks=true,bookmarksopen=true,
bookmarksnumbered=true,bookmarksopenlevel=3,
colorlinks,urlcolor=blue,linkcolor=blue,
pdftitle={Des Feldpredigers Schmelzle Reise nach},
pdfauthor={},
citecolor=blue]{hyperref}
\newcommand{\mdsh}[1]{\mbox{#1}\linebreak[1]}
\newcommand{\nodate}{\date{}}\nodate
\newcommand{\gutchapter}[1]{%
\cleardoublepage
\chapter{#1}
\markboth{Des Feldpredigers Schmelzle Reise nach}{#1}
}
% \setcounter{chapter}{1}
\begin{document}
\pagenumbering{alph} % bogus, never shown, names don't collide with below
\title{Des Feldpredigers Schmelzle Reise nach}
\author{}
\maketitle
\pagenumbering{roman}
\frontmatter
The Project Gutenberg EBook of Des Feldpredigers Schmelzle Reise nach
Fl\"{a}tz mit fortgehenden Noten, by Jean Paul
This eBook is for the use of anyone anywhere at no cost and with
almost no restrictions whatsoever. You may copy it, give it away or
re-use it under the terms of the Project Gutenberg License included
with this eBook or online at www.gutenberg.net
This text was converted to LaTeX by means of \textbf{GutenMark} software (version Jul 12 2014).
The text has been further processed by software
in the iTeX project, by Bill Cheswick.
\cleardoublepage
\tableofcontents
\cleardoublepage
\mainmatter
\pagenumbering{arabic}
\gutchapter{Title: Des Feldpredigers Schmelzle Reise nach Fl\"{a}tz mit fortgehenden Noten}
Author: Jean Paul
Illustrator: Karl Thylmann
Release Date: January 12, 2009 [EBook \#27775]
Language: German
*** START \textit{of} \textit{this} \textit{Project} \textit{gutenberg} EBOOK \textit{des} \textit{Feldpredigers} \textit{Schmelzle} \textit{Reise} ***
Produced by Norbert H. Langkau, Itay Perl, Jana Srna and the Online Distributed Proofreading Team at http://www.pgdp.net
[ Anmerkungen zur Transkription:
Im Original gesperrt gedruckter Text wurde mit = markiert.
Im Original nicht in Fraktur gedruckter Text wurde mit \_ markiert.
Schreibweise und Interpunktion des Originaltextes wurden \"{u}bernommen;
lediglich offensichtliche Druckfehler wurden korrigiert. Eine Liste
der vorgenommenen \"{A}nderungen findet sich am Ende des Textes.
Die $\gg$fortgehenden Noten$\ll$ (siehe die Vorrede des Verfassers, Punkt 2)
wurden an ihren urspr\"{u}nglichen Stellen im Text belassen. Um sie vom
Haupttext abzusetzen und damit die Lesbarkeit zu erh\"{o}hen, wurden sie
vier Zeichen einger\"{u}ckt.
]
[Illustration: Attila Schmelzle]
Des
Feldpredigers Schmelzle
Reise nach Fl\"{a}tz
mit fortgehenden Noten;
von
Jean Paul.
Leipzig
Kurt Wolff Verlag
1917.
Mit acht Kupfern
von
Karl Thylmann
2. Abdruck
Vorrede des Verfassers.
Ich glaube, mit drei Worten ist sie gemacht, so wie der Mensch und seine
Bu\ss{}e aus ebenso vielen Teilen.
1) Das erste Wort ist \"{u}ber den Zirkelbrief des Feldpredigers Schmelzle zu sagen, worin er seinen Freunden seine Reise nach der Hauptstadt Fl\"{a}tz beschreibt, nachdem er in einer Einleitung einige Beweise und Versicherungen seines Mutes vorausgeschickt. Eigentlich ist selber die Reise nur dazu bestimmt, seine vom Ger\"{u}chte angefochtene Herzhaftigkeit durch lauter Tatsachen zu bew\"{a}hren, die er darin erz\"{a}hlt. Ob es nicht inzwischen feine Nasen von Lesern geben d\"{u}rfte, welche aus einigen darunter gerade umgekehrt schlie\ss{}en, seine Brust sei nicht \"{u}berall bombenfest, wenigstens auf der linken Seite, dar\"{u}ber lass' ich mein Urteil schweben.
\"{U}brigens bitte ich die Kunstkenner sowie ihren Nachtrab, die Kunstrichter, diese Reise, f\"{u}r deren Kunstgehalt ich als Herausgeber verantwortlich werde, blo\ss{} f\"{u}r ein Portr\"{a}t (im franz\"{o}sischen Sinne), f\"{u}r ein Charakterst\"{u}ck zu halten. Es ist ein will- oder unwillk\"{u}rliches Lustst\"{u}ck, bei dem ich so oft gelacht, da\ss{} ich mir f\"{u}r die Zukunft \"{a}hnliche Charaktergem\"{a}lde zu machen vorgesetzt. --- Wann k\"{o}nnte indes ein solches Lustst\"{u}ckchen schicklicher der Welt ausgestellt und beschert werden, als eben in Zeiten, wo schweres Geld und leichtes Gel\"{a}chter fast ausgeklungen haben, zumal da wir jetzt wie T\"{u}rken blo\ss{} mit Beuteln rechnen und zahlen (der Inhalt ist heraus) und mit Herzbeuteln (der Inhalt ist darin)?---
Ver\"{a}chtlich w\"{u}rde mir's vorkommen, wenn irgendein roher Tintenknecht r\"{u}gend und \"{o}ffentlich anfragte, auf welchen Wegen ich zu diesem Selbst-Kabinetts-St\"{u}cke Schmelzles gekommen sei. Ich wei\ss{} sie gut und sage sie nicht. Dieses fremde Lustst\"{u}ck, wof\"{u}r ich allerdings (mein Verleger bezeugt's) den Ehrensold selber beziehe, \"{u}berkam ich so rechtlich, da\ss{} ich unbeschreiblich ruhig erwarte, was der Feldprediger gegen die Herausgabe sagt, falls er nicht schweigt. Mein Gewissen b\"{u}rgt mir, da\ss{} ich wenigstens auf ehrlicheren Wegen zu diesem Besitztume gekommen, als die sind, auf denen Gelehrte mit den Ohren stehlen, welche als geistige H\"{o}rsaalshausdiebe und Kathederschnapph\"{a}hne und Kreuzer die erbeuteten Vorlesungen in den Buchdruckereien ausschiffen, um sie im Lande als eigene Erzeugnisse zu verhandeln. Noch hab' ich wenig mehr in meinem Leben gestohlen, als jugendlich zuweilen --- Blicke.
2) Das zweite Wort soll die auffallende, mit einem Notensouterrain durchbrochene Gestalt des Werkleins entschuldigen. Sie gef\"{a}llt mir selber nicht. Die Welt schlage auf und schaue hinein und entscheide ebenfalls. Aber folgender Zufall zog diese durch das ganze Buch streichende Teilungslinie: ich hatte meine eigenen Gedanken (oder Digressionen), womit ich die des Feldpredigers nicht st\"{o}ren durfte, und die blo\ss{} als Noten hinter der Linie fechten konnten, aus Bequemlichkeit in ein besonderes Manuskript zusammengeschrieben, und jede Note ordentlich, wie man sieht, mit ihrer Nummer versehen, die sich blo\ss{} auf die Seitenzahl des fremden Hauptmanuskripts bezog; ich hatte aber bei dem Kopieren des letzteren vergessen, in den Text selber die entsprechende einzuschreiben. Daher werfe niemand, sowenig als ich, einen Stein auf den guten Setzer, da\ss{} dieser --- vielleicht in der Meinung, es geh\"{o}re zu meiner Manier, worin ich etwas suchte --- die Noten geradeso, wie sie ohne Rangordnung der Zahlen untereinander standen, unter den Text hinsetzte, jedoch durch ein sehr lobensw\"{u}rdiges k\"{u}nstliches Ausrechnen wenigstens daf\"{u}r sorgte, da\ss{} unter jede Textseite etwas von solchem gl\"{a}nzenden Notenniederschlag k\"{a}me. ------ Nun, die Sache ist einmal geschehen, ja verewigt, n\"{a}mlich gedruckt. Am Ende sollte ich mich eigentlich dar\"{u}ber erfreuen. In der Tat --- und h\"{a}tt' ich jahrelang darauf gesonnen (wie ich's bisher seit zwanzigen getan), um f\"{u}r meine Digressionskometenkerne neue Lichth\"{u}lsen, wenn nicht Zugsonnen, f\"{u}r meine Episoden neue Epop\"{o}en zu erdenken: schwerlich h\"{a}tt' ich f\"{u}r solche S\"{u}nden einen besseren und ger\"{a}umigeren S\"{u}ndenbalg erfunden, als hier Zufall und Setzer fertig gemacht darreichen. Ich habe nur zu beklagen, da\ss{} die Sache gedruckt worden, eh' ich Gebrauch davon machen k\"{o}nnen. Himmel! welche fernsten Anspielungen (h\"{a}tt' ich's vor dem Drucke gewu\ss{}t) w\"{a}ren nicht in jeder Textseite und Notennummer zu verstecken gewesen, und welche scheinbare Unangemessenheit in die wirkliche Gemessenheit und ins Notenuntere der Karten; wie empfindlich und boshaft w\"{a}re nicht die H\"{o}he und auf die Seite herauszuhauen gewesen, aus den sicheren Kasematten und Minierg\"{a}ngen unten, und welche \textit{laesio ultradimidium} (Verletzung \"{u}ber die H\"{a}lfte des Textes) w\"{a}re nicht mit satirischen Verletzungen zu erf\"{u}llen und zu erg\"{a}nzen gewesen!
Aber das Schicksal wollte mir nicht so gut; ich sollte von diesem goldenen Handwerksboden f\"{u}r Satiren erst etwas erfahren drei Tage vor der Vorrede.
Vielleicht aber holt die Schreibwelt --- bei dem Fl\"{a}mmchen dieses Zufalls --- eine wichtigere Ausbeute, einen gr\"{o}\ss{}eren unterirdischen Schatz herauf, als leider ich gehoben; denn nun ist dem Schriftsteller ein Weg gezeigt, in einem Marmorbande ganz verschiedene Werke zu geben, auf einem Blatte zugleich f\"{u}r zwei Geschlechter, ohne deren Vermischung, ja f\"{u}r f\"{u}nf Fakult\"{a}ten zugleich, ohne deren Grenzverr\"{u}ckung, zu schreiben, indem er, statt ein ekles, g\"{a}rendes Allerlei f\"{u}r niemand zu brauen, blo\ss{} dahin arbeitet, da\ss{} er Notenlinien oder Demarkationslinien zieht und so auf dem n\"{a}mlichen f\"{u}nfst\"{o}ckigen Blatte die un\"{a}hnlichsten K\"{o}pfe behauset und bewirtet. Vielleicht l\"{a}se dann mancher ein Buch zum vierten Male, blo\ss{}, weil er jedesmal nur ein Viertel gelesen.
Wenigstens den Wert hat dieses Werk, da\ss{} es ein Werkchen ist, und klein genug; so da\ss{} es, hoff' ich, jeder Leser fast schon im Buchladen schnell durchlaufen und auslesen kann, ohne es, wie ein dickes, erst deshalb kaufen zu m\"{u}ssen. --- Und warum soll denn \"{u}berhaupt auf der K\"{o}rperwelt etwas anderes gro\ss{} sein, als nur das, was nicht zu ihr geh\"{o}rt, die Geisterwelt?---
=Baireuth=,
im Heu- und Friedensmonat 1807.
=Jean Paul Fr. Richter.=
[Illustration: Der Blitzschirm ist n\"{a}mlich ganz der Reimarus'sche]
Zirkelbrief des vermutlichen katechetischen Professors =Attila Schmelzle= an seine Freunde, eine Ferienreise nach Fl\"{a}tz enthaltend, samt einer Einleitung, sein Davonlaufen und seinen Mut als voriger Feldprediger betreffend.
Nichts ist wohl l\"{a}cherlicher, meine werten Freunde, als wenn man einen Mann f\"{u}r einen Hasen ausgibt, der vielleicht gerade mit den entgegengesetzten Fehlern eines L\"{o}wen k\"{a}mpft, wiewohl nun auch der afrikanische Leu seit Sparrmanns Reise als ein Feigling zirkuliert. Ich bin indes in diesem Falle, Freunde, wovon ich sp\"{a}ter reden werde, ehe ich meine
\begin{quotation}
[103] Gute F\"{u}rsten bekommen leicht gute Untertanen (nicht so leicht diese jene); so wie Adam im Stande der Unschuld die Herrschaft \"{u}ber die Tiere hatte, die alle zahm waren und blieben, bis sie blo\ss{} mit ihm verwilderten und fielen.\end{quotation}
Reise beschreibe. Ihr freilich wi\ss{}t alle, da\ss{} ich gerade umgekehrt den Mut und den Waghals (ist er nur sonst kein Grobian) verg\"{o}ttere, zum Beispiel meinen Schwager, den Dragoner, der wohl nie in seinem Leben einen Menschen allein ausgepr\"{u}gelt; sondern immer einen ganzen geselligen Zirkel zugleich. Wie furchtbar war nicht meine Phantasie schon in der Kindheit, wo ich, wenn der Pfarrer die stumme Kirche in einem fort anredete, mir oft den Gedanken: $\gg$wie, wenn du jetzt geradezu aus dem Kirchenstuhle hinauf schrieest: ich bin auch da, Herr Pfarrer!$\ll$ so gl\"{u}hend ausmalte, da\ss{} ich vor Grausen hinaus mu\ss{}te! --- So etwas wie Rugendas' Schlachtst\"{u}cke --- entsetzliches Mordget\"{u}mmel --- Seetreffen und Landst\"{u}rme bei Toulon --- auffliegende Flotten --- und in der Kindheit Prager Schlachten auf Klavieren --- und kurz, jede Karte von einem reichen Kriegsschauplatz; dies sind vielleicht zu sehr meine Liebhabereien und ich lese --- und kaufe nichts lieber; es k\"{o}nnte
[5] Denn ein guter Arzt rettet, wenn nicht immer von der Krankheit,
doch von einem schlechten Arzt.
mich oft zu manchem versuchen, hielt mich nicht meine Lage aufrecht. Soll indes rechter Mut etwas H\"{o}heres sein, als blo\ss{}es Denken und Wollen: so genehmigt ihr es am ersten, Werteste, wenn auch der meinige einst dadurch in t\"{a}tige Worte ausbrechen will, da\ss{} ich meinen k\"{u}nftigen Katecheten, so gut es in Vorlesungen m\"{o}glich, zu christlichen Heroen st\"{a}hle. --- Es ist bekannt, da\ss{} ich immer, wenigstens zehn Acker weit, von jedem Ufer voll Badeg\"{a}ste und Wasserschwimmer fern spazieren gehe, um f\"{u}r mein Leben zu sorgen, blo\ss{} weil ich voraussehe, da\ss{} ich, falls einer davon ertrinken wollte, ohne weiteres (denn das Herz \"{u}berfl\"{u}gelt den Kopf) ihm, dem Narren, rettend nachspringen w\"{u}rde, in irgendeine bodenlose Tiefe hinein, wo wir beide ers\"{o}ffen. --- Und wenn das Tr\"{a}umen der Widerschein des Wachens ist, so frag' ich euch, Treue, erinnert ihr euch nicht mehr, da\ss{} ich euch Tr\"{a}ume von mir erz\"{a}hlt habe, deren sich kein C\"{a}sar, Alexander und
[100] Die B\"{u}cher liegen voll Ph\"{o}nixasche eines tausendj\"{a}hrigen
Reichs und Paradieses; aber der Krieg weht und viel Asche verst\"{a}ubt.
Luther sch\"{a}men darf? Hab' ich nicht --- um nur an einige zu erinnern --- Rom gest\"{u}rmt und mich mit dem Papste und dem Elefantenorden des Kardinalkollegiums zugleich duelliert? Bin ich nicht zu Pferde, worauf ich als Revuezuschauer gesessen, in ein \textit{bataillon quarr\'{e}} eingebrochen und habe in Aachen die Per\"{u}cke Karls des Gro\ss{}en, wof\"{u}r die Stadt j\"{a}hrlich zehn Rtlr. Frisiergeld zahlt, und darauf in Halberstadt von Gleim Friedrichs Hut erobert, und beide aufeinander aufgesetzt und habe mich doch noch umgekehrt, nachdem ich vorher auf einem erst\"{u}rmten Walle die Kanone gegen den Kanonier selber umgekehrt? --- habe ich nicht mich beschneiden und doch als Jude mich z\"{a}hlen lassen, und mit Schinken bewirten, wiewohl's Affenschinken am Orinoko waren (nach Humboldt)? Und tausend dergleichen; denn zum Beispiel den Fl\"{a}tzer Konsistorialpr\"{a}sidenten hab' ich aus dem Schlo\ss{}fenster geworfen --- Knall- oder Allarmfidibus von
[102] Lieber politischer und religi\"{o}ser Inquisitor! Die Turiner
Lichtchen leuchten ja erst recht, wenn du sie zerbrichst, und z\"{u}nden
dann sogar.
Heinrich Backofen in Gotha, das Dutzend zu 6Gr., und jeder wie eine Kanone knallschlagend, hab' ich so ruhig angeh\"{o}rt, da\ss{} die Fidibus mich nicht einmal aufweckten --- und mehr.
Doch genug! Es ist Zeit, mit wenigem die Verleumdung meines Feldpredigeramtes, die leider auch in Fl\"{a}tz uml\"{a}uft, blo\ss{} dadurch, wie ein C\"{a}sar den Alexander zu zerst\"{a}uben, da\ss{} ich sie ber\"{u}hre. Es sei daran wahr was wolle, es ist immer wenig oder gar nichts. Euer gro\ss{}er Minister und General in Fl\"{a}tz --- vielleicht der gr\"{o}\ss{}te \"{u}berall --- denn es gibt nicht viele Schabacker --- konnte allerdings wie jeder gro\ss{}e Mann gegen mich eingenommen werden, doch nicht mit dem Gesch\"{u}tz der Wahrheit; denn letzteres stell' ich euch hierher, ihr Herzen, und dr\"{u}ckt ihr's nur zu meinem Besten ab! Es laufen n\"{a}mlich im Fl\"{a}tzischen unsinnige Ger\"{u}chte um, da\ss{} ich aus bedeutenden Schlachten Rei\ss{}aus genommen
[86] So wahr! In der Jugend liebt und genie\ss{}t man un\"{a}hnliche Freunde
fast mehr, als im Alter die \"{a}hnlichsten.
(so p\"{o}belhaft spricht man), und da\ss{} nachher, als man Feldprediger zu Dank- und Siegespredigten gesucht, nichts zu haben gewesen. Das L\"{a}cherliche davon erhellt wohl am besten, wenn ich sage, da\ss{} ich in gar keinem Treffen gewesen bin, sondern mehrere Stunden vor demselben mich so viele Meilen r\"{u}ckw\"{a}rts dahin gezogen habe, wo mich unsere Leute, sobald sie geschlagen worden, notwendig treffen mu\ss{}ten. Zu keiner Zeit, ist der R\"{u}ckzug wohl so gut --- ein guter aber wird f\"{u}r das Meisterst\"{u}ck der Kriegskunst gehalten --- und mit solcher Ordnung, St\"{a}rke und Sicherheit zu machen, als eben vor dem Treffen, wo man ja nicht geschlagen ist.
Ich k\"{o}nnte zwar als hoffentlicher Professor der Katechetik zu solchen Verumfeiungen meines Mutes still sitzen und l\"{a}cheln --- denn schmied' ich meine k\"{u}nftigen Katecheten durch sokratisches Fragen zum Weiterfragen zu: so hab' ich sie zu Helden geh\"{a}rtet, da nichts gegen sie zu Felde zieht als Kinder --- Katecheten
[128] In der Liebe gibt's Sommerferien; aber in der Ehe gibt's auch
Winterferien, hoff' ich.
d\"{u}rfen ohnehin Feuer f\"{u}rchten, nur Licht nicht, da in unseren Tagen wie in London die Fenster eingeworfen werden, wenn sie nicht erleuchtet sind, anstatt da\ss{} es sonst den V\"{o}lkern mit dem Lichte ging wie den Hunden mit dem Wasser, die, wenn man ihnen lange keins gibt, endlich die Scheu vor dem Wasser bekommen --- und \"{u}berhaupt s\"{a}uselt f\"{u}r Katecheten jeder Park lieblicher und wohlriechender als ein schwefelhafter Artilleriepark, und der Kriegsfu\ss{}, worauf die Zeit gesetzt wird, ist ihnen der wahre teuflische Pferdefu\ss{} der Menschheit.------
Aber ich denke anders --- ordentlich als w\"{a}re der Patengeist des Taufnamen Attila mehr, als sich's geh\"{o}rt, in mich gefahren, ist
\begin{quotation}
[143] Die Weiber haben w\"{o}chentlich wenigstens einen aktiven und passiven =Neids=tag, den heiligen, den Sonntag; --- nur die h\"{o}hern St\"{a}nde haben mehr Sonn- als Werkeltage, so wie man in gro\ss{}en St\"{a}dten seinen Sonntag schon Freitags mit einem T\"{u}rken feiern kann, Sonnabends mit einem Juden, Sonntags mit sich selbst. Weiber gleichen k\"{o}stlichen Arbeiten aus Elfenbein, nichts ist wei\ss{}er und gl\"{a}tter und nichts wird leichter gelb.\end{quotation}
mir daran gelegen, immer nur meinen Mut zu beweisen, was ich denn hier wieder mit einigen Zeilen tun will, teuerste Freunde! Ich k\"{o}nnte diese Beweise schon durch blo\ss{}e Schl\"{u}sse und gelehrte Zitate f\"{u}hren. Zum Beispiel wenn Galen bemerkt, da\ss{} Tiere mit gro\ss{}en Hinterbacken sch\"{u}chtern sind: so brauch' ich blo\ss{} mich umzuwenden und dem Feinde nur den R\"{u}cken --- und was darunter ist --- zu zeigen, wenn er sehen soll, da\ss{} es mir nicht an Tapferkeit fehlt, sondern an Fleisch. --- Wenn nach bekannten Erfahrungen Fleischspeisen herzhaft machen: so kann ich dartun, da\ss{} ich hierin keinem Offizier nachstehe, welcher bei seinem Speisewirt gro\ss{}e Bratenrechnungen nicht nur machen, sondern auch unsaldiert bestehen l\"{a}\ss{}t, um zu jeder Stunde, sogar bei seinem Feinde selber (dem Wirte), ein offenes Dokument zu haben, da\ss{} er das Seinige (und Fremdes dazu) gegessen, und gemeines Fleisch auf den Kriegsfu\ss{} gesetzt,
[34] Nur die kleinen Tapeten- und Hintert\"{u}ren sind die Gnadent\"{u}ren;
das gro\ss{}e Tor ist die Ungnadent\"{u}re, die Fl\"{u}gelt\"{u}ren sind halbe
Januspforten.
lebend nicht, wie ein anderer, von Tapferkeit, sondern f\"{u}r Tapferkeit. Ebensowenig hab' ich je als Feldprediger hinter irgendeinem Offizier unter dem Regimente zur\"{u}ckstehen wollen, der ein L\"{o}we ist und mithin jeden Raub angreift, nur da\ss{} er, wie dieser K\"{o}nig der Tiere, das Feuer f\"{u}rchtet --- oder der, wie K\"{o}nig Jakob von England, welcher davonlaufend vor nackten Degen, desto k\"{u}hner vor ganz Europa dem st\"{u}rmenden Luther mit Buch und Feder entgegenschritt, gleichfalls bei \"{a}hnlicher Idiosynkrasie sowohl m\"{u}ndlich als schriftlich mit jedem Kriegsheer anbindet. Hier entsinn' ich mich vergn\"{u}gt eines wackeren Sous-Lieutenants, der mir beichtete --- wiewohl er mir noch das Beichtgeld schuldig ist, sowie, noch besser, seinen Wirtinnen das S\"{u}ndengeld --- welcher in R\"{u}cksicht der Herzhaftigkeit vielleicht etwas von jenem indischen Hunde hatte, den Alexander geschenkt bekommen
[21] Schiller und Klopstock sind poetische Spiegel vor dem
Sonnengotte; die Spiegel werfen so blendend die Sonne zur\"{u}ck, da\ss{}
man in ihnen die Gem\"{a}lde der Welt nicht gespiegelt sehen kann.
als einen Hundsalexander. Der Makedonier lie\ss{} zur Probe auf den Wunderhund andere Helden- oder Wappentiere anlaufen --- erstlich einen Hirschen --- aber der Hund ruhte; --- dann eine Sau --- er ruhte; --- sogar einen B\"{a}ren --- er ruhte: jetzt wollt' ihn Alexander verurteilen, als man endlich einen L\"{o}wen einlie\ss{}; da stand der Hund auf und zerri\ss{} den L\"{o}wen. Ebenso der Sous-Lieutenant. Ein Duellant, ein Ausw\"{a}rtsfeind, ein Franzose ist ihm nur Hirsch und Sau und B\"{a}r, und er bleibt liegen; aber nun komme und klopfe an sein \"{a}ltester, st\"{a}rkster Feind, sein Gl\"{a}ubiger, und fordere ihm f\"{u}r verj\"{a}hrte Freuden jetziges Schmerzensgeld ab, und wollt' ihm so Vergangenheit und Zukunft zugleich abrauben: der Leutnant f\"{a}hrt auf und wirft den Gl\"{a}ubiger die Treppe hinab. Leider steh' ich auch erst bei der Sau und werde nat\"{u}rlich verkannt.
\textit{Quo} --- sagt LiviusXII.5. mit Recht ---
[72] Den Halbgelehrten betet der Viertelsgelehrte an --- diesen der
Sechzehnteilsgelehrte --- und so fort; --- aber nicht den Ganzgelehrten
der Halbgelehrte.
\textit{quo timoris minus est, eo minus ferme periculi est}, oder zu deutsch --- je weniger man Furcht hat, desto weniger Gefahr ist fast dabei; ich kehre den Satz ebenso richtig um, je weniger Gefahr, desto kleiner die Furcht, ja es kann Lagen geben, wo man ganz und gar von Furcht nichts wei\ss{} --- worunter meine geh\"{o}rt. Um desto verha\ss{}ter mu\ss{} mir jede Afterrede \"{u}ber Hasenherzigkeit erscheinen.
Ich schicke meiner Ferienreise noch einige Tatsachen voraus, welche beweisen, wie leicht Vorsicht --- das hei\ss{}t wenn ein Mensch nicht dem dummen Hamster gleichen will, der sich sogar gegen einen Mann zu Pferde auflehnt --- f\"{u}r Feigheit gelte. Ich w\"{u}nschte \"{u}brigens nur, ich k\"{o}nnte ebenso gl\"{u}cklich einen ganz anderen Vorwurf, den eines Waghalses, ablehnen, wiewohl ich doch im folgenden gute Fakta beizubringen gedenke, die ihn entkr\"{a}ften.
[35] \textit{Bien \'{e}couter c'est presque r\'{e}pondre} sagt Marivaux mit Recht
von geselligen Zirkeln; ich dehn' es aber auch auf runde Sessions-
und Kabinettstische aus, wo man referiert und der F\"{u}rst zuh\"{o}rt.
Was hilft der Heldenarm ohne ein Heldenauge? Jener w\"{a}chst leicht st\"{a}rker und nerviger, dieses aber schleift sich nicht so bald wie Gl\"{a}ser sch\"{a}rfer. Indes aber, die Verdienste der Vorsicht fallen weniger ins Auge (ja mehr ins L\"{a}cherliche) als die des Mutes. Wer mich zum Beispiel bei ganz heiterem Himmel mit einem wachstuchenen Regenschirm gehen sieht: dem komm' ich wahrscheinlich so lange l\"{a}cherlich vor, als er nicht wei\ss{}, da\ss{} ich ihn als Blitzschirm f\"{u}hre, um nicht von einem Wetterstrahl aus blauem Himmel (wovon in der mittleren Geschichte mehr als ein Beispiel steht) getroffen zu werden. Der Blitzschirm ist n\"{a}mlich ganz der Reimarussche; ich trage auf einem langen Spazierstocke das wachstuchene Sturmdach, von dessen Giebel sich eine Goldtresse als Ableitungskette niederzieht, die durch einen Schl\"{u}ssel, den sie auf dem Fu\ss{}steig nachschleift, jeden m\"{o}glichen
[17] Das Bette der Ehren sollte man doch, da oft ganze Regimenter
darauf liegen, und die letzte \"{O}lung und vorletzte Ehre empfangen von
Zeit zu Zeit weichf\"{u}llen, ausklopfen und s\"{o}mmern.
Blitz leicht \"{u}ber die ganze Erdfl\"{a}che ableitet und verteilt. Mit diesem Paradonner (\textit{paratonnerre portatif}) in der Hand will ich mich wochenlang ohne die geringste Gefahr unter dem blauen Himmel herumtreiben. Indes deckt diese Taucherglocke noch gegen etwas anderes --- gegen Kugeln. Denn wer gibt mir im Herbste schwarz auf wei\ss{}, da\ss{} kein versteckter Narr von J\"{a}ger irgendwo, wenn ich die Natur genie\ss{}e und durchstreife, seine Kugelb\"{u}chse in einem Winkel von 45Grad so abdr\"{u}ckt, da\ss{} sie im Herunterfallen blo\ss{} auf meinem Scheitel aufzuschlagen braucht, damit es so gut ist, als w\"{u}rd' ich seitw\"{a}rts ins Gehirn geschossen?
Es ist ohnehin schlimm genug, da\ss{} wir nichts gegen den Mond haben, uns zu wehren --- der uns gegenw\"{a}rtig beschie\ss{}t mit Gestein, wie ein halber t\"{u}rkischer; denn dieser elende,
\begin{quotation}
[112] Gewisse Weltweiber benutzen in gewissen F\"{a}llen ihre k\"{o}rperliche Ohnmacht, wie Mohammed seine =fallende= Sucht --- auch ist jene diese --- blo\ss{} um Offenbarungen, Himmel, Eingebungen, Heiligkeit und Proselyten zu erhalten.\end{quotation}
kleine Erdtrabant und L\"{a}ufer und \textit{valet de Fantaisie} glaubt in diesen rebellierenden Zeiten auch anfangen zu m\"{u}ssen, seiner gro\ss{}en Landesmutter etwas zuzuschleudern aus der Davidshirtentasche. Wahrhaftig, jetzt kann ja ein junger Katechet von Gef\"{u}hl nachts mit geraden Gliedern in den Mondschein hinauswandeln, um manches zu empfinden oder zu bedenken, und kann (mitten im Gef\"{u}hl erwirft ihn der absurde Satellit) als zerquetschter Brei wieder nach Hause gehen. ------ Bei Gott! \"{u}berall Klingenproben des Muts! Hat man m\"{u}hsam Donnerkeile eingeschmolzen und Kometenschw\"{a}nze anglisiert: so f\"{u}hrt der Feind neues Gesch\"{u}tz im Mond auf oder sonst wo im Blau!
Noch eine Geschichte sei genug, um zu beweisen, wie l\"{a}cherlich gerade die ernsthafteste
\begin{quotation}
[120] Mancher wird ein freier Diogenes, nicht wenn er in dem Fasse, sondern wenn dieses in ihm wohnt; und die gewaltige Hebkraft des =Flaschenzugs= in der Mechanik sp\"{u}rt er fast von einem Flaschenzuge anderer Art beim Flaschenkeller wiederholt und gut bew\"{a}hrt.\end{quotation}
Vorsicht bei allem inneren Mute oft au\ss{}en dem P\"{o}bel erscheint. Reiter kennen die Gefahren auf einem durchgehenden Pferde l\"{a}ngst. Mein Unstern wollte, da\ss{} ich in Wien auf ein Mietspferd zu sitzen kam, das zwar ein sch\"{o}ner Honigschimmel war, aber alt und hartm\"{a}ulig wie der Satan, so da\ss{} die Bestie in der n\"{a}chsten Gasse mit mir durchging und zwar --- leider blo\ss{} im Schritte. Kein Halten, kein Lenken schlug an; ich tat endlich auf dem Selbststreitro\ss{} Notschu\ss{} nach Notschu\ss{} und schrie: $\gg$Haltet auf, ihr Leute, um Gottes Willen aufgehalten, mein Gaul geht durch!$\ll$ Aber da die einf\"{a}ltigen Menschen das Pferd so langsam gehen sahen wie den Reichshofratsproze\ss{} und den ordin\"{a}ren Postwagen: so konnten sie sich durchaus nicht in die Sache finden, bis ich in heftigster Bewegung wie besessen schrie: $\gg$Haltet doch auf, ihr Pinsel und Pensel, seht ihr denn nicht, da\ss{} ich die M\"{a}hre nicht mehr halten kann?$\ll$ Jetzt kam
[2] Die Kultur machte ganze L\"{a}nder, z.B. Deutschland, Gallien usw.
physisch w\"{a}rmer, aber geistig k\"{a}lter.
den Faulpelzen ein hartm\"{a}uliges, schrittlings ausziehendes Pferd l\"{a}cherlich vor. --- Halb Wien bekam ich dadurch wie einen Bartsternschwanz hinter meinem Ro\ss{}schweif und Zopf nach. --- F\"{u}rst Kaunitz, sonst der beste Reiter des Jahrhunderts (des vorigen), hielt an, um mir zu folgen. --- Ich selber sa\ss{} und schwamm als aufrechtes Treibeis auf dem Honigschimmel, der in einem fort Schritt f\"{u}r Stritt durchging. --- Ein vieleckiger, rocksch\"{o}\ss{}iger Brieftr\"{a}ger gab rechts und links seine Briefe in den Stockwerken ab und kam mir stets mit satirischen Gesichtsz\"{u}gen wieder nach, weil der Schimmel zu langsam auszog. --- Der Schwanzschleuderer (bekanntlich der Mann, der mit einer zweisp\"{a}nnigen Wassertonne
\begin{quotation}
[99] Gleichwohl hab' ich bei allem meinen Grimm \"{u}ber Nachdruck doch nie den Ankauf eines Privilegiums gegen Nachdruck f\"{u}r etwas anderes oder schlechteres gehalten als f\"{u}r die Abgabe, die bisher alle christlichen Seem\"{a}chte an die barbarischen Staaten erlegten, damit sie nicht beraubt wurden. Nur Frankreich hat eben der \"{A}hnlichkeit wegen sowohl das Nachdrucks-Privilegium als die barbarische Abgabe abgeschafft.\end{quotation}
\"{u}ber die Stra\ss{}en f\"{a}hrt und sie mit einem drei Ellen langen Schlauch aus einem blechernen Trichter benetzt) fuhr ungemein bequem den Hinterbacken meines Pferdes nach und feuchtete w\"{a}hrend seiner Pflicht jene und mich selber k\"{u}hlend an, ob ich gleich kalten Schwei\ss{} genug hatte, um keines frischeren zu bed\"{u}rfen. --- Ich geriet auf meinem h\"{o}llischen, trojanischen Pferd (nur war ich selber das untergehende Troja, das ritt) nach Matzleinsdorf (einer Wiener Vorstadt), oder waren's f\"{u}r meine gepeinigten Sinne ganz andere Gassen. --- Endlich mu\ss{}te ich abends sp\"{a}t nach dem Retr\"{a}teschu\ss{} des Praters im letzteren zu meinem Abscheu und gegen alle Polizeigesetze auf dem gesetzlosen Honigschimmel noch herumreiten, und ich h\"{a}tte vielleicht gar auf ihm \"{u}bernachtet, wenn nicht mein Schwager, der Dragoner, mich gesehen und noch fest auf dem durchgegangenen Gaule gefunden h\"{a}tte. Er machte keine Umst\"{a}nde --- fing das Vieh
[1] Je mehr Schw\"{a}che, je mehr L\"{u}ge; die Kraft geht gerade; jede
Kanonenkugel, die H\"{o}hlen oder Gruben hat, geht krumm.
--- tat die lustige Frage: warum ich nicht voltigiert h\"{a}tte, ob er gleich recht gut wei\ss{}, da\ss{} dazu ein h\"{o}lzerner Gaul geh\"{o}rt, der steht --- und holte mich herab --- und so kamen alle berittenen Wesen unberitten und unbesch\"{a}digt nach Hause.
Aber nun endlich einmal an meine Reise!
Reise nach Fl\"{a}tz.
Ihr wi\ss{}t, Freunde, da\ss{} ich die Reise nach Fl\"{a}tz gerade unter den Ferien machen mu\ss{}te, nicht nur, weil Viehmarkt und folglich der Minister und General von Schabacker da war, sondern vornehmlich, weil er (wie ich von geheimer Hand sicher hatte) j\"{a}hrlich den 23. Juli am Abend vor dem Markttage um f\"{u}nf Uhr
\begin{quotation}
[32] Unser Zeitalter --- von einigen papiernes genannt, als sei es aus Lumpen eines besser Bekleideten gemacht --- bessert sich schon halb, da es die Lumpen jetzt mehr zu Scharpien als zu Papieren zerzupft, wiewohl oder weil der Lumpenhacker (oder auch der Holl\"{a}nder) eben nicht ausruht; indes, wenn gelehrte K\"{o}pfe sich in B\"{u}cher verwandeln, so k\"{o}nnen sich auch gekr\"{o}nte in Staatspapiere verwandeln und umm\"{u}nzen; --- in Norwegen hat man nach dem Allg.\end{quotation}
soviel Gaudium und Gnade sich auslie\ss{}, da\ss{} er die meisten Menschen weniger anschnauzte als anh\"{o}rte und --- erh\"{o}rte. Die Gaudiumsursache vertrau ich ungern dem Papier. Kurz, ich konnte ihm meine Bittschrift, mich als unschuldig vertriebener Feldprediger durch eine katechetische Professur zu entsch\"{a}digen und zu besolden in keiner besseren Jahres- und Tageszeit \"{u}berreichen, als abends um f\"{u}nf Uhr Hundstagsanfang. Ich setzte mein Bittschreiben in drei Tagen auf. Da ich weder Konzepte, noch Abschriften desselben schonte und z\"{a}hlte: so war ich bald so weit, da\ss{} ich das relativ Beste ganz vollendet vor mir hatte, als ich erschrocken bemerkte, da\ss{} ich darin \"{u}ber drei\ss{}ig Gedankenstriche in Gedanken hingeschrieben
\begin{quotation}
Anzeiger sogar H\"{a}user von Papier, und in manchen guten deutschen Staaten --- h\"{a}lt das Kammerkollegium (das Justizkollegium ohnehin) seine eigenen Papierm\"{u}hlen, um D\"{u}ten genug f\"{u}r das Mehl seiner Windm\"{u}hlen zu haben. Ich w\"{u}nschte aber, unsere Kollegien n\"{a}hmen sich jene Glasschneiderei in Madrid zum Muster, in welcher (nach Baumg\"{a}rtner) zwar neunzehn Schreiber angestellt waren, aber doch auch eilf Arbeiter.\end{quotation}
hatte. Leider schie\ss{}en diese Stacheln heutzutage wie aus Wespenstei\ss{}en, unwillk\"{u}rlich aus gebildeten Federn hervor. Ich warf es zwar lange in mir hin und her, ob ein Privatgelehrter sich einem Minister mit Gedankenstrichen n\"{a}hern d\"{u}rfe --- so sehr auch dieses ebene Unterstreichen der Gedanken, diese wagerechten Taktstriche poetischer Tonst\"{u}cke und diese Treppenstricke oder Achillessehnen philosophischer Sehst\"{u}cke jetzt ebenso allgemein als n\"{o}tig sind --- allein ich mu\ss{}te doch am Ende (da Ausschaben Standespersonen beleidigt) das beste Probst\"{u}ck wieder umschreiben und mich wieder eine halbe Stunde am Namen Attila Schmelzle qu\"{a}len, weil ich immer
\begin{quotation}
[39] Epiktet r\"{a}t an zu reisen, weil die alten Bekanntschaften uns durch Scham und Einflu\ss{} vom \"{U}bergange zur hohen Tugend abhalten --- so wie man etwa seine Provinzialmundart schamhaft lieber au\ss{}er Lands ablegt und dann v\"{o}llig gel\"{a}utert zu seinen Landsleuten zur\"{u}ckkommt; noch jetzt befolgen Leute von Stand und Tugend diesen Rat, obwohl umgekehrt, und reisen, weil die alten Bekanntschaften sie durch Scham zu sehr von neuen S\"{u}nden abschrecken.\end{quotation}
[Illustration: ...es tue ihm bloss sanft / sagt' er / wie eine gute Frostsalbe...]
glaube, diesen sowie die Briefadresse, die beiden Kardinalgegenden und Punkte der Briefe, nie leserlich genug zu schreiben.
Erste Station, von Neusattel nach Vierst\"{a}dten.
Der 22.Juli, oder Mittwochs nachmittag um f\"{u}nf Uhr, war von der Postkarte der ordentlichen fahrenden Post selber zu meiner Abreise unwiderruflich anberaumt. Ich hatte also etwa einen halben Tag Zeit, mein Haus zu bestellen, welchem jetzt zwei N\"{a}chte und drittehalb Tage hindurch meine Brust als Brustwehr, der Verhack mit meinem Ich abgehen sollte. Sogar mein gutes Weib Bergelchen, wie ich meine Teutoberga nenne, reiste mir unaufhaltsam den 24. oder Freitags darauf nach, um den Jahrmarkt zu beschauen und zu benutzen; ja sie wollte schon sogleich mit mir ausreisen, die treue Gattin. Ich versammelte daher meine kleine Bedientenstube
[2] Ein Soldat huldigt und gehorcht in seinem F\"{u}rsten zugleich
seinem F\"{u}rsten und seinem Generalissimus; der Zivilist blo\ss{} seinem
F\"{u}rsten.
und publizierte ihr die Hausgesetze und Reichsabschiede, die sie nach meinem Abschiede den Tag und die Nacht erstlich vor der Abreise meiner Frau und zweitens nach derselben auf das p\"{u}nktlichste zu befolgen hatten, und alles, was ihnen besonders bei Feuersbr\"{u}nsten, Diebeseinbr\"{u}chen, Donnerwettern und Durchm\"{a}rschen vorzukehren oblag. Meiner Frau \"{u}bergab ich ein Sachregister des Besten in unserem kleinen Registerschiffe, was sie, im Falle es in Rauch aufginge, zu retten h\"{a}tte. --- Ich befahl ihr, in st\"{u}rmischer Nacht (dem eigentlichen Diebswetter) unsere Windharfe ans Fenster zu stellen, damit jeder schlechte Strauchdieb sich einbildete, ich phantasierte harmonisch und wachte; desgleichen den Kettenhund am Tage ins Zimmer zu nehmen, damit er ausschliefe, um nachts munterer zu sein. Ich riet ferner, auf jeden Brennpunkt der Glasscheiben im Stalle, ja auf jedes hingestellte Glas Wasser ihr Auge zu haben, da ich ihr schon \"{o}fter die Beispiele erz\"{a}hlt, da\ss{}
[29] Und wieviel ist nicht in der Jurisprudenz Jurisimprudenz,
ausgenommen bei Unrechtsgelehrten.
durch solche zuf\"{a}llige Brenngl\"{a}ser die Sonne ganze H\"{a}user in Brand gesteckt. --- Auch gab ich ihr die Morgenstunde, wo sie Freitags ab- und mir nachreisen sollte, sowie die Haustafeln sch\"{a}rfer an, die sie vorher dem Gesinde einzusch\"{a}rfen h\"{a}tte. Meine liebe, kerngesunde, bl\"{u}hende Honigw\"{o}chnerin Berga antwortete ihrem Flitterw\"{o}chner, wie es schien, sehr ernsthaft: $\gg$Geh nur Alterchen, es soll alles ganz scharmant geschehen. --- W\"{a}rest du nur erst voraus, so k\"{o}nnte man doch nach! Das w\"{a}hrt ja aber Ewigkeiten.$\ll$ --- Ihr Bruder, mein Schwager, der Dragoner, f\"{u}r den ich aus Gef\"{a}lligkeit das Passagiergeld trug, um auf dem Postkissen einen an sich tapferen Degen und Hauinsfeld, sozusagen als k\"{o}rperlichen und geistigen Verwandten und Spillmagen vor mir zu haben, dieser zog \"{u}ber meine Verordnungen (was ich leicht dem Hage- und Kriegsstolzen vergab) sein braunes Gesicht
[39] $\gg$=Die gr\"{o}\ss{}ere H\"{a}lfte=$\ll$ ist ein so me\ss{}widriger Ausdruck, da\ss{} ihn
kein Me\ss{}k\"{u}nstler anders als von der Ehe, ja sogar nur von der
seinigen gebrauchen k\"{o}nnte.
ansehnlich ins Sp\"{o}ttische und sagte zuletzt: $\gg$Schwester, an deiner Stelle t\"{a}te ich, was mir beliebte; und dann guckte ich nach, was er auf seinem Reglementszettel h\"{a}tte haben wollen.$\ll$ --- $\gg$O,$\ll$ versetzte ich, $\gg$Ungl\"{u}ck kann sich wie ein Skorpion in jede Ecke verkriechen; ich m\"{o}chte sagen, wir sind den Kindern gleich, die am sch\"{o}n bemalten K\"{a}stchen schnell den Schieber aufrei\ss{}en und --- heraus f\"{a}hrt eine Maus, die hackt$\ll$ --- $\gg$Maus, Maus, Raus, Raus!$\ll$, versetzte er auf- und niedertrabend. $\gg$Herr Schwager, aber es ist f\"{u}nf Uhr; und Sie werden schon finden, wenn Sie wiederkommen, da\ss{} alles so aussieht wie heute, die Hunde wie die Hunde, und meine Schwester wie eine h\"{u}bsche Frau: \textit{allons donc!}$\ll$ --- Er war eigentlich schuld, da\ss{} ich aus Besorgnis seines Mi\ss{}deutens nicht vorher eine Art von Testament gemacht.
Ich packte noch entgegengesetzte Arzneien, sowohl temperierende als erhitzende, gegen
[45] Die jetzigen Schriftsteller zucken die Achseln am meisten \"{u}ber
die, auf deren Achseln sie stehen; und erheben die am meisten, die
an ihnen hinaufkriechen.
zwei M\"{o}glichkeiten ein --- ferner meine alten Schienen gegen Arm- und Beinbr\"{u}che bei Wagenumst\"{u}rzen --- und (aus Vorsicht) noch einmal so viel Geldwechsel, als ich eigentlich n\"{o}tig hatte. Nur w\"{u}nschte ich dabei wegen der Mi\ss{}lichkeit des Aufbewahrens, ich w\"{a}r' ein Affe mit Backentaschen, oder ein Beuteltier, damit ich in mehr sichere und empfindungsvolle Taschen und Beutel solche Lebenspreziosen verschanzte. Rasieren lasse ich mich sonst stets vor Abreisen aus Mi\ss{}trauen gegen fremde, mords\"{u}chtige Bartputzer; aber diesmal behielt ich den Bart bei, weil er doch unterwegs, auch geschoren, so reich wieder getrieben h\"{a}tte, da\ss{} mit ihm vor keinem Minister w\"{a}re zu erscheinen gewesen.
Ich warf mich heftig ans Kraftherz meiner Berga an und ri\ss{} mich noch heftiger ab, aber sie schien \"{u}ber unsere erste Ehetrennung weniger in Jammer als in Jubel zu sein,
[14] Manche Dichter geraten unter dem Malen schlechter Charaktere
oft so ins Nachahmen derselben hinein, wie Kinder, wenn sie so
tr\"{a}umen, wirklich ihr Wasser lassen.
viel weniger best\"{u}rzt als seelenvergn\"{u}gt, blo\ss{} weil sie auf das Scheiden nicht halb so sehr als auf das Wiedersehen und Nachreisen, und die Jahrmarktsschau ihr Augenmerk hatte; doch warf und hing sie sich an meinen etwas d\"{u}nnen und langen Hals und K\"{o}rper fast schmerzhaft als eine zu fleischige, derbe Last und sagte: $\gg$Fege nur frisch davon, mein scharmanter Attel (Attila) --- und mache dir unterwegs keine Gedanken, du aparter Mensch! --- Haben wir denn zu klagen? Einen oder ein paar P\"{u}ffe halten wir mit Gottes Hilfe schon aus, solange mein Vater kein Bettelmann ist. --- Und dir aber, Franz,$\ll$ fuhr sie gegen ihren Bruder ordentlich zornig fort, $\gg$bind' ich meinen Attel auf die Seele, du wei\ss{}t recht gut, du w\"{u}ste Fliege, was ich tue, wenn du ein Narr bist und ihn wo im Stiche l\"{a}ssest.$\ll$ Ich verzieh ihr hier manches Gutgemeinte;
\begin{quotation}
[103] Die Gro\ss{}en sorgen vielleicht so emsig f\"{u}r ihre Nachkommen wie die Ameisen; sind die Eier gelegt, so fliegen die m\"{a}nnlichen und weiblichen Ameisen davon und vertrauen sie den treuen =Arbeitsameisen= an.\end{quotation}
und euch, Freunden, ist ihr Reichtum und ihre Freigebigkeit auch nichts Neues.
Ger\"{u}hrt sagt' ich: $\gg$Nun, Berga, gibt's ein Wiedersehen f\"{u}r uns, so ist's gewi\ss{} entweder im Himmel oder in Fl\"{a}tz; und ich hoffe zu Gott, das letztere.$\ll$ --- Stracks ging's r\"{u}stig davon. Ich sah mich durch das Kutschenr\"{u}ckfenster um nach meinem guten St\"{a}dtchen Neusattel; und es kam mir ger\"{u}hrt vor, als richte sich dessen Sturmspitze ordentlich als ein Epitaphium \"{u}ber meinem Leben oder meinem vielleicht tot zur\"{u}ckreisenden Leichnam in die H\"{o}he: --- $\gg$wie wird alles sein,$\ll$ dacht' ich, $\gg$wenn du nun endlich nach zwei oder drei Tagen wiederkommst?$\ll$ Jetzt sah ich mein Bergelchen uns aus dem Mansardenfenster nachschauen; ich legte mich weit aus dem Kutschenschlage hinaus, und ihr Falkenauge erkannte sofort meinen Kopf; K\"{u}sse \"{u}ber K\"{u}sse warf sie mir mit beiden H\"{a}nden herab, dem ins Tal rollenden Wagen nach. $\gg$Du
[10] Und liefert das Leben von unsern idealen Hoffnungen und
Vors\"{a}tzen etwas anderes als eine prosaische, unmetrische, ungereimte
\"{U}bersetzung?
herziges Weib,$\ll$ dacht' ich, $\gg$wie machst du deine niedrige Geburt durch die geistige Wiedergeburt verge\ss{}lich, ja merkw\"{u}rdig!$\ll$
Freilich, das Postkutschengelag' und Picknick wollte mir weniger schmecken; lauter verd\"{a}chtiges, unbekanntes Gesindel, welches (wie gew\"{o}hnlich die M\"{a}rkte tun) der Fl\"{a}tzer durch seine Witterung einlockte. Ungern werd' ich Unbekannten ein Bekannter; aber mein Schwager, der Dragoner, war wie immer schon mit allem, mit Himmel und H\"{o}lle herausgeplatzt. Neben mir sa\ss{} eine h\"{o}chstwahrscheinliche Hure. --- Auf ihrem Scho\ss{}e ein Zwerg, der sich auf dem Jahrmarkte wollte sehen lassen. --- Mir gegen\"{u}ber blickte ein Kammerj\"{a}ger mich an --- und unten im Tale stieg noch ein blinder Passagier mit einem roten Mantel ein. Mir gefiel gar niemand, ausgenommen mein Schwager. Ob nicht die Hure meine Bekanntschaft zu einer
\begin{quotation}
[78] Die Weiber halten alles Wei\ss{}zeug wei\ss{}, =nur= kein Buch, ob sie gleich vielleicht manchen polemischen Folianten, eh' er in die Papierm\"{u}hle gekommen, als Brauthemde am Leibe m\"{o}gen getragen haben. Die M\"{a}nner kehren es nur um.\end{quotation}
eidlichen Angabe ben\"{u}tzen, ob nicht Spitzbuben unter den Passagieren mich und meine Eigenheiten und Zuf\"{a}lle studieren w\"{u}rden, um auf der Tortur mich in ihre Bande zu flechten --- daf\"{u}r konnte sich mir niemand verpf\"{a}nden. An fremden Orten schau ich schon ungern --- und aus Vorsicht --- an irgendein Kerkergitter lange empor, weil ein schlechter Kerl dahinter sitzen kann, der eilig herunterschreit aus blo\ss{}er Bosheit: $\gg$Drunten steht mein Spie\ss{}kamerad, der Schmelzle!$\ll$ --- oder auch weil ein vernagelter Scherge sich denken kann, ich suchte meinen Konf\"{o}derierten oben zu entsetzen. Aus einer wenig davon verschiedenen Vorsicht dreh' ich mich daher niemals um, wenn ein Star mir nachruft: Dieb!
Was den Zwerg selber anlangt, so konnt' er meinetwegen mitfahren, wohin er wollte; aber er glaubte ein besonderes Frohleben in
\begin{quotation}
[7] Der geharnischte deutsche Reichsk\"{o}rper konnte sich darum schwer bewegen, weshalb die K\"{a}fer nicht fliegen k\"{o}nnen, deren =Fl\"{u}gel= recht gut durch =Fl\"{u}geldecken= --- und zwar durch zusammengewachsene --- verschanzt sind.\end{quotation}
uns zu bringen, wenn er uns verhie\ss{}e, da\ss{} sein Pollux und Amtsbruder, ein seltener Riese, der ebenfalls der Messe zur Anschau zuzog, gegen Mitternacht uns unfehlbar mit seinem Elefantenschritte nachkommen und sich einsetzen oder hinten aufstellen w\"{u}rde. Beide Narren beziehen n\"{a}mlich gemeinschaftlich die Messen als gegenseitige Me\ss{}helfer zu entgegengesetzten Gr\"{o}\ss{}en; der Zwerg ist das erhabene Vergr\"{o}\ss{}erungsglas des Riesen, der Riese das hohle Verkleinerungsglas des Zwergs. Niemand bezeugte gro\ss{}e Freude an der Aussicht der Nachkunft des Ma\ss{}kopisten des Zwergs, ausgenommen mein Schwager, der (ist das Wortspiel erlaubt) wie eine Uhr blo\ss{} zum Schlagen gemacht zu sein glaubt, und mir wirklich sagte: $\gg$K\"{o}nn' er einmal oben in der ewigen Seligkeit keine Seele zuweilen wamsen
\begin{quotation}
[8] Mit Staatseinrichtungen ist's wie mit Kunststra\ss{}en; auf einer ganz neuen, unbefahrenen, wo jeder Wagen am Stra\ss{}enbau mitarbeiten und zerklopfen hilft, man wird ebenso gesto\ss{}en und geworfen, als auf einer ganz alten, ausgefahrenen voll L\"{o}cher. Was ist also hier zu tun? Man fahre fort.\end{quotation}
und koram nehmen, so fahr' er lieber in die H\"{o}lle, wo gewi\ss{} des Guten und der H\"{a}ndel eher zu viel sein werden.$\ll$ --- Der Kammerj\"{a}ger im Postwagen hatte, au\ss{}erdem schon, da\ss{} uns niemand sehr einnimmt, der blo\ss{} vom Vergiften lebt, wie dieser Freund Hain der Ratten und die M\"{a}useparze, und da\ss{} ein solcher Kerl, was noch schlimmer, sogleich ein Mehrer des Ungezieferreiches zu werden droht, sobald er nicht dessen Minderer sein darf --- dieser hatte \"{u}berhaupt soviel Fatales an sich, zuerst den Stechblick wie eines Stiletts --- dann das hagere, scharfe Knochengesicht in Verbindung mit seinem Vorrechnen seines ansehnlichen Giftsortiments --- dann (denn ich ha\ss{}te ihn immer hei\ss{}er) seine geheime Stille, sein geheimes L\"{a}cheln, als seh' er in irgendeiner Schlupfecke eine Maus, \"{a}hnlich einem Menschen. --- Wahrlich, mir, der ich sonst ganz anderen Leuten stehe, kam endlich sein Rachen als eine Hundsgrotte vor, seine
[3] Vor Gericht werden oft ermordete Geburten f\"{u}r totgeborene
ausgegeben, in Antikritiken totgeborene f\"{u}r ermordete.
Backenknochen als Untiefen und Klippen, sein hei\ss{}er Atem als Kalzinierofen und die schwarzhaarige Brust als Welk- und Darrofen------
Ich hatte mich auch --- glaub' ich --- nicht viel versehen; denn bald darauf fing er an, der Gesellschaft, worin ein Zwerg und ein M\"{a}dchen war, ganz kalt zu berichten, er habe schon zehn Leiber mit dem Dolch nicht ohne Lust durchsto\ss{}en --- habe gem\"{a}chlich ein Dutzend Menschenarme abgehauen, vier K\"{o}pfe langsam gespalten, zwei Herzen ausgerissen und mehr dergleichen --- und keiner davon, sonst Leute von Mut, hab' ihm im geringsten widerstanden --- $\gg$aber warum?$\ll$ setzt' er giftig hinzu, und nahm den Hut vom h\"{a}\ss{}lichen Glatzkopf --- $\gg$ich bin unverwundbar. --- Wer von der Gesellschaft will, lege auf meiner Glatze soviel Feuer an, als er will, ich lass' es ausbrennen.$\ll$
Mein Schwager, der Dragoner, setzte sogleich einen brennenden Tabaksschwamm auf
[101] Nicht nur die Rhodier hie\ss{}en von ihrem Kolo\ss{} Kolosser, sondern
auch unz\"{a}hlige Deutsche hei\ss{}en von Luther Lutheraner.
den Sch\"{a}del, aber der J\"{a}ger stand es so ruhig aus, als w\"{a}r' es ein kalter Brand, und er und der Dragoner sahen einander wartend an, und jeder l\"{a}chelte sehr n\"{a}rrisch --- es tue ihm blo\ss{} sanft, sagt' er, wie eine gute Frostsalbe, denn dies sei \"{u}berhaupt die Winterseite an seinem Leibe. Hier griff mein Schwager ein wenig auf dem nackten Sch\"{a}del umher und rief verwundert: er f\"{u}hle sich so kalt an wie eine Kniescheibe. Nun hob der Kerl auf einmal nach einigen Vorr\"{u}stungen zu unserem Entsetzen den Viertelssch\"{a}del ab und hielt ihn uns hin, sagend, er habe ihn einem M\"{o}rder abges\"{a}gt, als ihm zuf\"{a}llig der eigene eingeschlagen gewesen; und erkl\"{a}rte nun, da\ss{} man
\begin{quotation}
[88] Bis hierher hab' ich immer die Streitschriften der jetzigen philosophischen und \"{a}sthetischen idealen Streitflegel, worin allerdings einige Schimpfworte und Trug- und Lugschl\"{u}sse vorkommen, mehr von der sch\"{o}nen Seite genommen, indem ich sie blo\ss{} als eine Nachahmung des klassischen Altertums, und zwar der Ringer desselben angesehen, welche (nach Sch\"{o}ttchen) ihren Leib mit =Kot= bestrichen, um nicht gefa\ss{}t zu werden, und ihre H\"{a}nde mit =Staub= anf\"{u}llten, um den fremden zu fassen.\end{quotation}
das erz\"{a}hlte Durchstechen und Armabhauen mehr als Scherz zu nehmen habe, indem er's lediglich getan als Famulus auf dem anatomischen Theater. --- Inzwischen wollte der Scherztreiber doch keinem von uns sehr schmecken und zu Hals, so da\ss{} ich, als er den Kapselkopf, den Repr\"{a}sentationssch\"{a}del, wieder aufsetzte, schweigend dachte: diese Mistbeetglocke hat gewi\ss{} nur den Ort, nicht die Giftzwiebel ver\"{a}ndert, die sie zudeckt.
Am Ende wurde mir's \"{u}berhaupt verd\"{a}chtig, da\ss{} er, sowie s\"{a}mtliche Gesellschaft (auch der blinde Passagier), gerade demselben Fl\"{a}tz zuschifften, wohin ich selber gedachte; besonderes Gl\"{u}ck brauchte ich mir davon nicht zu versprechen; und mir w\"{a}re in der Tat das Umkehren so lieb gewesen als das Fortfahren, h\"{a}tt' ich nicht lieber der Zukunft getrotzt.
Ich komme endlich auch auf den rot gemantelten blinden Passagier, wahrscheinlich
[103] Oder sind alle Moscheen, Episkopalkirchen, Pagoden,
Filialkirchen, Stiftsh\"{u}tten und Panthea etwas anderes als der
Heidenvorhof zum unsichtbaren Tempel und zu dessen Allerheiligsten?
ein \textit{Emigr\'{e}} oder ein \textit{Refugi\'{e}} (denn er spricht das deutsche nicht schlechter als das Franz\"{o}sische), entweder namens Jean Pierre oder Jean Paul ungef\"{a}hr, oder ganz namenlos. Sein roter Mantel w\"{a}re mir ungeachtet dieser Farbenverschmelzung mit dem Scharfrichter --- der in vielen Gegenden trefflich Angstmann hei\ss{}t --- an sich herzlich gleichg\"{u}ltig geblieben, w\"{a}re nicht der besondere Umstand eingetreten, da\ss{} er mir schon f\"{u}nfmal in f\"{u}nf St\"{a}dten (im gro\ss{}en Berlin, im kleinen Hof, Koburg, Meiningen und Baireuth) wider alle Wahrscheinlichkeit aufgesto\ss{}en, wobei er mich jedesmal bedeutend genug angesehen, und dann seines Weges gegangen. Ob er mir feindlich nachsetzt oder nicht, wei\ss{} ich nicht; nur ist auf alle F\"{a}lle der Phantasie kein Objekt erfreulich, das mit Observationskorps oder aus
\begin{quotation}
[40] Das Volk ist nur im Erz\"{a}hlen, nicht im R\"{a}sonieren weitl\"{a}ufig; der Gelehrte ist nur in jenem, nicht in diesem kurz; eben weil das Volk seine Gr\"{u}nde nur als Empfindungen so wie die Gegenwart blo\ss{} anschauet, der Gelehrte hingegen beide mehr nur denkt.\end{quotation}
Schie\ss{}scharten vielleicht mit Flinten h\"{a}lt und zielt, die es jahrelang bewegt, ohne da\ss{} man wei\ss{}, in welchem es abdr\"{u}ckt. --- Noch anst\"{o}\ss{}iger wurde mir der Rotmantel dadurch, da\ss{} er auffallend seine weiche Seelenmilde pries; dies schien beinah' auf Ausholen oder Sichermachen zu deuten. Ich erwiderte: $\gg$Mein Herr, ich komme eben, wie hier mein Schwager, vom Schlachtfeld her (die letzte Aff\"{a}re war bei Pimpelstadt), und stimme vielleicht deshalb zu stark f\"{u}r Markkraft, Bruststurm, Sto\ss{}glut, und es mag f\"{u}r manchen, der eine brausende Wasserhose, eigentlich Landhose von Herz hat, gut sein, wenn seine geistliche Lage (ich bin darin) ihn mehr mildert als wildert. Indes geh\"{o}rt jeder Milde ihr eisernes Schrankengitter. F\"{a}llt mich irgendein unbesonnener Hund bedeutend an, so tret' ich ihn freilich im ersten Zorn entzwei, und nachher hinter
\begin{quotation}
[9] Die \"{A}gypter nahmen bei einem Landesungl\"{u}ck dadurch am Gott Typhon, dem sie es zuschrieben, Rache, da\ss{} sie seine Lieblinge von Felsen st\"{u}rzten, die Esel. \"{A}hnlicherweise haben sich in der Geschichte auch Staaten anderer Religion ger\"{a}cht.\end{quotation}
mir treibt's mein guter Schwager vielleicht noch zweimal weiter, denn er ist der Mann dazu. Vielleicht ist's Eigenliebe, aber ich beklag's (gesteh' ich) noch heute, da\ss{} ich als Knabe einmal einem anderen Knaben drei erhaltene Ohrfeigen nicht derb zur\"{u}ckgereicht, und mir ist oft, als m\"{u}\ss{}t' ich sie seinen Enkeln nachzahlen. Wahrlich, wenn ich auch nur einen Jungen vor den schwachen Kr\"{a}ften eines \"{a}hnlichen Jungen feig entlaufen sehe, so kann ich das Laufen nicht lassen und will ihn ordentlich durch einen Machtschlag erretten.$\ll$ Der Passagier l\"{a}chelte indes nicht zum besten. Er gab sich zwar f\"{u}r einen Legationsrat aus und schien Fuchs genug zu sein, aber ein tollgewordener Fuchs bei\ss{}t mich am Ende so wasserscheu als ein toller Wolf. \"{U}brigens fuhr ich unbek\"{u}mmert mit meinem
\begin{quotation}
[70] In die Philosophie verh\"{u}lle sich die Dichtkunst nur so, wie in diese sich jene; Philosophie aber in poetischer Prosa gleicht jenen Trinkgl\"{a}sern in Schenken, welche mit bunten Bilderschn\"{o}rkeln umzogen, zugleich im Genusse des Getr\"{a}nks und des Bildwerks, die oft widrig sich decken, st\"{o}ren.\end{quotation}
Anpreisen des Mutes fort, nur da\ss{} ich absichtlich statt des l\"{a}cherlichen Bramarbasierens, welches gerade den Feigen recht verr\"{a}t, fest, still, klar sprach. $\gg$Ich bin$\ll$, sagt' ich, $\gg$blo\ss{} f\"{u}r Montaignes Rat: man trage nur Furcht vor der Furcht.$\ll$
$\gg$Ich w\"{u}rde,$\ll$ versetzte der Legationsrat unn\"{u}tz spitzfindig, $\gg$wieder f\"{u}rchten, da\ss{} ich mich nicht genug vor der Furcht f\"{u}rchtete, sondern zu feig bliebe.$\ll$
$\gg$Auch dieser Furcht$\ll$, erwidert' ich kalt, $\gg$steck' ich Grenzen. Ein Mann kann zum Beispiel nicht im geringsten Gespenster glauben und f\"{u}rchten; gleichwohl kann er nachts sich in Todesschwei\ss{} baden, und zwar blo\ss{} vor Angst, wie sehr er sich entsetzen w\"{u}rde (besonders mit welchen Nachwehen von Schlagfl\"{u}ssen,
\begin{quotation}
[158] Der Staat sollte \"{o}fter die Maul- und Kindertrommeln der Dichter nicht mit Regiments- und Feuertrommeln verwechseln; wieder umgekehrt sollte der B\"{u}rger manche f\"{u}rstliche Trommelsucht nur f\"{u}r eine Krankheit nehmen, worin der Patient blo\ss{} durch die unter die Haut eingedrungene Luft sehr aufgeschwollen ist.\end{quotation}
fallenden Suchten und so weiter), falls nichts als blo\ss{} seine so lebhafte Phantasie irgendein Fieber und Vexierbild vor ihn in die L\"{u}fte hineinhinge.$\ll$ ------ $\gg$Man sollte daher$\ll$, fiel mein Schwager, wider Gewohnheit moralisierend, ein, $\gg$das so arme Schaf von Mann auch gar mit keinem Geisterspuk foppen, der Hase kann ja auf der Stelle auf dem Platze bleiben.$\ll$
Ein lautes Gewitter, das dem Postwagen nachfuhr, ver\"{a}nderte den Diskurs. Ihr, Freunde, erratet wohl alle --- da ihr mich nicht als einen Mann ohne alle Physik kennen lernen --- meine Ma\ss{}regeln gegen Gewitter:
\begin{quotation}
[89] In gro\ss{}en St\"{a}dten lebt der Fremde die ersten Tage nach seiner Ankunft blo\ss{} von seinem Gelde im Gasthofe, erst darauf in den H\"{a}usern seiner Freunde umsonst; langt man hingegen auf der Erde an, wie z.B. ich, so wird man gerade die ersten Jahre hindurch h\"{o}flich freigehalten, in den andern und l\"{a}ngern aber --- denn man bleibt oft sechzig Jahre --- mu\ss{} man wahrhaftig (ich habe die Dokumente in H\"{a}nden) jeden Tropfen und Bissen bezahlen, als w\"{a}re man im gro\ss{}en Gasthofe zur Erde, was noch dazu wahr ist.\end{quotation}
ich setze mich n\"{a}mlich auf einen Sessel mitten in der Stube (oft bleib' ich bei bedenklichem Gew\"{o}lk ganze N\"{a}chte auf ihm), und decke mich durch mein Reinigen von allen Leitern, Ringen, Schnallen und so weiter und durch mein Absitzen von allen Blitzabspr\"{u}ngen immer so, da\ss{} ich kaltbl\"{u}tig die Sph\"{a}renmusik der Donnerpauke vernehme. --- Diese Vorsicht hat mir nie geschadet, da ich ja dato noch lebe; und ich w\"{u}nsche mir noch heute Gl\"{u}ck, da\ss{} ich einmal aus der Stadtkirche, ob ich gleich tags vorher gebeichtet hatte, ohne weiteres und ohne vorher das Abendmahl zu nehmen, ins Gebeinhaus hinausgelaufen, weil ein schweres Gewitter (was wirklich in die Kirchhofslinde einschlug) dar\"{u}ber stand; --- ich kam auch sogleich nach der Entladung der Wolke aus dem Gebeinhaus in die Kirche zur\"{u}ck und war so gl\"{u}cklich, noch hinter dem
[112] Ich sage aber nein. Der Mensch stelle sich so wie seinen Hut
--- wenn er sich und diesen nicht gerade gebraucht --- beide, um sie
zu schonen, so lange auf den =Kopf=, bis er wieder getragen wird.
[Illustration: und floh dann mit vollen Segeln auf geradewohl und geradeaus den K\"{u}rzesten Weg hindurch...]
Henker (als dem letzten) zu kommen und das Liebesmahl zu genie\ss{}en.
So denk' ich f\"{u}r meine Person; aber leider, im vollen Postwagen traf ich Menschen, denen Physik wahre Narretei ist. Denn als die Gewitter sich f\"{u}rchterlich \"{u}ber unsern Kutschenhimmel versammelten und prasselnde Feuerklumpen, als w\"{a}ren's Johannisw\"{u}rmchen, im Himmel umherspielten; und als ich endlich ersuchen mu\ss{}te, das schwitzende Postkonklave m\"{o}chte nur wenigstens Uhren, Ringe, Gelder und dergleichen zusammenwerfen, etwa in die Wagentaschen, damit kein Mensch einen Leiter am Leibe h\"{a}tte: so tat's nicht nur keiner, sondern mein eigener Schwager, der Dragoner, stieg gar mit gezogenem nackten Degen auf den Bock hinaus und schwur, er leite ab. Ich wei\ss{} nicht, war der desperate Mensch ein gescheiter oder keiner; kurz, unsere Lage
\begin{quotation}
[10] Die Weltepochen feiern --- wie die spanischen K\"{o}nige --- Regierungsantritt, Vollj\"{a}hrigkeit, Verm\"{a}hlung --- gern mit Scheiterhaufen (Autodaf\'{e}s, Tressenausbrennungen der Weisen oder auch der Irrgl\"{a}ubigen).\end{quotation}
war f\"{u}rchterlich, und jeder konnte ein gelieferter Mann sein. Zuletzt bekam ich gar einen halben Zank mit zweien von der rohen Menschenfracht der Kutsche, dem Vergifter und der Hure, weil sie fragend fast zu verstehen gaben, ich h\"{a}tte vielleicht bei dem angepriesenen Preziosenpicknick nicht die ehrlichsten Anschl\"{a}ge gehabt. So etwas verwundet die Ehre mit Gewalt, und in mir donnerte es nun st\"{a}rker als oben; dennoch mu\ss{}t' ich den ganzen n\"{o}tigen Erbitterungswortwechsel so leise und langsam als m\"{o}glich f\"{u}hren und haderte sanft, damit nicht am Ende eine ganz in Harnisch gebrachte Kutsche in Hitze und Schwei\ss{} geriete, und in unsere Mitte so den nahen Donnerkeil auf Ausd\"{u}nstungen durch den Kutschenhimmel herabfahren
\begin{quotation}
[144] Der Rezensent gebraucht seine Feder eigentlich nicht zum Schreiben, sondern er weckt mit deren Brandgeruch Ohnm\"{a}chtige auf, kitzelt mit ihr den Schlund des Plagarius zum Wiedergeben, und stochert mit ihr seine Z\"{a}hne aus. Er ist der einzige im ganzen gelehrten Lexikon, der sich nie ausschreiben und aussch\"{o}pfen kann, er mag ein Jahrhundert oder ein Jahrtausend vor dem Tintenfasse sitzen. Denn\end{quotation}
lie\ss{}e. Zuletzt setzt' ich der Gesellschaft das ganze elektrische Kapitel deutlich, aber leise und langsam --- ich wollte nicht ausdampfen --- auseinander und suchte besonders von der Furcht abzuschrecken. Denn, in der Tat, vor Furcht konnte jeden der Schlag --- ja ein doppelter, mit dem elektrischen ein apoplektischer --- treffen, da aus Erxleben und Reimarus genug bewiesen ist, da\ss{} starkes F\"{u}rchten durch D\"{u}nsten den Strahl zulockt; ich stellte daher in ordentlicher Angst vor meiner und fremder Furcht den Passagieren vor, da\ss{} sie jetzt durchaus bei unserer schw\"{u}len Menge, bei dem die Blitze spie\ss{}enden Degen auf dem Kutschbock, und bei dem \"{U}berhang der Wetterwolke, und selber bei so vielen Ausd\"{u}nstungen anfangender Furcht, kurz, bei
\begin{quotation}
indes der Gelehrte, der Philosoph und der Dichter das neue Buch nur aus neuem Stoff und Zuwachs schaffen, legt der Rezensent blo\ss{} sein altes Ma\ss{} von Einsicht und Geschmack an tausend neue Werke an, und sein altes Licht bricht sich an der vorbeiziehenden, stets verschieden geschliffenen Gl\"{a}serwelt, die er beleuchtet, in neue Farben.\end{quotation}
so augenscheinlicher Gefahr nichts f\"{u}rchten d\"{u}rften, wollten sie nicht samt und sonders erschlagen sein. $\gg$O, Gott,$\ll$ rief ich, $\gg$nur Mut! Keine Furcht! Nicht einmal Furcht vor der Furcht! --- Wollen wir denn als zusammengetriebene Hasen hier se\ss{}haft, von unserem Herrgott erschossen sein? --- F\"{u}rchte sich meinetwegen jeder, wenn er aus der Kutsche heraus ist, nach Belieben an anderen Orten, wo weniger zu besorgen ist, nur aber nicht hier.$\ll$
Ich kann nicht entscheiden --- da unter Millionen kaum ein Mensch an der Gewitterwolke stirbt, aber vielleicht Millionen an Schnee- und Regenwolken und d\"{u}nnen Nebeln --- ob meine Kutschenpredigt auf Menschenrettungspreise Anspruch zu machen hatte, als wir s\"{a}mtlich unbesch\"{a}digt, einem Regenbogen entgegen, in das St\"{a}dtchen Vierst\"{a}dten einfuhren, wo ein Posthalter in der einzigen Gasse wohnte, die der Ort hatte.
[107] Deutschland ist ein langes, erhabenes Gebirge --- unter dem
Meer.
[Illustration: Aus der hohen Posthauspforte trat / tief sich b\"{u}ckend / der Riese heraus]
Zweite Station, von Vierst\"{a}dten nach Niedersch\"{o}na.
Der Posthalter war ein grober Patron und ein Schl\"{a}ger; eine Gattung von Menschen, die ich unaussprechlich hasse, weil meine Phantasie mir immer vorspiegelt, ich k\"{o}nnte vielleicht aus Zufall oder Widerwillen ihnen ein recht h\"{o}hnisches und impertinentes Gesicht schneiden, und mir solche Gesellen auf den Hals hetzen, und darauf sp\"{u}r' ich schon Ziehen von Mienen. Zum Gl\"{u}ck konnt' ich diesmal (gesetzt, ich h\"{a}tte ein Fehlgesicht geschnitten) mich mit meinem Schwager, dem Dragoner, bewaffnen, f\"{u}r dessen Riesenmacht dergleichen ein Leckerbissen ist. Denn er kann zum Beispiel vor keinem Wirtshause, worin eine Schl\"{a}gerei laut wird, vorbeigehen, ohne hineinzutreten und sogleich unter der T\"{u}re zu schreien: $\gg$Macht Friede, ihr Hunde!$\ll$ darauf unter
\begin{quotation}
[18] Unter Selbststillen versteht man nicht, wie beim tatzensaugenden B\"{a}ren, da\ss{} man sich selber an die eigene Brust lege, sondern da\ss{} man andere nicht durch andere s\"{a}ugen lasse: so aber sollte auch das Wort Selbstliebe im Gebrauche sein.\end{quotation}
seinem Schein von Friedensdeputation nimmt er ohne Verzug, als w\"{a}r' es eine amerikanische Friedenspfeife, das n\"{a}chste Stuhlbein in die Hand und deckt damit das schlagende Personal hin\"{u}ber und her\"{u}ber zu, oder er n\"{a}hert die harten K\"{o}pfe der Parteien (er schl\"{a}gt sich zu keiner) einander mit Gewalt, indem er in jede Hand einen am Hinterkopfe fa\ss{}t; dann ist der Kauz im Himmel.
Ich f\"{u}r meine Person vermeide diskrepante Zirkel mehr, als da\ss{} ich sie aufsuche, sowie auch jeden toten oder totgemachten Menschen; --- der vorsichtige Mann sieht leicht voraus, was davon zu holen ist, entweder verdrie\ss{}liches und mi\ss{}liches Zeugschaftgeben, oder oft gar (wenn die Umst\"{a}nde sich verschw\"{o}ren) peinliches Nachfragen \"{u}ber Mitschuld.
\begin{quotation}
[97] Daher schlie\ss{}' ich, da\ss{} Schmelzle gut predigt, schon aus seinen vielen Kenntnissen und Wortspielen. Die theologische Welt auf Kathedern, noch mehr die auf Kanzeln, verdient das Lob, da\ss{} sie gleichsam der Lichtsammler oder Lichtfang oder Lichtmagnet der besten Strahlen und Entdeckungen ist, die aus andern Wissenschaften ausgehen, besonders derer aus der Philosophie und Dichtkunst: \end{quotation}
In Vierst\"{a}dten stie\ss{} mir nichts von Wichtigkeit auf als --- zu meinem Grausen --- ein Hund ohne Schwanz, der durch die Stadt oder Gasse lief. Ich zeigte erbittert im ersten Feuer den Passagieren den Hund und legte ihnen die Frage vor, ob sie denn eine medizinische Polizei f\"{u}r trefflich bestellt ans\"{a}hen, welche, wie die Vierst\"{a}dter es zulie\ss{}e, da\ss{} Hunde \"{o}ffentlich herumspr\"{a}ngen, denen der Schwanz fehlte. $\gg$An was$\ll$, sagt' ich, $\gg$halt' ich mich denn, wenn dieser weggeschnitten, und mir jede solche Bestie entgegenrennen, und ich weder aus dem eingezogenen noch aufgerichteten Schwanze, da der ganze weggehackt ist, einen Schlu\ss{} ziehen kann, ob das Vieh toll ist oder nicht. So wird der gescheiteste
\begin{quotation}
sie selber entdeckt eigentlich nichts als eben die passiven Diebsinseln, wo sie ihre Gew\"{u}rze abholt. So findet man in Predigten, z.B. in Marezolls Kanzelst\"{u}cken einen reichen Fund fremder Erfindungen; und \"{u}berhaupt gibt's wenige Entdeckungen in der Philosophie und Moral, welche ein Jahrf\"{u}nft oder Jahrzehnt sp\"{a}ter, nachdem sie ihren Sch\"{o}pfer ber\"{u}hmt gemacht, nicht den Nachsch\"{o}pfer in der theologischen Welt --- diese Erbin ihrer\end{quotation}
Mann w\"{u}tig und gebissen und scheitert blo\ss{} aus Mangel eines Schweifkompasses.$\ll$ Der nachkommende blinde Passagier (er lie\ss{} sich jetzt als sehender einschreiben, Gott wei\ss{} zu welchen Endzwecken) spann vor mir meinen eigenen Satz, dem er zugeh\"{o}rt, fast bis ins Komische aus, und erregte zuletzt in mir den Verdacht, er mache durch eine, aber sehr starke Schmeichelnachahmung meines Sprechstils Jagd auf mich. $\gg$Der Hundeschwanz$\ll$, sagt' er, $\gg$ist wohl f\"{u}r uns Alarmstange und Irrenanstalt, damit man in keine komme, gleichsam die \"{a}u\ss{}eren Vorposten der Wut --- man schneide den Kometen den Schwanz, den Bassen den Ro\ss{}schweif, den Krebsen den ihrigen (denn ausgestreckter bedeutet krepierte) ab: so ist man
\begin{quotation}
Magd, der Philosophie --- noch zehnmal gr\"{o}\ss{}er und reicher gemacht h\"{a}tten, sobald er nur Kanzelwasser genug zum Einfl\"{o}\ss{}en der fremden Bissen (\textit{boli}) aufgegossen hatte. Aber hier m\"{o}cht' ich gern auf einen Unterschied der meisten lutherischen Prediger von den M\"{o}nchen zeigen, der nicht ganz zum Nachteil der ersteren ausschl\"{a}gt. Der M\"{o}nch darf (\textit{C.Q.X. de stat.monach.}) nichts Eigenes haben, bei Strafe unehrlichen Begr\"{a}bnisses, und jedes\end{quotation}
in den gef\"{a}hrlichen Angelegenheiten des Lebens ohne Leitseil, ohne Avertisseur, ohne Hand in \textit{margine} --- und man kommt um, ohne vorher zu wissen wie.$\ll$
\"{U}brigens lief diese Station ohne Zank und Not vor\"{u}ber. Alles schlief gegen zehn Uhr ein, sogar der Postillion, au\ss{}er ich. Ich stellte mich zwar schlafend, um zu beobachten, wer sich etwa aus guten Gr\"{u}nden nur schlafend stelle; aber alles schnarchte fort, der Mond warf seine verkl\"{a}renden Strahlen nur auf herabgesunkene Augenlider.
Herrlich konnt' ich jetzt Lavaters Rat befolgen, an Schlafende vorz\"{u}glich die physiognomische Elle anzusetzen, weil der Schlaf wie der Tod die echte Form gr\"{o}ber auspr\"{a}gt.
\begin{quotation}
Eigentum wird ihm als Kirchenraub angerechnet. Mich d\"{u}nkt aber, der lutherische Kanzelredner dem\"{u}tigt und ent\"{a}u\ss{}ert sich weit mehr, wenn er auch, im h\"{o}heren Geistigen, wo er noch sch\"{o}n und frei zu w\"{a}hlen hat --- da \"{u}ber das Eigentum des k\"{o}rperlichen ohnehin in seinem Namen das Kammerkollegium das Armutsgel\"{u}bde ablegt --- kurz, wenn er, was Gedanken anlangt, gar nichts Eigenes hat und haben will.\end{quotation}
Andere Schl\"{a}fer au\ss{}erhalb der Postkutsche w\"{u}rd' ich mit gedachter Elle weniger auszumessen raten, immer in einiger Besorgnis bleibend, da\ss{} etwa ein Kerl, der sich nur schlafend stellte, sogleich, als ich nahe genug st\"{a}nde, wie im Traume aufspr\"{a}nge, und dem physiognomischen Me\ss{}k\"{u}nstler in die eigene Gesichtsbildung einen so hinterlistigen Fauststreich versetzte, da\ss{} sie in keinem physiognomischen Fragmente, weil sie selber eines geworden, mehr florieren k\"{o}nnte, weder in punktierter Manier, noch in geschabter. Und kann denn nicht der ehrlichste Schl\"{a}fer von der Welt, eben w\"{a}hrend ihr \"{u}ber dessen physiognomische Leichen\"{o}ffnung her seid, losschlagen, von der Ehre in einem Pr\"{u}geltraume angehetzt, und euch vielleicht mit wenigen Handgriffen und Fu\ss{}tritten in einen viel ewigeren Schlaf einwiegen, als der gewesen, woraus er aufgefahren?
In meinem sogenannten silhouettierenden
[71] Der J\"{u}ngling ist aus Willk\"{u}r sonderbar und freuet sich; der
Mann ist's unabsichtlich und gezwungen und \"{a}rgert sich.
Schattenspiele kommt der Gesichterinhalt der schlafenden Postkutsche selber vor; erst darin werde ich euch breit belegen, warum mir der Gifttr\"{a}ger mit der Mordkuppel teuflisch erschienen --- der Zwerg altkindisch --- die Hure matt- und schlafffrech --- mein Schwager ruhigges\"{a}ttigt von Rache oder von Essen --- der Legationsrat Jean Pierre aber, Gott wei\ss{} warum, als ein halber Engel, wiewohl er sich denken l\"{a}\ss{}t, der halbe Engel, da nur der sch\"{o}ne K\"{o}rper, nicht die andere im Schlaf vergangene H\"{a}lfte, die Seele, vor mir wirkte.
Beinahe verg\"{a}\ss{}' ich's, da\ss{} ich doch in meinem D\"{o}rfchen, w\"{a}hrend beide Schw\"{a}ger, der Dragoner und der Postillion, tranken, eine kleine Furcht gl\"{u}cklich bestanden, weil das Schicksal zweimal auf meiner Seite gewesen. Ich sah unweit eines Jagdschlosses neben einem sch\"{o}nen Baumklumpen eine wei\ss{}e Tafel mit schwarzer Inschrift schimmern. Dies lie\ss{} mich hoffen, da\ss{} mich dort ein kleines Sargkunstwerk, ein Ehrenpfahl, irgendein
[198] Der P\"{o}chel und das Vieh schwindeln auf keinem Abgrundsabhang,
aber wohl der Mensch.
Treff-, Zier- und Spie\ss{}dank f\"{u}r einen Toten erwarte. Auf einem unbetretenen blumigen Gewinde lang' ich vor dem Schwarz auf Wei\ss{} an und lese im Mondschein mit Entsetzen: $\gg$Jedermann wird hier vor dem Selbstschu\ss{} gewarnt!$\ll$ So stand ich also vielleicht einen Fu\ss{}zehennagel breit von dem B\"{u}chsenhahn, womit ich, wenn ich die Ferse r\"{u}ckte, mich selber als einen verbl\"{u}fften Stocknarren und Ladstock in die andere Welt, unter die Seligen hineinscho\ss{}. Ich suchte vor allen Dingen mich mit den Fu\ss{}n\"{a}geln in den Boden wie einzubei\ss{}en und einzufressen --- weil ich wenigstens so lange am holden Leben bleiben konnte, als ich mich fest pfl\"{o}ckte neben der daliegenden Atroposschere und Henkersb\"{u}hne; --- darauf w\"{u}nscht' ich mich zu entsinnen, auf welchen Steigen der Teufel mich unerschossen herbeigef\"{u}hrt. Aber vor Angst hatt' ich alles ausgeschwitzt und wu\ss{}te gar nichts, --- im nahen H\"{o}llendorf war kein
[11] Das goldene Kalb der Selbstsucht w\"{a}chst bald zum gl\"{u}henden
Phalarisochsen, der seinen Vater und Anbeter ein\"{a}schert.
Hund zu ersehen und zu erschreien, der mich etwa aus dem Wasser h\"{a}tte holen k\"{o}nnen, und die beiden Schw\"{a}ger soffen selig. Indes, ich fa\ss{}te Mut und Entschlu\ss{} --- schrieb auf einem Pergamentblatte meinen letzten Willen sowie meine zuf\"{a}llige Sterbart nieder, und meinen Todesdank ans Bergelchen --- und flog dann mit vollen Segeln auf Geratewohl und geradeaus den k\"{u}rzesten Weg hindurch, unter der Voraussetzung, mich bei jedem Schritte niederzuschie\ss{}en und mir so mit eigener Hand auf mein noch langes Lebenslicht den \textit{Bonsoir} oder Lichtt\"{o}ter zu setzen. Aber ohne Schu\ss{} kam ich an. In der Schenke lachte freilich mehr als ein Narr \"{u}ber mich, weil, was nur ein Narr wissen konnte, die Warnungstafel schon seit zehn Jahren ohne Sch\"{u}sse dageblieben, wie oft diese ohne jene.
\begin{quotation}
[103] Das m\"{a}nnliche Schmarotzergew\"{a}chs an den weiblichen Rosen und Lilien mu\ss{} (wenn ich dessen Schmeicheln recht fasse) wahrscheinlich bei den Sch\"{o}nen die Sitte der Italiener und Spanier voraussetzen, welche jede Kostbarkeit dem zum Geschenk anbieten, der solche sehr lobt.\end{quotation}
So aber steht's, ihr Freunde, mit unserer Jagdpolizei, die gegen alles warnt, nur nicht gegen Warnungstafeln.
\"{U}brigens hatt' ich auf der ganzen Station leichte H\"{a}ndel mit dem Postillion, weil er nicht von Viertelstunde zu Viertelstunde halten wollte, wenn ich ausstieg, um zu...... Leider sind freilich von Postknechten keine Urinpropheten zu erwarten, da so selten Gelehrte aus Hallers gro\ss{}er Physiologie es wissen, da\ss{} Aufschieben der gedachten Sache teuflisches Steingut niederschl\"{a}gt und zuletzt den Inhaber selber, weil diese Steingrube seltener der Blasenschneider als der Tod mit einem Grabe schlie\ss{}t. H\"{a}tten Postknechte gelesen, da\ss{} Tycho de Brahe wie eine Bombe am Zerspringen starb: sie hielten lieber an; sie f\"{a}nden bei solchen, mir so unerwarteten Kenntnissen es vern\"{u}nftig, da\ss{} ein Mann
\begin{quotation}
[199] Aber wenige gegenw\"{a}rtige Staaten, glaub' ich, k\"{o}pfen unter dem Vorwande, zu trepanieren --- oder heften (in einer gesuchtern Allegorie) die Lippen zusammen unter dem Vorwand, deren Hasenscharten zuzun\"{a}hen.\end{quotation}
seinen Leichenstein zwar einmal auf sich, aber nicht in sich tragen will. Bin ich denn nicht sogar in Weimar oft aus den l\"{a}ngsten Abschiedsauftritten Schillers mit Tr\"{a}nen in den Augen hinausgelaufen, blo\ss{} um (w\"{a}hrend seine Minerva mich im ganzen erweichte) nicht von deren Medusenkopf auf der Brust partiell versteinert zu werden? Und kam ich nicht ins weinende Kom\"{o}dienhaus zur\"{u}ck und viel munterer in die allgemeine R\"{u}hrung ein, weil ich dann nichts mehr zu erleichtern brauchte als mein Herz?
Sehr im Finstern kamen wir in Niedersch\"{o}na an.
Dritte Station, von Niedersch\"{o}na nach Fl\"{a}tz.
Als ich am Posthause, mit den Augen auf meinen Mantelsack geheftet, in Gedanken dastehe: schmettert und schnaubt ein Vieh von Nachtw\"{a}chter mir so nahe und unversehens
[12] Die Einzelwesen haben Lehrjahre, die Staaten Lehrjahrhunderte;
--- aber sind beide freigesprochen, so sind doch wieder Lehrstunden
und Sonntagsschulen nachzuholen.
mit seiner Nachttuba ins Ohr, da\ss{} ich ordentlich zur\"{u}ckspringe, ich, den schon jede heftig-schnelle Anrede verdrie\ss{}t. Gibt's denn keine medizinische Polizei gegen solche geblasene Stundenl\"{a}rmfidibus und -L\"{a}rmkanonen, durch welche doch keine knallenden entbehrlich werden? Eigentlich sollte niemand mit dem Nachtw\"{a}chterhorne investieret werden als ein vern\"{u}nftiger Mann, der sich schon einen Bruch geblasen oder gehoben h\"{a}tte und der imstande w\"{a}re, seinen Stundenvers so leise abzusingen, da\ss{} man gar nichts h\"{o}rte.
Was ich l\"{a}ngst erwartet und der Zwerg vorausgesagt, traf jetzt ein: aus der hohen Posthauspforte trat tief sich b\"{u}ckend der Riese heraus und hob im Freien eine unvern\"{u}nftig gro\ss{}e Statur und dito Kopf mit der ellenhohen
\begin{quotation}
[67] Gastfreiheitswirt, willst du deinen Gast erforschen? Begleite ihn zu einem andern Wirte und h\"{o}re zu! --- Ebenso: willst du deine Geliebte in einer Stunde besser kennen lernen als in einem Monat Zusammenlebens? Sieh ihr eine Stunde lang unter Freundinnen und Feindinnen (wenn dies kein Pleonasmus ist) zu!\end{quotation}
M\"{u}tze und Feder empor; mein Schwager ihm zur Seite schien nur sein vierzehnj\"{a}hriger Sohn zu sein, und der Zwerg gar sein auf zwei Beinen aufwartendes Scho\ss{}h\"{u}ndchen. $\gg$Lieber Freund,$\ll$ sagte mein neckender Schwager, der ihn an mich und die Postkutsche geleitete, $\gg$steig' Er ruhig ein, wir machen Ihm s\"{a}mtlich gern Platz. Kremp' Er sich nur recht zusammen, und leg' Er den Kopf aufs Knie; so geht's.$\ll$ Der unn\"{u}tze Necker h\"{a}tte so gern den fast einf\"{a}ltigen Giganten --- dem er's bald abgemerkt, da\ss{} dessen Gehirn kein schlauer Gast, sondern die negative Gr\"{o}\ss{}e seines Rumpfes war --- unter uns im bangen Postschrank und Notstall vor sich gesehen zu einem Giespuckel eingekn\"{u}llt und krumm geschlossen. $\gg$Giht doch nit! Giht gar nit!$\ll$ sagte der Riese, als er hineinsah. $\gg$Der Herr Soldat wissen vielleicht nicht,$\ll$ versetzte der Zwerg, $\gg$wie gro\ss{} ein Riese ist; und Er denken, weil
[80] Im Sommer des Lebens graben und statten die Menschen Eisgruben
so gut als m\"{o}glich aus, um sich doch f\"{u}r ihren Winter etwas
aufzuheben, was fortk\"{u}hlt.
ich hineingehe. --- Aber das ist ein anderes Loch. --- Ich will \"{u}berall hineinpassen, man sage mir nur wo.$\ll$---
Kurz, es war kein Ausweg f\"{u}r den Postmeister und den Riesen, als da\ss{} sich dieser hinten auf das Passagierwarenlager stellte und setzte, sich als eine Tr\"{a}nenweide her\"{u}berbeugend \"{u}ber den ganzen Kutschkasten. Mich selber konnte ein solcher R\"{u}ckenwind und R\"{u}ckhalt nicht au\ss{}erordentlich erg\"{o}tzen; und ich traue (hoff' ich) jedem von euch, ihr Freunde, zu, da\ss{} er hinter einem R\"{u}ckendekret so gut und so hell wie ich \"{u}berschlagen h\"{a}tte, was ein Kerl und Riese hinter ihm, ein Nachfahrer in allerlei Sinne, etwa Mordendes, probieren k\"{o}nne, es sei nun, da\ss{} er durch das R\"{u}ckenfenster des Wagens einbr\"{a}che und angreife oder sich \"{u}berhaupt mit Titanenmacht oben \"{u}ber den Kutschenhimmel hermache. Indessen fing der oben mit gekreuzten
\begin{quotation}
[28] Es ist mir unm\"{o}glich, sogleich auf der Stelle unter dem Wasser\"{a}sten-Wald von Anspielungen in meinen Werken --- sogar diese ist wieder ein Ast --- herauszubringen und darauf zu fallen, ob ich je\end{quotation}
Armen auf dem Kasten liegende Elefant --- der aber von seinem Gleichnis mehr die dr\"{u}ckende Masse als das fliegende Geisteslicht zu haben schien --- bald zu schlafen und zu schnarchen an; ein Elefant, wovon (wie ich immer froher einsah) mein Schwager, der Dragoner, leicht der Kornak und B\"{a}ndiger sein konnte, ja schon gewesen war.
Da jetzt mehr als eine Person schlafen wollte, aber (mit Recht) ich hingegen wachen: so bot ich gern meinen Fahrehrensitz, den Vordersitz (auch um manchen Neid der Passagiere zu tilgen), solchen Personen an, die auf ihm ein wenig schlummern wollten. Der Legationsmann ergriff das Anerbieten und den Lehnpolster mit Hast und entschlief an der R\"{u}cklehne des Titans hinter ihm. Etwas unbegreiflich blieb mir dergleichen Postschlaf von einem diplomatischen \textit{Charg\'{e} d'affaires}. Ein Mann, der so mitten unter einer blutfremden,
die s\"{a}mtlichen H\"{o}fe oder H\"{o}hen die (Bouguersche) Schneelinie Europas
genannt habe oder nicht, ich w\"{u}nschte aber Belehrung dar\"{u}ber, um es
im widrigen Falle etwa noch zu tun.
oft blutd\"{u}rstigen Genossenschaft entschl\"{a}ft, kann ja, wenn er im Schlummer und Wagen spricht (denkt nur alle an den s\"{a}chsischen Minister vor dem Siebenj\"{a}hrigen Kriege!) hundert Geheimnisse, tausend Schandtaten heraussto\ss{}en, die er kaum ver\"{u}bt hat. Sollte nicht jedem Minister, Gesandten oder anderen Mann von Ehre oder Stand ordentlich grausen vor Tollwerden oder hitzigen Fiebern, da ihm kein Mensch daf\"{u}r steht, da\ss{} er nicht darin mit den gr\"{o}\ss{}ten Skandalen herausf\"{a}hrt, wovon vielleicht die H\"{a}lfte L\"{u}gen sind?
Endlich, nach der langen Juliusnacht, kamen wir Passagiere samt der Aurora vor Fl\"{a}tz an. Ich sah scharf und weich nach den Turmspitzen; ich glaube, da\ss{} jeder Mensch, der in einer Stadt etwas Entscheidendes zu suchen
\begin{quotation}
[36] Und so w\"{u}nscht' ich \"{u}berall der erste zu sein, besonders im Betteln; der erste Kriegsgefangene, der erste Kr\"{u}ppel, der erste Abgebrannte (\"{a}hnlich dem, der die erste Feuerspritze anf\"{u}hrt) erbeutet die Hauptsumme und das Herz; der Nachk\"{o}mmling spricht die Pflicht nur an; und endlich geht es mit dem melodischen Mancando des Mitleids soweit\end{quotation}
hat, und dem sie entweder ein Richtplatz seiner Hoffnungen oder deren Ankerplatz, entweder Schlacht- oder Zuckerfeld wird, sein Auge am ersten und l\"{a}ngsten auf die T\"{u}rme der Stadt als auf die Zeigefinger und Z\"{u}ngelchen seiner Zukunftswage heftet; gleichsam architektonische Berge, welche wie die nat\"{u}rlichen die Thronen unserer Zukunft sind. Als ich mich damit zu dichterisch gegen Jean Pierre herauslie\ss{}, so antwortete er geschmacklos genug: $\gg$Die T\"{u}rme solcher St\"{a}dte sind ja die Alpenspitzen, worauf wir den Alpenk\"{a}se unserer Zukunft suchen und melken.$\ll$ Mochte der Legations-Peter mit diesem Stile mich l\"{a}cherlich machen oder nur sich? --- Entscheidet!
$\gg$Hier ist der Ort, die Stadt,$\ll$ sagt' ich heimlich zu mir, $\gg$wo heute viel und \"{u}ber
\begin{quotation}
herunter, da\ss{} der letzte --- wenn der vorletzte wenigstens noch mit einem reichen $\gg$Gotthelf$\ll$ beschwert abzieht --- nichts von der mildt\"{a}tigen Hand mehr erh\"{a}lt als deren Faust. Wie nun im Betteln der erste, so m\"{o}cht' ich im Geben der letzte sein; einer l\"{o}scht den andern aus, besonders der letzte den ersten; so aber ist die Welt bestellt.\end{quotation}
Zuk\"{u}nfte entschieden wird, wo du diesen Abend um f\"{u}nf Uhr deine Bittschrift und halb dich selber \"{u}bergibst; --- geh' es doch gut! geh' es herrlich! Werde Fl\"{a}tz, dieser Waffenplatz deiner kleinen Bestrebungen, zugleich die Baustelle von Lust- und Luftschl\"{o}ssern zweier Herzen, des deinigen und des weiblichen!$\ll$
Im Gasthofe zum Tiger stieg ich ab.
Erster Tag in Fl\"{a}tz.
Kein Mensch wird sich anfangs in meiner Tigerhotelslage stark enthusiasmieren \"{u}ber die n\"{a}chsten Aussichten. Ich, als der einzige mir bekannte Mensch, besonders von der Seite der Liebe (vom abgehenden Dragoner nachher!), sah aus den Fenstern des mit Marktg\"{a}sten sich vollstopfenden Gasthofes heraus und auf das Nachstr\"{o}men des Marktheeres
\begin{quotation}
[136] \"{U}bersteigt ihr eure Zeit zu hoch, so geht es euren Ohren (von seiten der Fama) nicht viel besser, als sinkt ihr unter solche zu tief, wirklich ganz \"{a}hnlicherweise sp\"{u}rte =Charles= oben in der Luftkugel, und =Halley= unten in der Taucherglocke gleichen besonderen Schmerz in den Ohren.\end{quotation}
hernieder und konnte sehr bald bedenken, da\ss{} eigentlich niemand als Gott und die Spitzbuben und M\"{o}rder genau wu\ss{}ten, wieviel von beiden letzteren darunter mit einschw\"{a}mmen, um vielleicht die unschuldigsten Marktg\"{a}ste teils zu enth\"{u}lsen, teils zu enthalsen. Meine Lage hatte etwas gegen sich --- mein Schwager hatte, weil er alles blind herausschl\"{a}gt, es fallen lassen, da\ss{} ich im Tiger abstiege --- (o Gott, wann lernen solche Menschen geheimnisreich bleiben und auch den elendesten Bettel des Lebens unter Deckm\"{a}nteln und Schleiern blo\ss{} deshalb zu tragen, weil so oft eine lausige Maus einen Eis- und Golgathaberg gebiert als ein Berg eine Maus?). S\"{a}mtliches Postgesindel sa\ss{} s\"{a}mtlich im Tiger ab --- die Hure --- der Kammerj\"{a}ger --- Jean Pierre --- der Riese, der schon am Stadttore ausstieg und den Gro\ss{}kopf des
\begin{quotation}
[25] In der Jugend sieht man eben wie ein operierter Blindgeborener --- und was tut auch der Geburtshelfer oder die Geburtshelferin anders als operieren --- die Ferne f\"{u}r die N\"{a}he an, den Sternenhimmel f\"{u}r greifbares Stubenger\"{a}te, die Gem\"{a}lde f\"{u}r Gegenst\"{a}nde,\end{quotation}
Zwergs als eigenen Kopf durch Mantelbem\"{a}ntelung \"{u}ber die Stra\ss{}en trug, damit er um einen halben Zwerg gratis riesenhafter erschiene, als er eigentlich f\"{u}r Geld zu sehen war.------
Es kam nun auf jeden ausgestiegenen Passagier an, ob er zum Tiger, dem Wappentiere des Gasthofs, den Prototypus machen, und welches Lamm er dann fressen, aussaugen, abrupfen wollte. Auch mein Schwager verlie\ss{} mich, um einem Ro\ss{}t\"{a}uscher nachzuziehen, behielt aber f\"{u}r seine Schwester sein Zimmer neben meinem; dies sollte, wie es schien, Aufmerksamkeit f\"{u}r sie verraten. Ich blieb einsam meiner Tatkraft \"{u}berlassen.
Gleichwohl dacht' ich unter so vielen Spitzbuben, die mich umzingelten, wenn nicht gar belagerten, warm an eine ferne, redliche Seele, an meine Berga in Neusattel, ein Mark- und Kraftherz, das vielleicht manchem
und die ganze Welt sitzt dem J\"{u}ngling auf der Nase, bis ihn, wie den
Blinden, mehrmaliges Auf- und Zubinden endlich Schein und Ferne
sch\"{a}tzen lehrt.
[Illustration: ...so gab ich dem Feld- und Bartscheerer einen so pl\"{o}tzlichen Stoss auf den Nabel..]
schwachen Eheb\"{u}ndner mehr Schutz gew\"{a}hren, als verdanken w\"{u}rde. $\gg$Erscheine nur morgen mittags recht bald, Berga,$\ll$ sagte mein Herz, $\gg$und wom\"{o}glich noch vormittags, damit ich dein Jahrmarktsparadies um so viele Stunden l\"{a}nger ausdehne, als du um fr\"{u}here anlangst!$\ll$
Ein Geistlicher l\"{a}uft mitten im Weltsturm leicht in einen Freihafen ein, in die Kirche; die Kirchenmauer ist seine Schie\ss{}hausmauer und Fortifikation; und dahinter sitzen gleichergestimmte und friedlichere Seelen beisammen als auf dem Marktplatz --- kurz, ich ging in die Hofkirche. Inzwischen wurde ich in meiner Liederandacht ein wenig verr\"{u}ckt durch einen Heiducken, der einem wohlgekleideten, jungen Herrn mir gegen\"{u}ber die Doppellorgnette von der Nase abri\ss{}, weil in Fl\"{a}tz sowie in Dresden
\begin{quotation}
[125] Am Ende mu\ss{} man noch aus Angst und Not der w\"{a}rmste Weltb\"{u}rger werden, den ich kenne; so sehr schie\ss{}en die Schiffe als Weberschiffchen hin und her und weben Weltteile und Inseln aneinander. Denn es falle heute das politische Wetterglas in S\"{u}damerika; so haben wir morgen in Europa Gewitter und Sturm.\end{quotation}
Gl\"{a}ser, die verkleinern und n\"{a}hern, gegen den Hof versto\ss{}en; ich hatte zwar selber eins aufgesetzt, aber es vergr\"{o}\ss{}erte. Ich konnte mich unm\"{o}glich dahin bringen, die Brille abzunehmen, und ich werde hier, f\"{u}rcht' ich, wieder als Starrkopf und Waghals aussehen; blo\ss{} dies hielt ich f\"{u}r schicklich, in einem fort mit ihr ins Gesangbuch zu blicken und nicht einmal, da der Hof einrauschte, aufzuschauen, um Winke zu geben, da\ss{} sie erhaben geschliffen. --- Die Predigt \"{u}brigens war gut, wenn auch nicht immer fein bedacht f\"{u}r eine Hofkirche; denn sie mahnte von unz\"{a}hligen Lastern ab, zu deren Widerspielen, den Tugenden, ein anderer Prediger zu leicht h\"{a}tte ermahnen k\"{o}nnen! Unter dem ganzen Gottesdienste trachtete ich, wahre, tiefe Ehrerbietung
\begin{quotation}
[19] Leichter, hat man bemerkt, ersteigt man einen Berg, wenn man r\"{u}ckw\"{a}rts hinaufgeht. Dies lie\ss{}e sich vielleicht auch auf Staatsh\"{o}hen anwenden, wenn man ihnen immer nur das Glied wiese, womit man sich darauf setzt, und das Gesicht gegen das Volk unten gerichtet hielte, indes man in einem fort sich entfernte und h\"{o}be.\end{quotation}
an den Tag zu legen, sowohl gegen Gott als gegen meinen erhabenen Landesherrn. Zur letzteren Ehrerbietung hatte ich noch meinen Privatgrund; ich wollte solche n\"{a}mlich recht \"{o}ffentlich und stark mit erhabenen Schriftpunzen auf meinem Gesicht auspr\"{a}gen, um irgendeinen eingefleischten Schadenfroh am Hofe L\"{u}gen zu strafen, der etwa meine neuliche Widerlegung von Linguets Lob auf Nero und meine deutsche freie Satire auf diesen wahren Tyrannen selber, die ich ins Fl\"{a}tzische Wochenblatt eingeschickt, m\"{o}chte zu einem heimlichen Charaktergem\"{a}lde meines F\"{u}rsten umzudrehen beliebt haben. Leider kann man jetzt kaum auf den h\"{o}llischen Teufel selber eine Stachelschrift abfassen, ohne da\ss{} irgendein menschlicher sie auf einen Engel appliziert.
Als endlich der Hof aus der Kirche in den
\begin{quotation}
[26] Wenige deutsche Gelehrte sind nicht originell, wenn man anders (wenigstens aller L\"{a}nder Sprachgebrauch ist) jedem Originalit\"{a}t zusprechen darf, der blo\ss{} seine eignen Gedanken auftischt und keine fremden. Denn da zwischen ihrem Ged\"{a}chtnis, wo das Gelesene oder Fremde wohnt, und zwischen\end{quotation}
Wagen stieg, hielt ich mich in solcher Entfernung, da\ss{} mein Gesicht unm\"{o}glich w\"{a}re zu sehen gewesen, falls ich etwa in der N\"{a}he kein ehrerbietiges, sondern ein zu stolzes gezogen h\"{a}tte. Gott wei\ss{}, wer mir allein jene tollkecken Phantasien und Gel\"{u}ste eingeknetet hat, die vielleicht einem Helden Schabacker mehr anst\"{a}nden als einem Feldprediger unter ihm. Ich kann hier nicht umhin, eine der frechsten, euch, meinen Freunden, zu vertrauen, w\"{u}rfe sie auch anfangs ein zu grelles Licht auf mich. Es war bei meiner Ordination zum Feldprediger, als ich zum heiligen Abendmahle ging am ersten Ostertag. W\"{a}hrend ich nun so dastand, weich bewegt vor dem Altargel\"{a}nder mit der ganzen M\"{a}nnergemeinde --- ja, ich vielleicht st\"{a}rker ger\"{u}hrt, als einer darunter, weil ich als ein in den Krieg Ziehender
\begin{quotation}
ihrer Phantasie oder Erzeugungskraft, wo das Geschriebene und Eigene entsteht, ein hinl\"{a}nglicher Zwischenraum und die Grenzsteine so gewissenhaft und fest gesetzet sind, da\ss{} nichts Fremde ins Eigne und umgekehrt her\"{u}ber kann, so da\ss{} sie wirklich hundert Werke lesen k\"{o}nnen, ohne den Erdgeschmack\end{quotation}
mich ja halb als einen Sterbenden betrachten durfte, der nun wie ein zu Henkender die letzte Seelenmahlzeit empf\"{a}ngt --- so warf in mir, mitten in die R\"{u}hrung von Orgel und Sang, etwas --- sei es nun der erste Osterfeiertag gewesen, der mich auf das sogenannte alte christliche Ostergel\"{a}chter brachte, oder der blo\ss{}e Abstich teuflischer Lagen gegen die ger\"{u}hrtesten --- kurz, etwas in mir (weswegen ich seitdem jeden Einf\"{a}ltigeren in Schutz nehme, der sonst dergleichen dem Teufel anschrieb!) --- dies Etwas warf die Frage in mir auf: $\gg$g\"{a}b' es denn etwas H\"{o}llischeres, als wenn du mitten im Empfange des heiligen Abendmahls verrucht und sp\"{o}ttisch zu lachen anfingest?$\ll$ Sogleich rang ich mich mit diesem H\"{o}llenhund von Einfall herum --- vers\"{a}umte die st\"{a}rksten R\"{u}hrungen,
\begin{quotation}
des eignen einzub\"{u}\ss{}en oder dasselbe sonst zu \"{a}ndern: so ist, glaub' ich, ihre Eigenheit bew\"{a}hrt; und ihre geistigen Nahrungsmittel, ihre Plinsen, Laibe, Krapfen, Kaviare und Suppenkugeln werden nicht, wie nach B\"{u}ffon die k\"{o}rperlichen, zu organischen K\"{u}gelchen der Erzeugung, sondern erscheinen rein\end{quotation}
um nur den Hund im Gesichte zu behalten, und abzutreiben --- kam aber von ihm abgemattet und begleitet vor dem Altarschemel mit der jammervollen Gewi\ss{}heit an, da\ss{} ich nun in kurzem ohne weiteres zu lachen anfangen w\"{u}rde, ich m\"{o}chte innen weinen und st\"{o}hnen, wie ich wollte. Als daher ich und ein sehr w\"{u}rdiger alter B\"{u}rgermeister uns miteinander vor dem langen Geistlichen verbeugten und letzterer mir (vielleicht kam er mir auf dem niedrigen Kniepolster zu lang vor) die Oblate in den klemmen Mund steckte: so sp\"{u}rt' ich schon, da\ss{} an den Mundwinkeln alle Lachmuskeln sardonisch zu ziehen anfingen, die auch nicht lange an der unschuldigen Gesichtshaut arbeiteten, als schon ein wirkliches L\"{a}cheln darauf erschien --- und als wir uns gar zum zweiten Male verneigten, so grinste
\begin{quotation}
und unver\"{a}ndert wieder. Oft denk' ich mir solche Gelehrte als lebendige, aber tausendmal k\"{u}nstlichere Entriche von Vaukansons Kunstente aus Holz. Denn in der Tat sind sie nicht weniger k\"{u}nstlich zusammengefugt als diese, welche fri\ss{}t und den Fra\ss{} hinten wiederzugeben scheint --- zarte Nachspiele\end{quotation}
ich wie ein Affe. Mein Nebenmann, der B\"{u}rgermeister, redete ganz mit Recht, als wir hinter den Altar umgingen, mich leise an: $\gg$Um Gottes willen, sind Sie ein ordinierter Prediger oder ein Pritschenmeister? --- Lacht denn der lebendige Gottseibeiuns aus Ihnen?$\ll$ --- $\gg$Ach, Gott! wer denn sonst?$\ll$ sagt' ich; erst nachher bracht' ich meine Andacht ernsthafter zu Ende.
Aus der Kirche --- (ich komme wieder in die Fl\"{a}tzer) --- ging ich in den Gasthof zum Tiger und a\ss{} an der Wirtstafel, weil ich nie menschenscheu bin. Vor dem zweiten Gerichte reichte mir der Kellner einen leeren Teller, worauf ich zu meinem Erstaunen einen franz\"{o}sischen Vers mit der Gabel eingekratzt erblickte, der nichts Geringeres enthielt als ein Pasquill auf den Kommandanten von
\begin{quotation}
der Ente, welche unter dem Schein, die Kost in Blut und Saft verwandelt zu haben, blo\ss{} einen, vom K\"{u}nstler im Hinterleibe trefflich vorger\"{u}steten Auswurf, der mit Speise und Verdauung gar nicht zusammenh\"{a}ngt, illusorisch in die Welt setzt und dr\"{u}ckt.\end{quotation}
Fl\"{a}tz. Ohne Umst\"{a}nde bot ich den Teller der Tischgesellschaft hin und sagte, ich h\"{a}tte das pasquillantische Geschirr, wie sie s\"{a}hen, eben bekommen, und b\"{a}te sie zu bezeugen, da\ss{} der Handel mich nichts angehe. Ein Offizier wechselte sogleich mit mir Teller. Bei dem f\"{u}nften Gericht durft' ich mich \"{u}ber die chemisch-medizinischen Unkenntnisse der Tischgesellschaft verwundern, indem ein Hase, aus welchem ein Herr mehrere Schrotk\"{o}rner, das hei\ss{}t also ein mit Arsenik versetztes und durch den warmen Essig nun aufgel\"{o}stes Blei, \"{o}ffentlich herausgezogen und vorgezeigt hatte, von den Zuschauern (mich ausgenommen) lustig fortgespeist wurde.
Unter den Tischgespr\"{a}chen fa\ss{}te mich eins gewaltig bei meiner schwachen Seite, bei meiner Ehre. Es wurde n\"{a}mlich der Gerichtsgebrauch der Residenz erz\"{a}hlt, da\ss{} ein unz\"{u}chtiges M\"{a}dchen jeden, wen eine Dirne dazu w\"{a}hle, in den Vater ihres Wurms verkehren
[15] Nach \"{A}hnlichkeit der sch\"{o}n polierten englischen Einlegmesser
gibt's auch Einlegkriegsschwerter, oder --- mit andern Worten ---
Friedensschl\"{u}sse.
k\"{o}nne blo\ss{} durch ihr Eidwort. $\gg$Schrecklich!$\ll$ sagt' ich, und mir stand das Haar zu Berg. --- $\gg$Auf diese Weise kann sich ja der erste beste Hausvater mit Frau und Kindern, oder ein Geistlicher, der im Tiger logiert, von der ersten schlimmsten Aufw\"{a}rterin, die er oder die ihn leider abends zuf\"{a}llig kennen lernen, um Ehre und Unschuld gebracht sehen?$\ll$ Ein \"{a}ltlicher Offizier fragte: $\gg$Soll denn aber das M\"{a}dchen sich lieber zum Teufel schw\"{o}ren?$\ll$ Welche Logik! --- $\gg$Oder gesetzt,$\ll$ fuhr ich ohne Antwort fort, $\gg$ein Mann reist mit jenem Wiener Schlossergesellen, der nachher Mutter wurde und mit einem S\"{o}hnchen niederkam, oder mit irgendeinem verkleideten Ritter d'Eon, mit dem er h\"{a}ufig \"{u}bernachtet; und der Schlossergeselle oder der Ritter d\"{u}rfen dann ihre Beilager beeidigen: so kann ja kein zarter Mann zuletzt mehr mit einem anderen reiten und fahren, weil er nicht wei\ss{}, wann dieser die Stiefel auszieht und die Weiberschuhe an, und ihn dann zum Vater schw\"{o}rt und sich zum Teufel?$\ll$
Aber einige von der Tischgesellschaft vergriffen sich in meinem Kanzelfeuer so sehr, da\ss{} sie schafsm\"{a}\ss{}ig zu glauben andeuteten: ich selber sei in diesem Punkt nicht richtig, sondern lax. Beim Himmel! ich wu\ss{}te da nicht mehr, was ich fra\ss{} und sprach. Zum Gl\"{u}cke wurde mir gegen\"{u}ber eben die L\"{u}ge irgendeiner franz\"{o}sischen Niederlage ausgesagt; da ich nun an den Stra\ss{}enecken die franz\"{o}sische und deutsche Proklamation angesehen, welche jeden, der Kriegsberichte --- n\"{a}mlich nachteilige --- anh\"{o}rt, ohne sie anzuzeigen, vor das Kriegsgericht bestellt: so konnt' ich als ein Mann, der sich nie gern vergessen will, wohl nichts Kl\"{u}geres tun, als davongehen mit leeren Ohren und nur dem Wirte rapportieren warum.
Es war keine unrechte Zeit, denn absichtlich um viereinhalb Uhr wollt' ich mir den Bart scheren lassen, um gegen f\"{u}nf so recht mit einem vom Balbiermessergl\"{a}ttzahn geleckten Kinn, wie glattes Velinpapier, ohne Wurzelst\"{o}cke vom Kinnhaare (Barthaare ist Pleonasmus) auf- und vorzutreten. Vorher go\ss{} ich, wie Pitt vor Parlamentssitzungen, verdammt viel Pontak mit wahrem Ekel in meinen Magen hinunter gegen jede Heillehre und Sperrordnung desselben, nicht sowohl um den leichten, fremden Bartputzer zu bestehen, als den Ministergeneral Schabacker, mit welchem ich eines und das andere Feuerwort zu wechseln vorhatte.
Es kam der gew\"{o}hnliche Fremdenbalbier des Hotels, hatte aber sogleich in seinem viellinigen ausgezackten Gesichte mehr von einem endlich toll werdenden, als von einem weiser werdenden Manne an sich. Tolle nun hass' ich unglaublich und bin daher in kein Tollhaus zu bringen, weil da der erste beste W\"{u}tige mich mit Riesenf\"{a}usten erschnappt, wenn er mag, und weil ich \"{u}berhaupt der Ansteckung wegen nicht wei\ss{}, ob ich wieder mit dem Verstande herauskomme, den ich hineintrage. --- Gew\"{o}hnlich sitz' ich (bin ich eingeseift) dergestalt auf dem Stuhle, da\ss{} ich, beide H\"{a}nde (den Blick spann' ich scharf gegen das balbierende Gesicht) auf den Schenkeln, dem Zwerchfell des Balbiers gegen\"{u}ber schlagfertig liegen habe, um ihn bei der kleinsten zweideutigen Bewegung wie w\"{u}tig umzusto\ss{}en.
Ich wei\ss{} kaum recht, wie es zuging, aber indes ich mich ins n\"{a}rrisch-gewundene Gesicht des Bartputzers vertiefe und da er eben das lang' gewetzte Schlachtmesser etwas vorschnell gegen meine entbl\"{o}\ss{}te Gurgel f\"{u}hrte: so gab ich dem Feld- und Bartscherer einen so pl\"{o}tzlichen Sto\ss{} auf den Nabel, da\ss{} der Mann sich im Fallen bald selber selbstm\"{o}rderisch die Gurgel abgeschnitten h\"{a}tte. Mir blieb freilich nichts davon als Gutmachungen und eine gegen meine sonstigen Grunds\"{a}tze umgebundene geschwollene Kravatte als Deckmantel dessen, was unbeschoren geblieben.
Jetzt brach ich denn endlich zum General auf und trank die Pontaksreste noch unter der Schwelle aus. Ich hoffe, in mir lagen Pl\"{a}ne fertig, richtig zu antworten, ja zu fragen. Das Bittschreiben hatt' ich in der Tasche und in der rechten Hand. In der linken hatt' ich dessen Duplikat. Mein Feuer half mir leicht \"{u}ber alle ministeriellen lebendigen Z\"{a}une hin\"{u}ber, und ich befand bald mich unverhofft im Vorzimmer unter seinen vornehmsten Lakaien, die, soviel ich merkte, nichts verpassen sollten. Ich \"{u}berreichte dem Ansehnlichsten meine papierne Bitte mit der m\"{u}ndlichen, sie seinerseits zu \"{u}berreichen. Er nahm sie, aber unverbindlich. Ich wartete tief in die Stunde sechs Uhr hinein vergeblich, worin allein dem frohen Generale manches vorzutragen ist. Endlich erseh' ich einen Stief- oder Duzbruder des vorigen Lakaien und wiederhole mein Gesuch; dieser rennt umsonst umher, um Bruder oder Schreiben zu suchen --- nichts war zu finden: --- wie gl\"{u}cklich war ich, da\ss{} ich das Duplikat der Bittschrift mitten im Pontak vor dem Rasieren mir wieder abgeschrieben, und also --- blo\ss{} aus dem Grundsatz, da\ss{} man immer ein zweites h\"{o}lzernes Bein im Mantelsack eingepackt haben m\"{u}sse, wenn man ein erstes am Leibe habe --- und aus der Furcht, da\ss{}, wenn mir das Urschreiben auf dem Wege
\begin{quotation}
[13] \textit{Omnibus una salus sanctis, sed gloria dispar}; das hei\ss{}t --- schreiben sonst die Gottesgelehrten --- nach Paulus haben wir im Himmel alle dieselbe Seligkeit, aber verschiedene Ruhmstufen. Schon auf der Erde finden wir im Himmel der Schriftstellerwelt\end{quotation}
vom Tiger zu Schabacker verloren ginge, meine ganze Reise und Hoffnung zu Wasser m\"{u}\ss{}te werden --- dies, sag' ich, war gut, da\ss{} ich das Repetierwerk des Urschreibens eingesteckt hatte, und folglich in jedem Falle etwas, und zwar ein detto, einzuh\"{a}ndigen vermochte. Ich h\"{a}ndigte dasselbe ein.
Leider nur war schon sechs Uhr vorbei. Der Lakei aber blieb nicht lange aus, sondern brachte mir bald --- ich m\"{o}chte sagen den Predigttext dieses Zirkelbriefes --- die fast rohe Antwort (die ihr, Freunde, aber aus Achtung f\"{u}r mich und Schabacker geheim zu halten habt): falls ich der Attila Schmelzle beim Schabackerschen Regiment w\"{a}re, so m\"{o}cht' ich mich nur mit meinem Hasenpanier wieder zum Teufel scheren, wie ich bei Pimpelstadt getan. Ein anderer w\"{a}re auf dem Platze geblieben; ich aber ging ganz derb davon und
\begin{quotation}
ein Vorbild davon. N\"{a}mlich die Seligkeit der von der Kritik seliggesprochenen Autoren der genialen, der guten, der mittelm\"{a}\ss{}igen, der geistesarmen, ist bei allen die n\"{a}mliche, sie machen s\"{a}mtlich im ganzen fast einerlei Kameralgl\"{u}ck, denselben\end{quotation}
versetzte dem Kerl: $\gg$Ich schere mich auch willig zum Teufel, und schere mich den Teufel darum.$\ll$ Unterwegs untersucht' ich mich selber, ob nicht etwa der Pontak aus mir gesprochen --- wiewohl schon die Untersuchung widerspricht, da kein Pontak untersucht; --- aber ich fand, da\ss{} nur ich, mein Herz, vielleicht mein Mut etwas gesprochen: und wozu denn \"{u}berhaupt Kleinmut, da das Verm\"{o}gen meiner guten Frau mich ja besser besoldet als zehn katechetische Professuren, und da sie alle Ecken meines Buches des Lebens mit so viel goldenen Beschl\"{a}gen versieht, da\ss{} ich es, ohne es abzun\"{u}tzen, immer aufschlagen kann? --- Schwangere m\"{o}gen bei Schrecken an den Hintern greifen, um das Muttermal des Versehens dorthin zu verstecken; ich griff bei dem Mute ans Herz und sagte: $\gg$Schlage dich nur tapfer durch, wer auch dabei geschlagen
\begin{quotation}
schwachen Profit. Aber Himmel, was hingegen Nachruhmsstaffeln anlangt, wie tief wird nicht --- ungeachtet des n\"{a}mlichen Honorars und Absatzes --- schon bei Lebzeiten ein sogenannter Duns unter ein Genie hinabgestellt! --- Wird nicht oft ein\end{quotation}
werde!$\ll$ Ich f\"{u}hlte mich ganz erhoben und erhitzt --- ich dachte mir Republiken, wo ich als Held nach Hause kommen k\"{o}nnte --- ich sehnte mich in jene heroischen Griechenzeiten hinein, wo ein Held vom andern Pr\"{u}gel gern einsteckte und sagte: schlage nur, aber h\"{o}re mich! und aus unseren feigen heraus, wo man kaum Schimpfworte aush\"{a}lt, geschweige mehr --- ich malte mir es aus, wie ich mich f\"{u}hlen w\"{u}rde, wenn ich in gl\"{u}cklichere Umgebungen Afterthronen umw\"{u}rfe und vor ganzen V\"{o}lkern auf Gro\ss{}taten wie auf Tempelstufen unsterblich aufstiege und in gigantischen Zeiten ganz andere und gr\"{o}\ss{}ere M\"{a}nner zu \"{u}bermannen und zu \"{u}bertreffen f\"{a}nde als jetzt den Milbenp\"{o}bel um mich her und h\"{o}chstens den einen und den anderen Vulcanello. Ich dachte --- und machte mich immer wilder und ich selber berauschte mich
\begin{quotation}
geistesarmer Autor in einer Messe vergessen, indes ein geistreicher oder gar ein genialer durch f\"{u}nfzig Messen durchbl\"{u}ht und so erst sein 25j\"{a}hriges Jubil\"{a}um feiert, bevor er sp\"{a}t vergessen untergeht und im deutschen Ruhmtempel eingesenkt wird, der\end{quotation}
(also kein Pontaksrausch, der bekanntlich mehr durch als ohne Trinken w\"{a}chst), und gestikulierte \"{o}ffentlich --- als ich mich fragte: $\gg$Willst du ein blo\ss{}er Staatsscho\ss{}hund werden --- ein Hunds-Hund --- ein \textit{pium desiderium} eines \textit{impii desiderii} --- ein Ex-Ex --- ein Nichts-Nichts? ------ O Sackerment!$\ll$ Dar\"{u}ber stie\ss{} ich mir aber meinen Hut in den Marktkot. Da ich ihn aufhob und s\"{a}uberte, sah ich \"{u}berall, wie verschossen er war, und entschlo\ss{} mich sogleich, einen neuen zu kaufen und anfangs selber zu tragen in der Hand.
Ich vollzog's und erhandelte einen vom feinsten Kaliber. Sonderbar, durch diesen Hut, als w\"{a}r's ein Magisterhut, wurde in der Ziegengasse ordentlich mein Kopf gepr\"{u}ft und examiniert. Da n\"{a}mlich der General Schabacker darin daherfuhr, und ich (wie sich wohl von selber versteht) mich nicht durch
die bekannte Eigenheit der Kirche des Ordens der Padri Lucchesi in
Neapel nachahmt, welche bekanntlich (nach Volkmann) unter ihrem
Dache eine Begr\"{a}bnisst\"{a}tte, aber kein Denkmal darauf verstatten.
gemeine Grobheit, sondern durch H\"{o}flichkeit r\"{a}chen wollte: so bekam ich eine der kitzlichsten Aufgaben zu l\"{o}sen vor. Schwenkt' ich n\"{a}mlich blo\ss{} den feinen Filz, den ich schon in der Hand trug, behielt aber den verschossenen auf dem Kopfe: so konnt' ich einem Grobian von Haus aus \"{a}hnlich sehen, der nichts abzieht; zog ich hingegen den alten vom Kopfe und hofierte damit: so spielten zwei Filze auf einmal (ich mochte nun den anderen mitbewegen oder nicht) die Sache ins L\"{a}cherliche. Nun, stimmt doch ab, ihr Freunde, eh' ihr weiter leset, wie man sich hier herauszuziehen h\"{a}tte, ohne den Kopf zu verlieren!.... Ich glaube vielleicht dadurch, da\ss{} man blo\ss{} den Hut verliert; kurz und gut, ich lie\ss{} eben geradezu den Putzhut aus der Hand in den Kot fallen, um mich in den Stand zu setzen, den Sudelhut einsam abzunehmen und mit n\"{o}tiger H\"{o}flichkeit zu schwenken ohne einen Anstrich von L\"{a}cherlichkeit.
Im Tiger lie\ss{} ich --- um etwas schlie\ss{}en zu lassen --- den brillantierten Fein-Fein-Fein-Filz
[Illustration: ...und betete laut: Dir \"{u}bergeb' ich mich ganz / Du allein sorgtest ja bisher f\"{u}r mich schwachen Knecht]
fr\"{u}her ausb\"{u}rsten als den Kotsassen- oder Schartekenhut.
Nun ging ich, meine wichtige Vergangenheit in der Adjustier- und Probierwage tragend, feurig auf und nieder. Der Pontak mu\ss{}te --- ich wei\ss{} wohl, da\ss{} es hinieden nur unechten gibt --- ein noch unechterer gewesen sein; so sehr jagte er meine Phantasie in ein Feuer nach dem anderen. Ich sah jetzt in ein weites, gl\"{a}nzendes Leben hinein, wo ich ohne Amt lebte, blo\ss{} von Geld; und das ich gleichsam mit den delphischen H\"{o}hlen und Zenonischen G\"{a}ngen und Musenbergen aller der Wissenschaften \"{u}bers\"{a}et sah, die ich ruhig treiben konnte. Besonders konnte ich mich mehr auf Preisschriften bei Akademien legen, deren (n\"{a}mlich der Schriften) sich kein Urheber jemals zu sch\"{a}men braucht, weil eine ganze kr\"{o}nende Akademie in jedem Falle f\"{u}r den Koronanden steht und err\"{o}tet. Schie\ss{}t auch der Preiswerber neben der Krone vorbei, so bleibt er doch stets unbekannter und anonymer (da man seine Devise nicht entsiegelt) als ein anderer Autor, der zwar namenlos ein Langohr von Buch ediert, den aber doch bald ein literarisches Eselbegr\"{a}bnis (\textit{sepultura asinina}) \"{o}ffentlich vor der halben Welt einsenkt.
Nur etwas dauerte mich voraus, das Leid meiner Berga, welcher ich morgen, der lieben M\"{u}degereisten, die Ankunft und die abgek\"{u}rzte Marktschau mit meiner abschl\"{a}gigen Nachricht versalzen mu\ss{}te. Sie wollte so gern in Neusattel --- und wer ver\"{u}belt's einer reichen P\"{a}chterstochter --- etwas vorstellen und manche Honoratiorin ausstechen. --- Jeder Mensch verlangt sein Paradepl\"{a}tzchen und eine fr\"{u}here lebendigere Ehre, als die letzte Ehre. --- Besonders will eine so gute Niedriggeborene, sich vielleicht mehr ihres metallischen als ihres geistigen Schatzes und Tilgungsfonds bewu\ss{}t, doch bei Ehrengelagen Meisterin von irgendeinem Stuhl oder St\"{u}hlchen sein und \"{u}ber die erste beste dumme Gans \textit{loci} hinaufsitzen.
Dazu sind nun Ehem\"{a}nner so unentbehrlich. Ich nahm mir daher vor, mir und folglich ihr einen der besten Titel, womit die H\"{o}fe in Deutschland (gleichsam wie in einem Auerbachshof in Leipzig) vom Adel und Halbadel an bis zum Rate herunter in einem fort feilstehen, anzukaufen und dieser geadelten Seele durch meinen Viertelsadel einen solchen Achtelsadel zuzuspielen, da\ss{} (hoff' ich) manche gemeine nebenbuhlerische Neusattlerin vom Neide halb geborsten sagen und rufen soll: $\gg$Ei du dummes P\"{a}chtersding! Seht doch, wie das schw\"{a}nzelt und wedelt! Es denkt nicht daran, was es mit ihm w\"{a}re, wenn es keinen Geldsack und keinen Hofrat h\"{a}tte;---$\ll$ Denn letzteres n\"{a}mlich m\"{u}\ss{}t' ich etwa vorher geworden sein.
Aber ich sehnte mich in der kalten Einsamkeit meines Zimmers und im Feuer meiner Erinnerungen unbeschreiblich nach dem Bergelchen --- ich und mein Herz waren m\"{u}de vom fremden treibenden Tage --- niemand um mich her sagte mir ein gutes Wort, das er nicht in die Wirtsrechnung zu bringen verhoffte. --- Freunde, ich schmachtete nach der Freundin, deren Herz gern das Blut zum Balsam f\"{u}r ein zweites vergie\ss{}t --- ich verfluchte meine \"{u}berklugen Ma\ss{}regeln, da\ss{} ich nicht, um die Gute sogleich mit mir zu nehmen, lieber das dumme Hauswesen allen Spitzbuben und Feuersch\"{a}den preisgegeben. --- Im Auf- und Abgehen ward es mir immer leichter, alles zu werden, jeder Kammerrat, Akzisrat, anderer Rat, und wie sie nur befahl, wenn sie ank\"{a}me.
$\gg$Mach dir nur einen guten Tag in der Stadt!$\ll$ sagte Bergelchen diese ganze Woche hindurch. Aber wie ist einer ohne sie zu machen? Unsere Trauertr\"{a}nen trocknen auch Freunde ab und begleiten sie mit eigenen; aber unsere Freudentr\"{a}nen finden wir am leichtesten in den Augen unserer Frauen wieder. --- Verzeiht, Freunde, diese Libationen meiner R\"{u}hrung --- ich zeig' euch nur mein Herz und meine Berga. --- Bedarf ich eines Abla\ss{}kr\"{a}mers, so nehmt den Pontakskr\"{a}mer dazu.
[79] Schwache und verschobene K\"{o}pfe verschieben und ver\"{a}ndern sich
am wenigsten wieder, und ihr innerer Mensch kleidet sich sparsam um;
ebenso mausern Kapaune sich nie.
Erste Nacht in Fl\"{a}tz.
Gleichwohl nahm mir der Wein die Besonnenheit nicht, vor dem Bettegehen unter das Bett zu sehen, ob jemand darunter lauere, zum Beispiel die Hure, der Zwerg oder der Legationsrat, ferner den Schl\"{u}ssel unter den T\"{u}rdr\"{u}cker (die beste Sperrordnung unter allen) zu schieben, dann zum \"{U}berflusse meine Nachtschraube an die T\"{u}re einzubohren und endlich davor noch die Sessel \"{u}bereinander zu bauen und Beinkleider und Schuhe anzubehalten, weil ich durchaus nichts besorgen wollte.
Ich hatte aber noch andere Sachen des Nachtwandels wegen abzutun. Mir war's \"{u}berhaupt von jeher unbegreiflich, wie so viele Menschen zu Bette gehen und darin gesetzt liegen k\"{o}nnen, ohne zu bedenken, da\ss{} sie vielleicht im ersten Schlafe sich aufmachen
\begin{quotation}
[89] Die Alten heilten sich im Zeitenungl\"{u}ck mit Philosophie oder mit Christentum; die Neueren aber z.B. in der Schreckenszeit griffen zur Wollust, wie etwa der verwundete B\"{u}ffel sich zur Kur und zum Verband im Schlamme w\"{a}lzt.\end{quotation}
als Nachtwandler und auf D\"{a}cher hinauskriechen und irgendwo erwachen, wo sie den Hals brechen und den Rest. Ja, es w\"{a}re mir schon Gefahr genug, wenn ein unbescholtener Mann, ein Feldprediger, im eigenen Bette einschliefe und etwa auf den Seidenpolstern im Schlafgemache der vornehmsten Dame in der Stadt aufwachte, von der er vielleicht sein Gl\"{u}ck erwartet. Bin ich zu Hause, so wag' ich wenig mit Schlaf; --- weil ich, da meine rechte Fu\ss{}zehe jede Nacht mit einem drei Ellen langen Wickelbande (ich nenn' es scherzend unser eheliches Band) an die linke Hand meiner Frau angeschlungen wird, die Gewi\ss{}heit habe, da\ss{} ich, falls ich aus dem Bettarrest herausginge, mit dem Sperrstrick sie wecken und ich folglich von ihr, als meinem lebendigen Zaun, an der Nachtschnur wieder ins Bett w\"{u}rde zur\"{u}ckgezogen werden. Im Gasthof aber konnt' ich nichts tun, als mich einige Male an den Bettfu\ss{} schn\"{u}ren, um nicht zu wandern; obgleich alsdann einbrechende Spitzbuben neue Not mitbringen konnten. Ach, so gef\"{a}hrlich ist alles Schlafen, da\ss{} leider jeder, der nicht auf dem R\"{u}cken wie ein Leichnam daliegt, besorgen mu\ss{}, mit dem Ganzen schlafe auch ein oder das andere Gliedma\ss{}, ein Fu\ss{}, ein Arm ein; und dann kann das entschlummerte Glied --- da es in der medizinischen Geschichte gar nicht daran an Exempeln fehlt --- am Morgen zum Amputieren gereift daliegen. Deshalb lass' ich mich h\"{a}ufig wecken, damit nichts einschl\"{a}ft.
Als ich an den Bettpfosten gut angebunden und endlich unter die Bettdecke gekommen war, wurde ich wegen meines Pontaks Feuertaufe aufs neue bedenklich und furchtsam vor meinen zu erwartenden Kraft- und Sturmtr\"{a}umen --- welche leider nachher auch nichts Besseres wurden als Helden- und Potentatentaten, Festungsst\"{u}rme, Felsenw\"{u}rfe; --- noch aber seh' ich wenig diesen Punkt \"{a}rztlich beherzigt.
\begin{quotation}
[108] Verwundert las ich, der Gru\ss{} im Gotthardstal sei: \textit{Allegro!} --- Denn nie wurd' ich in Wetzlar, in Regensburg oder Wien anders gegr\"{u}\ss{}t als: \textit{Andante di molto!} --- zuweilen jedoch: \textit{Allegro, ma non troppo!} --- Ja, alte Generale gr\"{u}\ss{}ten sich\end{quotation}
Medizinalr\"{a}te und ihre Kunden strecken sich alle ruhig in ihren Betten aus, ohne da\ss{} nur einer von ihnen bef\"{u}rchtet oder untersucht, ob ihm ein w\"{u}tiger Zorn (zumal wenn er schnell darauf kalt s\"{a}uft im Traum), oder ein herzzerrei\ss{}ender Harm, was er alles in den Tr\"{a}umen erleben kann, am Leben schade oder nicht. W\"{a}r' ich, ich bekenn' es, eine Frau und mithin weiblich-furchtsam zumal in guter Hoffnung, ich w\"{u}rd' in letzter \"{u}ber die Frucht meines Scho\ss{}es in Verzweiflung sein, wenn ich schliefe und folglich im Traum alle die von medizinischen Polizeien verbotenen Ungeheuer, wilden Bestien, Mi\ss{}geburten und dergleichen zu Gesicht bek\"{a}me, wovon eine ausreicht (sobald die best\"{a}tigte Lehre des Versehens wahr bleibt), da\ss{} ich Krei\ss{}ende mit einem elenden Kinde niederk\"{a}me, das ganz auss\"{a}he wie ein Hase und voll Hasenscharten dazu, oder das eine L\"{o}wenm\"{a}hne
oft: \textit{Poco vivace.} --- Ich erkl\"{a}re mir es daher, da\ss{} der Deutsche,
wenn alle V\"{o}lker, die F\"{u}\ss{}e und Schuhe zu ihren Ma\ss{}en nehmen, lieber
mit Sessions-Stei\ss{}en und Hosen abmi\ss{}t.
hinten h\"{a}tte oder Teufelsklauen an den H\"{a}nden, oder was sonst noch Mi\ss{}geburten an sich haben. Vielleicht wurden manche Mi\ss{}geburten von solchem Versehen in Tr\"{a}umen gezeugt.
Nachts kurz vor zw\"{o}lf Uhr erwacht' ich aus einem schweren Traum, um eine f\"{u}r meine Phantasie zu geisterhafte Geistergeschichte zu erleben. Mein Schwager, der sie mir eingebrockt, verdient f\"{u}r seine ungesalzene Kocherei, da\ss{} ich ihn euch als den Braumeister des schalen Gebr\"{a}ues ohne Schonen nenne. W\"{a}re Argwohn mit Unerschrockenheit vertr\"{a}glicher, so h\"{a}tte ich vielleicht schon aus seinem Sittenspruche \"{u}ber dergleichen unterwegs sowie aus dem Fortbehalten seines Nebenzimmers, an dessen Mittelt\"{u}re mein Lager stand, leicht alles geschlossen. Mir war n\"{a}mlich, als w\"{u}rd' ich angeblasen von einem kalten Geisteratem, den ich auf keine Weise
[181] Gott sei Dank, da\ss{} wir nirgends ewig leben als in der H\"{o}lle
oder im Himmel; auf der Erde w\"{u}rden sonst wahre Spitzbuben aus uns,
und die Welt ein Haus von Unheilbaren, aus Mangel der
aus den entfernten und versperrten Fenstern herzuleiten vermochte; --- worin ich's denn auch traf, denn der Schwager hatt' ihn aus einem Blasebalg durchs Schl\"{u}sselloch eingeschickt. Alles Kalte bringt in der Nacht auf Todes- oder Geisterk\"{a}lte. Ich ermannte mich aber und harrte --- nun fing gar das Deckbette an, sich in Bewegung zu setzen --- ich zog es an mich --- es wollte wieder weiter --- behend' setz' ich mich pl\"{o}tzlich im Bette auf und rufe: $\gg$Was ist das?$\ll$ --- Keine Antwort, \"{u}berall Stille im Gasthof --- das ganze Zimmer voll Mondschein---. Jetzt hob sich mein Zugpflaster, das Deckbett, gar empor und luftete mich, wobei mir war wie einem, von dem man ein Pflaster schnell abhebt. Nun tat ich den Rittersprung aus dem Teufelstorus und zersprengte springend mein Nachtwandlersleitseil. $\gg$Wo ist der dumme Menschennarr,$\ll$ rief ich, $\gg$der die erhabene unsichtbare
Kurschmiede (der Scharfrichter) und der ableitenden Haarseile (am
Galgen) und der Ekel- und Eisenkuren (auf Richtst\"{a}tten). So da\ss{} wir
also wirklich unsre sittliche Riesenkraft gerade so auf der Schuld
Geisterwelt nach\"{a}fft, die ihm ja auf der Stelle erscheinen kann?$\ll$ --- Aber an, \"{u}ber, unter dem Bette war nichts zu h\"{o}ren und zu sehen. Ich schaute zum Fenster hinaus; \"{u}berall geisterhaftes Mondlicht und Stra\ss{}enstille, und nichts bewegte sich, als (wahrscheinlich vom Winde) auf dem fernen Galberg ein Neugehenkter.
Jeder andere h\"{a}tt' es so gut f\"{u}r Selbstt\"{a}uschung gehalten als ich; daher wickelte ich mich wieder in mein passives \textit{lit de justice} und Luftbette ein, darin erwartend, inwiefern ich an Erschrecken erkalten sollte oder nicht.
Nach einigen Minuten fing das Deckbette, der teuflische Faustsmantel, sein Fliegen und Schiffsziehen (ich allein war der Verurteilte) wieder an, der Abwechslung wegen hob auch wieder der unsichtbare Bettaufhelfer empor. Verfluchte Stunde! --- Ich m\"{o}chte wissen, ob es im ganzen gebildeten Europa einen gebildeten
der Natur, die wir zu bezahlen haben, beruhend, finden, als die
Politiker (z.B. der Verfasser des neuen Leviathans) die \"{U}bermacht
der Engl\"{a}nder, auf deren Nationalschuld gest\"{u}tzt, erweisen.
oder ungebildeten Menschen g\"{a}be, der bei so etwas nicht auf Geisterteufeleien verfallen w\"{a}re; --- ich verfiel darauf, unter der (sich selber) fahrenden Habe des Deckbettes, und dachte, Berga sei Todes verfahren und fasse nun noch geistig mein Bette. Dennoch konnt' ich sie nicht anreden, sowenig als den Teufel, der hier einspielen konnte, sondern ich wandte mich blo\ss{} an Gott und betete laut: $\gg$Dir \"{u}bergeb' ich mich ganz, du allein sorgtest ja bisher f\"{u}r mich schwachen Knecht --- und ich schw\"{o}re, da\ss{} ich anders werde.$\ll$ --- Ein Versprechen, das dennoch von mir soll gehalten werden, so sehr auch alles nur dummer Lug und Trug gewesen ist.
Mein Gebet verfing nichts bei dem unchristlichen Dragoner, der mich einmal im Zuggarn des Deckbetts gefangen hielt --- unbek\"{u}mmert, ob er ein Gastbett zum Parade-
\begin{quotation}
[63] Die, welche vom V\"{o}lkerlichte Gefahren bef\"{u}rchten, gleichen denen, die besorgen, der Blitz schlag' ins Haus, weil es Fenster hat; da er doch nie durch diese, sondern durch deren Beeinflussung f\"{a}hrt oder an der Rauchwolke des Schornsteins herab.\end{quotation}
[Illustration: Ich pfiff frisch ein gas Konisches Liedchen darunterhinein...]
und Totenbette mache oder nicht. --- Er spann meine Nerven wie Golddraht durch engere L\"{o}cher hindurch immer d\"{u}nner bis zum Verschwenden und Verschwinden, denn das Bette marschierte endlich gar herab bis an die Mittelt\"{u}re.---
Jetzt war es Zeit, ohne Umst\"{a}nde erhaben zu werden und mich um nichts mehr hienieden zu scheren, sondern mich dem Tode schlicht zu widmen: $\gg$Rafft mich nur weg,$\ll$ rief ich und schlug unbedenklich drei Kreuze, $\gg$macht mich nur schnell nieder, ihr Geister; ich sterbe doch unschuldiger als tausend Tyrannen und Gottesleugner, denen ihr leider weniger erscheint als mir Unbeflecktem.$\ll$ Hier vernahm ich eine Art von Lachen, entweder auf der Gasse oder im Nebenzimmer; vor diesem warmen Menschenton bl\"{u}ht' ich pl\"{o}tzlich wie vor einem Fr\"{u}hling an allen Spitzen wieder auf. Ich verschm\"{a}hte g\"{a}nzlich die weggehaspelte
[76] Die \"{o}konomische predigende Poesie glaubt wahrscheinlich, ein
chirurgischer Steinschneider sei ein artistischer; und eine Kanzel
oder ein Sinai sei ein Musenberg.
Decke, die jetzt von der T\"{u}re nicht mehr weg konnte; ich legte mich unbedeckt, doch warm und schwitzend genug, bald in den Schlaf. \"{U}brigens sch\"{a}m' ich mich nicht im geringsten vor allen aufgekl\"{a}rten Hauptst\"{a}dten --- und st\"{a}nden sie vor mir---, da\ss{} ich durch meinen Teufelsglauben und meine Teufelsanrede einige \"{A}hnlichkeit mit dem gr\"{o}\ss{}ten deutschen L\"{o}wen bekommen, mit Luther.
Zweiter Tag in Fl\"{a}tz.
Am Fr\"{u}hmorgen sp\"{u}rt' ich mich aufgeweckt durch das bekannte Zudeckbett; es hatte sich wie ein Inkube auf mich gesetzt; ich gaffte auf; in einem Winkel sa\ss{} still ein rotes, rundes, kernhaftes, aufgeputztes M\"{a}dchen wie eine volle Tulpe von Lebensfrische aufgebl\"{a}ht und leise flatternd mit bunten B\"{a}ndern gleichsam
\begin{quotation}
[415] Nach Smith ist die Arbeit der allgemeine Ma\ss{}stab des kameralen Werts. Dies haben aber, wenigstens in bezug auf geistigen und poetischen Wert, die Deutschen noch fr\"{u}her eingesehen und meines Wissens stets den gelehrten Dichter \"{u}ber den genialen und das schwere Buch der Arbeit \"{u}ber das flatternde voll Spiel gesetzt.\end{quotation}
als mit Bl\"{a}ttern. $\gg$Wer ist dort, wie kommt man herein?$\ll$ rief ich halbblind.--- $\gg$Ich habe dich nur leise zugedeckt, und du solltest erst ausschlafen,$\ll$ sagte Bergelchen, $\gg$ich bin die ganze Nacht gegangen, damit ich recht fr\"{u}h k\"{a}me; sieh nur her!$\ll$ Sie zeigte mir ihre Stiefel, das einzige Reisest\"{u}ck (die Achillesferse), das sie vor dem Tore, als sie in der Mauser der Toilette war, nicht hatte abstreifen k\"{o}nnen. --- $\gg$Brach,$\ll$ fragt' ich, \"{u}ber ihre um sechs Stunden beschleunigte Nachkunft um so mehr best\"{u}rzt, da ich es die ganze Nacht und selber jetzt \"{u}ber ihr unbegreifliches Hereinkommen gewesen, $\gg$brach etwa frischer Jammer \"{u}ber uns aus und ein, Brand, Mord, Raub?$\ll$ --- Sie versetzte: $\gg$Der Ratz$\ll$, sie wollte sagen die Ratte, $\gg$ist gestern verreckt, dem du so lange nachgestellt; weiter passierte eben nichts.$\ll$ --- $\gg$Und auch alles ist richtig nach meinem Ordnungszettel zu Hause besorgt?$\ll$ fragt' ich. $\gg$Jawohl,$\ll$ versetzte
[4] Der Heuchler kehret die alte Methode, wonach man mit einem nur
an einer Schneidenseite vergifteten Messer die Frucht zerschnitt und
die damit
sie, $\gg$ich hab' ihn aber gar nicht gelesen, er ist mir weggekommen, du hast ihn wohl mit eingepackt.$\ll$---
Indes, ich verzieh alles der bl\"{u}henden, kecken Ritterin oder Fu\ss{}g\"{a}ngerin. --- Ihr Auge, dann ihr Herz brachte mir ja frisches, k\"{u}hles Morgenwehen mit Morgenrot in meine schw\"{u}len Vorstunden. Auch mu\ss{}t' ich ja ohnehin nachher der freundlichen, ins Leben hineinhoffenden und hineinliebenden Seele den verdienten Himmel des heutigen Tages mit der tr\"{u}ben Nachricht der fehlgeschlagenen Professur verfinstern. Daher vergab und verschob ich m\"{o}glichst. Ich fragte, wie sie hereingekommen, da noch das ganze spanische Reiterwerk von Sesseln an der T\"{u}re feststehe. Sie lachte, sich dabei nach Dorfsitte b\"{u}ckend, stark und sagte: sie h\"{a}tte es vorgestern mit ihrem Bruder verabredet, da\ss{} er sie durch seine Stube, da sie meine Sperrvorrichtung kennte, in meines einlie\ss{}e, damit sie mich heimlich
ge\"{a}tzte H\"{a}lfte dem Opfer hinreichte und die gesunde zweite selber
a\ss{}, so uneigenn\"{u}tzig gegen sich selber um, da\ss{} er gerade die gute
moralische H\"{a}lfte
wecken k\"{o}nnte. Jetzt fuhr der Dragoner laut lachend ins Zimmer und sagte: $\gg$Wie geschlafen, Herr Schwager?$\ll$
Aber auf diese Weise war mir freilich die halbe Gespenstergeschichte wie von einem Biester und Hennings aufgel\"{o}st und aufgedeckt; und ich durchschaute sogleich des Dragoners ganzen Gespensterplan, den er ausgef\"{u}hrt. Etwas bitter sagte ich ihm meine Vermutung und der Schwester meine Geschichte. Aber er log und lachte, ja er versuchte, noch frech genug, mir am hellen Morgen Geister zum zweiten Male weiszumachen und aufzuhalsen. Ich versetzte kalt, an mir find' er hierin sehr den unrechten Mann; gesetzt auch, ich w\"{a}re einem Luther, Hobbes, Brutus \"{a}hnlicher, die s\"{a}mtlich Geister gesehen und gef\"{u}rchtet. Er erwiderte --- und ri\ss{} die Tatsachen aus ihrer Motivierung: --- er sage ja weiter nichts, als da\ss{} er nachts irgendeinen armen S\"{u}nder ganz erb\"{a}rmlich habe
und Seite dem andern zeigt und gibt und nur sich die giftige
vorbeh\"{a}lt. Himmel, wie schlecht erscheint einem solchen Manne
gegen\"{u}ber der Teufel!
kr\"{a}chzen und lamentieren h\"{o}ren; und daraus habe er geschlossen, es sei eine arme, desperate Nachtm\"{u}tze von Mann, der ein Gespenst zusetze. Endlich gingen auch seiner Schwester die Augen \"{u}ber die gemeine Rolle auf, die er mit mir zu spielen vorgehabt; sie fuhr ihn derb an, schob ihn mit zwei H\"{a}nden aus meiner und seiner T\"{u}re schnell hinaus und rief nach: $\gg$Warte, du Schadenfroh, ich gedenk' dir's!$\ll$ Darauf kehrte sie schnell sich um und fiel mir um den Hals und dabei am falschen Ort ins Lachen und sagte: $\gg$Der dumme Junge! Aber ich konnte das Lachen nicht mehr verbei\ss{}en; und der Narr soll doch nichts merken. Vergib dem Pinsel, du als ein gelehrter Mann, seine Eselei.$\ll$
Ich fragte sie, ob sie auf ihrer Nachreise auf keine Geisterwelt gesto\ss{}en sei --- wiewohl ich wu\ss{}te, da\ss{} ihr Tiere, ein Wasser, ein halber Abgrund nichts sind; --- $\gg$nein, aber vor den geputzten Stadtleuten$\ll$, sagte sie, $\gg$habe ich mich am Morgen gescheut$\ll$. O wie lieb' ich diese weichen Harmonikasbebungen weiblicher Furcht!
Endlich mu\ss{}t' ich den Koloquintenapfel anbei\ss{}en oder anschneiden und ihr die H\"{a}lfte davon zureichen, n\"{a}mlich die Nachricht der Fehlbitte um die Professur. Da ich aber das freudige Herz mit der vollst\"{a}ndigen rohen Wahrheit verschonen und einer schweren Fracht etwas abschneiden mu\ss{}te, die sich besser M\"{a}nnerschultern aufpackt, so begann ich: $\gg$Bergelchen, die Professorssache geht einen anderen, aber an sich guten Gang --- der General, nach welchem ich den Teufel und seine Gro\ss{}mutter frage, legt es auf einen Generalsturm an --- und den soll er haben, so gewi\ss{}, als ich die Nachtm\"{u}tze aufhabe.$\ll$ --- $\gg$So bist du also noch nichts geworden?$\ll$ fragte sie. $\gg$Vorderhand zwar nicht!$\ll$ versetzt' ich. $\gg$Aber doch bis Sonnabend abend?$\ll$ sagte sie. $\gg$Das nicht,$\ll$ sagt' ich. $\gg$Nun, so bin ich hart geschlagen, und ich m\"{o}chte zum Fenster hinausspringen,$\ll$ sagte sie und drehte das Rosen- und Morgengesicht
[66] Wenn die Bemerkung des Verfassers der Glossen richtig ist, da\ss{}
die Postmeister in den gr\"{o}\ss{}ern L\"{a}ndern zugleich auch die gr\"{o}bern
sind: so hat Napoleon, der viele kleine L\"{a}nder zu einem gro\ss{}en
weg, um die feuchten Augen darin mir nicht zuzukehren, und schwieg sehr lange. Dann fing sie mit schmerzhaft zitternder Stimme an: $\gg$Du gro\ss{}er Heiland, stehe mir am Sonntag in Neusattel bei, wenn mich die hochtrabenden, vornehmen Weiber in der Kirche sehen und ich blutrot werde aus Scham!$\ll$
Jetzt sprang ich im Mitjammer aus dem Bette vor die liebe Seele hin, der die hellen Z\"{a}hren \"{u}ber die sch\"{o}nbl\"{u}henden Wangen flossen und rief: $\gg$Du treues Herz, zermartre mich doch nicht so ganz! Gott soll mich strafen, wenn ich nicht noch in den Hundstagen alles werde, was du nur willst. --- Sprich, willst du Bergr\"{a}tin werden, oder Baur\"{a}tin, oder Hofr\"{a}tin, Kriegsr\"{a}tin, Kammerr\"{a}tin, Kommerzienr\"{a}tin, Legationsr\"{a}tin, oder des Henkers- und Teufelsr\"{a}tin: ich bin dabei und werd' es und such' an. Morgen schick' ich reitende Boten nach Hessen und Sachsen,
\begin{quotation}
korinthischen Erze zusammenschmolz und brannte, die Postmeister und Posthalter, z.B. im h\"{o}flichen Sachsen, gewi\ss{} nicht noch h\"{o}flicher gemacht, sondern sie eher aus der Komplimentierschule herausgeschickt.\end{quotation}
nach Preu\ss{}en und Reu\ss{}en, nach Friesland und Katzenellenbogen und begehre Patente. Ja, ich treib's weiter als einer und werde zugleich alles, Flachsenfinger Hofrat, Scheerauer Akzisrat, Haar-Haarer Baurat, Pestitzer Kammerrat (denn wir haben das Geld), und stelle dann allein und eigenh\"{a}ndig mit einem einzigen \textit{Podex} und \textit{Corpus} eine ganze Ratssitzung von auserlesenen R\"{a}ten vor --- und stehe als eine ganze Ehrenlegion und ein Ehrengelag, blo\ss{} auf zwei Beinen da --- dergleichen hat noch kein Mensch getan.$\ll$
$\gg$O! Nun, du bist ja engelgut!$\ll$ sagte sie und frohere Z\"{a}hren rollten, $\gg$du sollst mir selber raten, was die vornehmsten R\"{a}te sind, damit wir's werden.$\ll$ --- $\gg$Nein,$\ll$ fuhr ich befeuert fort, $\gg$dabei bleib' ich nicht einmal; mir ist's nicht genug, da\ss{} du dich ordentlich bei der Kapl\"{a}nin kannst als Baur\"{a}tin melden lassen, bei der Stadtpredigerin als Legationsr\"{a}tin,
Was sie indes an H\"{o}flichkeit verloren, gewinnen sie vielleicht an
Briefporto wieder, da ich mir nicht denken kann, da\ss{} der Kardinal
\textit{Pretettore del S. Imperio}, dessen Briefe bekanntlich
bei der regierenden B\"{u}rgermeisterin als Hofr\"{a}tin, bei der Chausseeeinnehmerin als Kommerzienr\"{a}tin, oder wie du wo willst.$\ll$ --- $\gg$Ach du mein gar zu gutes Attelchen!$\ll$ sagte sie. $\gg$Sondern,$\ll$ fuhr ich fort, $\gg$ich werde auch korrespondierendes Mitglied verschiedener besten gelehrten Gesellschaften in verschiedenen besten Hauptst\"{a}dten (worunter ich blo\ss{} zu w\"{a}hlen habe), und zwar kein gemeines wirkliches Mitglied, sondern ein ganzes Ehrenmitglied; und dann streck' ich wieder dich als ein auf mir Ehrenmitglied wachsendes Ehrenmitglied aus.$\ll$
Verzeiht, Freunde, diesen Breiumschlag oder T\"{a}uschungsbalsam f\"{u}r eine verwundete Brust, deren Blut zu rein und k\"{o}stlich ist, als da\ss{} man es nicht mit allen m\"{o}glichen Stillungsmitteln aus Spinnweben ins sch\"{o}ne Herz zur\"{u}ckzuschlie\ss{}en trachten sollte.
Jetzt kamen sch\"{o}ne, sch\"{o}nste Stunden. Ich hatte die Zeit besiegt, wie mich Berga; selten
sonst alle postfrei durch das heilige r\"{o}mische Reich gelaufen, nicht
jetzt alles frankieren sollte was er etwa zu melden hat.
beseligt, so wie ich, ein Sieger, zugleich die \"{u}berwindende und die \"{u}berwundene Partei. Berga holte ihren alten Himmel zur\"{u}ck und zog die staubigen Stiefel aus und blumige Schuhe an. K\"{o}stlicher Morgentrunk! Wie berauscht ein liebendes Herz! Ich sp\"{u}rte ordentlich (ist die niedere Redeblume erlaubt) ein Doppelbier von Mut in mir, seitdem ich ein Wesen mehr um mich zu beschirmen hatte. \"{U}berhaupt werd' ich --- was der treffliche General nicht ganz zu wissen scheint --- nicht wie andere Mutige mutiger, sondern am st\"{a}rksten durch Hasen, weil an mir das schlechte Beispiel sich zum Widerspiel umdreht. Kleine Pinselstriche m\"{o}gen hier Mann und Frau mehr abschatten als verschatten! Als der nette Kellner mit der gr\"{u}nseidenen Sch\"{u}rze
\begin{quotation}
[67] Einzelne Seelen, ja Staatsk\"{o}rper gleichen organischen K\"{o}rpern; man zieht aus ihnen die innere Luft heraus, so erquetscht sie der Dunstkreis; pumpt man unter der Glocke die \"{a}u\ss{}ere widerstehende hinweg, so schwellen sie von innerer \"{u}ber und zerplatzen. Demnach behalte jeder Staat inneren und \"{a}u\ss{}eren Widerstand zugleich.\end{quotation}
Morgenbrezeln heraufbrachte --- weil ich gesagt hatte: $\gg$Johann, zwei Portionen!$\ll$ --- so sagte sie zu ihm: er verb\"{a}nde sie sehr damit, und hie\ss{} ihn Herr Johann.
Bergelchen --- mehr in Marktflecken als Hauptst\"{a}dten aufgewachsen --- wurde ordentlich best\"{u}rzt \"{u}ber die Kaffeebretter, Waschtische, Papiertapeten, Wandleuchter, alabasterne Schreibzeuge mit \"{a}gyptischen Sinnbildern und \"{u}ber den vergoldeten Klingeldrahtsknopf, den ja jeder abdrehen und einstecken konnte. Daher hatte sie nicht den Mut, durch den Saal voll Kronleuchter zu gehen, blo\ss{} weil ein pfeifender, vornehmer Federhut darin auf- und abspazierte. Ja, ihrem armen Herzen wurde ordentlich die Brust zur Schn\"{u}rbrust, wenn sie zum Fenster hinaus auf so viele geputzte und fahrende St\"{a}dter guckte (ich pfiff frisch ein gaskonisches Liedchen darunter hinein) --- und wenn sie daran dachte,
\begin{quotation}
[19] Mehr als ein Schriftsteller hat es hinter Hermes nachversucht, das Beispiel der Gattinnen und \"{A}rzte, welche einem Trunkenbold das Lieblingsgetr\"{a}nk auf immer durch einen eingeschw\"{a}rzten, krepierten Frosch\end{quotation}
wie sie nachher samt mir mitten durch dieses blendende Vorzimmergew\"{u}hl brechen m\"{u}\ss{}te. Hier verfangen Schl\"{u}sse noch weniger als Beispiele. Ich wollte mein Bergelchen durch einige meiner n\"{a}chtlichen Traumgigantesken heben --- z.B. durch die, da\ss{} ich auf einem Walfisch reitend mit einer Dreizacksgabel drei Adler gespie\ss{}et und gespeiset, und durch dergleichen; aber ich machte keinen Effekt, vielleicht, weil ich eben dadurch dem furchtsamen Frauenherzen das Schlachtfeld n\"{a}her als den Sieger, den Abgrund n\"{a}her als den Springer dar\"{u}ber vor das Auge geschoben.
Jetzt wurde mir ein Pack Zeitungen gebracht, voll lauter kr\"{a}ftigster Siege. Obgleich diese nur auf der einen Seite vorfallen und auf der anderen ebenso viele Niederlagen vorkommen: so verquicken doch jene sich mehr mit meinen Blute als diese, und fl\"{o}\ss{}en mir --- wie sonst Schillers R\"{a}uber --- eine wunderbare
oder durch Brechweinstein zu verleiden wu\ss{}ten, nachzuahmen und auf
\"{a}hnliche Weise dem hei\ss{}hungrigen Romanenleser den Roman durch
h\"{a}ufige in denselben eingebrockte Predigten, Moralien und
Neigung ein, irgend jemand auf der Stelle zu dreschen und zu fegen. Ungl\"{u}cklicherweise f\"{u}r den Kellner hatte dieser sich eben wie ein Herr dreimalige Klingelorder zum Marsche geben lassen, bevor er sich mobil und herauf gemacht. $\gg$Herr,$\ll$ --- fing ich an, den Kopf voll Schlachtfelder und den Arm voll Triebe ihn abzuklopfen, und Berga f\"{u}rchtete alles, da ich das ihr bekannte Zorn- und Alarmzeichen gab, n\"{a}mlich die M\"{u}tze hinten am Hinterkopfe in die H\"{o}he stie\ss{} --- $\gg$ist das Manier gegen G\"{a}ste? Warum kommt Er nicht prompt? Komm' Er mir nicht wieder so und geh' Er, Freund!$\ll$ --- Ungeachtet sein R\"{u}ckzug mein Sieg war, so kanonierte ich doch noch auf der Wahlstatt lebhaft fort und feuerte desto lauter (er sollt' es h\"{o}ren), je mehr Treppen er hinuntergeflogen. Bergelchen --- die sich ganz entsetzte \"{u}ber mein Ergrimmen, zumal in einem ganz fremden Hause
\begin{quotation}
Langweilen (dergleichen sollte krepierte Fr\"{o}sche vorstellen) derma\ss{}en zu versalzen und zu verekeln, da\ss{} er dann nach keinem Romane mehr griffe. ------ Aber der Ekel verfing wenig; und Hermesen selber\end{quotation}
und \"{u}ber einen vornehmen Putzbengel mit Seidenschurz --- suchte alle ihre sanften Worte hervor gegen wilde einer Kriegsgurgel und gab mir Gefahren zu bedenken. $\gg$Gefahren$\ll$, versetzt' ich, $\gg$w\"{u}nscht' ich ja eben, nur gibt's keine f\"{u}r den Mann, stets wird er ihnen entweder obsiegen oder entspringen, entweder die Stirn bieten oder den R\"{u}cken.$\ll$
Ich konnte kaum aufh\"{o}ren mich zu erbittern, so s\"{u}\ss{} war mir's, und so sehr f\"{u}hlt' ich mich vom Zornfeuer erfrischt und in der Brust wie von einem Geierfelle lind geheizt. Es geh\"{o}rt auch allerdings unter die unerkannten Wohltaten --- wor\"{u}ber man sonst predigte, da\ss{} man nie mehr in seinem Himmel und \textit{monplaisir} (ein Lustschlo\ss{}) ist, als so recht im Toben und Grimm.
Und wurde der ganze Vormittagsmorgen mit Beschauen und Behandeln verbracht; und zwar am l\"{a}ngsten in der breiten Gasse unseres
gl\"{u}ckt es am wenigsten, eher noch seinen Nachfolgern, bei denen der
Wein sich weniger im Geschmacke von dem Brechwein unterschied, den
sie dazu gegossen.
Hotels. Berga sollte sich erst ins Marktgedr\"{a}nge einschie\ss{}en; sie sollte erst einsehen, da\ss{} sie mehr $\gg$nach der Modi$\ll$, mit ihr zu reden, aufgeschm\"{u}ckt sei, als hundert andere ihres Ungleichen. Aber bald verga\ss{} sie \"{u}ber den Haushalt den Aufputz und auf dem T\"{o}pfermarkte den Nachttisch.
Nach dem Mittagsessen (auf unserem Zimmer) kamen wir aus dem Fegfeuer des Me\ss{}get\"{u}mmels, wo Berga an jeder Bude etwas zu bestellen und ihrer Nachtreterin etwas aufzuladen hatte, endlich im Himmel an, in der sogenannten Hundewirtschaft, wie das beste Fl\"{a}tzer Wirts- und Lusthaus au\ss{}er der Stadt sich nennt, wo Messenszeiten Hunderte einkehren, um Tausende vorbeigehen zu sehen. Schon unterwegs wuchs meinem Weibchen als meinem Ellenbogenefeu derma\ss{}en der Mut, da\ss{} sie unter dem Tore, wo ich mich, da nach der bekannten milit\"{a}rischen Proze\ss{}ordnung nicht nahe an der Schildwache vor\"{u}bergegangen werden darf, deshalb auf die entgegengesetzte Seite hinwarf, ruhig dicht am Schie\ss{}- und Stechgewehr der Torwache vor\"{u}berstrich. Drau\ss{}en konnt' ich ihr den umketteten, vergitterten, riesenhaften, schon au\ss{}en mit Treppen aufsteigenden Schabackerpalast mit Fingern zeigen, worin ich gestern gehaust und (vielleicht) gest\"{u}rmt; $\gg$lieber den Riesen m\"{o}cht' ich begucken,$\ll$ sagte sie, $\gg$und den Zwergen; zu was sind wir denn mit ihnen unter einem Dach?$\ll$
Im Lusthause selber fanden wir hinl\"{a}ngliche Lust, umrungen von bl\"{u}henden Gesichtern und Auen. Da setzt' ich mich heimlich in einem fort \"{u}ber Schabackers Refus mit Erfolg hinweg und machte mir \"{u}berhaupt bis gegen Mitternacht einen guten Tag; ich hatt' ihn verdient, Berga noch mehr. Gleichwohl sollt' ich noch nachts um ein Uhr eine Windm\"{u}hle zu berennen bekommen, die freilich mit etwas l\"{a}ngeren, st\"{a}rkeren und mehreren Armen schl\"{a}gt als ein Riese, wof\"{u}r Don Quixote eine solche M\"{u}hle gern angesehen h\"{a}tte. Ich
\begin{quotation}
[8] In gro\ss{}en S\"{a}len wird der wahre Ofen in einen zierlichen Scheinofen entlarvt; so ist es schicklich und zierlich, da\ss{} sich die jungfr\"{a}uliche =Liebe= immer in eine sch\"{o}ne, jungfr\"{a}uliche Freundschaft verberge.\end{quotation}
lasse n\"{a}mlich auf dem Marktplatz aus Gr\"{u}nden, die sich leichter denken als sagen, Bergelchen um einige zwanzig vorausgehen, und begebe mich aus gedachten Gr\"{u}nden ohne Arg hinter eine versteckte Bude, die wohl die Silberh\"{u}tte und der Silberschrank eines rohen Kr\"{a}mers sein mochte, und verweile davor nat\"{u}rlich nach Umst\"{a}nden: --- sieh, kommt dahergerudert mit Spie\ss{} und Speer der Budenw\"{a}chter und m\"{u}nzt und pr\"{a}gt mich so unversehens und unbesehen zu einem Schnapphahn und Raubfisch seiner Budengassen aus, obgleich der schwache Kopf nichts weiter sieht, als da\ss{} ich in einer Ecke stehe und nichts weniger tue als --- nehmen. Ein Ehrgef\"{u}hl ohne Tallus ist f\"{u}r solche Angriffe niemals abgestumpft. Nur aber, wie war einem Manne, der nichts im Kopfe hat --- h\"{o}chstens jetzt Bier statt Hirn --- in der Nachmitternacht Licht zu geben?---
Ich verhehle mein Wagmittel nicht; ich griff zum Fuchsschwanz, ich spiegelte ihm n\"{a}mlich vor, ich h\"{a}tte einen sogenannten Hieb, und w\"{u}\ss{}te in der Betrunkenheit mich schlecht zu finden und zu halten --- ich spielte daher alles nach, was mir aus diesem Fache zu Gesicht gekommen, schwankte hin und her, setzte die F\"{u}\ss{}e tanzmeisterlich ausw\"{a}rts, geriet in Zickzacke hinein bei allem Aussegeln nach gerader Linie, ja ich stie\ss{} meinen guten Kopf (vielleicht einen der hellsten und leersten der Nacht) als einen vollen gegen wahre Pfosten.---
Gleichwohl sah der Budenvogt, der vielleicht \"{o}fter betrunken gewesen als ich, und die Zeichen besser kannte, oder der es gar selber in dieser Stunde war, die ganze Verstellung f\"{u}r blo\ss{}es Blendwerk an und schrie entsetzlich. $\gg$Halt, Strauchdieb, du hast keinen Haarbeutel, du Windbeutel bist ja noch weniger besoffen als ich! --- Wir kennen uns wohl l\"{a}nger. Steh! Ich komm dir nach.
\begin{quotation}
[12] Die V\"{o}lker lassen --- als Widerspiele der Str\"{o}me, die in der Ebene und Ruhe am meisten das Unreine niederschlagen --- gerade nur im st\"{a}rksten Bewegen das Schlechte fallen, und sie werden desto schmutziger, je l\"{a}nger sie in tr\"{a}gen, platten Fl\"{a}chen weiterschleichen.\end{quotation}
Willst du im Markt deine Diebesfinger haben? --- Steh, Hund, oder ich forciere dich!$\ll$
Man sieht hier seinen ganzen Zustand; ich entsprang zickzackig zwischen den Buden diesem rohen Trunkenbolde so eilig, als ich konnte; dennoch humpelte er mir nach. Aber meine Teutoberga, die einiges geh\"{o}rt, rannte zur\"{u}ck, fa\ss{}te den betrunkenen Marktportier beim Kragen und sagte, obwohl (nach Dorfweise) zuschreiend: $\gg$Dummer Mann, schlaf' Er seinen Rausch aus, oder ich zeig's Ihm! Wei\ss{} Er denn, wen Er vor sich hat? Meinen Mann, den Feldprediger Schmelzle unter dem Herrn General und Minister von Schabacker bei Pimpelstadt, Er Narr! Pfui, sch\"{a}m' Er sich, Kerl!$\ll$ Der W\"{a}chter brummte: $\gg$Nichts f\"{u}r ungut!$\ll$ und taumelte davon. $\gg$O du L\"{o}win,$\ll$ sagt' ich im Liebesrausch, $\gg$warum bist du in keiner Todesgefahr, damit ich dir nur den L\"{o}wen zeige als Gemahl?$\ll$
So gelangten wir beide liebend nach Hause;
[23] Wenn die Natur das alte gro\ss{}e Erdenrund, den Erdenlaib von
neuem durchknetet, um unter diesem Pastetendeckel neue Gef\"{u}llsel und
Zwerge hineinzubacken;
und ich h\"{a}tte vielleicht zum sch\"{o}nen Tage noch den Nachsommer einer herrlichen Nachmitternacht erlebt, h\"{a}tte mich nicht der Teufel \"{u}ber Lichtenbergs neunten Band, und zwar auf die 206.Seite gef\"{u}hrt, wo dieses steht: $\gg$Es w\"{a}re doch m\"{o}glich, da\ss{} einmal unsere Chemiker auf ein Mittel gerieten, unsere Luft pl\"{o}tzlich zu zersetzen, durch eine Art von Ferment. So k\"{o}nnte die Welt untergehen.$\ll$ Ach, ja, wahrlich! Da die Erdkugel in der gr\"{o}\ss{}eren Luftkugel eingekapselt steckt: so erfinde blo\ss{} ein chemischer Spitzbube auf irgendeiner fernsten Spitzbubeninsel oder in Neuholland, ein Zersetzmittel f\"{u}r die Luft, dem \"{a}hnlich, was etwa ein Feuerfunke f\"{u}r einen Pulverkarren ist: in wenig Stunden packt mich und uns in Fl\"{a}tz der ungeheure, herschnaubende Weltsturm bei der Gurgel, mein Atemholen und dergleichen ist in Erstickluft vorbei, und alles \"{u}berhaupt vorbei.---
Indes verbarg ich der treuen Seele jeden
so gibt sie meistens wie eine backende Mutter ihrem T\"{o}chterchen zum
Scherze etwas weniges Pastetenteig davon (ein paar tausend
Quadratmeilen
Todesnachtgedanken, da sie mich doch entweder nur schmerzlich nachempfunden oder gar lustig ausgelacht h\"{a}tte. Ich befahl blo\ss{}, da\ss{} sie am Morgen (des Sonnabends) f\"{u}r die zur\"{u}ckkehrende Landkutsche fertig und gestiefelt dast\"{a}nde, sollt' ich anders ihren W\"{u}nschen gem\"{a}\ss{} an die \"{U}berschw\"{a}ngerung mit R\"{a}ten, die ihr so am Herzen lag, fr\"{u}h genug kommen. Sie war so freudig meiner Meinung, da\ss{} sie gern den Jahrmarkt aufgab. Auch ruht' ich ruhig, mit der Fu\ss{}zehe an ihre Finger gekn\"{u}pft, die ganze Nacht hindurch.
Der Dragoner nahm und zupfte mich am Morgen heimlich beim Ohre und sagte mir in dasselbe hinein, er habe ein lustiges Me\ss{}geschenk f\"{u}r seine Schwester vor und reite deshalb auf seinem gestern vom Ro\ss{}t\"{a}uscher eingetauschten Rappen etwas fr\"{u}h voraus. Ich bot ihm meinen Vordank.
Am Morgen lief jeder lustig vom Stapel,
solchen Teigs sind genug f\"{u}r ein Kind) irgendeiner Dichter-, oder
Weisen-, oder Heldenseele ab, damit das kleine Ding doch auch etwas
auszuformen und aufzustellen habe neben der Mutter.
ausgenommen ich; denn ich behielt noch immer, auch vor dem besten Morgenrote das n\"{a}chtliche Teufelsferment und Zersetzmittel, meiner Gehirnkugel sowohl als der Erdkugel, g\"{a}rend im Kopf; ein Beweis, da\ss{} die Nacht mich und meine Furcht gar nichts hatte \"{u}bertreiben lassen. Der mir verdrie\ss{}liche blinde Passagier setzte sich auch wieder ein und sah mich wie gew\"{o}hnlich an, doch ohne Effekt, denn diesmal, wo ich Weltumw\"{a}lzungen, nicht blo\ss{} die meinigen, im Kopfe hatte, war mir der Passagier mehr ein Spa\ss{} und Spuk; da niemand unter Fu\ss{}abs\"{a}gen das Herzgespann versp\"{u}rt, oder unter dem Summen der Kanonen sich gegen das der Wespen wehrt, ebenso konnte mir ein Passagier mit allen Brandbriefen, die etwa sein verd\"{a}chtiges Gesicht in meine noch sp\"{a}te Zukunft wirft, blo\ss{} l\"{a}cherlich zu einer Zeit vorkommen, wo ich bedachte, das $\gg$Ferment$\ll$ k\"{o}nne
Bekommen dann die Geschwister etwas von dem Geb\"{a}cke des
Schwesterchens, so klopfen sie alle in die H\"{a}nde und rufen:
$\gg$Mutter, kannst du auch so backen wie Viktoriechen?$\ll$
ja mitten auf meinem Wege von Fl\"{a}tz nach Neusattel von irgendeinem Amerikas, Europas Manne, der ganz unschuldig versucht und zersetzt, zuf\"{a}llig erfunden und losgelassen werden. Die Frage, ja Preisfrage w\"{a}re aber nun, inwiefern es seit Lichtenbergs Drohung nicht etwa welt- und selbstm\"{o}rderisch aussieht, wenn aufgekl\"{a}rte Potentaten scheidek\"{u}nstlerischer V\"{o}lker es nicht ihren Scheidek\"{u}nstlern, die so leicht Leib von Seele scheiden und Erde mit Himmel gatten, auferlegen, keine andere chemische Versuche zu machen, als die schon gemachten, die doch bisher den Staaten weit mehr gen\"{u}tzt als geschadet.
Leider blieb ich in diesen j\"{u}ngsten Tag des Ferments mit allen Sinnen versunken, ohne auf der ganzen R\"{u}ckreise nach Neusattel mehr zu erleben und zu bemerken, als da\ss{} ich daselbst ankam, wo ich zugleich wieder den blinden Passagier seines Weges gehen sah.
Nur mein Bergelchen schaute ich in einem fort unterwegs an, teils um sie noch solange zu sehen, als Leben und Augen dauern, teils um auch bei kleinster Gefahr derselben, es sei nun eine gro\ss{}e oder gar ein ganzes hereinst\"{u}rzendes Goldau und verzehrendes Weltgericht, wenn nicht f\"{u}r sie, doch an ihr zu sterben, und so, verkn\"{u}pft mit ihr, ein geplagtes und plagendes Leben hinzuwerfen, worin ihr ohnehin nicht die H\"{a}lfte meiner W\"{u}nsche f\"{u}r sie erf\"{u}llt worden.
So w\"{a}re denn meine Reise an sich vollendet --- gekr\"{o}nt mit einigen Historiolen --- vielleicht k\"{u}nftig noch belohnter durch euch, ihr Freunde um Fl\"{a}tz herum, wenn ihr darin etwa einige gutgeschliffene J\"{a}temesser finden solltet, womit ihr leichter das L\"{u}genunkraut ausreutet, das mich bis jetzt dem wackeren Schabacker verbauet. --- Nur sitzt mir noch das verfluchte Ferment im Kopfe. Lebt denn wohl, solange es noch Atmosph\"{a}ren einzuatmen gibt. Ich wollt', ich h\"{a}tte mir das Ferment aus dem Kopfe geschlagen.
Euer
Attila Schmelzle.
NS. Mein Schwager hat seine Sache gut gemacht und Berga tanzt. K\"{u}nftig das N\"{a}here!------
Gedruckt bei
Poeschel \& Trepte
in Leipzig
[ Im folgenden werden alle ge\"{a}nderten Textzeilen angef\"{u}hrt, wobei jeweils zuerst die Zeile wie im Original, danach die ge\"{a}nderte Zeile steht.
Taufnamen Attilla mehr, als sich's geh\"{o}rt, in mich gefahren, ist Taufnamen Attila mehr, als sich's geh\"{o}rt, in mich gefahren, ist
[112] Gewisse Welt weiberbenutzen in gewissen F\"{a}llen ihre k\"{o}rperliche
[112] Gewisse Weltweiber benutzen in gewissen F\"{a}llen ihre k\"{o}rperliche
Malzleinsdorf (einer Wiener Vorstadt), oder waren's f\"{u}r meine gepeinigten Matzleinsdorf (einer Wiener Vorstadt), oder waren's f\"{u}r meine gepeinigten
sagen, mir sind den Kindern gleich, die am sch\"{o}n bemalten K\"{a}stchen sagen, wir sind den Kindern gleich, die am sch\"{o}n bemalten K\"{a}stchen
Freilich, das Postkutschen gelag' und Picknick wollte mir weniger Freilich, das Postkutschengelag' und Picknick wollte mir weniger
sich einsetzen ober hinten aufstellen w\"{u}rde. Beide Narren beziehen sich einsetzen oder hinten aufstellen w\"{u}rde. Beide Narren beziehen
erkl\"{a}rte nun, das man erkl\"{a}rte nun, da\ss{} man
zu schonen, so lange auf den =Kopf=, bis wieder getragen wird.
zu schonen, so lange auf den =Kopf=, bis er wieder getragen wird.
Menge, bei dem die Blitze spie\ss{}enden Degen auf dem Kutschbock, unb bei Menge, bei dem die Blitze spie\ss{}enden Degen auf dem Kutschbock, und bei
Eigentum wird ihm als Kirchenraub angerechent. Mich d\"{u}nkt aber, der
Eigentum wird ihm als Kirchenraub angerechnet. Mich d\"{u}nkt aber, der
logiert, von der ersten schimmsten Aufw\"{a}rterin, die er oder die ihn logiert, von der ersten schlimmsten Aufw\"{a}rterin, die er oder die ihn
Helden und Potentatentaten, Festungsst\"{u}rme, Felsenw\"{u}rfe; --- noch aber Helden- und Potentatentaten, Festungsst\"{u}rme, Felsenw\"{u}rfe; --- noch aber
Sonnabend abend?$\ll$ sagte sie. $\gg$Das nicht, sagt' ich. $\gg$Nun, so bin ich Sonnabend abend?$\ll$ sagte sie. $\gg$Das nicht,$\ll$ sagt' ich. $\gg$Nun, so bin ich
Gleichwohl sollt' ich noch nachts um ein Uhr eine Winm\"{u}hle zu berennen Gleichwohl sollt' ich noch nachts um ein Uhr eine Windm\"{u}hle zu berennen ]
\gutchapter{End of the Project Gutenberg EBook of Des Feldpredigers Schmelzle Reise nach Fl\"{a}tz mit fortgehenden Noten, by Jean Paul}
*** END OF THIS PROJECT GUTENBERG EBOOK DES FELDPREDIGERS SCHMELZLE REISE ***
***** This file should be named 27775-8.txt or 27775-8.zip ***** This and all associated files of various formats will be found in:
http://www.gutenberg.org/2/7/7/7/27775/
Produced by Norbert H. Langkau, Itay Perl, Jana Srna and the Online Distributed Proofreading Team at http://www.pgdp.net
Updated editions will replace the previous one---the old editions will be renamed.
Creating the works from public domain print editions means that no one owns a United States copyright in these works, so the Foundation (and you!) can copy and distribute it in the United States without permission and without paying copyright royalties. Special rules, set forth in the General Terms of Use part of this license, apply to copying and distributing Project Gutenberg-tm electronic works to protect the PROJECT GUTENBERG-tm concept and trademark. Project Gutenberg is a registered trademark, and may not be used if you charge for the eBooks, unless you receive specific permission. If you do not charge anything for copies of this eBook, complying with the rules is very easy. You may use this eBook for nearly any purpose such as creation of derivative works, reports, performances and research. They may be modified and printed and given away---you may do practically ANYTHING with public domain eBooks. Redistribution is subject to the trademark license, especially commercial redistribution.
*** START: FULL LICENSE ***
THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
To protect the Project Gutenberg-tm mission of promoting the free distribution of electronic works, by using or distributing this work (or any other work associated in any way with the phrase ``Project Gutenberg"), you agree to comply with all the terms of the Full Project Gutenberg-tm License (available with this file or online at http://gutenberg.net/license).
\gutchapter{Section 1. General Terms of Use and Redistributing Project Gutenberg-tm electronic works}
1.A. By reading or using any part of this Project Gutenberg-tm electronic work, you indicate that you have read, understand, agree to and accept all the terms of this license and intellectual property (trademark/copyright) agreement. If you do not agree to abide by all the terms of this agreement, you must cease using and return or destroy all copies of Project Gutenberg-tm electronic works in your possession. If you paid a fee for obtaining a copy of or access to a Project Gutenberg-tm electronic work and you do not agree to be bound by the terms of this agreement, you may obtain a refund from the person or entity to whom you paid the fee as set forth in paragraph 1.E.8.
1.B. ``Project Gutenberg'' is a registered trademark. It may only be used on or associated in any way with an electronic work by people who agree to be bound by the terms of this agreement. There are a few things that you can do with most Project Gutenberg-tm electronic works even without complying with the full terms of this agreement. See paragraph 1.C below. There are a lot of things you can do with Project Gutenberg-tm electronic works if you follow the terms of this agreement and help preserve free future access to Project Gutenberg-tm electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation'' or PGLAF), owns a compilation copyright in the collection of Project Gutenberg-tm electronic works. Nearly all the individual works in the collection are in the public domain in the United States. If an individual work is in the public domain in the United States and you are located in the United States, we do not claim a right to prevent you from copying, distributing, performing, displaying or creating derivative works based on the work as long as all references to Project Gutenberg are removed. Of course, we hope that you will support the Project Gutenberg-tm mission of promoting free access to electronic works by freely sharing Project Gutenberg-tm works in compliance with the terms of this agreement for keeping the Project Gutenberg-tm name associated with the work. You can easily comply with the terms of this agreement by keeping this work in the same format with its attached full Project Gutenberg-tm License when you share it without charge with others.
1.D. The copyright laws of the place where you are located also govern what you can do with this work. Copyright laws in most countries are in a constant state of change. If you are outside the United States, check the laws of your country in addition to the terms of this agreement before downloading, copying, displaying, performing, distributing or creating derivative works based on this work or any other Project Gutenberg-tm work. The Foundation makes no representations concerning the copyright status of any work in any country outside the United States.
1.E. Unless you have removed all references to Project Gutenberg:
1.E.1. The following sentence, with active links to, or other immediate access to, the full Project Gutenberg-tm License must appear prominently whenever any copy of a Project Gutenberg-tm work (any work on which the phrase ``Project Gutenberg'' appears, or with which the phrase ``Project Gutenberg'' is associated) is accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.net
1.E.2. If an individual Project Gutenberg-tm electronic work is derived from the public domain (does not contain a notice indicating that it is posted with permission of the copyright holder), the work can be copied and distributed to anyone in the United States without paying any fees or charges. If you are redistributing or providing access to a work with the phrase ``Project Gutenberg'' associated with or appearing on the work, you must comply either with the requirements of paragraphs 1.E.1 through 1.E.7 or obtain permission for the use of the work and the Project Gutenberg-tm trademark as set forth in paragraphs 1.E.8 or 1.E.9.
1.E.3. If an individual Project Gutenberg-tm electronic work is posted with the permission of the copyright holder, your use and distribution must comply with both paragraphs 1.E.1 through 1.E.7 and any additional terms imposed by the copyright holder. Additional terms will be linked to the Project Gutenberg-tm License for all works posted with the permission of the copyright holder found at the beginning of this work.
1.E.4. Do not unlink or detach or remove the full Project Gutenberg-tm License terms from this work, or any files containing a part of this work or any other work associated with Project Gutenberg-tm.
1.E.5. Do not copy, display, perform, distribute or redistribute this electronic work, or any part of this electronic work, without prominently displaying the sentence set forth in paragraph 1.E.1 with active links or immediate access to the full terms of the Project Gutenberg-tm License.
1.E.6. You may convert to and distribute this work in any binary, compressed, marked up, nonproprietary or proprietary form, including any word processing or hypertext form. However, if you provide access to or distribute copies of a Project Gutenberg-tm work in a format other than ``Plain Vanilla ASCII'' or other format used in the official version posted on the official Project Gutenberg-tm web site (www.gutenberg.net), you must, at no additional cost, fee or expense to the user, provide a copy, a means of exporting a copy, or a means of obtaining a copy upon request, of the work in its original ``Plain Vanilla ASCII'' or other form. Any alternate format must include the full Project Gutenberg-tm License as specified in paragraph 1.E.1.
1.E.7. Do not charge a fee for access to, viewing, displaying, performing, copying or distributing any Project Gutenberg-tm works unless you comply with paragraph 1.E.8 or 1.E.9.
1.E.8. You may charge a reasonable fee for copies of or providing access to or distributing Project Gutenberg-tm electronic works provided that
- You pay a royalty fee of 20\%% of the gross profits you derive from
the use of Project Gutenberg-tm works calculated using the method
you already use to calculate your applicable taxes. The fee is
owed to the owner of the Project Gutenberg-tm trademark, but he
has agreed to donate royalties under this paragraph to the
Project Gutenberg Literary Archive Foundation. Royalty payments
must be paid within 60 days following each date on which you
prepare (or are legally required to prepare) your periodic tax
returns. Royalty payments should be clearly marked as such and
sent to the Project Gutenberg Literary Archive Foundation at the
address specified in Section 4, ``Information about donations to
the Project Gutenberg Literary Archive Foundation.''
- You provide a full refund of any money paid by a user who notifies
you in writing (or by e-mail) within 30 days of receipt that s/he
does not agree to the terms of the full Project Gutenberg-tm
License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg-tm works.
- You provide, in accordance with paragraph 1.F.3, a full refund of any
money paid for a work or a replacement copy, if a defect in the
electronic work is discovered and reported to you within 90 days
of receipt of the work.
- You comply with all other terms of this agreement for free
distribution of Project Gutenberg-tm works.
1.E.9. If you wish to charge a fee or distribute a Project Gutenberg-tm electronic work or group of works on different terms than are set forth in this agreement, you must obtain permission in writing from both the Project Gutenberg Literary Archive Foundation and Michael Hart, the owner of the Project Gutenberg-tm trademark. Contact the Foundation as set forth in Section 3 below.
1.F.
1.F.1. Project Gutenberg volunteers and employees expend considerable effort to identify, do copyright research on, transcribe and proofread public domain works in creating the Project Gutenberg-tm collection. Despite these efforts, Project Gutenberg-tm electronic works, and the medium on which they may be stored, may contain ``Defects,'' such as, but not limited to, incomplete, inaccurate or corrupt data, transcription errors, a copyright or other intellectual property infringement, a defective or damaged disk or other medium, a computer virus, or computer codes that damage or cannot be read by your equipment.
1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES --- Except for the ``Right of Replacement or Refund'' described in paragraph 1.F.3, the Project Gutenberg Literary Archive Foundation, the owner of the Project Gutenberg-tm trademark, and any other party distributing a Project Gutenberg-tm electronic work under this agreement, disclaim all liability to you for damages, costs and expenses, including legal fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH F3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.
1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND --- If you discover a defect in this electronic work within 90 days of receiving it, you can receive a refund of the money (if any) you paid for it by sending a written explanation to the person you received the work from. If you received the work on a physical medium, you must return the medium with your written explanation. The person or entity that provided you with the defective work may elect to provide a replacement copy in lieu of a refund. If you received the work electronically, the person or entity providing it to you may choose to give you a second opportunity to receive the work electronically in lieu of a refund. If the second copy is also defective, you may demand a refund in writing without further opportunities to fix the problem.
1.F.4. Except for the limited right of replacement or refund set forth in paragraph 1.F.3, this work is provided to you `AS-IS' WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTIBILITY OR FITNESS FOR ANY PURPOSE.
1.F.5. Some states do not allow disclaimers of certain implied warranties or the exclusion or limitation of certain types of damages. If any disclaimer or limitation set forth in this agreement violates the law of the state applicable to this agreement, the agreement shall be interpreted to make the maximum disclaimer or limitation permitted by the applicable state law. The invalidity or unenforceability of any provision of this agreement shall not void the remaining provisions.
1.F.6. INDEMNITY --- You agree to indemnify and hold the Foundation, the trademark owner, any agent or employee of the Foundation, anyone providing copies of Project Gutenberg-tm electronic works in accordance with this agreement, and any volunteers associated with the production, promotion and distribution of Project Gutenberg-tm electronic works, harmless from all liability, costs and expenses, including legal fees, that arise directly or indirectly from any of the following which you do or cause to occur: (a) distribution of this or any Project Gutenberg-tm work, (b) alteration, modification, or additions or deletions to any Project Gutenberg-tm work, and (c) any Defect you cause.
\gutchapter{Section 2. Information about the Mission of Project Gutenberg-tm}
Project Gutenberg-tm is synonymous with the free distribution of electronic works in formats readable by the widest variety of computers including obsolete, old, middle-aged and new computers. It exists because of the efforts of hundreds of volunteers and donations from people in all walks of life.
Volunteers and financial support to provide volunteers with the assistance they need are critical to reaching Project Gutenberg-tm's goals and ensuring that the Project Gutenberg-tm collection will remain freely available for generations to come. In 2001, the Project Gutenberg Literary Archive Foundation was created to provide a secure and permanent future for Project Gutenberg-tm and future generations. To learn more about the Project Gutenberg Literary Archive Foundation and how your efforts and donations can help, see Sections 3 and 4 and the Foundation web page at http://www.pglaf.org.
\gutchapter{Section 3. Information about the Project Gutenberg Literary Archive Foundation}
The Project Gutenberg Literary Archive Foundation is a non profit 501(c)(3) educational corporation organized under the laws of the state of Mississippi and granted tax exempt status by the Internal Revenue Service. The Foundation's EIN or federal tax identification number is 64-6221541. Its 501(c)(3) letter is posted at http://pglaf.org/fundraising. Contributions to the Project Gutenberg Literary Archive Foundation are tax deductible to the full extent permitted by U.S. federal laws and your state's laws.
The Foundation's principal office is located at 4557 Melan Dr. S. Fairbanks, AK, 99712., but its volunteers and employees are scattered throughout numerous locations. Its business office is located at 809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887, email [email protected]. Email contact links and up to date contact information can be found at the Foundation's web site and official page at http://pglaf.org
For additional contact information:
Dr. Gregory B. Newby
Chief Executive and Director
[email protected]
\gutchapter{Section 4. Information about Donations to the Project Gutenberg Literary Archive Foundation}
Project Gutenberg-tm depends upon and cannot survive without wide spread public support and donations to carry out its mission of increasing the number of public domain and licensed works that can be freely distributed in machine readable form accessible by the widest array of equipment including outdated equipment. Many small donations (\$1 to \$5,000) are particularly important to maintaining tax exempt status with the IRS.
The Foundation is committed to complying with the laws regulating charities and charitable donations in all 50 states of the United States. Compliance requirements are not uniform and it takes a considerable effort, much paperwork and many fees to meet and keep up with these requirements. We do not solicit donations in locations where we have not received written confirmation of compliance. To SEND DONATIONS or determine the status of compliance for any particular state visit http://pglaf.org
While we cannot and do not solicit contributions from states where we have not met the solicitation requirements, we know of no prohibition against accepting unsolicited donations from donors in such states who approach us with offers to donate.
International donations are gratefully accepted, but we cannot make any statements concerning tax treatment of donations received from outside the United States. U.S. laws alone swamp our small staff.
Please check the Project Gutenberg Web pages for current donation methods and addresses. Donations are accepted in a number of other ways including including checks, online payments and credit card donations. To donate, please visit: http://pglaf.org/donate
Section 5. General Information About Project Gutenberg-tm electronic works.
Professor Michael S. Hart is the originator of the Project Gutenberg-tm concept of a library of electronic works that could be freely shared with anyone. For thirty years, he produced and distributed Project Gutenberg-tm eBooks with only a loose network of volunteer support.
Project Gutenberg-tm eBooks are often created from several printed editions, all of which are confirmed as Public Domain in the U.S. unless a copyright notice is included. Thus, we do not necessarily keep eBooks in compliance with any particular paper edition.
Most people start at our Web site which has the main PG search facility:
http://www.gutenberg.net
This Web site includes information about Project Gutenberg-tm, including how to make donations to the Project Gutenberg Literary Archive Foundation, how to help produce our new eBooks, and how to subscribe to our email newsletter to hear about new eBooks.
\end{document}
|
http://git.videolan.org/?p=ffmpeg.git;a=blob_plain;f=doc/general.texi;hb=17a1919027fc6b0f2ea9b61fc3fecaa3ff080b14
|
videolan.org
|
CC-MAIN-2020-05
|
application/x-texinfo
|
application/x-tex
|
crawl-data/CC-MAIN-2020-05/segments/1579251669967.70/warc/CC-MAIN-20200125041318-20200125070318-00442.warc.gz
| 66,272,637
| 13,050
|
\input texinfo @c -*- texinfo -*-
@settitle General Documentation
@titlepage
@center @titlefont{General Documentation}
@end titlepage
@top
@contents
@chapter external libraries
FFmpeg can be hooked up with a number of external libraries to add support
for more formats. None of them are used by default, their use has to be
explicitly requested by passing the appropriate flags to @file{./configure}.
@section OpenCORE AMR
FFmpeg can make use of the OpenCORE libraries for AMR-NB
decoding/encoding and AMR-WB decoding.
Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the instructions for
installing the libraries. Then pass @code{--enable-libopencore-amrnb} and/or
@code{--enable-libopencore-amrwb} to configure to enable the libraries.
Note that OpenCORE is under the Apache License 2.0 (see
@url{http://www.apache.org/licenses/LICENSE-2.0} for details), which is
incompatible with the LGPL version 2.1 and GPL version 2. You have to
upgrade FFmpeg's license to LGPL version 3 (or if you have enabled
GPL components, GPL version 3) to use it.
@chapter Supported File Formats and Codecs
You can use the @code{-formats} and @code{-codecs} options to have an exhaustive list.
@section File Formats
FFmpeg supports the following file formats through the @code{libavformat}
library:
@multitable @columnfractions .4 .1 .1 .4
@item Name @tab Encoding @tab Decoding @tab Comments
@item 4xm @tab @tab X
@tab 4X Technologies format, used in some games.
@item 8088flex TMV @tab @tab X
@item Adobe Filmstrip @tab X @tab X
@item Audio IFF (AIFF) @tab X @tab X
@item American Laser Games MM @tab @tab X
@tab Multimedia format used in games like Mad Dog McCree.
@item 3GPP AMR @tab X @tab X
@item Apple HTTP Live Streaming @tab @tab X
@item ASF @tab X @tab X
@item AVI @tab X @tab X
@item AVISynth @tab @tab X
@item AVS @tab @tab X
@tab Multimedia format used by the Creature Shock game.
@item Beam Software SIFF @tab @tab X
@tab Audio and video format used in some games by Beam Software.
@item Bethesda Softworks VID @tab @tab X
@tab Used in some games from Bethesda Softworks.
@item Bink @tab @tab X
@tab Multimedia format used by many games.
@item Brute Force & Ignorance @tab @tab X
@tab Used in the game Flash Traffic: City of Angels.
@item Interplay C93 @tab @tab X
@tab Used in the game Cyberia from Interplay.
@item Delphine Software International CIN @tab @tab X
@tab Multimedia format used by Delphine Software games.
@item CD+G @tab @tab X
@tab Video format used by CD+G karaoke disks
@item Core Audio Format @tab @tab X
@tab Apple Core Audio Format
@item CRC testing format @tab X @tab
@item Creative Voice @tab X @tab X
@tab Created for the Sound Blaster Pro.
@item CRYO APC @tab @tab X
@tab Audio format used in some games by CRYO Interactive Entertainment.
@item D-Cinema audio @tab X @tab X
@item Deluxe Paint Animation @tab @tab X
@item DV video @tab X @tab X
@item DXA @tab @tab X
@tab This format is used in the non-Windows version of the Feeble Files
game and different game cutscenes repacked for use with ScummVM.
@item Electronic Arts cdata @tab @tab X
@item Electronic Arts Multimedia @tab @tab X
@tab Used in various EA games; files have extensions like WVE and UV2.
@item FFM (FFserver live feed) @tab X @tab X
@item Flash (SWF) @tab X @tab X
@item Flash 9 (AVM2) @tab X @tab X
@tab Only embedded audio is decoded.
@item FLI/FLC/FLX animation @tab @tab X
@tab .fli/.flc files
@item Flash Video (FLV) @tab @tab X
@tab Macromedia Flash video files
@item framecrc testing format @tab X @tab
@item FunCom ISS @tab @tab X
@tab Audio format used in various games from FunCom like The Longest Journey.
@item GIF Animation @tab X @tab
@item GXF @tab X @tab X
@tab General eXchange Format SMPTE 360M, used by Thomson Grass Valley
playout servers.
@item id Quake II CIN video @tab @tab X
@item id RoQ @tab X @tab X
@tab Used in Quake III, Jedi Knight 2, other computer games.
@item IEC61937 encapsulation @tab X @tab X
@item IFF @tab @tab X
@tab Interchange File Format
@item Interplay MVE @tab @tab X
@tab Format used in various Interplay computer games.
@item IV8 @tab @tab X
@tab A format generated by IndigoVision 8000 video server.
@item IVF (On2) @tab X @tab X
@tab A format used by libvpx
@item LMLM4 @tab @tab X
@tab Used by Linux Media Labs MPEG-4 PCI boards
@item LXF @tab @tab X
@tab VR native stream format, used by Leitch/Harris' video servers.
@item Matroska @tab X @tab X
@item Matroska audio @tab X @tab
@item FFmpeg metadata @tab X @tab X
@tab Metadata in text format.
@item MAXIS XA @tab @tab X
@tab Used in Sim City 3000; file extension .xa.
@item MD Studio @tab @tab X
@item Mobotix .mxg @tab @tab X
@item Monkey's Audio @tab @tab X
@item Motion Pixels MVI @tab @tab X
@item MOV/QuickTime/MP4 @tab X @tab X
@tab 3GP, 3GP2, PSP, iPod variants supported
@item MP2 @tab X @tab X
@item MP3 @tab X @tab X
@item MPEG-1 System @tab X @tab X
@tab muxed audio and video, VCD format supported
@item MPEG-PS (program stream) @tab X @tab X
@tab also known as @code{VOB} file, SVCD and DVD format supported
@item MPEG-TS (transport stream) @tab X @tab X
@tab also known as DVB Transport Stream
@item MPEG-4 @tab X @tab X
@tab MPEG-4 is a variant of QuickTime.
@item MIME multipart JPEG @tab X @tab
@item MSN TCP webcam @tab @tab X
@tab Used by MSN Messenger webcam streams.
@item MTV @tab @tab X
@item Musepack @tab @tab X
@item Musepack SV8 @tab @tab X
@item Material eXchange Format (MXF) @tab X @tab X
@tab SMPTE 377M, used by D-Cinema, broadcast industry.
@item Material eXchange Format (MXF), D-10 Mapping @tab X @tab X
@tab SMPTE 386M, D-10/IMX Mapping.
@item NC camera feed @tab @tab X
@tab NC (AVIP NC4600) camera streams
@item NTT TwinVQ (VQF) @tab @tab X
@tab Nippon Telegraph and Telephone Corporation TwinVQ.
@item Nullsoft Streaming Video @tab @tab X
@item NuppelVideo @tab @tab X
@item NUT @tab X @tab X
@tab NUT Open Container Format
@item Ogg @tab X @tab X
@item TechnoTrend PVA @tab @tab X
@tab Used by TechnoTrend DVB PCI boards.
@item QCP @tab @tab X
@item raw ADTS (AAC) @tab X @tab X
@item raw AC-3 @tab X @tab X
@item raw Chinese AVS video @tab X @tab X
@item raw CRI ADX @tab X @tab X
@item raw Dirac @tab X @tab X
@item raw DNxHD @tab X @tab X
@item raw DTS @tab X @tab X
@item raw E-AC-3 @tab X @tab X
@item raw FLAC @tab X @tab X
@item raw GSM @tab @tab X
@item raw H.261 @tab X @tab X
@item raw H.263 @tab X @tab X
@item raw H.264 @tab X @tab X
@item raw Ingenient MJPEG @tab @tab X
@item raw MJPEG @tab X @tab X
@item raw MLP @tab @tab X
@item raw MPEG @tab @tab X
@item raw MPEG-1 @tab @tab X
@item raw MPEG-2 @tab @tab X
@item raw MPEG-4 @tab X @tab X
@item raw NULL @tab X @tab
@item raw video @tab X @tab X
@item raw id RoQ @tab X @tab
@item raw Shorten @tab @tab X
@item raw TrueHD @tab X @tab X
@item raw VC-1 @tab @tab X
@item raw PCM A-law @tab X @tab X
@item raw PCM mu-law @tab X @tab X
@item raw PCM signed 8 bit @tab X @tab X
@item raw PCM signed 16 bit big-endian @tab X @tab X
@item raw PCM signed 16 bit little-endian @tab X @tab X
@item raw PCM signed 24 bit big-endian @tab X @tab X
@item raw PCM signed 24 bit little-endian @tab X @tab X
@item raw PCM signed 32 bit big-endian @tab X @tab X
@item raw PCM signed 32 bit little-endian @tab X @tab X
@item raw PCM unsigned 8 bit @tab X @tab X
@item raw PCM unsigned 16 bit big-endian @tab X @tab X
@item raw PCM unsigned 16 bit little-endian @tab X @tab X
@item raw PCM unsigned 24 bit big-endian @tab X @tab X
@item raw PCM unsigned 24 bit little-endian @tab X @tab X
@item raw PCM unsigned 32 bit big-endian @tab X @tab X
@item raw PCM unsigned 32 bit little-endian @tab X @tab X
@item raw PCM floating-point 32 bit big-endian @tab X @tab X
@item raw PCM floating-point 32 bit little-endian @tab X @tab X
@item raw PCM floating-point 64 bit big-endian @tab X @tab X
@item raw PCM floating-point 64 bit little-endian @tab X @tab X
@item RDT @tab @tab X
@item REDCODE R3D @tab @tab X
@tab File format used by RED Digital cameras, contains JPEG 2000 frames and PCM audio.
@item RealMedia @tab X @tab X
@item Redirector @tab @tab X
@item Renderware TeXture Dictionary @tab @tab X
@item RL2 @tab @tab X
@tab Audio and video format used in some games by Entertainment Software Partners.
@item RPL/ARMovie @tab @tab X
@item Lego Mindstorms RSO @tab X @tab X
@item RTMP @tab X @tab X
@tab Output is performed by publishing stream to RTMP server
@item RTP @tab X @tab X
@item RTSP @tab X @tab X
@item SAP @tab X @tab X
@item SDP @tab @tab X
@item Sega FILM/CPK @tab @tab X
@tab Used in many Sega Saturn console games.
@item Sierra SOL @tab @tab X
@tab .sol files used in Sierra Online games.
@item Sierra VMD @tab @tab X
@tab Used in Sierra CD-ROM games.
@item Smacker @tab @tab X
@tab Multimedia format used by many games.
@item Sony OpenMG (OMA) @tab @tab X
@tab Audio format used in Sony Sonic Stage and Sony Vegas.
@item Sony PlayStation STR @tab @tab X
@item Sony Wave64 (W64) @tab @tab X
@item SoX native format @tab X @tab X
@item SUN AU format @tab X @tab X
@item Text files @tab @tab X
@item THP @tab @tab X
@tab Used on the Nintendo GameCube.
@item Tiertex Limited SEQ @tab @tab X
@tab Tiertex .seq files used in the DOS CD-ROM version of the game Flashback.
@item True Audio @tab @tab X
@item VC-1 test bitstream @tab X @tab X
@item WAV @tab X @tab X
@item WavPack @tab @tab X
@item WebM @tab X @tab X
@item Windows Televison (WTV) @tab @tab X
@item Wing Commander III movie @tab @tab X
@tab Multimedia format used in Origin's Wing Commander III computer game.
@item Westwood Studios audio @tab @tab X
@tab Multimedia format used in Westwood Studios games.
@item Westwood Studios VQA @tab @tab X
@tab Multimedia format used in Westwood Studios games.
@item YUV4MPEG pipe @tab X @tab X
@item Psygnosis YOP @tab @tab X
@end multitable
@code{X} means that encoding (resp. decoding) is supported.
@section Image Formats
FFmpeg can read and write images for each frame of a video sequence. The
following image formats are supported:
@multitable @columnfractions .4 .1 .1 .4
@item Name @tab Encoding @tab Decoding @tab Comments
@item .Y.U.V @tab X @tab X
@tab one raw file per component
@item animated GIF @tab X @tab X
@tab Only uncompressed GIFs are generated.
@item BMP @tab X @tab X
@tab Microsoft BMP image
@item DPX @tab @tab X
@tab Digital Picture Exchange
@item JPEG @tab X @tab X
@tab Progressive JPEG is not supported.
@item JPEG 2000 @tab @tab E
@tab decoding supported through external library libopenjpeg
@item JPEG-LS @tab X @tab X
@item LJPEG @tab X @tab
@tab Lossless JPEG
@item PAM @tab X @tab X
@tab PAM is a PNM extension with alpha support.
@item PBM @tab X @tab X
@tab Portable BitMap image
@item PCX @tab X @tab X
@tab PC Paintbrush
@item PGM @tab X @tab X
@tab Portable GrayMap image
@item PGMYUV @tab X @tab X
@tab PGM with U and V components in YUV 4:2:0
@item PIC @tab @tab X
@tab Pictor/PC Paint
@item PNG @tab X @tab X
@tab 2/4 bpp not supported yet
@item PPM @tab X @tab X
@tab Portable PixelMap image
@item PTX @tab @tab X
@tab V.Flash PTX format
@item SGI @tab X @tab X
@tab SGI RGB image format
@item Sun Rasterfile @tab @tab X
@tab Sun RAS image format
@item TIFF @tab X @tab X
@tab YUV, JPEG and some extension is not supported yet.
@item Truevision Targa @tab X @tab X
@tab Targa (.TGA) image format
@end multitable
@code{X} means that encoding (resp. decoding) is supported.
@code{E} means that support is provided through an external library.
@section Video Codecs
@multitable @columnfractions .4 .1 .1 .4
@item Name @tab Encoding @tab Decoding @tab Comments
@item 4X Movie @tab @tab X
@tab Used in certain computer games.
@item 8088flex TMV @tab @tab X
@item 8SVX exponential @tab @tab X
@item 8SVX fibonacci @tab @tab X
@item A64 multicolor @tab X @tab
@tab Creates video suitable to be played on a commodore 64 (multicolor mode).
@item American Laser Games MM @tab @tab X
@tab Used in games like Mad Dog McCree.
@item AMV Video @tab @tab X
@tab Used in Chinese MP3 players.
@item ANSI/ASCII art @tab @tab X
@item Apple MJPEG-B @tab @tab X
@item Apple QuickDraw @tab @tab X
@tab fourcc: qdrw
@item Asus v1 @tab X @tab X
@tab fourcc: ASV1
@item Asus v2 @tab X @tab X
@tab fourcc: ASV2
@item ATI VCR1 @tab @tab X
@tab fourcc: VCR1
@item ATI VCR2 @tab @tab X
@tab fourcc: VCR2
@item Auravision Aura @tab @tab X
@item Auravision Aura 2 @tab @tab X
@item Autodesk Animator Flic video @tab @tab X
@item Autodesk RLE @tab @tab X
@tab fourcc: AASC
@item AVS (Audio Video Standard) video @tab @tab X
@tab Video encoding used by the Creature Shock game.
@item Beam Software VB @tab @tab X
@item Bethesda VID video @tab @tab X
@tab Used in some games from Bethesda Softworks.
@item Bink Video @tab @tab X
@tab Support for version 'b' is missing.
@item Brute Force & Ignorance @tab @tab X
@tab Used in the game Flash Traffic: City of Angels.
@item C93 video @tab @tab X
@tab Codec used in Cyberia game.
@item CamStudio @tab @tab X
@tab fourcc: CSCD
@item CD+G @tab @tab X
@tab Video codec for CD+G karaoke disks
@item Chinese AVS video @tab E @tab X
@tab AVS1-P2, JiZhun profile, encoding through external library libxavs
@item Delphine Software International CIN video @tab @tab X
@tab Codec used in Delphine Software International games.
@item Cinepak @tab @tab X
@item Cirrus Logic AccuPak @tab @tab X
@tab fourcc: CLJR
@item Creative YUV (CYUV) @tab @tab X
@item Dirac @tab E @tab E
@tab supported through external libdirac/libschroedinger libraries
@item Deluxe Paint Animation @tab @tab X
@item DNxHD @tab X @tab X
@tab aka SMPTE VC3
@item Duck TrueMotion 1.0 @tab @tab X
@tab fourcc: DUCK
@item Duck TrueMotion 2.0 @tab @tab X
@tab fourcc: TM20
@item DV (Digital Video) @tab X @tab X
@item Feeble Files/ScummVM DXA @tab @tab X
@tab Codec originally used in Feeble Files game.
@item Electronic Arts CMV video @tab @tab X
@tab Used in NHL 95 game.
@item Electronic Arts Madcow video @tab @tab X
@item Electronic Arts TGV video @tab @tab X
@item Electronic Arts TGQ video @tab @tab X
@item Electronic Arts TQI video @tab @tab X
@item Escape 124 @tab @tab X
@item FFmpeg video codec #1 @tab X @tab X
@tab experimental lossless codec (fourcc: FFV1)
@item Flash Screen Video v1 @tab X @tab X
@tab fourcc: FSV1
@item Flash Video (FLV) @tab X @tab X
@tab Sorenson H.263 used in Flash
@item Fraps @tab @tab X
@item H.261 @tab X @tab X
@item H.263 / H.263-1996 @tab X @tab X
@item H.263+ / H.263-1998 / H.263 version 2 @tab X @tab X
@item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 @tab E @tab X
@tab encoding supported through external library libx264
@item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration) @tab E @tab X
@item HuffYUV @tab X @tab X
@item HuffYUV FFmpeg variant @tab X @tab X
@item IBM Ultimotion @tab @tab X
@tab fourcc: ULTI
@item id Cinematic video @tab @tab X
@tab Used in Quake II.
@item id RoQ video @tab X @tab X
@tab Used in Quake III, Jedi Knight 2, other computer games.
@item IFF ILBM @tab @tab X
@tab IFF interlaved bitmap
@item IFF ByteRun1 @tab @tab X
@tab IFF run length encoded bitmap
@item Intel H.263 @tab @tab X
@item Intel Indeo 2 @tab @tab X
@item Intel Indeo 3 @tab @tab X
@item Intel Indeo 5 @tab @tab X
@item Interplay C93 @tab @tab X
@tab Used in the game Cyberia from Interplay.
@item Interplay MVE video @tab @tab X
@tab Used in Interplay .MVE files.
@item Karl Morton's video codec @tab @tab X
@tab Codec used in Worms games.
@item Kega Game Video (KGV1) @tab @tab X
@tab Kega emulator screen capture codec.
@item Lagarith @tab @tab X
@item LCL (LossLess Codec Library) MSZH @tab @tab X
@item LCL (LossLess Codec Library) ZLIB @tab E @tab E
@item LOCO @tab @tab X
@item lossless MJPEG @tab X @tab X
@item Microsoft RLE @tab @tab X
@item Microsoft Video 1 @tab @tab X
@item Mimic @tab @tab X
@tab Used in MSN Messenger Webcam streams.
@item Miro VideoXL @tab @tab X
@tab fourcc: VIXL
@item MJPEG (Motion JPEG) @tab X @tab X
@item Motion Pixels video @tab @tab X
@item MPEG-1 video @tab X @tab X
@item MPEG-1/2 video XvMC (X-Video Motion Compensation) @tab @tab X
@item MPEG-1/2 video (VDPAU acceleration) @tab @tab X
@item MPEG-2 video @tab X @tab X
@item MPEG-4 part 2 @tab X @tab X
@ libxvidcore can be used alternatively for encoding.
@item MPEG-4 part 2 Microsoft variant version 1 @tab @tab X
@item MPEG-4 part 2 Microsoft variant version 2 @tab X @tab X
@item MPEG-4 part 2 Microsoft variant version 3 @tab X @tab X
@item Nintendo Gamecube THP video @tab @tab X
@item NuppelVideo/RTjpeg @tab @tab X
@tab Video encoding used in NuppelVideo files.
@item On2 VP3 @tab @tab X
@tab still experimental
@item On2 VP5 @tab @tab X
@tab fourcc: VP50
@item On2 VP6 @tab @tab X
@tab fourcc: VP60,VP61,VP62
@item VP8 @tab E @tab X
@tab fourcc: VP80, encoding supported through external library libvpx
@item planar RGB @tab @tab X
@tab fourcc: 8BPS
@item Q-team QPEG @tab @tab X
@tab fourccs: QPEG, Q1.0, Q1.1
@item QuickTime 8BPS video @tab @tab X
@item QuickTime Animation (RLE) video @tab X @tab X
@tab fourcc: 'rle '
@item QuickTime Graphics (SMC) @tab @tab X
@tab fourcc: 'smc '
@item QuickTime video (RPZA) @tab @tab X
@tab fourcc: rpza
@item R10K AJA Kona 10-bit RGB Codec @tab @tab X
@item R210 Quicktime Uncompressed RGB 10-bit @tab @tab X
@item Raw Video @tab X @tab X
@item RealVideo 1.0 @tab X @tab X
@item RealVideo 2.0 @tab X @tab X
@item RealVideo 3.0 @tab @tab X
@tab still far from ideal
@item RealVideo 4.0 @tab @tab X
@item Renderware TXD (TeXture Dictionary) @tab @tab X
@tab Texture dictionaries used by the Renderware Engine.
@item RL2 video @tab @tab X
@tab used in some games by Entertainment Software Partners
@item Sierra VMD video @tab @tab X
@tab Used in Sierra VMD files.
@item Smacker video @tab @tab X
@tab Video encoding used in Smacker.
@item SMPTE VC-1 @tab @tab X
@item Snow @tab X @tab X
@tab experimental wavelet codec (fourcc: SNOW)
@item Sony PlayStation MDEC (Motion DECoder) @tab @tab X
@item Sorenson Vector Quantizer 1 @tab X @tab X
@tab fourcc: SVQ1
@item Sorenson Vector Quantizer 3 @tab @tab X
@tab fourcc: SVQ3
@item Sunplus JPEG (SP5X) @tab @tab X
@tab fourcc: SP5X
@item TechSmith Screen Capture Codec @tab @tab X
@tab fourcc: TSCC
@item Theora @tab E @tab X
@tab encoding supported through external library libtheora
@item Tiertex Limited SEQ video @tab @tab X
@tab Codec used in DOS CD-ROM FlashBack game.
@item V210 Quicktime Uncompressed 4:2:2 10-bit @tab X @tab X
@item VMware Screen Codec / VMware Video @tab @tab X
@tab Codec used in videos captured by VMware.
@item Westwood Studios VQA (Vector Quantized Animation) video @tab @tab X
@item Windows Media Video 7 @tab X @tab X
@item Windows Media Video 8 @tab X @tab X
@item Windows Media Video 9 @tab @tab X
@tab not completely working
@item Wing Commander III / Xan @tab @tab X
@tab Used in Wing Commander III .MVE files.
@item Wing Commander IV / Xan @tab @tab X
@tab Used in Wing Commander IV.
@item Winnov WNV1 @tab @tab X
@item WMV7 @tab X @tab X
@item YAMAHA SMAF @tab X @tab X
@item Psygnosis YOP Video @tab @tab X
@item ZLIB @tab X @tab X
@tab part of LCL, encoder experimental
@item Zip Motion Blocks Video @tab X @tab X
@tab Encoder works only in PAL8.
@end multitable
@code{X} means that encoding (resp. decoding) is supported.
@code{E} means that support is provided through an external library.
@section Audio Codecs
@multitable @columnfractions .4 .1 .1 .4
@item Name @tab Encoding @tab Decoding @tab Comments
@item 8SVX audio @tab @tab X
@item AAC @tab E @tab X
@tab encoding supported through external library libfaac
@item AC-3 @tab IX @tab X
@item ADPCM 4X Movie @tab @tab X
@item ADPCM CDROM XA @tab @tab X
@item ADPCM Creative Technology @tab @tab X
@tab 16 -> 4, 8 -> 4, 8 -> 3, 8 -> 2
@item ADPCM Electronic Arts @tab @tab X
@tab Used in various EA titles.
@item ADPCM Electronic Arts Maxis CDROM XS @tab @tab X
@tab Used in Sim City 3000.
@item ADPCM Electronic Arts R1 @tab @tab X
@item ADPCM Electronic Arts R2 @tab @tab X
@item ADPCM Electronic Arts R3 @tab @tab X
@item ADPCM Electronic Arts XAS @tab @tab X
@item ADPCM G.722 @tab X @tab X
@item ADPCM G.726 @tab X @tab X
@item ADPCM IMA AMV @tab @tab X
@tab Used in AMV files
@item ADPCM IMA Electronic Arts EACS @tab @tab X
@item ADPCM IMA Electronic Arts SEAD @tab @tab X
@item ADPCM IMA Funcom @tab @tab X
@item ADPCM IMA QuickTime @tab X @tab X
@item ADPCM IMA Loki SDL MJPEG @tab @tab X
@item ADPCM IMA WAV @tab X @tab X
@item ADPCM IMA Westwood @tab @tab X
@item ADPCM ISS IMA @tab @tab X
@tab Used in FunCom games.
@item ADPCM IMA Duck DK3 @tab @tab X
@tab Used in some Sega Saturn console games.
@item ADPCM IMA Duck DK4 @tab @tab X
@tab Used in some Sega Saturn console games.
@item ADPCM Microsoft @tab X @tab X
@item ADPCM MS IMA @tab X @tab X
@item ADPCM Nintendo Gamecube THP @tab @tab X
@item ADPCM QT IMA @tab X @tab X
@item ADPCM SEGA CRI ADX @tab X @tab X
@tab Used in Sega Dreamcast games.
@item ADPCM Shockwave Flash @tab X @tab X
@item ADPCM SMJPEG IMA @tab @tab X
@tab Used in certain Loki game ports.
@item ADPCM Sound Blaster Pro 2-bit @tab @tab X
@item ADPCM Sound Blaster Pro 2.6-bit @tab @tab X
@item ADPCM Sound Blaster Pro 4-bit @tab @tab X
@item ADPCM Westwood Studios IMA @tab @tab X
@tab Used in Westwood Studios games like Command and Conquer.
@item ADPCM Yamaha @tab X @tab X
@item AMR-NB @tab E @tab X
@tab encoding supported through external library libopencore-amrnb
@item AMR-WB @tab @tab X
@item Apple lossless audio @tab X @tab X
@tab QuickTime fourcc 'alac'
@item Atrac 1 @tab @tab X
@item Atrac 3 @tab @tab X
@item Bink Audio @tab @tab X
@tab Used in Bink and Smacker files in many games.
@item Delphine Software International CIN audio @tab @tab X
@tab Codec used in Delphine Software International games.
@item COOK @tab @tab X
@tab All versions except 5.1 are supported.
@item DCA (DTS Coherent Acoustics) @tab @tab X
@item DPCM id RoQ @tab X @tab X
@tab Used in Quake III, Jedi Knight 2, other computer games.
@item DPCM Interplay @tab @tab X
@tab Used in various Interplay computer games.
@item DPCM Sierra Online @tab @tab X
@tab Used in Sierra Online game audio files.
@item DPCM Sol @tab @tab X
@item DPCM Xan @tab @tab X
@tab Used in Origin's Wing Commander IV AVI files.
@item DSP Group TrueSpeech @tab @tab X
@item DV audio @tab @tab X
@item Enhanced AC-3 @tab @tab X
@item FLAC (Free Lossless Audio Codec) @tab X @tab IX
@item GSM @tab E @tab X
@tab encoding supported through external library libgsm
@item GSM Microsoft variant @tab E @tab X
@tab encoding supported through external library libgsm
@item IMC (Intel Music Coder) @tab @tab X
@item MACE (Macintosh Audio Compression/Expansion) 3:1 @tab @tab X
@item MACE (Macintosh Audio Compression/Expansion) 6:1 @tab @tab X
@item MLP (Meridian Lossless Packing) @tab @tab X
@tab Used in DVD-Audio discs.
@item Monkey's Audio @tab @tab X
@tab Only versions 3.97-3.99 are supported.
@item MP1 (MPEG audio layer 1) @tab @tab IX
@item MP2 (MPEG audio layer 2) @tab IX @tab IX
@item MP3 (MPEG audio layer 3) @tab E @tab IX
@tab encoding supported through external library LAME, ADU MP3 and MP3onMP4 also supported
@item MPEG-4 Audio Lossless Coding (ALS) @tab @tab X
@item Musepack SV7 @tab @tab X
@item Musepack SV8 @tab @tab X
@item Nellymoser Asao @tab X @tab X
@item PCM A-law @tab X @tab X
@item PCM mu-law @tab X @tab X
@item PCM 16-bit little-endian planar @tab @tab X
@item PCM 32-bit floating point big-endian @tab X @tab X
@item PCM 32-bit floating point little-endian @tab X @tab X
@item PCM 64-bit floating point big-endian @tab X @tab X
@item PCM 64-bit floating point little-endian @tab X @tab X
@item PCM D-Cinema audio signed 24-bit @tab X @tab X
@item PCM signed 8-bit @tab X @tab X
@item PCM signed 16-bit big-endian @tab X @tab X
@item PCM signed 16-bit little-endian @tab X @tab X
@item PCM signed 24-bit big-endian @tab X @tab X
@item PCM signed 24-bit little-endian @tab X @tab X
@item PCM signed 32-bit big-endian @tab X @tab X
@item PCM signed 32-bit little-endian @tab X @tab X
@item PCM signed 16/20/24-bit big-endian in MPEG-TS @tab @tab X
@item PCM unsigned 8-bit @tab X @tab X
@item PCM unsigned 16-bit big-endian @tab X @tab X
@item PCM unsigned 16-bit little-endian @tab X @tab X
@item PCM unsigned 24-bit big-endian @tab X @tab X
@item PCM unsigned 24-bit little-endian @tab X @tab X
@item PCM unsigned 32-bit big-endian @tab X @tab X
@item PCM unsigned 32-bit little-endian @tab X @tab X
@item PCM Zork @tab X @tab X
@item QCELP / PureVoice @tab @tab X
@item QDesign Music Codec 2 @tab @tab X
@tab There are still some distortions.
@item RealAudio 1.0 (14.4K) @tab X @tab X
@tab Real 14400 bit/s codec
@item RealAudio 2.0 (28.8K) @tab @tab X
@tab Real 28800 bit/s codec
@item RealAudio 3.0 (dnet) @tab IX @tab X
@tab Real low bitrate AC-3 codec
@item RealAudio SIPR / ACELP.NET @tab @tab X
@item Shorten @tab @tab X
@item Sierra VMD audio @tab @tab X
@tab Used in Sierra VMD files.
@item Smacker audio @tab @tab X
@item Sonic @tab X @tab X
@tab experimental codec
@item Sonic lossless @tab X @tab X
@tab experimental codec
@item Speex @tab @tab E
@tab supported through external library libspeex
@item True Audio (TTA) @tab @tab X
@item TrueHD @tab @tab X
@tab Used in HD-DVD and Blu-Ray discs.
@item TwinVQ (VQF flavor) @tab @tab X
@item Vorbis @tab E @tab X
@tab A native but very primitive encoder exists.
@item WavPack @tab @tab X
@item Westwood Audio (SND1) @tab @tab X
@item Windows Media Audio 1 @tab X @tab X
@item Windows Media Audio 2 @tab X @tab X
@item Windows Media Audio Pro @tab @tab X
@item Windows Media Audio Voice @tab @tab X
@end multitable
@code{X} means that encoding (resp. decoding) is supported.
@code{E} means that support is provided through an external library.
@code{I} means that an integer-only version is available, too (ensures high
performance on systems without hardware floating point support).
@section Subtitle Formats
@multitable @columnfractions .4 .1 .1 .1 .1
@item Name @tab Muxing @tab Demuxing @tab Encoding @tab Decoding
@item SSA/ASS @tab X @tab X @tab X @tab X
@item DVB @tab X @tab X @tab X @tab X
@item DVD @tab X @tab X @tab X @tab X
@item PGS @tab @tab @tab @tab X
@item SubRip (SRT) @tab X @tab X @tab @tab X
@item XSUB @tab @tab @tab X @tab X
@end multitable
@code{X} means that the feature is supported.
@section Network Protocols
@multitable @columnfractions .4 .1
@item Name @tab Support
@item file @tab X
@item Gopher @tab X
@item HTTP @tab X
@item MMS @tab X
@item pipe @tab X
@item RTP @tab X
@item TCP @tab X
@item UDP @tab X
@end multitable
@code{X} means that the protocol is supported.
@section Input/Output Devices
@multitable @columnfractions .4 .1 .1
@item Name @tab Input @tab Output
@item ALSA @tab X @tab X
@item BKTR @tab X @tab
@item DV1394 @tab X @tab
@item JACK @tab X @tab
@item LIBDC1394 @tab X @tab
@item OSS @tab X @tab X
@item Video4Linux @tab X @tab
@item Video4Linux2 @tab X @tab
@item VfW capture @tab X @tab
@item X11 grabbing @tab X @tab
@end multitable
@code{X} means that input/output is supported.
@chapter Platform Specific information
@section DOS
Using a cross-compiler is preferred for various reasons.
@subsection DJGPP
FFmpeg cannot be compiled because of broken system headers, add
@code{--extra-cflags=-U__STRICT_ANSI__} to the configure options as a
workaround.
@section OS/2
For information about compiling FFmpeg on OS/2 see
@url{http://www.edm2.com/index.php/FFmpeg}.
@section Unix-like
Some parts of FFmpeg cannot be built with version 2.15 of the GNU
assembler which is still provided by a few AMD64 distributions. To
make sure your compiler really uses the required version of gas
after a binutils upgrade, run:
@example
$(gcc -print-prog-name=as) --version
@end example
If not, then you should install a different compiler that has no
hard-coded path to gas. In the worst case pass @code{--disable-asm}
to configure.
@subsection BSD
BSD make will not build FFmpeg, you need to install and use GNU Make
(@file{gmake}).
@subsubsection FreeBSD
FreeBSD will not compile out-of-the-box due to broken system headers.
Passing @code{--extra-cflags=-D__BSD_VISIBLE} to configure will work
around the problem. This may have unexpected sideeffects, so use it at
your own risk. If you care about FreeBSD, please make an attempt at
getting the system headers fixed.
@subsection (Open)Solaris
GNU Make is required to build FFmpeg, so you have to invoke (@file{gmake}),
standard Solaris Make will not work. When building with a non-c99 front-end
(gcc, generic suncc) add either @code{--extra-libs=/usr/lib/values-xpg6.o}
or @code{--extra-libs=/usr/lib/64/values-xpg6.o} to the configure options
since the libc is not c99-compliant by default. The probes performed by
configure may raise an exception leading to the death of configure itself
due to a bug in the system shell. Simply invoke a different shell such as
bash directly to work around this:
@example
bash ./configure
@end example
@subsection Darwin (MacOS X, iPhone)
MacOS X on PowerPC or ARM (iPhone) requires a preprocessor from
@url{http://github.com/yuvi/gas-preprocessor} to build the optimized
assembler functions. Just download the Perl script and put it somewhere
in your PATH, FFmpeg's configure will pick it up automatically.
@section Windows
To get help and instructions for building FFmpeg under Windows, check out
the FFmpeg Windows Help Forum at
@url{http://ffmpeg.arrozcru.org/}.
@subsection Native Windows compilation
FFmpeg can be built to run natively on Windows using the MinGW tools. Install
the latest versions of MSYS and MinGW from @url{http://www.mingw.org/}.
You can find detailed installation
instructions in the download section and the FAQ.
FFmpeg does not build out-of-the-box with the packages the automated MinGW
installer provides. It also requires coreutils to be installed and many other
packages updated to the latest version. The minimum version for some packages
are listed below:
@itemize
@item bash 3.1
@item msys-make 3.81-2 (note: not mingw32-make)
@item w32api 3.13
@item mingw-runtime 3.15
@end itemize
FFmpeg automatically passes @code{-fno-common} to the compiler to work around
a GCC bug (see @url{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216}).
Within the MSYS shell, configure and make with:
@example
./configure --enable-memalign-hack
make
make install
@end example
This will install @file{ffmpeg.exe} along with many other development files
to @file{/usr/local}. You may specify another install path using the
@code{--prefix} option in @file{configure}.
Notes:
@itemize
@item Building natively using MSYS can be sped up by disabling implicit rules
in the Makefile by calling @code{make -r} instead of plain @code{make}. This
speed up is close to non-existent for normal one-off builds and is only
noticeable when running make for a second time (for example in
@code{make install}).
@item In order to compile FFplay, you must have the MinGW development library
of SDL. Get it from @url{http://www.libsdl.org}.
Edit the @file{bin/sdl-config} script so that it points to the correct prefix
where SDL was installed. Verify that @file{sdl-config} can be launched from
the MSYS command line.
@item By using @code{./configure --enable-shared} when configuring FFmpeg,
you can build libavutil, libavcodec and libavformat as DLLs.
@end itemize
@subsection Microsoft Visual C++ compatibility
As stated in the FAQ, FFmpeg will not compile under MSVC++. However, if you
want to use the libav* libraries in your own applications, you can still
compile those applications using MSVC++. But the libav* libraries you link
to @emph{must} be built with MinGW. However, you will not be able to debug
inside the libav* libraries, since MSVC++ does not recognize the debug
symbols generated by GCC.
We strongly recommend you to move over from MSVC++ to MinGW tools.
This description of how to use the FFmpeg libraries with MSVC++ is based on
Microsoft Visual C++ 2005 Express Edition. If you have a different version,
you might have to modify the procedures slightly.
@subsubsection Using static libraries
Assuming you have just built and installed FFmpeg in @file{/usr/local}.
@enumerate
@item Create a new console application ("File / New / Project") and then
select "Win32 Console Application". On the appropriate page of the
Application Wizard, uncheck the "Precompiled headers" option.
@item Write the source code for your application, or, for testing, just
copy the code from an existing sample application into the source file
that MSVC++ has already created for you. For example, you can copy
@file{libavformat/output-example.c} from the FFmpeg distribution.
@item Open the "Project / Properties" dialog box. In the "Configuration"
combo box, select "All Configurations" so that the changes you make will
affect both debug and release builds. In the tree view on the left hand
side, select "C/C++ / General", then edit the "Additional Include
Directories" setting to contain the path where the FFmpeg includes were
installed (i.e. @file{c:\msys\1.0\local\include}).
Do not add MinGW's include directory here, or the include files will
conflict with MSVC's.
@item Still in the "Project / Properties" dialog box, select
"Linker / General" from the tree view and edit the
"Additional Library Directories" setting to contain the @file{lib}
directory where FFmpeg was installed (i.e. @file{c:\msys\1.0\local\lib}),
the directory where MinGW libs are installed (i.e. @file{c:\mingw\lib}),
and the directory where MinGW's GCC libs are installed
(i.e. @file{C:\mingw\lib\gcc\mingw32\4.2.1-sjlj}). Then select
"Linker / Input" from the tree view, and add the files @file{libavformat.a},
@file{libavcodec.a}, @file{libavutil.a}, @file{libmingwex.a},
@file{libgcc.a}, and any other libraries you used (i.e. @file{libz.a})
to the end of "Additional Dependencies".
@item Now, select "C/C++ / Code Generation" from the tree view. Select
"Debug" in the "Configuration" combo box. Make sure that "Runtime
Library" is set to "Multi-threaded Debug DLL". Then, select "Release" in
the "Configuration" combo box and make sure that "Runtime Library" is
set to "Multi-threaded DLL".
@item Click "OK" to close the "Project / Properties" dialog box.
@item MSVC++ lacks some C99 header files that are fundamental for FFmpeg.
Get msinttypes from @url{http://code.google.com/p/msinttypes/downloads/list}
and install it in MSVC++'s include directory
(i.e. @file{C:\Program Files\Microsoft Visual Studio 8\VC\include}).
@item MSVC++ also does not understand the @code{inline} keyword used by
FFmpeg, so you must add this line before @code{#include}ing libav*:
@example
#define inline _inline
@end example
@item Build your application, everything should work.
@end enumerate
@subsubsection Using shared libraries
This is how to create DLL and LIB files that are compatible with MSVC++:
@enumerate
@item Add a call to @file{vcvars32.bat} (which sets up the environment
variables for the Visual C++ tools) as the first line of @file{msys.bat}.
The standard location for @file{vcvars32.bat} is
@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat},
and the standard location for @file{msys.bat} is @file{C:\msys\1.0\msys.bat}.
If this corresponds to your setup, add the following line as the first line
of @file{msys.bat}:
@example
call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
@end example
Alternatively, you may start the @file{Visual Studio 2005 Command Prompt},
and run @file{c:\msys\1.0\msys.bat} from there.
@item Within the MSYS shell, run @code{lib.exe}. If you get a help message
from @file{Microsoft (R) Library Manager}, this means your environment
variables are set up correctly, the @file{Microsoft (R) Library Manager}
is on the path and will be used by FFmpeg to create
MSVC++-compatible import libraries.
@item Build FFmpeg with
@example
./configure --enable-shared --enable-memalign-hack
make
make install
@end example
Your install path (@file{/usr/local/} by default) should now have the
necessary DLL and LIB files under the @file{bin} directory.
@end enumerate
To use those files with MSVC++, do the same as you would do with
the static libraries, as described above. But in Step 4,
you should only need to add the directory where the LIB files are installed
(i.e. @file{c:\msys\usr\local\bin}). This is not a typo, the LIB files are
installed in the @file{bin} directory. And instead of adding the static
libraries (@file{libxxx.a} files) you should add the MSVC import libraries
(@file{avcodec.lib}, @file{avformat.lib}, @file{avcore.lib}, and
@file{avutil.lib}). Note that you should not use the GCC import
libraries (@file{libxxx.dll.a} files), as these will give you undefined
reference errors. There should be no need for @file{libmingwex.a},
@file{libgcc.a}, and @file{wsock32.lib}, nor any other external library
statically linked into the DLLs. The @file{bin} directory contains a bunch
of DLL files, but the ones that are actually used to run your application
are the ones with a major version number in their filenames
(i.e. @file{avcodec-51.dll}).
FFmpeg headers do not declare global data for Windows DLLs through the usual
dllexport/dllimport interface. Such data will be exported properly while
building, but to use them in your MSVC++ code you will have to edit the
appropriate headers and mark the data as dllimport. For example, in
libavutil/pixdesc.h you should have:
@example
extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[];
@end example
@subsection Cross compilation for Windows with Linux
You must use the MinGW cross compilation tools available at
@url{http://www.mingw.org/}.
Then configure FFmpeg with the following options:
@example
./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
@end example
(you can change the cross-prefix according to the prefix chosen for the
MinGW tools).
Then you can easily test FFmpeg with Wine
(@url{http://www.winehq.com/}).
@subsection Compilation under Cygwin
Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack
llrint() in its C library.
Install your Cygwin with all the "Base" packages, plus the
following "Devel" ones:
@example
binutils, gcc4-core, make, subversion, mingw-runtime, texi2html
@end example
And the following "Utils" one:
@example
diffutils
@end example
Then run
@example
./configure --enable-static --disable-shared
@end example
to make a static build.
The current @code{gcc4-core} package is buggy and needs this flag to build
shared libraries:
@example
./configure --enable-shared --disable-static --extra-cflags=-fno-reorder-functions
@end example
If you want to build FFmpeg with additional libraries, download Cygwin
"Devel" packages for Ogg and Vorbis from any Cygwin packages repository:
@example
libogg-devel, libvorbis-devel
@end example
These library packages are only available from Cygwin Ports
(@url{http://sourceware.org/cygwinports/}) :
@example
yasm, libSDL-devel, libdirac-devel, libfaac-devel, libgsm-devel,
libmp3lame-devel, libschroedinger1.0-devel, speex-devel, libtheora-devel,
libxvidcore-devel
@end example
The recommendation for libnut and x264 is to build them from source by
yourself, as they evolve too quickly for Cygwin Ports to be up to date.
Cygwin 1.7.x has IPv6 support. You can add IPv6 to Cygwin 1.5.x by means
of the @code{libgetaddrinfo-devel} package, available at Cygwin Ports.
@subsection Crosscompilation for Windows under Cygwin
With Cygwin you can create Windows binaries that do not need the cygwin1.dll.
Just install your Cygwin as explained before, plus these additional
"Devel" packages:
@example
gcc-mingw-core, mingw-runtime, mingw-zlib
@end example
and add some special flags to your configure invocation.
For a static build run
@example
./configure --target-os=mingw32 --enable-memalign-hack --enable-static --disable-shared --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
@end example
and for a build with shared libraries
@example
./configure --target-os=mingw32 --enable-memalign-hack --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
@end example
@bye
|
https://hajtmar.cz/fotoalbum-lib/comments/pekarov6-lisaurus.tex
|
hajtmar.cz
|
CC-MAIN-2022-49
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2022-49/segments/1669446710503.24/warc/CC-MAIN-20221128102824-20221128132824-00474.warc.gz
| 345,226,368
| 784
|
\{\tfd Velikonoce 2006 (13.-17.4.2006) - LiĊĦaurus (dirpath: pekarov6)}\par
%\ObrTwo\{img000xx.jpg}{Pokec}{here} \blank[small]
% <img class="alignleft" style="margin: 10px;" src="http://www.sqrt.rps.cz/fotoalbum/velikonoce2009/img00007.jpg" alt="" width="300" />
Konec
|
https://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/GSWLaTeX.tex
|
tcd.ie
|
CC-MAIN-2019-09
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2019-09/segments/1550249550830.96/warc/CC-MAIN-20190223203317-20190223225317-00402.warc.gz
| 866,091,395
| 23,643
|
\documentclass[a4paper,12pt]{article}
\addtolength{\textwidth}{50pt}
\addtolength{\evensidemargin}{-25pt}
\addtolength{\oddsidemargin}{-25pt}
\def\displayandname#1{\rlap{$\displaystyle\csname #1\endcsname$}%
\qquad \texttt{\char92 #1}}
\def\mathlexicon#1{$$\vcenter{\halign{\displayandname{##}\hfil&&\qquad
\displayandname{##}\hfil\cr #1}}$$}
\begin{document}
\title{Getting Started with \LaTeX}
\author{David R. Wilkins}
\date{2nd Edition\\[3pt]
Copyright \copyright\ David R. Wilkins 1995}
\maketitle
\tableofcontents
\section{Introduction to \LaTeX}
\subsection{What is \LaTeX?}
\LaTeX\ is a computer program for typesetting documents. It
takes a computer file, prepared according to the rules of
\LaTeX\, and converts it to a form that may be printed on a
high-quality printer, such as a laser writer, to produce
a printed document of a quality comparable with good
quality books and journals. Simple documents, which do
not contain mathematical formulae or tables may be produced
very easily: effectively all one has to do is to type the
text straight in (though observing certain rules relating to
quotation marks and punctuation dashes). Typesetting
mathematics is somewhat more complicated, but even here
\LaTeX\ is comparatively straightforward to use when one
considers the complexity of some of the formulae that it
has to produce and the large number of mathematical symbols
which it has to produce.
\LaTeX\ is one of a number of `dialects' of \TeX, all based on the
version of \TeX\ created by D. E. Knuth which is known as
Plain \TeX. \LaTeX\ (created by L. B. Lamport) is one of
these `dialects'. It is particularly suited to the
production of long articles and books, since it has
facilities for the automatic numbering of chapters, sections,
theorems, equations etc., and also has facilities for
cross-referencing. It is probably one of the most suitable
version of \LaTeX\ for beginners to use.
\subsection{A Typical \LaTeX\ Input File}
In order to produce a document using \LaTeX, we must first
create a suitable \emph{input file} on the computer. We
apply the \LaTeX\ program to the input file and then use the
printer to print out the so-called `DVI' file produced by
the \LaTeX\ program (after first using another program to
translate the `DVI' file into a form that the printer
can understand). Here is an example of a typical
\LaTeX\ input file:
\begin{quote}
\begin{verbatim}
\documentclass[a4paper,12pt]{article}
\begin{document}
The foundations of the rigorous study of \textit{analysis}
were laid in the nineteenth century, notably by the
mathematicians Cauchy and Weierstrass. Central to the
study of this subject are the formal definitions of
\textit{limits} and \textit{continuity}.
Let $D$ be a subset of $\bf R$ and let
$f \colon D \to \textbf{R}$ be a real-valued function on
$D$. The function $f$ is said to be \textit{continuous} on
$D$ if, for all $\epsilon > 0$ and for all $x \in D$,
there exists some $\delta > 0$ (which may depend on $x$)
such that if $y \in D$ satisfies
\[ |y - x| < \delta \]
then
\[ |f(y) - f(x)| < \epsilon. \]
One may readily verify that if $f$ and $g$ are continuous
functions on $D$ then the functions $f+g$, $f-g$ and
$f.g$ are continuous. If in addition $g$ is everywhere
non-zero then $f/g$ is continuous.
\end{document}
\end{verbatim}
\end{quote}
When we apply \LaTeX\ to these paragraphs we produce the text
\begin{quotation}
\normalsize
The foundations of the rigorous study of \textit{analysis}
were laid in the nineteenth century, notably by the
mathematicians Cauchy and Weierstrass. Central to the
study of this subject are the formal definitions of
\textit{limits} and \textit{continuity}.
Let $D$ be a subset of $\bf R$ and let
$f \colon D \to \textbf{R}$ be a real-valued function on
$D$. The function $f$ is said to be \textit{continuous} on
$D$ if, for all $\epsilon > 0$ and for all $x \in D$,
there exists some $\delta > 0$ (which may depend on $x$)
such that if $y \in D$ satisfies
\[ |y - x| < \delta\]
then
\[ |f(y) - f(x)| < \epsilon.\]
One may readily verify that if $f$ and $g$ are continuous
functions on $D$ then the functions $f+g$, $f-g$ and
$f.g$ are continuous. If in addition $g$ is everywhere
non-zero then $f/g$ is continuous.
\end{quotation}
This example illustrates various features of \LaTeX. Note
that the lines
\begin{quote}
\begin{verbatim}
\documentclass[a4paper,12pt]{article}
\begin{document}
\end{verbatim}
\end{quote}
are placed at the beginning of the input file. These are followed
by the main body of the text, followed by the concluding line
\begin{quote}
\begin{verbatim}
\end{document}
\end{verbatim}
\end{quote}
Note also that, although most characters occurring in this file
have their usual meaning, yet there are special characters such
as \verb/\/, \verb/$/, \verb/{/ and \verb/}/
which have special
meanings within \LaTeX. Note in particular that there are
sequences of characters which begin with a `backslash'
\verb/\/ which are used to produce mathematical symbols and
Greek letters and to accomplish tasks such as changing fonts.
These sequences of characters are known as
\emph{control sequences}.
\subsection{Characters and Control Sequences}
We now describe in more detail some of the features of
\LaTeX\ illustrated in the above example.
Most characters on the keyboard, such as letters and
numbers, have their usual meaning. However the characters
\begin{quote}
\begin{verbatim}
\ { } $ ^ _ % ~ # &
\end{verbatim}
\end{quote}
are used for special purposes within \LaTeX. Thus typing one of
these characters will not produce the corresponding character
in the final document. Of course these characters are very
rarely used in ordinary text, and there are methods of
producing them when they are required in the final document.
In order to typeset a mathematical document it is
necessary to produce a considerable number of special
mathematical symbols. One also needs to be able to
change fonts. Also mathematical documents often contain
arrays of numbers or symbols (matrices) and other complicated
expressions. These are produced in \LaTeX\ using \emph{control
sequences}. Most control sequences consist of a backslash
\verb/\/ followed by a string of (upper or lower case) letters.
For example, \verb/\alpha/, \verb/\textit/ and \verb/\sum/
are control sequences.
In the example above we used the control sequences
\verb/\textit/ and \verb/\textbf/ to change the font to
\textit{italic}
and \textbf{boldface} respectively. Also we used the control
sequences \verb/\to/, \verb/\in/, \verb/\delta/ and
\verb/\epsilon/ to produce the mathematical symbols
$\to$
and
$\in$
and the Greek letters
$\delta$
and
$\epsilon$
There is another variety of control sequence which consists
of a backslash followed by a \emph{single} character that
is not a letter. Examples of control sequences of this sort
are \verb/\{/, \verb/\"/ and \verb/\$/.
The special characters \verb/{/ and \verb/}/ are used for
\emph{grouping} purposes. Everything enclosed within
matching pair of such brackets is treated as a single unit.
We have applied these brackets in the example above whenever
we changed fonts. We shall see other instances where one needs
to use \verb/{/ and \verb/}/ in \LaTeX\ to group words and symbols
together (e.g., when we need to produce superscripts and
subscripts which contain more than one symbol).
The special character \verb/$/ is used when one is
changing from ordinary text to a mathematical expression
and when one is changing back to ordinary text. Thus we
used
\begin{quote}
\begin{verbatim}
for all $\epsilon > 0$ and for all $x \in D$,
\end{verbatim}
\end{quote}
to produce the phrase
\begin{quotation}
for all $\epsilon > 0$ and for all $x \in D$,
\end{quotation}
in the example given above. Note also that we used
\verb/\[/ and \verb/\]/ in the example above to mark
the beginning and end respectively of a mathematical formula that
is displayed on a separate line.
The remaining special characters
\begin{quote}
\begin{verbatim}
^ _ % ~ # &
\end{verbatim}
\end{quote}
have special purposes within \LaTeX\ that we shall discuss
later.
\section{Producing Simple Documents using \LaTeX}
\subsection{Producing a \LaTeX\ Input File}
We describe the structure of a typical \LaTeX\ input file.
The first line of the input file should consist of a
\verb/\documentclass/ command. The recommended such
\verb/\documentclass/ command for mathematical articles
and similar documents has the form
\begin{quote}
\begin{verbatim}
\documentclass[a4paper,12pt]{article}
\end{verbatim}
\end{quote}
(You do not have to worry about what this command means when
first learning to use \LaTeX: its effect is to ensure that the
final document is correctly positioned on A4 size paper and
that the text is of a size that is easy to read.) There are
variants of this \verb/\documentclass/ command which are
appropriate for letters or for books.
The \verb/documentclass/ command may be followed by certain
other optional commands, such as the \verb/\pagestyle/ command.
It is not necessary to find out about these commands when first
learning to use \LaTeX.
After the \verb/\documentclass/ command and these other
optional commands, we place the command
\begin{quote}
\begin{verbatim}
\begin{document}
\end{verbatim}
\end{quote}
This command is then followed by the main body of the text,
in the format prescribed by the rules of \LaTeX.
Finally, we end the input file with a line containing the
command
\begin{quote}
\begin{verbatim}
\end{document}
\end{verbatim}
\end{quote}
\subsection{Producing Ordinary Text using \LaTeX}
To produce a simple document using \LaTeX\ one should create a
\LaTeX\ input file, beginning with a \verb/\documentclass/
command and the \verb/\begin{document}/ command, as
described above. The input file should end with the
\verb/\end{document}/ command, and the text of the
document should be sandwiched between the
\verb/\begin{document}/ and \verb/\end{document}/
commands in the manner described below.
If one merely wishes to type in ordinary text, without
complicated mathematical formulae or special effects such
as font changes, then one merely has to type it in as it
is, leaving a completely blank line between successive
paragraphs. You do not have to worry about paragraph
indentation: \LaTeX\ will automatically indent all paragraphs
with the exception of the first paragraph of a new section
(unless you take special action to override the conventions
adopted by \LaTeX)
For example, suppose that we wish to create a document
containing the following paragraphs:
\begin{quotation}
\normalsize
\noindent
If one merely wishes to type in ordinary text, without
complicated mathematical formulae or special effects such
as font changes, then one merely has to type it in as it
is, leaving a completely blank line between successive
paragraphs.
You do not have to worry about paragraph indentation:
all paragraphs will be indented with the exception of
the first paragraph of a new section.
One must take care to distinguish between the `left quote'
and the `right quote' on the computer terminal. Also, one
should use two `single quote' characters in succession if
one requires ``double quotes''. One should never use the
(undirected) `double quote' character on the computer
terminal, since the computer is unable to tell whether it
is a `left quote' or a `right quote'. One also has to
take care with dashes: a single dash is used for
hyphenation, whereas three dashes in succession are required
to produce a dash of the sort used for punctuation---such as
the one used in this sentence.
\end{quotation}
To create this document using \LaTeX\ we use the following
input file:
\begin{quote}
\begin{verbatim}
\documentclass[a4paper,12pt]{article}
\begin{document}
If one merely wishes to type in ordinary text, without
complicated mathematical formulae or special effects such
as font changes, then one merely has to type it in as it
is, leaving a completely blank line between successive
paragraphs.
You do not have to worry about paragraph indentation:
all paragraphs will be indented with the exception of
the first paragraph of a new section.
One must take care to distinguish between the `left quote'
and the `right quote' on the computer terminal. Also, one
should use two `single quote' characters in succession if
one requires ``double quotes''. One should never use the
(undirected) `double quote' character on the computer
terminal, since the computer is unable to tell whether it
is a `left quote' or a `right quote'. One also has to
take care with dashes: a single dash is used for
hyphenation, whereas three dashes in succession are required
to produce a dash of the sort used for punctuation---such as
the one used in this sentence.
\end{document}
\end{verbatim}
\end{quote}
Having created the input file, one then has to run it
through the \LaTeX\ program and then print it out the
resulting output file (known as a `DVI' file).
\subsection{Blank Spaces and Carriage Returns in the Input File}
\LaTeX\ treats the carriage return at the end of a line
as though it were a blank space. Similarly \LaTeX\ treats
tab characters as blank spaces. Moreover, \LaTeX\ regards
a sequence of blank spaces as though it were a single
space, and similarly it will ignore blank spaces at the
beginning or end of a line in the input file. Thus, for
example, if we type
\begin{quote}
\begin{verbatim}
This is
a
silly
example of a
file with many spaces.
This is the beginning
of a new paragraph.
\end{verbatim}
\end{quote}
then we obtain
\begin{quotation}
This is
a
silly
example of a
file with many spaces.
This is the beginning
of a new paragraph.
\end{quotation}
It follows immediately from this that one will obtain
the same results whether one types one space or two spaces
after a full stop: \LaTeX\ does not distinguish between the
two cases.
Any spaces which follow a control sequence will be ignored
by \LaTeX.
If you really need a blank space in the final document
following whatever is produced by the control sequence,
then you must precede this blank by a
\emph{backslash} \verb/\/. Thus in order to obtain the
sentence
\begin{quotation}
\LaTeX\ is a very powerful computer typesetting program.
\end{quotation}
we must type
\begin{quote}
\begin{verbatim}
\LaTeX\ is a very powerful computer typesetting program.
\end{verbatim}
\end{quote}
(Here the control sequence \verb/TeX/ is used to produce
the \LaTeX\ logo.)
In general, preceding a blank space by a backslash
forces \LaTeX\ to include the blank space in the final
document.
As a general rule, you should never put a blank space after
a left parenthesis or before a right parenthesis. If you were
to put a blank space in these places, then you run the risk
that \LaTeX\ might start a new line immediately after the left
parenthesis or before the right parenthesis, leaving the
parenthesis marooned at the beginning or end of a line.
\subsection{Quotation Marks and Dashes}
Single quotation marks are produced in \LaTeX\ using
\verb/`/ and \verb/'/. Double quotation marks are
produced by typing \verb/``/ and \verb/''/. (The
`undirected double quote character \verb/"/ produces
double right quotation marks: it should \emph{never} be
used where left quotation marks are required.)
\LaTeX\ allows you to produce dashes of various length, known as
`hyphens', `en-dashes' and `em-dashes'. Hyphens are obtained
in \LaTeX\ by typing \verb/-/, en-dashes by typing \verb/--/ and
em-dashes by typing \verb/---/.
One normally uses en-dashes when specifying a range of numbers.
Thus for example, to specify a range of page numbers, one would type
\begin{quote}
\begin{verbatim}
on pages 155--219.
\end{verbatim}
\end{quote}
Dashes used for punctuating are often typeset as em-dashes,
especially in older books. These are obtained by typing
\verb/---/.
The dialogue
\begin{quotation}
``You \emph{were} a little grave,'' said Alice.
``Well just then I was inventing a new way of
getting over a gate---would you like to hear it?''
``Very much indeed,'' Alice said politely.
``I'll tell you how I came to think of it,'' said
the Knight. ``You see, I said to myself `The only
difficulty is with the feet: the \emph{head} is
high enough already.' Now, first I put my head on
the top of the gate---then the head's high
enough---then I stand on my head---then the feet
are high enough, you see---then I'm over, you see.''
\end{quotation}
(taken from \emph{Alice through the Looking Glass}, by Lewis Carroll)
illustrates the use of quotation marks and dashes. It is obtained in
\LaTeX\ from the following input:
\begin{quote}
\begin{verbatim}
``You \emph{were} a little grave,'' said Alice.
``Well just then I was inventing a new way of
getting over a gate---would you like to hear it?''
``Very much indeed,'' Alice said politely.
``I'll tell you how I came to think of it,'' said
the Knight. ``You see, I said to myself `The only
difficulty is with the feet: the \emph{head} is
high enough already.' Now, first I put my head on
the top of the gate---then the head's high
enough---then I stand on my head---then the feet
are high enough, you see---then I'm over, you see.''
\end{verbatim}
\end{quote}
Sometimes you need single quotes immediately following double quotes,
or vica versa, as in
\begin{quotation}
``I regard computer typesetting as being reasonably
`straightforward'\,'' he said.
\end{quotation}
The way to typeset this correctly in \LaTeX\ is to use the
control sequence \verb/\,/ between the quotation marks,
so as to obtain the necessary amount of separation. The above
example is thus produced with the input
\begin{quote}
\begin{verbatim}
``I regard computer typesetting as being reasonably
`straightforward'\,'' he said.
\end{verbatim}
\end{quote}
\subsection{Section Headings in \LaTeX}
Section headings of various sizes are produced (in the
\textbf{article} document style) using the commands
\verb/\section/,\verb/\subsection/ and
\verb/\subsubsection/
commands. \LaTeX\ will number the sections and subsections
automatically. The title of the section should be surrounded
by curly brackets and placed immediately after the relevant
command. Thus if we type
\begin{quote}
\begin{verbatim}
\section{Section Headings}
We explain in this section how to obtain headings
for the various sections and subsections of our
document.
\subsection{Headings in the `article' Document Style}
In the `article' style, the document may be divided up
into sections, subsections and subsubsections, and each
can be given a title, printed in a boldface font,
simply by issuing the appropriate command.
\end{verbatim}
\end{quote}
then the title of the section and that of the subsection
will be printed in a large boldface font, and will be
numbered accordingly.
Other document styles (such as the \textbf{book} and
\textbf{letter} styles) have other `sectioning'
commands available (for example, the \textbf{book}
style has a \verb/\chapter/ command for beginning
a new chapter).
Sometimes one wishes to suppress the automatic numbering
provided by \LaTeX. This can be done by placing an
asterisk before the title of the section or subsection.
Thus, for example, the section numbers in the above example
could be suppressed by typing
\begin{quote}
\begin{verbatim}
\section*{Section Headings}
We explain in this section how to obtain headings
for the various sections and subsections of our
document.
\subsection*{Headings in the `article' Document Style}
In the `article' style, the document may be divided up
into sections, subsections and subsubsections, and each
can be given a title, printed in a boldface font,
simply by issuing the appropriate command.
\end{verbatim}
\end{quote}
\subsection{Changing Fonts in Text Mode}
\LaTeX\ has numerous commands for changing the typestyle.
The most useful of these is \verb/\emph{/\emph{text}\verb/}/
which \emph{emphasizes} some piece of text, setting it
usually in an \textit{italic font} (unless the surrounding
text is already italicized). Thus for example, the text
\begin{quotation}
The basic results and techniques of \emph{Calculus}
were discovered and developed by \emph{Newton}
and \emph{Leibniz}, though many of the basic ideas
can be traced to earlier work of \emph{Cavalieri},
\emph{Fermat}, \emph{Barrow} and others.
\end{quotation}
is obtained by typing
\begin{quote}
\begin{verbatim}
The basic results and techniques of \emph{Calculus}
were discovered and developed by \emph{Newton}
and \emph{Leibniz}, though many of the basic ideas
can be traced to earlier work of \emph{Cavalieri},
\emph{Fermat}, \emph{Barrow} and others.
\end{verbatim}
\end{quote}
Another useful font-changing command is \verb/\textbf{/\emph{text}\verb/}/,
which typesets the specified portion of text in \textbf{boldface}.
A \emph{font family} or \emph{typeface} in \LaTeX\ consists of a
collection of related fonts characterized by \emph{size}, \emph{shape}
and \emph{series}. The font families available in \LaTeX\ include
\textrm{roman}, \textsf{sans serif} and \texttt{typewriter}:
\begin{itemize}
\item
\textrm{Roman is normally the default family and includes
\textup{upright}, \textit{italic}, \textsl{slanted}, \textsc{small caps}
and \textbf{boldface} fonts of various sizes.}
\item
\textsf{There is a sans serif family with
\textup{upright}, \textsl{slanted}
and \textbf{boldface} fonts of various sizes.}
\item
\texttt{There is a typewriter family with
\textup{upright}, \textit{italic}, \textsl{slanted}\newline
and \textsc{small caps} fonts of various sizes.}
\end{itemize}
The sizes of fonts used in \LaTeX\ are can be determined
and changed by means of the control sequences
\verb/\tiny/,
\verb/\scriptsize/,
\verb/\footnotesize/,
\verb/\small/,
\verb/\normalsize/,
\verb/\large/,
\verb/\Large/,
\verb/\LARGE/,
\verb/\huge/ and
\verb/\HUGE/:
\begin{quote}
{\tiny This text is \texttt{tiny}}.
{\scriptsize This text is \texttt{scriptsize}}.
{\footnotesize This text is \texttt{footnotesize}}.
{\small This text is \texttt{small}}.
{\normalsize This text is \texttt{normalsize}}.
{\large This text is \texttt{large}}.
{\Large This text is \texttt{Large}}.
{\LARGE This text is \texttt{LARGE}}.
{\huge This text is \texttt{huge}}.
{\Huge This text is \texttt{Huge}}.
\end{quote}
\vspace{6pt}
The \emph{shape} of a font can be \textup{upright},
\textit{italic}, \textsl{slanted} or \textsc{small caps}:
\begin{itemize}
\item
\textup{The LaTeX command}
\verb/\textup{/\emph{text}\verb/}/
\textup{typesets the specified text with an upright shape:
this is normally the default shape.}
\item
\textit{The LaTeX command}
\verb/\textit{/\emph{text}\verb/}/
\textit{typesets the specified text with an italic shape.}
\item
\textsl{The LaTeX command}
\verb/\textsl{/\emph{text}\verb/}/
\textsl{typesets the specified text with a slanted shape:
slanted text is similar to italic.}
\item
\textsc{The LaTeX command}
\verb/\textsc{/\emph{text}\verb/}/
\textsc{typesets the specified text with a small caps shape
in which all letters are capitals (with uppercase letters taller than
lowercase letters).}
\end{itemize}
The \emph{series} of a font can be \textmd{medium} (the default) or
\textbf{boldface}:
\begin{itemize}
\item
\textup{The LaTeX command}
\verb/\textmd{/\emph{text}\verb/}/
\textmd{typesets the specified text with a medium series font.}
\item
\textbf{The LaTeX command}
\verb/\textbf{/\emph{text}\verb/}/
\textbf{typesets the specified text with a boldface series font.}
\end{itemize}
If the necessary fonts are available, one can combine changes to
the size, shape and series of a font, for example producing
\textbf{\textsl{boldface slanted text}} by typing
\begin{quote}
\begin{verbatim}
\textbf{\textsl{boldface slanted text}}.
\end{verbatim}
\end{quote}
There are in \LaTeX\ font declarations corresponding to the
the font-changing commands described above. When included in the
\LaTeX\ input such declarations determine the type-style of the
subsequent text (till the next font declaration or the end
of the current `group' delimited by curly brackets
or by appropriate \verb/\begin/ and \verb/\end/
commands). Here is a list of font-changing commands and
declarations in text mode:
\begin{quote}
\begin{tabular}{lll}
\emph{Command}&\emph{Declaration}&\\
\verb/\textrm/&\verb/\rmfamily/&{\rmfamily Roman family}\\
\verb/\textsf/&\verb/\sffamily/&{\sffamily Sans serif family}\\
\verb/\texttt/&\verb/\ttfamily/&{\ttfamily Typewriter family}\\[6pt]
\verb/\textup/&\verb/\upshape/&{\upshape Upright shape}\\
\verb/\textit/&\verb/\itshape/&{\itshape Italic shape}\\
\verb/\textsl/&\verb/\slshape/&{\slshape Slanted shape}\\
\verb/\textsc/&\verb/\scshape/&{\scshape Small caps shape}\\[6pt]
\verb/\textmd/&\verb/\mdseries/&{\mdseries Medium series}\\
\verb/\textbf/&\verb/\bfseries/&{\bfseries Boldface series}\\
\end{tabular}
\end{quote}
\subsection{Accents used in Text}
There are a variety of control sequences for producing accents.
For example, the control sequence \verb/\'{o}/ produces an
acute accent on the letter \verb/o/. Thus typing
\begin{quote}
\begin{verbatim}
Se\'{a}n \'{O} Cinn\'{e}ide.
\end{verbatim}
\end{quote}
produces
\begin{quotation}
Se\'{a}n \'{O} Cinn\'{e}ide.
\end{quotation}
Similarly we use the control sequence \verb/\`/ to
produce the grave accent in `alg\`{e}bre' and we use
\verb/\"/ to produce the umlaut in `Universit\"{a}t'.
A list of the accents provided by \LaTeX\ is given in the
following table:
\begin{quote}
\begin{tabular}{lll}
\verb/\'{e}/ & \'{e}
& e.g., \verb/math\'{e}matique/ yields `math\'{e}matique' \\
\verb/\`{e}/ & \`{e}
& e.g., \verb/alg\`{e}bre/ yields `alg\`{e}bre' \\
\verb/\^{e}/ & \^{e}
& e.g., \verb/h\^{o}te/ yields `h\^{o}te' \\
\verb/\"{o}/ & \"{o}
& e.g., \verb/H\"{o}lder/ yields `H\"{o}lder' \\
\verb/\~{n}/ & \~{n}
& e.g., \verb/ma\~{n}ana/ yields `ma\~{n}ana' \\
\verb/\={o}/ & \={o} & \\
\verb/\.{o}/ & \.{o} & \\
\verb/\u{o}/ & \u{o} & \\
\verb/\v{c}/ & \v{c}
& e.g., \verb/\v{C}ech/ yields `\v{C}ech' \\
\verb/\H{o}/ & \H{o} & \\
\verb/\t{oo}/ & \t{oo} & \\
\verb/\c{c}/ & \c{c}
& e.g., \verb/gar\c{c}on/ yields `gar\c{c}on' \\
\verb/\d{o}/ & \d{o} & \\
\verb/\b{o}/ & \b{o} &
\end{tabular}
\end{quote}
These accents are for use in ordinary text. They cannot be
used within mathematical formulae, since different control
sequences are used to produce accents within mathematics.
The control sequences \verb/\i/ and \verb/\j/ produce
dotless `i' and `j'. These are required when placing an
accent on the letter. Thus \'{i} is produced by typing
\verb/\'{\i}/.
\subsection{Active Characters and Special Symbols in Text}
The `active characters'
\begin{quote}
\begin{verbatim}
# $ % & \ ^ _ { } ~
\end{verbatim}
\end{quote}
have special purposes within \LaTeX. Thus they cannot be produced
in the final document simply by typing them directly. On the
rare occasions when one needs to use the special characters
\begin{quote}
\#\ \$\ \%\ \&\ \_\ \{\ \}
\end{quote}
in the final document, they can be produced by typing the control
sequences
\begin{quote}
\begin{verbatim}
\# \$ \% \& \_ \{ \}
\end{verbatim}
\end{quote}
respectively. However the characters
\verb/\/, \verb/^/ and \verb/~/ cannot be
produced simply by preceding them with a backslash. They can
however be produced using \verb/\char92/ (in the \verb/\texttt/ font
only), \verb/\char94/ and \verb/\char126/ respectively.
(The decimal numbers 92, 94 and 126 are the ASCII codes of these
characters.)
Other special symbols can be introduced into
text using the appropriate control sequences:
\begin{quote}
\begin{tabular}{l|l}
\emph{Symbol} & \emph{Control Sequence}\\
\hline
\oe, \OE & \verb/\oe, \OE/ \\
\ae, \AE & \verb/\ae, \AE/ \\
\aa, \AA & \verb/\aa, \AA/ \\
\o, \O & \verb/\o, \O/ \\
\l, \L & \verb/\l, \L/ \\
\ss & \verb/\ss/ \\
?` & \verb/?`/ \\
!` & \verb/!`/ \\
\dag & \verb/\dag/ \\
\ddag & \verb/\ddag/ \\
\S & \verb/\S/ \\
\P & \verb/\P/ \\
\copyright & \verb/\copyright/ \\
\pounds & \verb/\pounds/ \\
\i & \verb/\i/ \\
\j & \verb/\j/ \\
\end{tabular}
\end{quote}
\section{Producing Mathematical Formulae using \LaTeX}
\subsection{Mathematics Mode}
In order to obtain a mathematical formula using \LaTeX, one must
enter \emph{mathematics mode} before the formula and leave it
afterwards. Mathematical formulae can occur either embedded in text
or else displayed between lines of text. When a formula occurs within
the text of a paragraph one should place a \verb/$/ sign before and
after the formula, in order to enter and leave mathematics mode.
Thus to obtain a sentence like
\begin{quotation}
Let $f$ be the function defined by $f(x) = 3x + 7$, and
let $a$ be a positive real number.
\end{quotation}
one should type
\begin{quote}
\begin{verbatim}
Let $f$ be the function defined by $f(x) = 3x + 7$, and
let $a$ be a positive real number.
\end{verbatim}
\end{quote}
In particular, note that even mathematical expressions consisting
of a single character, like $f$ and $a$ in the example above,
are placed within \verb/$/ signs. This is to ensure that they are set
in italic type, as is customary in mathematical typesetting.
\LaTeX\ also allows you to use \verb/\(/ and \verb/\)/ to mark
the beginning and the end respectively of a mathematical formula
embedded in text. Thus
\begin{quotation}
Let \( f \) be the function defined by \( f(x) = 3x + 7 \).
\end{quotation}
may be produced by typing
\begin{quote}
\begin{verbatim}
Let \( f \) be the function defined by \( f(x) = 3x + 7 \).
\end{verbatim}
\end{quote}
However this use of \verb/\(/ ... \verb/\)/ is only
permitted in \LaTeX: other dialects of TeX such as
Plain \TeX\ and AmSTeX use \verb/$/ ... \verb/$/.
In order to obtain an mathematical formula or equation which
is displayed on a line by itself, one places \verb/\[/
before and
\verb/\]/ after the formula. Thus to obtain
\begin{quotation}
If $f(x) = 3x + 7$ and $g(x) = x + 4$ then
\[ f(x) + g(x) = 4x + 11 \]
and
\[ f(x)g(x) = 3x^2 + 19x +28. \]
\end{quotation}
one would type
\begin{quote}
\begin{verbatim}
If $f(x) = 3x + 7$ and $g(x) = x + 4$ then
\[ f(x) + g(x) = 4x + 11 \]
and
\[ f(x)g(x) = 3x^2 + 19x +28. \]
\end{verbatim}
\end{quote}
(Here the character \verb/^/ is used to obtain a superscript.)
\LaTeX\ provides facilities for the automatic numbering of
displayed equations. If you want an numbered equation then you
use \verb/\begin{equation}/ and \verb/\end{equation}/ instead
of using \verb/\[/ and \verb/\]/ . Thus
\begin{quote}
\begin{verbatim}
If $f(x) = 3x + 7$ and $g(x) = x + 4$ then
\begin{equation}
f(x) + g(x) = 4x + 11
\end{equation}
and
\begin{equation}
f(x)g(x) = 3x^2 + 19x +28.
\end{equation}
\end{verbatim}
\end{quote}
produces
\begin{quotation}
If $f(x) = 3x + 7$ and $g(x) = x + 4$ then
\begin{equation}
f(x) + g(x) = 4x + 11
\end{equation}
and
\begin{equation}
f(x)g(x) = 3x^2 + 19x +28.
\end{equation}
\end{quotation}
\subsection{Characters in Mathematics Mode}
All the characters on the keyboard have their standard meaning
in mathematics mode, with the exception of the characters
\begin{quote}
\begin{verbatim}
# $ % & ~ _ ^ \ { } '
\end{verbatim}
\end{quote}
Letters are set in italic type. In mathematics mode the character
\verb/'/ has a special meaning: typing \verb/$u' + v''$/
produces
$u' + v''$
When in mathematics mode the spaces you type
between letters and other symbols do not affect the spacing of
the final result, since \LaTeX\ determines the spacing of characters
in formulae by its own internal rules. Thus \verb/$u v + w = x$/
and \verb/$uv+w=x$/ both produce
$u v + w = x$
You can also type carriage returns where necessary in your input file
(e.g., if you are typing in a complicated formula with many
Greek characters and funny symbols) and this will have no effect on
the final result if you are in mathematics mode.
To obtain the characters
\begin{quote}
\begin{verbatim}
# $ % & _ { }
\end{verbatim}
\end{quote}
in mathematics mode, one should type
\begin{quote}
\begin{verbatim}
\# \$ \% \& \_ \{ \} .
\end{verbatim}
\end{quote}
To obtain \ in mathematics mode, one may type
\verb/\backslash/.
\subsection{Superscripts and Subscripts}
Subscripts and superscripts are obtained using the special
characters \verb/_/ and \verb/^/ respectively. Thus the
identity
\[ ds^2 = dx_1^2 + dx_2^2 + dx_3^2 - c^2 dt^2 \]
is obtained by typing
\begin{quote}
\begin{verbatim}
\[ ds^2 = dx_1^2 + dx_2^2 + dx_3^2 - c^2 dt^2 \]
\end{verbatim}
\end{quote}
It can also be obtained by typing
\begin{quote}
\begin{verbatim}
\[ ds^2 = dx^2_1 + dx^2_2 + dx^2_3 - c^2 dt^2 \]
\end{verbatim}
\end{quote}
since, when a superscript is to appear above a subscript, it is
immaterial whether the superscript or subscript is the first to be
specified.
Where more than one character occurs in a superscript or subscript,
the characters involved should be enclosed in curly brackets.
For example, the polynomial
$x^{17} - 1$
is obtained by typing \verb/$x^{17} - 1$/.
One may not type expressions such as \verb/$s^n^j$/ since this is
ambiguous and could be interpreted either as
$s^{n j}$
or as
$s^{n^j}$
The first of these alternatives is
obtained by typing \verb/$s^{n j}$/, the second by typing
\verb/$s^{n^j}$/. A similar remark applies to subscripts.
Note that one can obtain in this way double superscripts (where a
superscript is placed on a superscript) and double subscripts.
It is sometimes necessary to obtain expressions in which the horizontal
ordering of the subscripts is significant. One can use an `empty group'
\verb/{}/ to separate superscripts and subscripts that must follow
one another. For example, the identity
\[ R_i{}^j{}_{kl} = g^{jm} R_{imkl}
= - g^{jm} R_{mikl} = - R^j{}_{ikl} \]
can be obtained by typing
\begin{quote}
\begin{verbatim}
\[ R_i{}^j{}_{kl} = g^{jm} R_{imkl}
= - g^{jm} R_{mikl} = - R^j{}_{ikl} \]
\end{verbatim}
\end{quote}
\subsection{Greek Letters}
Greek letters are produced in mathematics mode by preceding the
name of the letter by a backslash \verb/\/. Thus to
obtain the formula
$A = \pi r^2$
one types \verb/A = \pi r^2/.
Here are the control sequences for the standard forms of the
lowercase Greek letters:-
\begin{quotation}
\mathlexicon{alpha&iota&rho\cr
beta&kappa&sigma\cr
gamma&lambda&tau\cr
delta&mu&upsilon\cr
epsilon&nu&phi\cr
zeta&xi&chi\cr
eta&\omit\qquad \rlap{$o$}\qquad \texttt{o}\hfil&psi\cr
theta&pi&omega\cr}
\end{quotation}
There is no special command for omicron: just use \verb/o/.
Some Greek letters occur in variant forms. The variant forms
are obtained by preceding the name of the Greek letter by `var'.
The following table lists the usual form of these letters and
the variant forms:-
\begin{quotation}
$$\vcenter{\halign{\displayandname{#}\hfil&&\qquad
\displayandname{#}\hfil\cr
epsilon&varepsilon\cr
theta&vartheta\cr
pi&varpi\cr
rho&varrho\cr
sigma&varsigma\cr
phi&varphi\cr}}$$
\end{quotation}
Upper case Greek letters are obtained by making the first character
of the name upper case. Here are the control sequence for the
uppercase letters:---
\begin{quotation}
\mathlexicon{Gamma&Xi&Phi\cr
Delta&Pi&Psi\cr
Theta&Sigma&Omega\cr
Lambda&Upsilon&\omit\hfil\cr}
\end{quotation}
\subsection{Mathematical Symbols}
There are numerous mathematical symbols that can be used in
mathematics mode. These are obtained by typing an appropriate
control sequence.
Miscellaneous Symbols:
\begin{quotation}
\mathlexicon{aleph&prime&forall\cr
hbar&emptyset&exists\cr
imath&nabla&neg\cr
jmath&surd&flat\cr
ell&top&natural\cr
wp&bot&sharp\cr
Re&|&clubsuit\cr
Im&angle&diamondsuit\cr
partial&triangle&heartsuit\cr
infty&backslash&spadesuit\cr}
\end{quotation}
``Large'' Operators:
\begin{quotation}
\mathlexicon{sum&bigcap&bigodot\cr
prod&bigcup&bigotimes\cr
coprod&bigsqcup&bigoplus\cr
int&bigvee&biguplus\cr
oint&bigwedge&\omit\hfil\cr}
\end{quotation}
Binary Operations:
\begin{quotation}
\mathlexicon{pm&cap&vee\cr
mp&cup&wedge\cr
setminus&uplus&oplus\cr
cdot&sqcap&ominus\cr
times&sqcup&otimes\cr
ast&triangleleftø\cr
star&triangleright&odot\cr
diamond&wr&dagger\cr
circ&bigcirc&ddagger\cr
bullet&bigtriangleup&amalg\cr
div&bigtriangledown&\omit\hfil\cr}
\end{quotation}
Relations:
\begin{quotation}
\mathlexicon{leq&geq&equiv\cr
prec&succ&sim\cr
preceq&succeq&simeq\cr
ll&gg&asymp\cr
subset&supset&approx\cr
subseteq&supseteq&cong\cr
sqsubseteq&sqsupseteq&bowtie\cr
in&ni&propto\cr
vdash&dashv&models\cr
smile&mid&doteq\cr
frown¶llel&perp\cr}
\end{quotation}
Negated Relations:
\begin{quotation}
\def\negdisplayandname#1{\rlap{$\displaystyle\not\csname #1\endcsname$}%
\qquad \texttt{\char92 not\char92 #1}}
$$\vcenter{\halign{\negdisplayandname{#}\hfil&&\qquad
\negdisplayandname{#}\hfil\cr
\omit\rlap{$\not<$}\qquad\texttt{\char92 not<}\hfil&\omit
\qquad\rlap{$\not>$}\qquad\texttt{\char92 not>}\hfil&\omit
\qquad\rlap{$\not=$}\qquad\texttt{\char92 not=}\hfil\cr
leq&geq&equiv\cr
prec&succ&sim\cr
preceq&succeq&simeq\cr
subset&supset&approx\cr
subseteq&supseteq&cong\cr
sqsubseteq&sqsupseteq&asymp\cr}}$$
\end{quotation}
Arrows:
\begin{quotation}
\mathlexicon{%
leftarrow&rightarrow\cr
longleftarrow&longrightarrow\cr
Leftarrow&Rightarrow\cr
Longleftarrow&Longrightarrow\cr
leftrightarrow&Leftrightarrow\cr
longleftrightarrow&Longleftrightarrow\cr
hookleftarrow&hookrightarrow\cr
leftharpoonup&rightharpoonup\cr
leftharpoondown&rightharpoondown\cr
uparrow&downarrow\cr
Uparrow&Downarrow\cr
updownarrow&Updownarrow\cr
nearrow&nwarrow\cr
searrow&swarrow\cr
mapsto&longmapsto\cr
rightleftharpoons&\omit\hfil\cr}
\end{quotation}
Openings:
\begin{quotation}
\mathlexicon{lbrack&lfloor&lceil\cr
lbrace&langle&\omit\hfil\cr}
\end{quotation}
Closings:
\begin{quotation}
\mathlexicon{rbrack&rfloor&rceil\cr
rbrace&rangle&\omit\hfil\cr}
\end{quotation}
Alternative Names:
\begin{quotation}
\def\widedisplayandname#1{\rlap{$\displaystyle\csname #1\endcsname$}%
\qquad\qquad \texttt{\char92 #1}}
$$\vcenter{\halign{\widedisplayandname{#}\hfil&\qquad
(same as \texttt{\char92 #})\hfil\cr
\omit\rlap{$\not=$}\qquad\qquad
\texttt{\char92 ne} or \texttt{\char92 neq}\hfil¬=\cr
le&leq\cr
ge&geq\cr
\omit\rlap{$\{$}\qquad\qquad\texttt{\char92 \char123}\hfil&lbrace\cr
\omit\rlap{$\}$}\qquad\qquad\texttt{\char92 \char125}\hfil&lbrace\cr
to&rightarrow\cr
gets&leftarrow\cr
owns&ni\cr
land&wedge\cr
lor&vee\cr
lnot&neg\cr
vert&\omit\qquad (same as \texttt{|})\hfil\cr
Vert&\omit\qquad (same as \texttt{\char92 |})\hfil\cr
iff&\omit\qquad (same as \texttt{\char92 Longleftrightarrow}, but with\hfil\cr
\omit\hfil&\omit\qquad\ extra space at each end)\hfil\cr
colon&\omit\qquad (same as \texttt{:}, but with less space around it and\hfil\cr
\omit\hfil&\omit
\qquad\ less likelihood of a line break after it)\hfil\cr}}$$
\end{quotation}
\subsection{Changing Fonts in Mathematics Mode}
\emph{(The following applies to \LaTeX2$\epsilon$, a
recent version of \LaTeX. It does not apply to older
versions of \LaTeX.)}
The `math italic' font is automatically
used in mathematics mode unless you explicitly change the font.
The rules for changing the font in mathematics mode are rather different
to those applying when typesetting ordinary text.
In mathematics mode any change only applies to the single character
or symbol that follows (or to any text enclosed within curly brackets
immediately following the control sequence). Also, to change
a character to the roman or boldface font, the control sequences
\verb/\mathrm/ and \verb/\mathbf/ must be used
(rather than \verb/\textrm/ and \verb/\textbf/).
The following example illustrates the use of boldface in mathematical
formulae. To obtain
\begin{quotation}
Let $\mathbf{u}$,$\mathbf{v}$ and $\mathbf{w}$ be three
vectors in ${\mathbf R}^3$. The volume~$V$ of the
parallelepiped with corners at the points
$\mathbf{0}$, $\mathbf{u}$, $\mathbf{v}$,
$\mathbf{w}$, $\mathbf{u}+\mathbf{v}$,
$\mathbf{u}+\mathbf{w}$, $\mathbf{v}+\mathbf{w}$
and $\mathbf{u}+\mathbf{v}+\mathbf{w}$
is given by the formula
\[ V = (\mathbf{u} \times \mathbf{v}) \cdot \mathbf{w}.\]
\end{quotation}
one could type
\begin{quote}
\begin{verbatim}
Let $\mathbf{u}$,$\mathbf{v}$ and $\mathbf{w}$ be three
vectors in ${\mathbf R}^3$. The volume~$V$ of the
parallelepiped with corners at the points
$\mathbf{0}$, $\mathbf{u}$, $\mathbf{v}$,
$\mathbf{w}$, $\mathbf{u}+\mathbf{v}$,
$\mathbf{u}+\mathbf{w}$, $\mathbf{v}+\mathbf{w}$
and $\mathbf{u}+\mathbf{v}+\mathbf{w}$
is given by the formula
\[ V = (\mathbf{u} \times \mathbf{v}) \cdot \mathbf{w}.\]
\end{verbatim}
\end{quote}
There is also a `calligraphic' font available in mathematics mode.
This is obtained using the control sequence \verb/\cal/.
\emph{This font can only be used for uppercase letters.}
These calligraphic letters have the form
\[ \cal{A}\cal{B}\cal{C}\cal{D}\cal{E}\cal{F}\cal{G}\cal{H}\cal{I}
\cal{J}\cal{K}\cal{L}\cal{M}\cal{N}\cal{O}\cal{P}\cal{Q}\cal{R}
\cal{S}\cal{T}\cal{U}\cal{V}\cal{W}\cal{X}\cal{Y}\cal{Z}. \]
\subsection{Standard Functions (sin, cos etc.)}
The names of certain standard functions and abbreviations are
obtained by typing a backlash \verb/\/ before the name.
For example, one obtains
\[ \cos(\theta + \phi) = \cos \theta \cos \phi
- \sin \theta \sin \phi \]
by typing
\begin{quote}
\begin{verbatim}
\[ \cos(\theta + \phi) = \cos \theta \cos \phi
- \sin \theta \sin \phi \]
\end{verbatim}
\end{quote}
The following standard functions are represented by control sequences
defined in \LaTeX:
\[
\vcenter{\halign{$\backslash$\texttt{#}&&\quad
$\backslash$\texttt{#}\cr
arccos&cos&csc&exp&ker&limsup&min&sinh\cr
arcsin&cosh°&gcd&lg&ln&Pr&sup\cr
arctan&cot&det&hom&lim&log&sec&tan\cr
arg&coth&dim&inf&liminf&max&sin&tanh\cr}} \]
Names of functions and other abbreviations not in this list can be
obtained by converting to the roman font. Thus one obtains
$\mathrm{cosec} A$
by typing \verb/$\mathrm{cosec} A$/.
Note that if one were to type simply \verb/$cosec A$/ one
would obtain
$cosec A$,
because \LaTeX\ has treated
\verb/cosec A/ as the product of six quantities
$c$, $o$, $s$, $e$, $c$ and $A$
and typeset the formula accordingly.
\subsection{Text Embedded in Displayed Equations}
Text can be embedded in displayed equations (in \LaTeX) by using
\verb/\mbox{/\emph{embedded text}\verb/}/. For example,
one obtains
\[ M^\bot = \{ f \in V' : f(m) = 0 \mbox{ for all } m \in M \}. \]
by typing
\begin{quote}
\begin{verbatim}
\[ M^\bot = \{ f \in V' : f(m) = 0 \mbox{ for all } m \in M \}.\]
\end{verbatim}
\end{quote}
Note the blank spaces before and after the words `for all' in the above
example. Had we typed
\begin{quote}
\begin{verbatim}
\[ M^\bot = \{ f \in V' : f(m) = 0 \mbox{for all} m \in M \}.\]
\end{verbatim}
\end{quote}
we would have obtained
\[ M^\bot = \{ f \in V' : f(m) = 0 \mbox{for all} m \in M \}. \]
(In Plain \TeX\ one should use \verb/\hbox/ in place of
\verb/\mbox/.)
\subsection{Fractions and Roots}
Fractions of the form
\[ \frac{\mbox{\textit{numerator}}}{\mbox{\textit{denominator}}} \]
are obtained in \LaTeX\ using the construction
\begin{quote}
\verb/\frac{/\emph{numerator}\verb/}{/\emph{denominator}\verb/}/.
\end{quote}
For example, to obtain
\begin{quotation}
The function $f$ is given by
\[ f(x) = 2x + \frac{x - 7}{x^2 + 4}\]
for all real numbers $x$.
\end{quotation}
one would type
\begin{quote}
\begin{verbatim}
The function $f$ is given by
\[ f(x) = 2x + \frac{x - 7}{x^2 + 4}\]
for all real numbers $x$.
\end{verbatim}
\end{quote}
To obtain square roots one uses the control sequence
\begin{quote}
\verb/\sqrt{/\emph{expression}\verb/}/.
\end{quote}
For example, to obtain
\begin{quotation}
The roots of a quadratic polynomial $a x^2 + bx + c$ with
$a \neq 0$ are given by the formula
\[ \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]
\end{quotation}
one would type
\begin{quote}
\begin{verbatim}
The roots of a quadratic polynomial $a x^2 + bx + c$ with
$a \neq 0$ are given by the formula
\[ \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]
\end{verbatim}
\end{quote}
In \LaTeX, an
$n$th root is produced using
\begin{quote}
\verb/\sqrt[n]{/\emph{expression}\verb/}/.
\end{quote}
For example, to obtain
\begin{quotation}
The roots of a cubic polynomial of the form $x^3 - 3px - 2q$
are given by the formula
\[ \sqrt[3]{q + \sqrt{ q^2 - p^3 }}
+ \sqrt[3]{q - \sqrt{ q^2 - p^3 }} \]
where the values of the two cube roots must are chosen
so as to ensure that their product is equal to $p$.
\end{quotation}
in \LaTeX, one would type
\begin{quote}
\begin{verbatim}
The roots of a cubic polynomial of the form $x^3 - 3px - 2q$
are given by the formula
\[ \sqrt[3]{q + \sqrt{ q^2 - p^3 }}
+ \sqrt[3]{q - \sqrt{ q^2 - p^3 }} \]
where the values of the two cube roots must are chosen
so as to ensure that their product is equal to $p$.
\end{verbatim}
\end{quote}
\subsection{Ellipsis (i.e., `three dots')}
Ellipsis (three dots) is produced in mathematics mode using
the control sequences \verb/\ldots/ (for dots aligned
with tbe baseline of text), and \verb/\cdots/ (for dots
aligned with the centreline of mathematical formulae). Thus
the formula
\[ f(x_1, x_2,\ldots, x_n) = x_1^2 + x_2^2 + \cdots + x_n^2 \]
is obtained by typing
\begin{quote}
\begin{verbatim}
\[ f(x_1, x_2,\ldots, x_n) = x_1^2 + x_2^2 + \cdots + x_n^2 \]
\end{verbatim}
\end{quote}
Similarly the formula
\[ \frac{1 - x^{n+1}}{1 - x} = 1 + x + x^2 + \cdots + x^n \]
is produced using \verb/\cdots/, by typing
\begin{quote}
\begin{verbatim}
\[ \frac{1 - x^{n+1}}{1 - x} = 1 + x + x^2 + \cdots + x^n \]
\end{verbatim}
\end{quote}
\subsection{Accents in Mathematics Mode}
There are various control sequences for producing underlining,
overlining and various accents in mathematics mode. The
following table lists these control sequences, applying them
to the letter~$a$:
\begin{quotation}
\def\exhibitaccent#1#2{\rlap{$\csname #1\endcsname{#2}$}%
\qquad \texttt{\char92 #1\char123 #2\char125}}
$$\vcenter{\halign{#\hfil\cr
\exhibitaccent{underline}{a}\cr
\exhibitaccent{overline}{a}\cr
\exhibitaccent{hat}{a}\cr
\exhibitaccent{check}{a}\cr
\exhibitaccent{tilde}{a}\cr
\exhibitaccent{acute}{a}\cr
\exhibitaccent{grave}{a}\cr
\exhibitaccent{dot}{a}\cr
\exhibitaccent{ddot}{a}\cr
\exhibitaccent{breve}{a}\cr
\exhibitaccent{bar}{a}\cr
\exhibitaccent{vec}{a}\cr
}}$$
\end{quotation}
It should be borne in mind that when a character is underlined in
a mathematical manuscript then it is normally typeset in
bold face without any underlining. Underlining is used very
rarely in print.
The control sequences such as \verb/\'/ and \verb/\"/, used
to produce accents in ordinary text, may not be used in
mathematics mode.
\subsection{Brackets and Norms}
The frequently used left delimiters include (, [ and \{,
which are obtained by typing \verb/(/, \verb/[/ and
\verb/\{/
respectively. The corresponding right delimiters are of course
obtained by typing \verb/)/,
\verb/]/ and \verb/\}/. In addition
$|$
and
$\|$
are used as both left and right delimiters, and are obtained by typing
\verb/|/ and \verb/\|/ respectively. For example, we obtain
\begin{quotation}
Let $X$ be a Banach space and let $f \colon B \to \textbf{R}$
be a bounded linear functional on $X$. The \textit{norm} of
$f$, denoted by $\|f\|$, is defined by
\[ \|f\| = \inf \{ K \in [0,+\infty) :
|f(x)| \leq K \|x\| \mbox{ for all } x \in X \}.\]
\end{quotation}
by typing
\begin{quote}
\begin{verbatim}
Let $X$ be a Banach space and let $f \colon B \to \textbf{R}$
be a bounded linear functional on $X$. The \textit{norm} of
$f$, denoted by $\|f\|$, is defined by
\[ \|f\| = \inf \{ K \in [0,+\infty) :
|f(x)| \leq K \|x\| \mbox{ for all } x \in X \}.\]
\end{verbatim}
\end{quote}
Larger delimiters are sometimes required which have the
appropriate height to match the size of the subformula which
they enclose. Consider, for instance, the problem of typesetting
the following formula:
\[ f(x,y,z) = 3y^2 z \left( 3 + \frac{7x+5}{1 + y^2} \right). \]
The way to type the large parentheses is to type \verb/\left(/
for the left parenthesis and \verb/\right)/ for the right
parenthesis, and let \LaTeX\ do the rest of the work for you.
Thus the above formula was obtained by typing
\begin{quote}
\begin{verbatim}
\[ f(x,y,z) = 3y^2 z \left( 3 + \frac{7x+5}{1 + y^2} \right).\]
\end{verbatim}
\end{quote}
If you type a delimiter which is preceded by \verb/\left/ then
\LaTeX\ will search for a corresponding delimiter preceded by
\verb/\right/ and calculate the size of the delimiters required
to enclose the intervening subformula. One is allowed to balance
a \verb/\left(/ with a \verb/\right]/ (say) if one desires: there
is no reason why the enclosing delimiters have to have the same
shape. One may also nest pairs of delimiters within one another:
by typing
\begin{quote}
\begin{verbatim}
\[ \left| 4 x^3 + \left( x + \frac{42}{1+x^4} \right) \right|.\]
\end{verbatim}
\end{quote}
we obtain
\[ \left| 4 x^3 + \left( x + \frac{42}{1+x^4} \right) \right|. \]
By typing \verb/\left./ and \verb/\right./ one obtains
\emph{null delimiters} which are completely invisible. Consider,
for example, the problem of typesetting
\[ \left. \frac{du}{dx} \right|_{x=0}.\]
We wish to make the vertical bar big enough to match the
derivative preceding it. To do this, we suppose that the
derivative is enclosed by delimiters, where the left delimiter
is invisible and the right delimiter is the vertical line.
The invisible delimiter is produced using \verb/\left./ and thus
the whole formula is produced by typing
\[ \left. \frac{du}{dx} \right|_{x=0}.\]
\subsection{Multiline Formulae in \LaTeX}
Consider the problem of typesetting the formula
\begin{quotation}
\begin{eqnarray*}
\cos 2\theta & = & \cos^2 \theta - \sin^2 \theta \\
& = & 2 \cos^2 \theta - 1.
\end{eqnarray*}
\end{quotation}
It is necessary to ensure that the = signs are aligned with one
another. In \LaTeX, such a formula is typeset using the
\verb/eqnarray*/ environment. The above example was obtained by
typing the lines
\begin{quote}
\begin{verbatim}
\begin{eqnarray*}
\cos 2\theta & = & \cos^2 \theta - \sin^2 \theta \\
& = & 2 \cos^2 \theta - 1.
\end{eqnarray*}
\end{verbatim}
\end{quote}
Note the use of the special character \verb/&/ as an
\emph{alignment tab}. When the formula is typeset, the part of
the second line of the formula beginning with an occurrence of
\verb/&/ will be placed immediately beneath that part of
the first line of the formula which begins with the corresponding
occurrence of \verb/&/. Also \verb/\\/ is used to
separate the lines of the formula.
Although we have placed corresponding occurrences of \verb/&/
beneath one another in the above example, it is not necessary to
do this in the input file. It was done in the above example merely
to improve the appearance (and readability) of the input file.
The more complicated example
\begin{quotation}
If $h \leq \frac{1}{2} |\zeta - z|$ then
\[ |\zeta - z - h| \geq \frac{1}{2} |\zeta - z|\]
and hence
\begin{eqnarray*}
\left| \frac{1}{\zeta - z - h} - \frac{1}{\zeta - z} \right|
& = & \left|
\frac{(\zeta - z) - (\zeta - z - h)}{(\zeta - z - h)(\zeta - z)}
\right| \\ & = &
\left| \frac{h}{(\zeta - z - h)(\zeta - z)} \right| \\
& \leq & \frac{2 |h|}{|\zeta - z|^2}.
\end{eqnarray*}
\end{quotation}
was obtained by typing
\begin{quote}
\begin{verbatim}
If $h \leq \frac{1}{2} |\zeta - z|$ then
\[ |\zeta - z - h| \geq \frac{1}{2} |\zeta - z|\]
and hence
\begin{eqnarray*}
\left| \frac{1}{\zeta - z - h} - \frac{1}{\zeta - z} \right|
& = & \left|
\frac{(\zeta - z) - (\zeta - z - h)}{(\zeta - z - h)(\zeta - z)}
\right| \\ & = &
\left| \frac{h}{(\zeta - z - h)(\zeta - z)} \right| \\
& \leq & \frac{2 |h|}{|\zeta - z|^2}.
\end{eqnarray*}
\end{verbatim}
\end{quote}
The asterisk in \verb/eqnarray*/ is put there to suppress the
automatic equation numbering produced by \LaTeX. If you wish for
an automatically numbered multiline formula, you should use
\verb/\begin{eqnarray}/ and \verb/\end{eqnarray}/.
\subsection{Matrices and other arrays in \LaTeX}
Matrices and other arrays are produced in \LaTeX\ using the
\textbf{array} environment. For example, suppose that we wish to
typeset the following passage:
\begin{quotation}
The \emph{characteristic polynomial} $\chi(\lambda)$ of the
$3 \times 3$~matrix
\[ \left( \begin{array}{ccc}
a & b & c \\
d & e & f \\
g & h & i \end{array} \right)\]
is given by the formula
\[ \chi(\lambda) = \left| \begin{array}{ccc}
\lambda - a & -b & -c \\
-d & \lambda - e & -f \\
-g & -h & \lambda - i \end{array} \right|.\]
\end{quotation}
This passage is produced by the following input:
\begin{quote}
\begin{verbatim}
The \emph{characteristic polynomial} $\chi(\lambda)$ of the
$3 \times 3$~matrix
\[ \left( \begin{array}{ccc}
a & b & c \\
d & e & f \\
g & h & i \end{array} \right)\]
is given by the formula
\[ \chi(\lambda) = \left| \begin{array}{ccc}
\lambda - a & -b & -c \\
-d & \lambda - e & -f \\
-g & -h & \lambda - i \end{array} \right|.\]
\end{verbatim}
\end{quote}
First of all, note the use of \verb/\left/ and \verb/\right/
to produce the large delimiters around the arrays. As we have
already seen, if we use
\begin{quote}
\verb/\left)/ ... \verb/\right)/
\end{quote}
then the size of the parentheses is chosen to match the subformula
that they enclose. Next note the use of the alignment tab
character \verb/&/ to separate the entries of the matrix and
the use of \verb/\\/ to separate the rows of the matrix, exactly
as in the construction of multiline formulae described above.
We begin the array with \verb/\begin{array}/ and end it with
\verb/\end{array}/. The only thing left to explain, therefore,
is the mysterious \verb/{ccc}/ which occurs immediately after
\verb/\begin{array}/.
Now each of the \verb/c/'s in \verb/{ccc}/ represents a
column of the matrix and indicates that the entries of the
column should be \emph{centred}. If the \verb/c/ were replaced by
\verb/l/ then the corresponding column would be typeset with
all the entries flush \emph{left}, and \verb/r/ would produce a
column with all entries flush \emph{right}. Thus
\begin{quote}
\begin{verbatim}
\[ \begin{array}{lcr}
\mbox{First number} & x & 8 \\
\mbox{Second number} & y & 15 \\
\mbox{Sum} & x + y & 23 \\
\mbox{Difference} & x - y & -7 \\
\mbox{Product} & xy & 120 \end{array}\]
\end{verbatim}
\end{quote}
produces
\[ \begin{array}{lcr}
\mbox{First number} & x & 8 \\
\mbox{Second number} & y & 15 \\
\mbox{Sum} & x + y & 23 \\
\mbox{Difference} & x - y & -7 \\
\mbox{Product} & xy & 120 \end{array}\]
We can use the array environment to produce formulae such as
\[ |x| = \left\{ \begin{array}{ll}
x & \mbox{if $x \geq 0$};\\
-x & \mbox{if $x < 0$}.\end{array} \right. \]
Note that both columns of this array are set flush left. Thus we
use \verb/{ll}/ immediately after \verb/\begin{array}/. The large
curly bracket is produced using \verb/\left\{/. However this
requires a corresponding \verb/\right/ delimiter to match it.
We therefore use the \emph{null delimiter} \verb/\right./
discussed earlier. This delimiter is invisible. We can
therefore obtain the above formula by typing
\begin{quote}
\begin{verbatim}
\[ |x| = \left\{ \begin{array}{ll}
x & \mbox{if $x \geq 0$};\\
-x & \mbox{if $x < 0$}.\end{array} \right. \]
\end{verbatim}
\end{quote}
\subsection{Derivatives, Limits, Sums and Integrals}
The expressions
\[ \frac{du}{dt} \mbox{ and } \frac{d^2 u}{dx^2} \]
are obtained in \LaTeX\ by typing \verb/\frac{du}{dt}/
and \verb/\frac{d^2 u}{dx^2}/ respectively. The mathematical
symbol
$\partial$
is produced using \verb/\partial/. Thus the Heat Equation
\[\frac{\partial u}{\partial t}
= \frac{\partial^2 u}{\partial x^2}
+ \frac{\partial^2 u}{\partial y^2}
+ \frac{\partial^2 u}{\partial z^2} \]
is obtained in \LaTeX\ by typing
\begin{quote}
\begin{verbatim}
\[\frac{\partial u}{\partial t}
= \frac{\partial^2 u}{\partial x^2}
+ \frac{\partial^2 u}{\partial y^2}
+ \frac{\partial^2 u}{\partial z^2} \]
\end{verbatim}
\end{quote}
To obtain mathematical expressions such as
\[ \lim_{x \to +\infty} \mbox{, } \inf_{x > s} \mbox{ and } \sup_K \]
in displayed equations we type \verb/\lim_{x \to +\infty}/,
\verb/\inf_{x > s}/ and \verb/\sup_K/ respectively. Thus to obtain
\[ \lim_{x \to 0} \frac{3x^2 +7}{x^2 +1} = 3. \]
(in \LaTeX) we type
\begin{quote}
\begin{verbatim}
\[ \lim_{x \to 0} \frac{3x^2 +7x^3}{x^2 +5x^4} = 3.\]
\end{verbatim}
\end{quote}
To obtain a summation sign such as
\[ \sum_{i=1}^{2n} \]
we type \verb/sum_{i=1}^{2n}/. Thus
\[ \sum_{k=1}^n k^2 = \frac{1}{2} n (n+1). \]
is obtained by typing
\begin{quote}
\begin{verbatim}
\[ \sum_{k=1}^n k^2 = \frac{1}{2} n (n+1).\]
\end{verbatim}
\end{quote}
We now discuss how to obtain \emph{integrals} in mathematical
documents. A typical integral is the following:
\[ \int_a^b f(x)\,dx. \]
This is typeset using
\begin{quote}
\begin{verbatim}
\[ \int_a^b f(x)\,dx.\]
\end{verbatim}
\end{quote}
The integral sign
$\int$
is typeset using the control sequence
\verb/\int/, and the \emph{limits of integration}
(in this case $a$ and $b$ are treated as a
subscript and a superscript on the integral sign.
Most integrals occurring in mathematical documents begin with
an integral sign and contain one or more instances of~$d$
followed by another (Latin or Greek) letter, as in
$dx$, $dy$ and $dt$.
To obtain the correct appearance one should put
extra space before the~$d$,
using \verb/\,/. Thus
\[ \int_0^{+\infty} x^n e^{-x} \,dx = n!. \]
\[ \int \cos \theta \,d\theta = \sin \theta. \]
\[ \int_{x^2 + y^2 \leq R^2} f(x,y)\,dx\,dy
= \int_{\theta=0}^{2\pi} \int_{r=0}^R
f(r\cos\theta,r\sin\theta) r\,dr\,d\theta. \]
and
\[ \int_0^R \frac{2x\,dx}{1+x^2} = \log(1+R^2). \]
are obtained by typing
\begin{quote}
\begin{verbatim}
\[ \int_0^{+\infty} x^n e^{-x} \,dx = n!.\]
\end{verbatim}
\end{quote}
\begin{quote}
\begin{verbatim}
\[ \int \cos \theta \,d\theta = \sin \theta.\]
\end{verbatim}
\end{quote}
\begin{quote}
\begin{verbatim}
\[ \int_{x^2 + y^2 \leq R^2} f(x,y)\,dx\,dy
= \int_{\theta=0}^{2\pi} \int_{r=0}^R
f(r\cos\theta,r\sin\theta) r\,dr\,d\theta.\]
\end{verbatim}
\end{quote}
and
\begin{quote}
\begin{verbatim}
\[ \int_0^R \frac{2x\,dx}{1+x^2} = \log(1+R^2).\]
\end{verbatim}
\end{quote}
respectively.
In some multiple integrals (i.e., integrals containing more than
one integral sign) one finds that \LaTeX\ puts too much space
between the integral signs. The way to improve the appearance of
of the integral is to use the control sequence \verb/\!/ to
remove a thin strip of unwanted space. Thus, for example, the
multiple integral
\[ \int_0^1 \! \int_0^1 x^2 y^2\,dx\,dy. \]
is obtained by typing
\begin{quote}
\begin{verbatim}
\[ \int_0^1 \! \int_0^1 x^2 y^2\,dx\,dy.\]
\end{verbatim}
\end{quote}
Had we typed
\begin{quote}
\begin{verbatim}
\[ \int_0^1 \int_0^1 x^2 y^2\,dx\,dy.\]
\end{verbatim}
\end{quote}
we would have obtained
\[ \int_0^1 \int_0^1 x^2 y^2\,dx\,dy. \]
A particularly noteworthy example comes when we are
typesetting a multiple integral such as
\[ \int \!\!\! \int_D f(x,y)\,dx\,dy. \]
Here we use \verb/\!/ three times to obtain suitable spacing
between the integral signs. We typeset this integral using
\begin{quote}
\begin{verbatim}
\[ \int \!\!\! \int_D f(x,y)\,dx\,dy.\]
\end{verbatim}
\end{quote}
Had we typed
\begin{quote}
\begin{verbatim}
\[ \int \int_D f(x,y)\,dx\,dy.\]
\end{verbatim}
\end{quote}
we would have obtained
\[ \int \int_D f(x,y)\,dx\,dy. \]
The following (reasonably complicated) passage exhibits a
number of the features which we have been discussing:
\begin{quotation}
In non-relativistic wave mechanics, the wave function
$\psi(\mathbf{r},t)$ of a particle satisfies the
\textit{Schr\"{o}dinger Wave Equation}
\[ i\hbar\frac{\partial \psi}{\partial t}
= \frac{-\hbar^2}{2m} \left(
\frac{\partial^2}{\partial x^2}
+ \frac{\partial^2}{\partial y^2}
+ \frac{\partial^2}{\partial z^2}
\right) \psi + V \psi.\]
It is customary to normalize the wave equation by
demanding that
\[ \int \!\!\! \int \!\!\! \int_{\textbf{R}^3}
\left| \psi(\mathbf{r},0) \right|^2\,dx\,dy\,dz = 1.\]
A simple calculation using the Schr\"{o}dinger wave
equation shows that
\[ \frac{d}{dt} \int \!\!\! \int \!\!\! \int_{\textbf{R}^3}
\left| \psi(\mathbf{r},t) \right|^2\,dx\,dy\,dz = 0,\]
and hence
\[ \int \!\!\! \int \!\!\! \int_{\textbf{R}^3}
\left| \psi(\mathbf{r},t) \right|^2\,dx\,dy\,dz = 1\]
for all times~$t$. If we normalize the wave function in this
way then, for any (measurable) subset~$V$ of $\textbf{R}^3$
and time~$t$,
\[ \int \!\!\! \int \!\!\! \int_V
\left| \psi(\mathbf{r},t) \right|^2\,dx\,dy\,dz\]
represents the probability that the particle is to be found
within the region~$V$ at time~$t$.
\end{quotation}
One would typeset this in \LaTeX\ by typing
\begin{quote}
\begin{verbatim}
In non-relativistic wave mechanics, the wave function
$\psi(\mathbf{r},t)$ of a particle satisfies the
\textit{Schr\"{o}dinger Wave Equation}
\[ i\hbar\frac{\partial \psi}{\partial t}
= \frac{-\hbar^2}{2m} \left(
\frac{\partial^2}{\partial x^2}
+ \frac{\partial^2}{\partial y^2}
+ \frac{\partial^2}{\partial z^2}
\right) \psi + V \psi.\]
It is customary to normalize the wave equation by
demanding that
\[ \int \!\!\! \int \!\!\! \int_{\textbf{R}^3}
\left| \psi(\mathbf{r},0) \right|^2\,dx\,dy\,dz = 1.\]
A simple calculation using the Schr\"{o}dinger wave
equation shows that
\[ \frac{d}{dt} \int \!\!\! \int \!\!\! \int_{\textbf{R}^3}
\left| \psi(\mathbf{r},t) \right|^2\,dx\,dy\,dz = 0,\]
and hence
\[ \int \!\!\! \int \!\!\! \int_{\textbf{R}^3}
\left| \psi(\mathbf{r},t) \right|^2\,dx\,dy\,dz = 1\]
for all times~$t$. If we normalize the wave function in this
way then, for any (measurable) subset~$V$ of $\textbf{R}^3$
and time~$t$,
\[ \int \!\!\! \int \!\!\! \int_V
\left| \psi(\mathbf{r},t) \right|^2\,dx\,dy\,dz\]
represents the probability that the particle is to be found
within the region~$V$ at time~$t$.
\end{verbatim}
\end{quote}
\section{Further Features of \LaTeX}
\subsection{Producing White Space in \LaTeX}
To produce (horizontal) blank space within a paragraph, use
\verb/\hspace/, followed by the length
of the blank space enclosed within curly brackets. The length
of the skip should be expressed in a unit recognized by \LaTeX.
These recognized units are given in the following table:
\begin{quote}
\begin{tabular}{lll}
\texttt{pt} & point & (1 in = 72.27 pt) \\
\texttt{pc} & pica & (1 pc = 12 pt) \\
\texttt{in} & inch & (1 in = 25.4 mm) \\
\texttt{bp} & big point & (1 in = 72 bp) \\
\texttt{cm} & centimetre & (1 cm = 10 mm) \\
\texttt{mm} & millimetre & \\
\texttt{dd} & didot point & (1157 dd = 1238 pt) \\
\texttt{cc} & cicero & (1 cc = 12 dd) \\
\texttt{sp} & scaled point & (65536 sp = 1 pt) \\
\end{tabular}
\end{quote}
Thus to produce a horizontal blank space of 20 mm in the middle
of a paragraph one would type \verb/\hspace{20 mm}/.
If \LaTeX\ decides to break between lines at a point in the document
where an \verb/\hspace/ is specified, then no white
space is produced. To ensure that white space is produced
even at points in the document where line breaking takes place, one
should replace \verb/\hspace/ by \verb/\hspace*/
To produce (vertical) blank space between paragraphs, use
\verb/\vspace/, followed by the length of the blank space
enclosed within curly brackets. Thus to obtain
\begin{quotation}
This is the first paragraph of some text. It is
separated from the second paragraph by a vertical skip of
10 millimetres.
\vspace{10 mm}
This is the second paragraph.
\end{quotation}
one should type
\begin{quote}
\begin{verbatim}
This is the first paragraph of some text. It is
separated from the second paragraph by a vertical skip of
10 millimetres.
\vspace{10 mm}
This is the second paragraph.
\end{verbatim}
\end{quote}
If \LaTeX\ decides to introduce at a point in the document
where a \verb/\vspace/ is specified, then no white
space is produced. To ensure that white space is produced
even at points in the document where page breaking takes place, one
should replace \verb/\vspace/ by \verb/\vspace*/
We now describe certain features of \LaTeX\ relating to blank spaces
and paragraph indentation which will improve the appearance
of the final document. Experienced users of \LaTeX\ will improve
the appearance of their documents if they bear these remarks in mind.
First note that, as a general rule, you should never put
a blank space after a left parenthesis or before a right
parenthesis. If you were to put a blank space in these
places, then you run the risk that \LaTeX\ might start a
new line immediately after the left parenthesis or before
the right parenthesis, leaving the parenthesis marooned at
the beginning or end of a line.
\LaTeX\ has its own rules for deciding the lengths of blank
spaces. For instance, \LaTeX\ will put an extra amount of space
after a full stop if it considers that the full stop marks the
end of a sentence.
The rule adopted by \LaTeX\ is to regard a period (full stop) as
the end of a sentence if it is preceded by a lowercase letter.
If the period is preceded by an uppercase letter then
\LaTeX\ assumes that it is not a full stop but follows the
initials of somebody's name.
This works very well in most cases. However
\LaTeX\ occasionally gets things wrong. This happens with
a number of common abbreviations (as in `Mr.\ Smith' or
in `etc.'), and, in particular, in the names of
journals given in abbreviated form (e.g.,
`Proc.\ Amer.\ Math.\ Soc.'). The way to overcome this
problem is to put a backslash before the blank space in
question. Thus we should type
\begin{quote}
\begin{verbatim}
Mr.\ Smith
etc.\ and
Proc.\ Amer.\ Math.\ Soc.
\end{verbatim}
\end{quote}
\LaTeX\ determines itself how to break up a paragraph into
lines, and will occasionally hyphenate long words where this
is desirable. However it is sometimes necessary to tell
\LaTeX\ not to break at a particular blank space. The special
character used for this purpose is \verb/~/. It represents
a blank space at which \LaTeX\ is not allowed to break between
lines. It is often desirable to use \verb/~/ in names where
the forenames are represented by initials. Thus to obtain
`W. R. Hamilton' it is best to type \verb/W.~R.~Hamilton/.
It is also desirable in phrases like `Example 7' and
`the length~$l$ of the rod', obtained by typing
\verb/Example~7/ and \verb/the length~$l$ of the rod./
\LaTeX\ will automatically indent paragraphs (with the
exception of the first paragraph of a new section). One
can prevent \LaTeX\ from indenting a paragraph though by
beginning the paragraph with the control sequence
\verb/\noindent/. Thus one obtains
\begin{quotation}
\noindent
This is the beginning of a paragraph which is not
indented in the usual way. This has been achieved
by placing an appropriate control sequence at the
beginning of the paragraph.
\end{quotation}
by typing
\begin{quote}
\begin{verbatim}
\noindent
This is the beginning of a paragraph which is not
indented in the usual way. This has been achieved
by placing an appropriate control sequence at the
beginning of the paragraph.
\end{verbatim}
\end{quote}
Conversely, the control sequence \verb/\indent/ forces
\LaTeX\ to indent the paragraph.
\subsection{Lists}
\LaTeX\ provides the following list environments:
\begin{itemize}
\item \verb/enumerate/ for numbered lists,
\item \verb/itemize/ for un-numbered lists,
\item \verb/description/ for description lists
\end{itemize}
Numbered lists are produced using
\begin{quote}
\begin{verbatim}
\begin{enumerate} ... \end{enumerate}
\end{verbatim}
\end{quote}
The items in the list should be enclosed between
\begin{quote}
\verb/\begin{enumerate}/ and \verb/\end{enumerate}/
\end{quote}
and should each be preceded by the control sequence \verb/\item/
(which will automatically generate the number labelling the item).
For example, the text
\begin{quotation}
A \emph{metric space} $(X,d)$ consists of a set~$X$ on
which is defined a \emph{distance function} which assigns
to each pair of points of $X$ a distance between them,
and which satisfies the following four axioms:
\begin{enumerate}
\item
$d(x,y) \geq 0$ for all points $x$ and $y$ of $X$;
\item
$d(x,y) = d(y,x)$ for all points $x$ and $y$ of $X$;
\item
$d(x,z) \leq d(x,y) + d(y,z)$ for all points $x$, $y$
and $z$ of $X$;
\item
$d(x,y) = 0$ if and only if the points $x$ and $y$
coincide.
\end{enumerate}
\end{quotation}
is generated by \LaTeX\ from the following input:
\begin{quote}
\begin{verbatim}
A \emph{metric space} $(X,d)$ consists of a set~$X$ on
which is defined a \emph{distance function} which assigns
to each pair of points of $X$ a distance between them,
and which satisfies the following four axioms:
\begin{enumerate}
\item
$d(x,y) \geq 0$ for all points $x$ and $y$ of $X$;
\item
$d(x,y) = d(y,x)$ for all points $x$ and $y$ of $X$;
\item
$d(x,z) \leq d(x,y) + d(y,z)$ for all points $x$, $y$
and $z$ of $X$;
\item
$d(x,y) = 0$ if and only if the points $x$ and $y$
coincide.
\end{enumerate}
\end{verbatim}
\end{quote}
Un-numbered lists are produced using
\begin{quote}
\begin{verbatim}
\begin{itemize} ... \end{itemize}
\end{verbatim}
\end{quote}
If we replace
\begin{quote}
\verb/\begin{enumerate}/ and \verb/\end{enumerate}/
\end{quote}
in the above input by
\begin{quote}
\verb/\begin{itemize}/ and \verb/\end{itemize}/
\end{quote}
respectively, \LaTeX\ generates an itemized list in which each
item is preceeded by a `bullet':
\begin{quotation}
A \emph{metric space} $(X,d)$ consists of a set~$X$ on
which is defined a \emph{distance function} which assigns
to each pair of points of $X$ a distance between them,
and which satisfies the following four axioms:
\begin{itemize}
\item
$d(x,y) \geq 0$ for all points $x$ and $y$ of $X$;
\item
$d(x,y) = d(y,x)$ for all points $x$ and $y$ of $X$;
\item
$d(x,z) \leq d(x,y) + d(y,z)$ for all points $x$, $y$
and $z$ of $X$;
\item
$d(x,y) = 0$ if and only if the points $x$ and $y$
coincide.
\end{itemize}
\end{quotation}
Description lists (for glossaries etc.) are produced using
\begin{quote}
\begin{verbatim}
\begin{description} ... \end{description}
\end{verbatim}
\end{quote}
The items in the list should be enclosed between
\begin{quote}
\verb/\begin{description}/ and \verb/\end{description}/
\end{quote}
and should each be preceded by
\verb/\item[/\emph{label}\verb/]/,
where \emph{label} is the label to be assigned to each item.
For example, the text
\begin{quotation}
We now list the definitions of \emph{open ball},
\emph{open set} and \emph{closed set} in a metric space.
\begin{description}
\item[open ball]
The \emph{open ball} of radius~$r$ about any point~$x$
is the set of all points of the metric space whose
distance from $x$ is strictly less than $r$;
\item[open set]
A subset of a metric space is an \emph{open set} if,
given any point of the set, some open ball of
sufficiently small radius about that point is contained
wholly within the set;
\item[closed set]
A subset of a metric space is a \emph{closed set} if its
complement is an open set.
\end{description}
\end{quotation}
is generated by \LaTeX\ from the following input:
\begin{quote}
\begin{verbatim}
We now list the definitions of \emph{open ball},
\emph{open set} and \emph{closed set} in a metric space.
\begin{description}
\item[open ball]
The \emph{open ball} of radius~$r$ about any point~$x$
is the set of all points of the metric space whose
distance from $x$ is strictly less than $r$;
\item[open set]
A subset of a metric space is an \emph{open set} if,
given any point of the set, some open ball of
sufficiently small radius about that point is contained
wholly within the set;
\item[closed set]
A subset of a metric space is a \emph{closed set} if its
complement is an open set.
\end{description}
\end{verbatim}
\end{quote}
\subsection{Displayed Quotations}
Displayed quotations can be embedded in text using the
\textbf{quote} and \textbf{quotation} environments
\begin{quote}
\begin{verbatim}
\begin{quote} ... \end{quote}
\end{verbatim}
\end{quote}
and
\begin{quote}
\begin{verbatim}
\begin{quotation} ... \end{quotation}.
\end{verbatim}
\end{quote}
The \textbf{quote} environment is recommended for short quotations:
the whole quotation is indended in the \textbf{quote} environment,
but the first lines of individual paragraphs are not further indented.
The input file
\begin{quote}
\begin{verbatim}
Isaac Newton discovered the basic techiques of
the differential and integral calculus, and
applied them in the study of many problems
in mathematical physics. His main mathematical
works are the \emph{Principia} and the \emph{Optics}.
He summed up his own estimate of his work as follows:
\begin{quote}
I do not know what I may appear to the world; but to
myself I seem to have been only like a boy, playing
on the sea-shore, and diverting myself, in now and
then finding a smoother pebble, or a prettier shell
than ordinary, whilst the great ocean of truth lay
all undiscovered before me.
\end{quote}
In later years Newton became embroiled in a bitter
priority dispute with Leibniz over the discovery
of the basic techniques of calculus.
\end{verbatim}
\end{quote}
is typeset by \LaTeX\ as follows:
\begin{quotation}
Isaac Newton discovered the basic techiques of
the differential and integral calculus, and
applied them in the study of many problems
in mathematical physics. His main mathematical
works are the \emph{Principia} and the \emph{Optics}.
He summed up his own estimate of his work as follows:
\begin{quote}
I do not know what I may appear to the world; but to
myself I seem to have been only like a boy, playing
on the sea-shore, and diverting myself, in now and
then finding a smoother pebble, or a prettier shell
than ordinary, whilst the great ocean of truth lay
all undiscovered before me.
\end{quote}
In later years Newton became embroiled in a bitter
priority dispute with Leibniz over the discovery
of the basic techniques of calculus.
\end{quotation}
For longer quotations one may use the \textbf{quotation}
environment: the whole quotation is indented, and the openings
of paragraphs are then further indented in the normal fashion.
\subsection{Tables}
Tables can be produced in \LaTeX\ using the \textbf{tabular} environment.
For example, the text
\begin{quotation}
The first five International Congresses of Mathematicians
were held in the following cities:
\begin{quote}
\begin{tabular}{lll}
Chicago&U.S.A.&1893\\
Z\"{u}rich&Switzerland&1897\\
Paris&France&1900\\
Heidelberg&Germany&1904\\
Rome&Italy&1908
\end{tabular}
\end{quote}
\end{quotation}
is produced in \LaTeX using the following input file:
\begin{quote}
\begin{verbatim}
The first five International Congresses of Mathematicians
were held in the following cities:
\begin{quote}
\begin{tabular}{lll}
Chicago&U.S.A.&1893\\
Z\"{u}rich&Switzerland&1897\\
Paris&France&1900\\
Heidelberg&Germany&1904\\
Rome&Italy&1908
\end{tabular}
\end{quote}
\end{verbatim}
\end{quote}
The \verb/\begin{tabular}/ command must be followed by a string
of characters enclosed within braces which specifies the format
of the table. In the above example, the string \verb/{lll}/ is a
format specification for a table with three columns of left-justified text.
Within the body of the table the ampersand character~\verb/&/ is used
to separate columns of text within each row, and the double
backslash~\verb/\\/ is used to separate the rows of the table.
The next example shows how to obtain a table with
vertical and horizontal lines. The text
\begin{quotation}
The group of permutations of a set of $n$~elements has
order $n!$, where $n!$, the factorial of $n$, is the
product of all integers between $1$ and $n$. The
following table lists the values of the factorial of each
integer~$n$ between 1 and 10:
\begin{quote}
\begin{tabular}{|r|r|}
\hline
$n$&$n!$\\
\hline
1&1\\
2&2\\
3&6\\
4&24\\
5&120\\
6&720\\
7&5040\\
8&40320\\
9&362880\\
10&3628800\\
\hline
\end{tabular}
\end{quote}
Note how rapidly the value of $n!$ increases with $n$.
\end{quotation}
is produced in \LaTeX using the following input file:
\begin{quote}
\begin{verbatim}
The group of permutations of a set of $n$~elements has
order $n!$, where $n!$, the factorial of $n$, is the
product of all integers between $1$ and $n$. The
following table lists the values of the factorial of each
integer~$n$ between 1 and 10:
\begin{quote}
\begin{tabular}{|r|r|}
\hline
$n$&$n!$\\
\hline
1&1\\
2&2\\
3&6\\
4&24\\
5&120\\
6&720\\
7&5040\\
8&40320\\
9&362880\\
10&3628800\\
\hline
\end{tabular}
\end{quote}
Note how rapidly the value of $n!$ increases with $n$.
\end{verbatim}
\end{quote}
In this example the format specification \verb/{|r|r|}/ after
\verb/\begin{tabular}/ specifies that the table should consist
of two columns of right-justified text, with vertical lines
to the left and to the right of the table, and between columns.
Within the body of the table, the command \verb/\hline/ produces
a horizontal line; this command can only be placed between the
format specification and the body of the table (to produce a line
along the top of the table) or immediately after a row separator
(to produce a horizontal line between rows or at the bottom of the
table).
In a \textbf{tabular} environment, the format specification after
\verb/\begin{tabular}/ should consist of one or more of the following,
enclosed within braces \verb/{/ and \verb/}/:
\begin{quote}
\begin{tabular}{ll}
\verb/l/&specifies a column of left-justified text\\
\verb/c/&specifies a column of centred text\\
\verb/r/&specifies a column of right-justified text\\
\verb/p{/\emph{width}\verb/}/&specifies a left-justified column
of the given width\\
\verb/|/&inserts a vertical line between columns\\
\verb/@{/\emph{text}\verb/}/&inserts the given \emph{text}
between columns\\
\end{tabular}
\end{quote}
A string \emph{str} of characters in the format specification can be
repeated \emph{num} times using the construction
\verb/*{/\emph{num}\verb/}{/\emph{str}\verb/}/. For example,
a table with 15 columns of right-justified text enclosed within
vertical lines can be produced using the format specification
\verb/{|*{15}{r|}}/.
If additional vertical space is required between rows of the table,
then this can be produced by specifying the amount of space within
square brackets after \verb/\\/. For example, on would use
\verb/\\[6pt]/ to separate two rows of the table by 6~points of
blank space.
A horizontal line in a table from column~$i$ to column~$j$ inclusive
can be produced using \verb/\cline{/$i$\verb/-/$j$\verb/}/. For
example \verb/\cline{3-5}/ produces a horizontal line spanning
columns 3, 4 and 5 of some table.
A command of the form
\verb/\multicolumn{/\emph{num}\verb/}{/\emph{fmt}\verb/}{/\emph{text}\verb/}/
can be used within the body of a table to produce an entry spanning
several columns. Here \emph{num} specifies the number of columns
to be spanned, \emph{fmt} specifies the format for the entry
(e.g., \verb/l/ if the entry is to be left-justified entry,
or \verb/c/ if the entry is to be centred), and \emph{text} is
the text of the entry. For example, to span three columns
of a table with the words `Year of Entry' (centred with respect
to the three columns), one would use
\begin{quote}
\begin{verbatim}
\multicolumn{3}{c}{Year of entry}
\end{verbatim}
\end{quote}
\subsection{The Preamble of the \LaTeX\ Input file}
We describe the options available in \LaTeX\ for specifying
the overall style of a document.
A \LaTeX\ document should begin with a \verb/\documentclass/
command and any text to be printed must be included between
\begin{quote}
\verb/\begin{document}/ and \verb/\end{document}/
\end{quote}
commands. The \verb/\begin{document}/ command is sometimes
preceded by commands that set the page-style and set up
user-defined control sequences.
Here is a typical \LaTeX\ input file:
\begin{quote}
\begin{verbatim}
\documentclass[a4paper,12pt]{article}
\begin{document}
This is the first paragraph of a typical document. It is
produced in a `12~point' size. A \textit{point} is a unit
of length used by printers. One point is approximately
$1/72$~inch. In a `12~point' font the height of the
parentheses is 12~points (i.e. about $1/6$~inch) and the
letter~`m' is about 12 points long.
This is the second paragraph of the document. There are
also `10 point' and `11 point' styles available in \LaTeX.
The required size is specified in the `documentclass'
command. If no such size is specified then the 10~point
size is assumed.
\end{document}
\end{verbatim}
\end{quote}
The syntax of the \verb/\documentclass/ command is as
follows. The command begins with \verb/\documentclass/
and ends with the names of one of the available styles,
enclosed in curly brackets. The available styles are
\verb/article/, \verb/report/, \verb/book/
and \verb/letter/. Between the ``\verb/\documentclass/''
and the name of the document style, one may place a
list of \emph{options}. These options are separated by
commas and the list of options is enclosed in square
brackets (as in the above example). The options
available (which are usually the names of certain
`style files') include the following:
\begin{description}
\item[11pt]
Specifies a size of type known as
\emph{eleven-point}, which is ten percent larger than
the ten-point type normally used.
\item[12pt]
Specifies a twelve-point type size, which is
twenty percent larger than ten-point.
\item[twocolumn]
Produces two-column output.
\item[a4paper]
This ensures that the page is appropriately positioned
on A4 size paper.
\end{description}
Typing simply \verb/\documentclass{article}/ will produce a
document in ten-point type size. However the printed output
will not be nicely positioned on A4 paper, since the default
size is intended for a different (American) paper size.
Pages will be automatically numbered at the bottom of the
page, unless you specify otherwise. This can be done using the
\verb/\pagestyle/ command. This command should come after the
\verb/\documentclass/ command and before the
\verb/\begin{document}/ command. This command has the
syntax \verb/\pagestyle{/\textit{option}\verb/}/, where
the \textit{option} is one of the following:
\begin{description}
\item[plain]
The page number is at the foot of the page.
This is the default page style for the \verb/article/
and \verb/report/ document styles.
\item[empty]
No page number is printed.
\item[headings]
The page number (and any other information
determined by the document style) is put at the top of
the page.
\item[myheadings]
Similar to the \textbf{headings} pagestyle,
except that the material to go at the top of the
page is determined by \verb/\markboth/ and
\verb/\markright/ commands (see the \LaTeX\ manual).
\end{description}
For example, the input file
\begin{quote}
\begin{verbatim}
\documentclass[a4paper]{article}
\pagestyle{empty}
\begin{document}
The main body of the document is placed here.
\end{document}
\end{verbatim}
\end{quote}
produces a document without page numbers, using the
standard ten-point type size.
\subsection{Defining your own Control Sequences in \LaTeX}
Suppose that we are producing a paper that makes frequent
use of some mathematical expression. For example,
suppose that integrals like
\[ \int_{-\infty}^{+\infty} f(x)\,dx. \]
occur frequently throughout the text. This formula is
obtained by typing
\begin{quote}
\begin{verbatim}
\[ \int_{-\infty}^{+\infty} f(x)\,dx.\]
\end{verbatim}
\end{quote}
It would be nice if we could type \verb/\inftyint/ (say)
to obtain the integral sign at the beginning. This can
be done using \verb/\newcommand/. What we do is to place
a line with the command
\begin{quote}
\begin{verbatim}
\newcommand{\inftyint}{\int_{-\infty}^{+\infty}}
\end{verbatim}
\end{quote}
near the beginning of the input file (e.g., after
the \verb/\documentclass/ command but before the
\verb/\begin{document}/ command). Then we only have to
type
\begin{quote}
\begin{verbatim}
\[ \inftyint f(x)\,dx.\]
\end{verbatim}
\end{quote}
to obtain the above formula.
We can modify this procedure slightly. Suppose that we
we defined a new control sequence \verb/\intwrtx/ by
putting the line
\begin{quote}
\begin{verbatim}
\newcommand{\intwrtx}[1]{\int_{-\infty}^{+\infty} #1 \,dx}
\end{verbatim}
\end{quote}
at the beginning of the input file. If we then type the line
\begin{quote}
\begin{verbatim}
\[ \intwrtx{f(x)}.\]
\end{verbatim}
\end{quote}
then we obtain
\newcommand{\intwrtx}[1]{\int_{-\infty}^{+\infty} #1 \,dx}
\[ \intwrtx{f(x)}. \]
What has happened is that the expression in curly brackets
after \verb/\intwrtx/ has been substituted in the expression
defining \verb/\intwrtx/, replacing the \verb/#1/ in that
expression.
The number 1 inside square brackets in the
\verb/\newcommand/ line defining \verb/\intwrtx/ indicates
to \LaTeX\ that it is to expect one expression (in curly
brackets) after \verb/\intwrtx/ to substitute for \verb/#1/
in the definition of \verb/\intwrtx/. If we defined a
control sequence \verb/\intwrt/ by
\begin{quote}
\begin{verbatim}
\newcommand{\intwrt}[2]{\int_{-\infty}^{+\infty} #2 \,d #1}
\end{verbatim}
\end{quote}
then it would expect two expressions to substitute in for
\verb/#1/ and \verb/#2/ in the definition of \verb/\intwrt/.
Thus if we then type
\begin{quote}
\begin{verbatim}
\[ \intwrt{y}{f(y)}.\]
\end{verbatim}
\end{quote}
we obtain
\newcommand{\intwrt}[2]{\int_{-\infty}^{+\infty} #2 \,d #1}
\[ \intwrt{y}{f(y)}. \]
\end{document}
|
https://dlmf.nist.gov/23.3.E4.tex
|
nist.gov
|
CC-MAIN-2021-49
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-49/segments/1637964362619.23/warc/CC-MAIN-20211203091120-20211203121120-00186.warc.gz
| 279,715,585
| 710
|
\[\Delta={g_{2}}^{3}-27{g_{3}}^{2}=16(e_{2}-e_{3})^{2}(e_{3}-e_{1})^{2}(e_{1}-e_%
{2})^{2}.\]
|
https://florianstecker.net/Skripte/an2/skript.tex
|
florianstecker.net
|
CC-MAIN-2021-10
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2021-10/segments/1614178375096.65/warc/CC-MAIN-20210306131539-20210306161539-00279.warc.gz
| 340,275,353
| 35,773
|
\documentclass[headsepline=true]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{enumerate}
\usepackage{verbatim}
\usepackage[a4paper,top=3cm,bottom=5.5cm]{geometry}
\usepackage[colorlinks=true,linkcolor=black,bookmarks]{hyperref}
\usepackage{scrpage2}
\pagestyle{useheadings}
\newcommand{\myclearpage}{\clearpage}
\newtheorem{theorem}{Satz}[section]
\newtheorem{lemma}[theorem]{Lemma}
\renewcommand{\thetheorem}{\arabic{theorem}}
\newtheorem*{corollary}{Korollar}
\theoremstyle{remark}
\newtheorem*{remark}{Bemerkung}
\theoremstyle{definition}
\newtheorem*{definition}{Definition}
\newtheorem*{example}{Beispiel}
\newtheorem*{convention}{Konvention}
\newtheorem*{notation}{Notation}
\newtheorem*{question}{Frage}
\newenvironment{gelaber}{}{}
\newenvironment{preamble}{}{}
\newcommand{\grad}{\nabla}
\newcommand{\dd}{\,\mathrm{d}}
\newcommand{\hess}{\operatorname{Hess}}
\newcommand{\scalar}[2]{\ensuremath{\langle #1, #2 \rangle}}
\newcommand{\GL}{\operatorname{GL}}
\newcommand{\inv}{\operatorname{Inv}}
\newcommand{\id}{\operatorname{id}}
\newcommand{\graph}{\operatorname{Graph}}
% \KOMAoptions{twocolumn}
% \geometry{a2paper,top=2cm,bottom=2cm,textwidth=39cm}
% \linespread{0.9}
% \let\gelaber=\comment
% \let\proof=\comment
% \let\example=\comment
% \let\convention=\comment
% \let\question=\comment
% \let\preamble=\comment
% \renewcommand{\myclearpage}{\relax}
% \pagestyle{empty}
\begin{document}
\begin{preamble}
\subject{Vorlesung aus dem Sommersemester 2010}
\title{Analysis 2}
\author{Prof.\,Dr\kern-.1em.~Hans-Dieter Donder}%Prof. Dr. Hans-Dieter Donder
\date{}
\publishers{\small ge\TeX{}t von Viktor Kleen \& Florian Stecker}
\maketitle
\thispagestyle{empty}
\tableofcontents
\clearpage
\end{preamble}
\setcounter{section}{8}
\section{Gleichmäßige Konvergenz, Taylorreihen}
\begin{definition}
Sei $D \subseteq \mathbb R$. Für $n \in \mathbb N$ sei $f_n \colon D \to \mathbb R$. Weiterhin sei $f \colon D \to \mathbb R$.
\begin{enumerate}[(a)]
\item Die Folge $(f_n)_{n\in\mathbb N}$ {\em konvergiert punktweise} gegen $f$, wenn für alle $x \in D$ die Folge $(f_n(x))_{n \in \mathbb N}$ gegen $f(x)$ konvergiert.
\[\forall x \in D \colon \forall \varepsilon > 0 \colon \exists m \in \mathbb N \colon \forall n \geq m \colon |f_n(x) - f(x)| < \varepsilon\]
\item Die Folge $(f_n)_{n\in\mathbb N}$ {\em konvergiert gleichmäßig} gegen $f$, wenn gilt:
\[\forall \varepsilon > 0 \colon \exists m \in \mathbb N \colon \forall x \in D \colon \forall n \geq m \colon |f_n(x) - f(x)| < \varepsilon\]
\end{enumerate}
\end{definition}
\begin{remark}
Wenn $(f_n)_{n\in\mathbb N}$ gleichmäßig gegen $f$ konvergiert, so konvergiert $(f_n)_{n\in\mathbb N}$ auch punktweise gegen $f$.
\end{remark}
\begin{example}
Sei $I = [0,1]$ und $f_n \colon I \to \mathbb R, x \mapsto x/n$. Weiterhin sei $f = 0$. Dann konvergiert $(f_n)_{n\in\mathbb N}$ gleichmäßig gegen $f$. Denn sei $\varepsilon > 0$. Wähle $m \in \mathbb N$ mit $1/m < \varepsilon$. Dann gilt für alle $x \in I$ und alle $n \geq m$
\[|f_n(x) - f(x)| = x/n \leq 1/n \leq 1/m < \varepsilon\]
\end{example}
\begin{gelaber}
Zur Erinnerung: Für $f \colon D \to \mathbb R$ sei $\|f\| = \sup \{|f(x)| \colon x \in D\}$.
\end{gelaber}
\begin{remark}
Seien $f_n \colon D \to \mathbb R$, $f \colon D \to \mathbb R$. $(f_n)_{n\in\mathbb N}$ konvergiert gleichmäßig gegen $f$, wenn
\[\lim_{n\to\infty}\|f_n-f\| = 0\]
\end{remark}
\begin{remark}
Sei $I = [a,b]$. Ein $f \colon I \to \mathbb R$ ist Regelfunktion genau dann, wenn es eine Folge $(f_n)_{n\in\mathbb N}$ von Treppenfunktionen gibt, die gleichmäßig gegen $f$ konvergieren.
\end{remark}
\begin{theorem}
Sei $(f_n)_{n\in\mathbb N}$ eine Folge von stetigen Funktionen auf $D$, die gleichmäßig gegen $f$ konvergiert. Dann ist auch $f$ stetig.
\end{theorem}
\begin{proof}
Sei $a \in D$. Wir müssen zeigen, dass $f$ stetig in $a$ ist. Sei also $\varepsilon > 0$. Da $(f_n)_{n\in\mathbb N}$ gleichmäßig gegen $f$ konvergiert, existiert ein $m \in \mathbb N$ mit $|f_m(x) - f(x)| < \varepsilon/3$ für alle $x \in D$. Da $f_m$ stetig in $a$ ist, existiert ein $\delta > 0$ mit $|f_m(x) - f_m(a)| < \varepsilon/3$ für alle $x \in D$ mit $|x-a| < \delta$. Dann gilt für alle $x \in D$ mit $|x-a| < \delta$
\begin{align*}
|f(x)-f(a)| &= |(f(x)-f_m(x)) + (f_m(x) - f_m(a)) + (f_m(a)-f(a))| \leq\\
&\leq |f(x)-f_m(x)| + |f_m(x)-f_m(a)| + |f_m(a)-f(a)| <\\
&< \varepsilon/3 + \varepsilon/3 + \varepsilon/3 = \varepsilon\qedhere
\end{align*}
\end{proof}
\begin{remark}
Dies gilt nicht bei punktweiser Konvergenz. Sei $I = [0,1]$ und definiere $f_n \colon I \to \mathbb R, x \to x^n$. Die $f_n$ sind stetig und es gilt für $x \in I$
\[\lim_{n\to\infty}f_n(x) = \lim_{n\to\infty}x^n= \begin{cases}0 & \quad x \neq 1\\1 & \quad x=1\end{cases}\]
Also konvergiert $(f_n)_{n\in\mathbb N}$ punktweise gegen $f \colon I \to \mathbb R$ mit $f(x) = \delta_{x1}$. $f$ ist aber in $1$ nicht stetig.
\end{remark}
\begin{theorem}
Sei $I = [a,b]$ ein kompaktes Intervall. Sei $(f_n)_{n\in\mathbb N}$ eine Folge von Regelfunktionen auf $I$, die gleichmäßig gegen $f$ konvergiert. Dann ist auch $f$ eine Regelfunktion und es gilt
\[\int_a^bf\dd x = \lim_{n\to\infty}\int_a^b f_n \dd x\]
\end{theorem}
\begin{proof}
Wir zeigen zuerst, dass $f$ eine Regelfunktion ist. Hierzu müssen wir zeigen, dass für alle $\varepsilon > 0$ eine Treppenfunktion $g \colon I \to \mathbb R$ existiert mit $\|f-g\| < \varepsilon$. Sei also $\varepsilon > 0$. Da $(f_n)_{n\in\mathbb N}$ gleichmäßig gegen $f$ konvergiert, gilt $\lim_{n\to\infty}\|f_n-f\| = 0$. Also existiert ein $m \in \mathbb N$ mit $\|f_m-f\| \leq \varepsilon/2$. Da $f_m$ eine Regelfunktion ist, existiert eine Treppenfunktion $g \colon I \to \mathbb R$ mit $\|f_m-g\| \leq \varepsilon/2$. Dann gilt aber $\|f-g\| \leq \|f-f_m\|+\|f_m-g\| \leq \varepsilon/2 + \varepsilon/2 = \varepsilon$. Wir zeigen nun $\int_a^b f \dd x = \lim_{n\to\infty}\int_a^bf_n\dd x$. Dies ist trivial für $a=b$. Sei also $a < b$. Sei nun $\varepsilon > 0$. Wegen $\lim_{n\to\infty}\|f_n-f\| = 0$ existiert $m \in \mathbb N$ mit $\|f_n-f\| < \varepsilon/(b-a)$ für alle $n \geq m$. Somit gilt für alle $n \geq m$:
\[\left|\int_a^bf\dd x - \int_a^bf_n\dd x\right| = \left|\int_a^bf-f_n\dd x\right| \leq (b-a)\|f_n-f\| < \varepsilon\qedhere\]
\end{proof}
\begin{theorem}
Sei $I$ ein echtes Intervall. Sei $(f_n)_{n\in\mathbb N}$ eine Folge stetig differenzierbarer Funktionen auf $I$, die punktweise gegen $f$ konvergiert. Weiterhin konvergiere die Folge der Ableitungen $(f_n')_{n\in\mathbb N}$ gleichmäßig gegen $g$. Dann ist $f$ auch stetig differenzierbar und $f' = g$.
\end{theorem}
\begin{proof}
Nach Satz 1 ist $g$ stetig. Also genügt es zu zeigen, dass $f$ differenzierbar ist und $f' = g$ gilt. Wähle hierzu ein festes $a \in I$. Sei nun $x \in I$. Natürlich konvergiert auch die Folge der Einschränkungen von $f'_n$ auf $[a,x]$ (bzw. $[x,a]$) gleichmäßig gegen die Einschränkung von $g$ auf $[a,x]$($[x,a]$). Also folgt aus Satz 2
\[\int_a^x g(t)\dd t = \lim_{n\to\infty}\int_a^xf_n'(t)\dd t = \lim_{n\to\infty}(f_n(x)-f_n(a)) = f(x)-f(a)\]
d.h. $f(x) = f(a) + \int_a^xg(t)\dd t$. Somit ist nach Satz 7 aus §7 $f$ differenzierbar und es gilt $f' = g$.
\end{proof}
\begin{remark}
Wenn in Satz 3 $I = [a,b]$ kompakt ist, so folgt automatisch, dass $(f_n)_{n\in\mathbb N}$ sogar gleichmäßig gegen $f$ konvergiert, denn für all $x \in [a,b]$ gilt:
\begin{align*}
|f_n(x)-f(x)| &= \left|\left(\int_a^xf_n'(t)\dd t - \int_a^xg(t)\dd t\right) + (f_n(a)-f(a))\right| \leq\\
&\leq \left|\int_a^xf_n'(t)-g(t)\dd t\right| + |f_n(a)-f(a)| \leq\\
&\leq (b-a)\|f_n'-g\| + |f_n(a)-f(a)| \underset{n\to\infty}{\longrightarrow} 0
\end{align*}
Also ist $\lim_{n\to\infty}\|f_n-f\| = 0$.
\end{remark}
\begin{definition}
Sei $D \subseteq \mathbb R$. Für $k \in \mathbb N$ sei $f_k \colon D \to \mathbb R$. Die Reihe $\sum_{k=0}^\infty f_k$ {\em konvergiert punktweise} (bzw. {\em konvergiert gleichmäßig}) gegen $f$, wenn die Folge der Partialsummen $\left(\sum_{k=0}^n f_k\right)_{n\in\mathbb N}$ punktweise (bzw. gleichmäßig) gegen $f$ konvergiert. Wir schreiben dann $\sum_{k=0}^\infty f_k = f$.
\end{definition}
\begin{theorem}[Konvergenzkriterium von Weierstraß]
Seien $f_k \colon D \to \mathbb R$ Funktionen für $k \in \mathbb N$. Ist $\sum_{k=0}^\infty\|f_k\|$ konvergent, so ist $\sum_{k=0}^\infty f_k$ gleichmäßig konvergent.
\end{theorem}
\begin{proof}
Wir zeigen zuerst, dass $\sum_{k=0}^\infty f_k$ punktweise konvergiert. Sei hierzu $x \in D$. Da $|f_k(x)| \leq \|f_k\|$ für alle $k \in \mathbb N$ ist $\sum_{k=0}^\infty f_k(x)$ absolut konvergent. Definiere also $f \colon D \to \mathbb R, x \mapsto \sum_{k=0}^\infty f_k(x)$. Dann konvergiert $\sum_{k=0}^\infty f_k$ punktweise gegen $f$. Wir zeigen nun, dass $\sum_{k=0}^\infty f_k$ sogar gleichmäßig gegen $f$ konvergiert. Sei also $\varepsilon > 0$. Da $\sum_{k=0}^\infty \|f_k\|$ konvergiert, existiert $m \in \mathbb N$ mit $\sum_{k=m}^\infty \|f_k\| < \varepsilon$. Dann gilt für alle $x \in D$ und alle $n \geq m$:
\[\left|\sum_{k=0}^n f_k(x) - f(x)\right| = \left|\sum_{k=n+1}^\infty f_k(x)\right| \leq \sum_{k=n+1}^\infty|f_k(x)| \leq \sum_{k=n+1}^\infty\|f_k\| < \varepsilon\]
\end{proof}
\begin{example}
Sei $\sum_{k=0}^\infty a_kx^k$ eine Potenzreihe mit Konvergenzradius $r$. Sei $0 \leq c < r$ und setze $I = [-c,c]$. Für $k \in \mathbb N$ definiere $f_k \colon I \to \mathbb R, x \mapsto a_k x^k$. Dann ist für alle $k \in \mathbb N$ und alle $x \in I$
\[|f_k(x)| = |a_kx^k| = |a_k||x|^k \leq |a_kc^k|\]
also $\|f_k\| \leq |a_kc^k|$. Da $\sum_{k=0}^\infty a_kc^k$ absolut konvergiert, ist also $\sum_{k=0}^\infty\|f_k\|$ absolut konvergent. Somit ist nach Satz 4 $\sum_{k=0}^\infty f_k$ gleichmäßig konvergent. Mit Satz 1 folgt also, dass $\sum_{k=0}^\infty f_k$ stetig ist.
\end{example}
\begin{definition}
Sei $a \in \mathbb R$. Eine {\em Potenzreihe mit Mittelpunkt $a$} ist eine Reihe der Form $\sum_{k=0}^\infty a_k(x-a)^k$ mit $a_k \in \mathbb R$. Sie konvergiert (bzw. divergiert) an der Stelle $b \in \mathbb R$, wenn $\sum_{k=0}^\infty a_k(b-a)^k$ konvergiert (bzw. divergiert).
\end{definition}
\begin{gelaber}
$\sum_{k=0}^\infty a_k(x-a)^k$ konvergiert natürlich an der Stelle $b$ genau dann, wenn $\sum_{k=0}^\infty a_k x^k$ an der Stelle $b-a$ konvergiert. Somit können wir alle Ergebnisse von früher auf diesen allgemeineren Begriff übertragen. Setzen wir also
\[I = \left\{b \in \mathbb R \colon \text{$\sum_{k=0}^\infty a_k(x-a)^k$ konvergiert an der Stelle $b$}\right\}\]
so ist $I$ ein Intervall mit Mittelpunkt $a$. Den Radius von $I$ nennen wir den Konvergenzradius von $\sum_{k=0}^\infty a_k(x-a)^k$. Die zugehörige Funktion wird definiert durch $f(b) = \sum_{k=0}^\infty a_k(b-a)^k$. $f$ ist stetig und in $\mathring I$ differenzierbar und es gilt für $b \in \mathring I$
\[f'(b) = \sum_{k=1}^\infty ka_k(b-a)^{k-1}\]
Damit ist $f$ in $\mathring I$ natürlich beliebig oft differenzierbar. Man kann nun folgende Frage stellen:
Sei $g \colon I \to \mathbb R$ beliebig oft differenzierbar und $I$ ein Intervall. Sei $a \in \mathring I$. Gibt es dann eine Potenzreihe $\sum_{k=0}^\infty a_k(x-a)^k$ mit Mittelpunkt $a$ und Konvergenzradius $r > 0$ und ein $0 \leq \overline r \leq r$, so dass $g(b) = \sum_{k=0}^\infty a_k(b-a)^k$ für alle $b \in I$ mit $|b-a| < \overline r$. Leider ist dies nicht immer der Fall. Nach dem Identitätssatz gibt es aber nur einen Kandidaten. Man kann sogar die Koeffizienten bestimmen. Es muss nämlich gelten
\[a_k = \frac{g^{(k)}(a)}{k!}\]
\end{gelaber}
\begin{definition}
Sei $I$ ein Intervall, $g \colon I \to \mathbb R$ eine in $\mathring I$ beliebig oft differenzierbare Funktion und $a \in \mathring I$. Setze dann
\[T(g,a) = \sum_{k=0}^\infty \frac{g^{(k)}(a)}{k!}(x-a)^k\]
$T(g,a)$ ist die {\em Taylorreihe von $g$ mit Entwicklungspunkt $a$}. Wir bezeichnen mit $T(g,a)$ auch die zugehörige Funktion.
\end{definition}
\begin{gelaber}
Ist der Konvergenzradius $r$ von $T(g,a)$ echt größer als $0$ und gibt es ein $0 < \overline r \leq r$ mit $g(b) = T(g,a)(b)$ für alle $b \in I$ mit $|b-a| < \overline r$, so sagen wir $g$ besitzt im Punkt $a$ ein Taylorentwicklung. Dies motiviert folgendes:
\end{gelaber}
\begin{definition}
Seien $f \colon I \to \mathbb R$, $I$ ein Intervall, $a \in I$. Sei $f$ $n$-mal differenzierbar in $a$. Setze dann
\[T_n(f,a) = \sum_{k=0}^n\frac{f^{(k)}(a)}{k!}(x-a)^k\]
$T_n(f,a)$ ist das {\em $n$-te Taylorpolynom von $f$ mit Entwicklungspunkt $a$}. Wir betrachten $T_n(f,a)$ als Funktion $I \to \mathbb R$.
\end{definition}
\begin{theorem}[Taylorsche Formel]
Sei $I$ ein Intervall und $f \colon I \to \mathbb R$ eine $(n+1)$-mal differenzierbare Funktion, und sei $a \in I$. Dann gilt für alle $x \in I$:
\[f(x) = T_n(f,a)(x) + R_{n+1}(x)\quad\text{wobei}\quad R_{n+1}(x) = \frac{1}{n!}\int_a^x(x-t)^nf^{(n+1)}(t)\dd t\]
\end{theorem}
\begin{proof}
Durch Induktion über $n$.
\begin{itemize}
\item Induktionsanfang: Es ist $f(x) = f(a) + \int_a^x f'(t)\dd t = T_0(f,a)(x) + R_1(x)$.
\item Induktionsschritt:
\begin{align*}
R_{n+1}(x) &= \frac{1}{n!} \int_a^x(x-t)^nf^{(n+1)}(t)\dd t =\\
&= -\int_a^x f^{(n+1)}(t)\left(\frac{(x-t)^{n+1}}{(n+1)!}\right)'\dd t =\\
&= -f^{(n+1)}(t)\frac{(x-t)^{n+1}}{(n+1)!}\bigg|_{t=a}^x + \int_a^x f^{(n+2)}(t)\frac{(x-t)^{n+1}}{(n+1)!}\dd t =\\
&= \frac{f^{(n+1)}(a)}{(n+1)!}(x-a)^{n+1} + \frac{1}{(n+1)!}\int_a^x (x-t)^{n+1} f^{(n+2)}(t)\dd t = \\
&= \frac{f^{(n+1)}(a)}{(n+1)!}(x-a)^{n+1} + R_{n+2}(x)
\end{align*}
Also ist nach Induktionsvoraussetzung
\begin{align*}
f(x) &= T_n(f,a)(x) + R_{n+1}(x) =\\
&= T_n(f,a)(x) + \frac{f^{(n+1)}(a)}{(n+1)!}(x-a)^{n+1} + R_{n+2}(x) =\\
&= T_{n+1}(f,a)(x) + R_{n+2}(x)\qedhere
\end{align*}
\end{itemize}
\end{proof}
\begin{corollary}[Langrangesches Restglied]
Sei $I$ ein Intervall und $f \colon I \to \mathbb R$ eine $(n+1)$-mal stetig differenzierbare Funktion. Weiterhin seien $a,x \in I$. Dann existiert ein $\xi$ zwischen $a$ und $x$ mit
\[f(x) = T_n(f,a)(x) + \frac{f^{(n+1)}(\xi)}{(n+1)!}(x-a)^{n+1}\]
\end{corollary}
\begin{proof}
Sei $R_{n+1}(x) = \frac{1}{n!} \int_a^x(x-t)^n f^{(n+1)}(t)\dd t = \int_a^x f^{(n+1)}(t)\frac{(x-t)^n}{n!}\dd t$ wie in Satz 5. Nach dem Mittelwertsatz der Integralrechnung existiert ein $\xi$ zwischen $a$ und $x$, so dass gilt
\[R_{n+1}(x) = f^{(n+1)}(\xi)\int_a^x\frac{(x-t)^n}{n!}\dd t = - f^{(n+1)}(\xi)\frac{(x-t)^{n+1}}{(n+1)!}\bigg|_{t=a}^x = \frac{f^{(n+1)}(\xi)}{(n+1)!}(x-a)^{n+1} \qedhere\]
\end{proof}
\begin{corollary}
Sei $I$ ein Intervall und $f \colon I \to \mathbb R$ eine $n$-mal stetig differenzierbare Funktion. Weiterhin sei $a \in I$. Dann gibt es eine stetige Funktion $r \colon I \to \mathbb R$ mit $r(a) = 0$ und
\[f(x) = T_n(f,a)(x) + r(x)(x-a)^n\]
für alle $x \in I$.
\end{corollary}
\begin{proof}
Für $n=0$ setze $r(x) = f(x) - f(a)$. Sei also $n > 0$. Definiere $r \colon I \to \mathbb R$ durch
\[r(x) = \begin{cases}\frac{1}{(x-a)^n}(f(x)-T_n(f,a)(x)) & \quad x \neq a \\ 0 & \quad x = a\end{cases}\]
Offenbar ist $f(x) = T_n(f,a)(x) + r(x)(x-a)^n$ für $x \in I$, denn $T_n(f,a)(a) = f(a)$. Weiter ist $r$ stetig in $I \setminus \{a\}$. Wir müssen also nur noch zeigen, dass $r$ stetig in $a$ ist. Sei also $(x_k)_{k \in \mathbb N}$ eine folge aus $I \setminus \{a\}$, die gegen $a$ konvergiert. Dann ist
\begin{align*}
r(x_k) &= \frac{1}{(x_k-a)^n}\left(f(x_k) - T_n(f,a)(x_k)\right) =\\
&= \frac{1}{(x_k-a)^n}\left(f(x_k) - T_{n-1}(f,a)(x_k) - \frac{f^{(n)}(a)}{n!}(x_k-a)^n\right) =\\
&= \frac{1}{(x_k-a)^n}\left(f(x_k) - T_{n-1}(f,a)(x_k)\right) - \frac{f^{(n)}(a)}{n!}
\end{align*}
Nach obigem Korollar existiert ein $\xi_k$ zwischen $a$ und $x_k$ mit
\[f(x_k) - T_{n-1}(f,a)(x_k) = \frac{f^{(n)}(\xi_k)}{n!}(x_k-a)^n\]
Dann ist $r(x_k) = \frac{1}{n!}(f^{(n)}(\xi_k) - f^{(n)}(a))$. Wegen $\lim_{k\to\infty} x_k = a$ ist aber auch $\lim_{k\to\infty} \xi_k = a$. Da $f^{(n)}$ stetig ist, folgt als $\lim_{k\to\infty} r(x_k) = 0$.
\end{proof}
\begin{theorem}
Sei $f \colon I \to \mathbb R$ $n$-mal stetig differenzierbar, wobei $I$ ein Intervall ist und $n \geq 2$. Sei $a \in \mathring I$ und es gelte $f^{(k)}(a) = 0$ für $1 \leq k < n$, aber $f^{(n)}(a) \neq 0$.
\begin{enumerate}[(a)]
\item Ist $n$ gerade und $f^{(n)}(a) > 0$, so besitzt $f$ in $a$ ein lokales Minimum.
\item Ist $n$ gerade und $f^{(n)}(a) < 0$, so besitzt $f$ in $a$ ein lokales Maximum.
\item Ist $n$ ungerade, so besitzt $f$ in $a$ kein lokales Extremum.
\end{enumerate}
\end{theorem}
\begin{proof}
Nach Voraussetzung ist $T_{n-1}(f,a) = f(a)$.
\begin{enumerate}[zu (a)]
\item Sei $n$ gerade und $f^{(n)}(a) > 0$. Wegen $f^{(n)}$ stetig und $a \in \mathring I$ existiert ein $\varepsilon > 0$ mit $U_\varepsilon(a) \subseteq I$ und $f^{(n)}(b) > 0$ für alle $b \in U_\varepsilon(a)$. Sei nun $x \in U_\varepsilon(a)$, $x \neq a$. Nach dem ersten Korollar zu Satz 5 existiert ein $\xi$ zwischen $a$ und $x$ mit
\[f(x) = f(a) + \frac{f^{(n)}(\xi)}{n!}(x-a)^n\]
Dann ist aber $f^{(n)}(\xi) > 0$ und wegen $n$ gerade ist auch $(x-a)^n > 0$. Also folgt $f(x) > f(a)$.
\item wende (a) auf $-f$ an.
\item Sei nun $n$ ungerade. Sei o.E. $f^{(n)}(a) > 0$ (sonst betrachte $-f$). Sei $\varepsilon > 0$. Es ist zu zeigen, dass $x_0,x_1 \in U_\varepsilon(a) \cap I$ existieren mit $f(x_0) < f(a) < f(x_1)$. Wegen $f^{(n)}$ stetig in $a$ und $a \in \mathring I$ existiert ein $\delta > 0$ mit $\delta \leq \varepsilon$ und $U_\delta(a) \subseteq I$ und $f^{(n)}(b) > 0$ für alle $b \in U_\delta(a)$. Wähle $x_0,x_1 \in U_\delta(a)$ mit $x_0 < a < x_1$. Dann existiert wieder $\xi_i$ zwischen $a$ und $x_i$ mit
\[f(x_i) = f(a) + \frac{f^{(n)}(\xi_i)}{n!}(x_i-a)^n\]
Dann gilt $f^{(n)}(\xi_i) > 0$. Wegen $n$ ungerade ist aber $(x_0-a)^n < 0$ und $(x_1-a)^n > 0$. Also $f(x_0) < f(a) < f(x_1)$.\qedhere
\end{enumerate}
\end{proof}
\begin{example}
\begin{enumerate}[(a)]
\item Definiere $f \colon \mathbb R \to \mathbb R$ durch
\[f(x) = \begin{cases}\exp(-1/x^2) & \quad x \neq 0\\ 0 & \quad x=0\end{cases}\]
$f$ ist beliebig oft differenzierbar und es gilt $f^{(n)}(0) = 0$ für ale $n$. Die Taylorreihe von $f$ mit Entwicklungspunkt $0$ ist also identisch $0$. Somit besitzt $f$ keine Taylorentwicklung in $0$.
\item Früher wurde gezeigt
\[\ln(1+b) = \sum_{k=1}^\infty(-1)^{k-1}\frac{b^k}{k} \quad \forall b \in (-1,1)\]
Also
\[\ln(x) = \sum_{k=1}^\infty(-1)^{k-1}\frac{(x-1)^k}{k} \quad \forall x \in (0,2)\]
Also besitzt $\ln$ eine Taylorentwicklung im Punkt $1$.
\end{enumerate}
\end{example}
\section{Metrische Räume}
\begin{gelaber}
Wir wollen nun $\mathbb R^n$ untersuchen. Für beliebige $n$ ist $\mathbb R^n$ nicht mehr ein Körper. Aber $\mathbb R^n$ ist noch ein $\mathbb R$-Vektorraum, d.h. wir haben Addition und Skalarmultiplikation. Wir haben auch ein Analogon zum Absolutbetrag. Hierzu setzen wir für $a = (a_1,\dots,a_n) \in \mathbb R^n$
\[\|a\| = \sqrt{\sum_{k=1}^na_k^2}\]
$\| \cdot \|$ ist die euklidische Norm. Für $a \in \mathbb R$ ist $\|a\| = |a|$. Für die euklidische Norm $\| \cdot \| \colon \mathbb R^n \to \mathbb R$ gilt:
\begin{enumerate}[(N1)]
\item $\|x\| = 0 \Longleftrightarrow x = 0$
\item $\forall x \in \mathbb R^n \colon \forall \lambda \in \mathbb R \colon \| \lambda x \| = | \lambda | \|x\|$
\item $\forall x,y \in \mathbb R^n \colon \|x+y\| \leq \|x\| + \|y\|$
\end{enumerate}
\end{gelaber}
\begin{proof}
Seien $x = (x_1,\dots,x_n)$, $y = (y_1,\dots,y_n)$.
\begin{enumerate}[(N1)]
\item $\displaystyle \|x\| = \sqrt{\sum_{k=1}^n a_k^2} = 0 \Longleftrightarrow x_1 = \dots = x_n = 0 \Longleftrightarrow x = 0$
\item $\displaystyle \|\lambda x \| = \sqrt{\sum_{k=1}^n(\lambda x_k)^2} = |\lambda|\sqrt{\sum_{k=1}^nx_k^2} = |\lambda|\|x\|$
\item Setze $\scalar{x}{y} = \sum_{k=1}^nx_ky_k$. Wir zeigen zuerst die {\em Cauchy-Schwarz-Ungleichung}
\[\scalar{x}{y} \leq \|x\|^2\|y\|^2\]
Dies ist trivial für $y = 0$. Sei also $y \neq 0$. Setze $\lambda = \scalar{x}{y}/\|y\|^2$. Es ist:
\begin{align*}
0 &\leq \|x-\lambda y\|^2 = \sum_{k=1}^n(x_k-\lambda y_k)^2 =\\
&= \sum_{k=1}^n(x_k^2-2\lambda x_ky_k + \lambda^2 y_k^2) =\\
&= \sum_{k=1}^nx_k^2 - 2 \lambda \sum_{k=1}^nx_ky_k + \lambda^2\sum_{k=1}^n y_k^2 =\\
&= \|x\|^2 - 2 \lambda \scalar{x}{y} + \lambda^2 \|y\|^2
\end{align*}
Durch Multiplikation mit $\|y\|^2$ also
\[0 \leq \|x\|^2\|y\|^2 - 2\scalar{x}{y}^2 + \scalar{x}{y}^2\]
also $\scalar{x}{y}^2 \leq \|x\|^2\|y\|^2$
Dann gilt aber
\begin{align*}
\|x+y\|^2 &= \sum_{k=1}^n(x_k+y_k)^2 = \sum_{k=1}^n(x_k^2 + 2x_ky_k + y_k^2) =\\
&= \sum_{k=1}^nx_k^2 + 2\sum_{k=1}^nx_ky_k + \sum_{k=1}^ny_k^2 = \\
&= \|x\|^2 + 2 \scalar{x}{y} + \|y\|^2 \leq\\
&\leq \|x\|^2 + 2 \|x\|\|y\| + \|y\|^2 =\\
&=(\|x\|+\|y\|)^2
\end{align*}
Also $\|x+y\| \leq \|x\| + \|y\|$ \qedhere
\end{enumerate}
\end{proof}
\begin{definition}
Sei $V$ ein $\mathbb R$-Vektorraum und $\|\cdot\| \colon V \to \mathbb R^+$. Dann ist $\|\cdot\|$ eine {\em Norm}, wenn gilt:
\begin{enumerate}[(N1)]
\item $\|x\| = 0 \Longleftrightarrow x = 0$
\item $\forall x \in V \colon \forall \lambda \in \mathbb R \colon \| \lambda x \| = | \lambda | \|x\|$
\item $\forall x,y \in V \colon \|x+y\| \leq \|x\| + \|y\|$
\end{enumerate}
$V$ mit $\|\cdot\|$ heißt dann {\em normierter Vektorraum}.
\end{definition}
\begin{gelaber}
Sei nun $V$ mit $\|\cdot\|$ ein normierter Vektorraum. Wir können dann den Abstand zwischen zwei Punkten $x,y \in V$ definieren durch $d(x,y) = \|x-y\|$. Hierfür gilt dann $d \colon V^2 \to \mathbb R^+$
\begin{enumerate}[(M1)]
\item $d(x,y) = 0 \Longleftrightarrow x=y$
\item $\forall x,y \in V \colon d(x,y) = d(y,x)$ (Symmetrie)
\item $\forall x,y,z \in V \colon d(x,z) \leq d(x,y) + d(y,z)$ (Dreiecksungleichung)
\end{enumerate}
\end{gelaber}
\begin{proof}
\begin{enumerate}[(M1)]
\item $d(x,y) = 0 \Longleftrightarrow \|x-y\| = 0 \Longleftrightarrow x-y = 0 \Longleftrightarrow x=y$
\item $d(x,y) = \|x-y\| = \|-(y-x)\| = |-1|\|y-x\| = \|y-x\| = d(y,x)$
\item $d(x,z) = \|x-z\| = \|(x-y)+(y-z)\| \leq \|x-y\|+\|y-z\| = d(x,y)+d(y,z)$\qedhere
\end{enumerate}
\end{proof}
\begin{definition}
Sei $X$ eine Menge. Eine {\em Metrik} auf $X$ ist eine Funktion $d \colon X^2 \to \mathbb R^+$ mit
\begin{enumerate}[(M1)]
\item $d(x,y) = 0 \Longleftrightarrow x=y$
\item $\forall x,y \in X \colon d(x,y) = d(y,x)$ (Symmetrie)
\item $\forall x,y,z \in X \colon d(x,z) \leq d(x,y) + d(y,z)$ (Dreiecksungleichung)
\end{enumerate}
$X$ mit $d$ ist ein {\em metrischer Raum}.
\end{definition}
\begin{gelaber}
Wir sagen auch einfach "`$X$ ist ein metrischer Raum"' und bezeichnen dann die Metrik mit $d$. Dies machen wir auch für verschiedene Räume. Speziell ist also jeder $\mathbb R^n$ ein metrischer Raum mit der euklidischen Metrix $d(x,y) = \|x-y\|$. Dies benutzen wir immer auf dem $\mathbb R^n$. Sei nun $X$ ein metrischer Raum.
\end{gelaber}
\begin{definition}
Für $x \in X$ und $\varepsilon > 0$ setzen wir
\[U_\varepsilon(x) = \{y \in X \colon d(x,y) < \varepsilon\}\]
$U_\varepsilon(x)$ ist die {\em $\varepsilon$-Umgebung von $X$}.
\end{definition}
\begin{definition}
Sei $x \in X$ und $U \subseteq X$. $U$ ist eine {\em Umgebung von $x$}, wenn ein $\varepsilon > 0$ existiert mit $U_\varepsilon(x) \subseteq U$. Speziell ist also für $\varepsilon > 0$ $U_\varepsilon(x)$ eine Umgebung von $X$.
\end{definition}
\begin{theorem}[Trennungseigenschaft von Hausdorff]
Zu je 2 verschiedenen Punkten $x,y \in X$ gibt es Umgebungen $U$ von $x$ und $V$ von $y$ mit $U \cap V = \varnothing$.
\end{theorem}
\begin{proof}
Seien $x,y \in X$, $x \neq y$. Setze $\varepsilon = d(x,y)$. Dann ist $\varepsilon > 0$ nach (M1). Setze $\delta = \varepsilon /2$ und $U = U_\delta(x)$ und $V = U_\delta(y)$. Dann ist $U$ Umgebung von $x$ und $V$ Umgebung von $y$. Es ist $U \cap V \neq \varnothing$, denn nehme an, dass $z \in U \cap V$. Dann ist
\[ 2 \delta = d(x,y) \leq d(x,z) + d(x,y) = d(x,z) + d(y,z) < \delta + \delta = 2 \delta \]
was ein Widerspruch ist.
Ist $X$ ein metrischer Raum und $A \subseteq X$, so ist $A$ mit der auf $A$ eingeschränkten Metrix selbst ein metrischer Raum. Auf diese Weise wird insbesondere jede Teilmenge von $\mathbb R^n$ zu einem metrischen Raum.
\end{proof}
\begin{gelaber}
Im folgenden seien $X$,$Y$,$Z$ stets metrische Räume.
\end{gelaber}
\begin{definition}
Sei $(a_n)_{n \in \mathbb N}$ eine Folge von $X$ und $a \in X$. Die Folge $(a_n)_{n \in \mathbb N}$ {\em konvergiert} gegen $a$, wenn gilt:
für alle $\varepsilon > 0$ existiert ein $m \in \mathbb N$ mit $d(a_n,a) < \varepsilon$ für alle $n \geq m$. $a$ ist dann {\em Grenzwert} (oder Limes) von $(a_n)_{n \in \mathbb N}$.
\end{definition}
\begin{gelaber}
Wir können dies auf verschiedene Weise umformulieren.
\end{gelaber}
\begin{remark}
$(a_n)_{n \in \mathbb N}$ konvergiert gegen $a$ genau dann wenn $\lim_{n\to\infty}d(a_n,a) = 0$
\end{remark}
\begin{remark}
Es ist äquivalent:
\begin{enumerate}
\item $(a_n)_{n \in \mathbb N}$ konvergiert gegen $a$.
\item für alle $\varepsilon > 0$ existiert ein $m \in \mathbb N$ mit $a_n \in U_\varepsilon(a)$ für alle $n \geq m$.
\item für alle Umgebungen $U$ von $a$ existiert ein $m \in \mathbb N$ mit $a_n \in U$ für alle $n \geq m$.
\end{enumerate}
Aus Satz 1 folgt also, dass jede Folge höchstens einen Grenzwert besitzt.
Wir können also schreiben:
\[\lim_{n\to\infty} a_n = a \qquad\text{für "`$(a_n)_{n\in\mathbb N}$ konvergiert gegen $a$"'}\]
\end{remark}
\begin{definition}
Eine Folge $(a_n)_{n \in \mathbb N}$ aus $X$ ist {\em beschränkt}, wenn ein $b \in X$ und $r > 0$ existieren mit $a_n \in U_r(b)$ für alle $n \in \mathbb N$.
\end{definition}
\begin{remark}
Jede konvergente Folge ist beschränkt.
\end{remark}
\begin{proof}
Sei $\lim_{n\to\infty}a_n = a$. Dann existiert ein $m \in \mathbb N$ mit $a_n \in U_1(a)$ für alle $n \geq m$. Setze $r = \max\{d(a_k,a) \colon k < m\} + 1$. Dann gilt $a_n \in U_r(a)$ für alle $n$.
\end{proof}
\begin{theorem}
Sei $(a_k)_{k \in \mathbb N}$ eine Folge aus $\mathbb R^n$ und $b \in \mathbb R^n$. Sei $b = (b_1,\ldots,b_n)$ und $a_k = (a_{k1},\ldots,a_{kn})$. Dann gilt $\lim_{k\to\infty}a_k = b$ genau dann, wenn $\displaystyle\lim_{k\to\infty}a_{kl} = b_l$ für alle $1 \leq l \leq n$.
\end{theorem}
\begin{proof}
Sei $\lim_{k\to\infty}a_k = b$. Dann gilt $\lim_{k\to\infty}d(a_k,b) = 0$. Sei $1 \leq l \leq n$. Dann ist für $k \in \mathbb N$
\[0 \leq \left| a_{kl} - b_l \right| \leq \sqrt{\sum_{j=1}^n(a_{kj}-b_j)^2} = d(a_k,b)\]
Also $\lim_{k\to\infty}|a_{kl}-b_l| = 0$, d.h. $\lim_{k\to\infty}a_{kl} = b_l$. \\
Sei umgekehrt $\lim_{k\to\infty}a_{kl} = b_l$ für alle $1 \leq l \leq n$. Dann ist für alle $1 \leq l \leq n$ $\lim_{k\to\infty}(a_{kl}-b_l) = 0$. Also ist
\[\lim_{k\to\infty}d(a_k,b) = \lim_{k\to\infty}\sqrt{\sum_{j=1}^n(a_{kj}-b_j)^2} = 0\]
Damit folgt sofort für Folgen $(a_k)_{k\in\mathbb N}$, $(b_k)_{k \in \mathbb N}$ und $c \in \mathbb R$.
\[\lim_{k\to\infty}(a_k+b_k) = \lim_{k\to\infty}a_k + \lim_{k\to\infty}b_k\]
\[\lim_{k\to\infty}(ca_k) = c\lim_{k\to\infty}a_k \qedhere\]
\end{proof}
\begin{definition}
Sei $(a_n)_{n\in\mathbb N}$ Folge aus $X$ und $a \in X$. $a$ ist {\em Häufungspunkt} von $(a_n)_{n\in\mathbb N}$, wenn es für jede Umgebung $U$ von $a$ unendlich viele $n$ gibt mit $a_n \in U$.
\end{definition}
\begin{remark}
$a$ ist ein Häufungspunkt von $(a_n)_{n\in\mathbb N}$, wenn es eine Teilfolge von $(a_n)_{n\in\mathbb N}$ gibt, die gegen $a$ konvergiert.
\end{remark}
\begin{proof}
Wie in Analysis I. \phantom{\qedhere}
\end{proof}
\begin{theorem}[Bolzano-Weierstraß]
Im $\mathbb R^n$ besitzt jede beschränkte Folge einen Häufungspunkt.
\end{theorem}
\begin{proof}
Durch Induktion über $n$.
\begin{itemize}
\item Induktionsanfang ($n=1$): nach Analysis I
\item Induktionsschritt: Sei $(a_k)_{k\in\mathbb N}$ beschränkte Folge in $\mathbb R^{n+1}$. Sei $a_k = (a_{k1},\ldots,a_{k,n+1})$ für $k \in \mathbb N$. Setze $b_k = (a_{k1},\ldots,a_{kn})$. Dann ist $(b_k)_{k\in\mathbb N}$ eine beschränkte Folge in $\mathbb R^n$. Nach Induktionsvoraussetzung besitzt also $(b_k)_{k\in\mathbb N}$ eine konvergente Teilfolge $(b_{k(l)})_{l\in\mathbb N}$. Nach Analysis I besitzt die beschränkte Folge $(a_{k(l),n+1})_{l\in\mathbb N}$ eine konvergente Teilfolge $(a_{k(l)(j),n+1})_{j\in\mathbb N}$. Nach Satz 2 ist dann $(a_{k(l)(j)})_{j\in\mathbb N}$ eine konvergente Teilfolge von $(a_k)_{k\in\mathbb N}$. \qedhere
\end{itemize}
\end{proof}
\begin{definition}
Eine Folge $(a_n)_{n\in\mathbb N}$ aus $X$ ist eine {\em Cauchy-Folge}, wenn gilt:
\[\forall \varepsilon > 0 \colon \exists m \in \mathbb N \colon \forall n \geq m \colon d(a_n,a_m) < \varepsilon\]
\end{definition}
\begin{remark}
Ist $(a_n)_{n\in\mathbb N}$ eine Cauchy-Folge, so gilt stärker:
\[\forall \varepsilon > 0 \colon \exists m \in \mathbb N \colon \forall k,n \geq m \colon d(a_n,a_k) < \varepsilon\]
\end{remark}
\begin{proof}
Wie in Analysis I \phantom{\qedhere}
\end{proof}
\begin{remark}
Jede konvergente Folge ist eine Cauchy-Folge. Die Umkehrung gilt nicht in beliebigen metrischen Räumen.
\end{remark}
\begin{proof}
Sei $\lim_{n\to\infty}a_n = a$. Sei $\varepsilon > 0$. Dann existiert $m \in \mathbb N$ mit $d(a_n,a) < \varepsilon/2$ für alle $n \geq m$. Dann ist aber für $n \geq m$
$d(a_n,a_m) \leq d(a_n,a) + d(a_m,a) < \varepsilon/2 + \varepsilon/2 = \varepsilon$.
\end{proof}
\begin{example}
Sei $X = (0,1)$ ein offenes Intervall. In $X$ ist $(1/n)_{n\in\mathbb N}$ eine Cauchy-Folge, die in $X$ (!) nicht konvergiert.
\end{example}
\begin{definition}
Ein metrischer Raum ist {\em vollständig}, wenn jede Cauchy-Folge aus $X$ konvergiert (in $X$).
\end{definition}
\begin{theorem}
$\mathbb R^n$ ist vollständig.
\end{theorem}
\begin{proof}
Sei $(a_k)_{k\in\mathbb N}$ eine Cauchy-Folge aus $\mathbb R^n$. Sei $a_k = (a_{k1},\ldots,a_{kn})$. Dann ist für jedes $1 \leq l \leq n$ $(a_{kl})_{k\in\mathbb N}$ eine Cauchy-Folge in $\mathbb R$, denn $0 \leq \left|a_{kl}-a_{jl}\right| \leq d(a_k,a_j)$ für alle $k,j$. Also ist $(a_{kl})_{k\in\mathbb N}$ konvergent. Somit ist nach Satz 2 $(a_k)_{k\in\mathbb N}$ konvergent.
\end{proof}
\begin{definition}
Sei $f \colon X \to Y$, $a \in X$.
\begin{enumerate}
\item $f$ ist {\em stetig in $a$}, wenn für alle $\varepsilon > 0$ ein $\delta > 0$ existiert mit $d(f(x),f(a)) < \varepsilon$ für alle $x \in X$ mit $d(x,a) < \delta$.
\item $f$ ist {\em stetig}, wenn $f$ in jedem Punkt $a \in X$ stetig ist.
\end{enumerate}
\end{definition}
\begin{remark}
Somit sind also folgende Aussagen äquivalent:
\begin{enumerate}
\item $f$ ist stetig in $a$
\item Für alle $\varepsilon > 0$ existiert ein $\delta > 0$ mit $f[U_\delta(a)] \subseteq U_\varepsilon(f(a))$
\item Für alle Umgebungen $U$ von $f(a)$ existiert eine Umgebung $V$ von $a$ mit $f[V] \subseteq U$
\end{enumerate}
\end{remark}
\begin{remark}
Eine Funktion $f \colon X \to Y$ ist genau dann stetig im Punkt $a \in X$, wenn für jede Folge $(x_n)_{n\in\mathbb N}$, die gegen $a$ konvergiert, die Bildfolge $(f(x_n))_{n\in\mathbb N}$ gegen $f(a)$ konvergiert.
\end{remark}
\begin{proof}
Wie in Analysis I \phantom{\qedhere}
\end{proof}
\begin{example}\
\begin{itemize}
\item Sei $1 \leq i \leq n$. Definiere $p_i \colon \mathbb R^n \to \mathbb R$ durch $p_i(x_1,\ldots,x_n) = x_i$. $p_i$ ist die $i$-te Projektion. $p_i$ ist stetig. Das folgt sofort aus Satz 2.
\item Die Funktion $+ \colon \mathbb R^2 \to \mathbb R$ ist stetig.
\item Die Funktion $\cdot \colon \mathbb R^2 \to \mathbb R$ ist stetig.
\item Sind $f,g \colon X \to \mathbb R$ stetig, $c \in \mathbb R$, so sind $f + g$, $f \cdot g$, $cf$ stetig (entsprechend abgeändert gilt das auch für $1/g$).
\end{itemize}
\end{example}
\begin{theorem}
Seien $f \colon X \to Y$ und $g \colon Y \to Z$. Die Funktion $f$ sei in $a \in X$ stetig und $g$ sei in $f(a) \in Y$ stetig. Dann ist $g \circ f$ in $a$ stetig.
\end{theorem}
\begin{proof}
Sei $U$ eine Umgebung von $(g \circ f)(a) = g(f(a))$. Wegen $g$ in $f(a)$ stetig existiert dann eine Umgebung $V$ von $f(a)$ mit $g[V] \subseteq U$. Wegen $f$ in $a$ stetig existiert eine Umgebung $W$ von $a$ mit $f[W] \subseteq V$. Dann ist $(g \circ f)[W] = g[f[W]] \subseteq g[V] \subseteq U$.
\end{proof}
\begin{example}
Die Funktion $\|\cdot\| \colon \mathbb R^n \to \mathbb R$ ist stetig. Denn
\[\|(x_1,\ldots,x_n)\| = \sqrt{\sum_{k=1}^nx_k^2}\]
\end{example}
\begin{definition}
Sei $f \colon X \to \mathbb R^n$. Dann existieren eindeutig bestimmte Funktionen $f_1,\ldots,f_n$ von $X \to \mathbb R$ mit $f(x) = (f_1(x),\ldots,f_n(x))$. $f_i$ ist die $i$-te {\em Komponentenfunktion} von $f$. Wir schreiben hierfür etwas ungenau $f = (f_1,\ldots,f_n)$.
\end{definition}
\begin{theorem}
Sei $f \colon X \to \mathbb R^n$, $f = (f_1,\ldots,f_n)$, und sei $a \in X$. Dann ist $f$ genau dann in $a$ stetig, wenn jedes $f_i$ mit $1 \leq i \leq n$ in $a$ stetig ist.
\end{theorem}
\begin{proof}
Sei $f$ in $a$ stetig. Es ist $f_i = p_i \circ f$. Da $p_i$ stetig ist, ist $f_i$ in $a$ stetig. Sei umgekehrt jedes $f_i$ in $a$ stetig. Sei $\lim_{k\to\infty}x_k = a$. Dann ist $\lim_{k\to\infty}f_i(x_k) = f_i(a)$ für $1 \leq i \leq n$. Also $\lim_{k\to\infty}f(x_k) = (f_1(a),\ldots,f_n(a)) = f(a)$.
\end{proof}
\begin{definition}
Sei $A \subseteq X$ und $b \in X$. $b$ ist {\em Häufungspunkt} von $A$, wenn in jeder Umgebung von $b$ ein Element von $A$ liegt, das von $b$ verschieden ist.
\end{definition}
\begin{remark}
Seien $A$,$b$ wie oben. Es sind äquivalent:
\begin{enumerate}
\item $b$ ist ein Häufungspunkt von $A$
\item Es gibt eine Folge aus $A \setminus \{b\}$, die gegen $b$ konvergiert
\item In jeder Umgebung von $b$ liegen unendlich viele Elemente von $A$.
\end{enumerate}
\end{remark}
\begin{definition}
Seien $A \subseteq X$ und $f \colon A \to Y$ und $b \in Y$. Weiterhin sei $a \in A$ oder $a$ ein Häufungspunkt von $A$. Dann ist $\lim_{x \to a}f(x) = b$, falls für jede Folge $(a_n)_{n\in\mathbb N}$ aus $A$, die gegen $a$ konvergiert, die Folge $(f(a_n))_{n\in\mathbb N}$ gegen $b$ konvergiert.
\end{definition}
\begin{definition}\
\begin{enumerate}
\item Eine Teilmenge $A$ von $X$ ist {\em abgeschlossen}, wenn sie jeden ihrer Häufungspunkte enthält.
\item Eine Teilmenge $U$ von $X$ ist {\em offen}, wenn für alle $x \in U$ $U$ eine Umgebung von $x$ ist.
\end{enumerate}
\end{definition}
\begin{example}
Seien $a \in X$ und $\varepsilon > 0$. Setze $U = U_\varepsilon(a)$. Dann ist $U$ offen.
\end{example}
\begin{proof}
Sei $x \in U$. Setze $\delta = \varepsilon - d(x,a) > 0$. Dann ist $U_\delta(x) \subseteq U$, denn sei $z \in U_\delta(x)$. Dan ist $d(z,a) \leq d(z,x) + d(x,a) < \delta + d(x,a) = \varepsilon$. Somit ist $U$ Umgebung von $X$.
\end{proof}
\begin{remark}
Sei $U \subseteq X$. Dann ist $U$ offen genau dann, wenn $X \setminus U$ abgeschlossen ist.
\end{remark}
\begin{proof}
Sei also $U$ offen. Dann ist kein $x \in U$ ein Häufungspunkt von $X \setminus U$, denn für $x \in U$ ist $U$ Umgebung von $x$ mit $U \cap (X \setminus U) = \varnothing$. Also ist $X \setminus U$ abgeschlossen. Sei umgekehrt $X \setminus U$ abgeschlossen und $x \in U$. Dann ist $x$ kein Häufungspunkt von $X \setminus U$. Somit existiert eine Umgebung $W$ von $x$ mit $W \cap (X \setminus U) \subseteq \{x\}$. Wegen $x \in U$ ist dann $W \subseteq U$. Also ist $U$ Umgebung von $x$.
\end{proof}
\begin{theorem}
Sei $f \colon X \to Y$, Dann sind folgende Aussagen äquivalent:
\begin{enumerate}
\item $f$ ist stetig
\item Für alle offenen $U \subseteq Y$ ist $f^{-1}[U]$ offen.
\item Für alle abgeschlossenen $A \subseteq Y$ ist $f^{-1}[A]$ abgeschlossen.
\end{enumerate}
\end{theorem}
\begin{proof}\
\begin{enumerate}
\item Sie $f$ stetig und $U \subseteq Y$ offen. Sei $a \in f^{-1}[U]$. Wir müssen zeigen, dass $f^{-1}[U]$ eine Umgebung von $a$ ist. Nun ist $f(a) \in U$. Wegen $U$ offen ist also $U$ eine Umgebung von $f(a)$. Wegen $f$ stetig existiert also eine Umgebung $V$ von $a$ mit $f[V] \subseteq U$. Dann ist aber $V \subseteq f^{-1}[U]$. Also ist $f^{-1}[U]$ Umgebung von $a$.
\item Sei $A \subseteq Y$ abgeschlossen. Dann ist nach obiger Bemerkung $Y \setminus A$ offen. Also $f^{-1}[Y \setminus A]$ offen. Aber $f^{-1}[Y \setminus A] = X \setminus f^{-1}[A]$. Also ist $f^{-1}[A]$ abgeschlossen
\item Sei $a \in X$. Wir müssen zeigen, dass $f$ in $a$ stetig ist. Sei also $\varepsilon > 0$. Setze $U = U_\varepsilon(f(a))$. Wegen $U$ offen ist dann $Y \setminus U$ abgeschlossen. Also $f^{-1}[Y \setminus U] = X \setminus f^{-1}[U]$ abgeschlossen. Somit ist $V = f^{-1}[U]$ offen. Wegen $a \in V$ ist also $V$ eine Umgebung von $a$ mit $f[V] \subseteq U$. \qedhere
\end{enumerate}
\end{proof}
\begin{example}
Sei $f \colon X \to \mathbb R$ stetig, $b \in \mathbb R$. Dann ist $A = \{ x \in X \colon f(x) = b \}$ abgeschlossen und $B = \{x \in X \colon f(x) < b\}$ offen. Denn $A = f^{-1}[\{b\}]$, $B = f^{-1}[(-\infty,b)]$.
\end{example}
\begin{definition}
Eine Teilmenge $A$ von $X$ ist {\em kompakt}, wenn jede Folge aus $A$ einen Häu\-fungs\-punkt besitzt, der in $A$ liegt.
\end{definition}
\begin{definition}
Eine Teilmenge $A$ von $X$ ist {\em beschränkt}, wenn es ein $b \in X$ und $r > 0$ gibt mit $A \subseteq U_r(b)$ oder wenn $A = \varnothing$.
\end{definition}
\begin{theorem}
Jede kompakte Teilmenge von $X$ ist abgeschlossen und beschränkt.
\end{theorem}
\begin{proof}
Sei $A \subseteq X$ kompakt. Wir zeigen zuerst, dass $A$ abgeschlossen ist. Sei hierzu $a$ ein Häufungspunkt von $A$. Dann existiert eine Folge $(a_n)_{n\in\mathbb N}$ aus $A \setminus \{a\}$, die gegen $a$ konvergiert. Also ist $a$ der einzige Häufungspunkt von $(a_n)_{n\in\mathbb N}$. Wegen Kompaktheit von $A$ ist also $a \in A$. Weiterhin kann $A$ nicht unbeschränkt sein. Denn nehme an, dass dies der Fall ist. Dann ist natürlich $X \neq \varnothing$. Sei also $x \in X$ Wenn $A$ unbeschränkt ist, dann ist für alle $n \geq 1$ $A$ keine Teilmenge von $U_n(x)$. Wähle also für jedes $n \geq 1$ ein $a_n \in A$ mit $a_n \not\in U_n(x)$ und setze $a_0 = x$. Dann besitzt offenbar die Folge $(a_n)_{n\in\mathbb N}$ keinen Häufungspunkt, denn jede Teilfolge von $(a_n)_{n\in\mathbb N}$ ist unbeschränkt. Also ist $A$ nicht kompakt.
\end{proof}
\begin{remark}
Die Umkehrung von Satz 8 gilt aber nicht in jedem metrischen Raum.
\end{remark}
\begin{example}
Sei $X = \{1/(n+1) \colon n \in \mathbb N\}$. Dann ist $X$ abgeschlossen (in $X$!) und beschränkt. Aber $X$ ist nicht kompakt in $X$, da $(1/(n+1))_{n\in\mathbb N}$ in $X$ keinen Häufungspunkt besitzt.
\end{example}
\begin{theorem}
Sei $A \subseteq \mathbb R^n$. Dann ist $A$ genau dann kompakt, wenn $A$ abgeschlossen und beschränkt ist.
\end{theorem}
\begin{proof}
Ist $A$ kompakt, so ist $A$ abgeschlossen und beschränkt nach Satz 8. Sei also umgekehrt $A$ abgeschlossen und beschränkt. Wir müssen zeigen, dass $A$ kompakt ist. Sei hierzu $(a_n)_{n\in\mathbb N}$ eine Folge aus $A$. Wegen $A$ beschränkt ist dann auch $(a_n)_{n\in\mathbb N}$ beschränkt. Nach Satz 3 besitzt dann $(a_n)_{n\in\mathbb N}$ einen Häufungspunkt $a$. Wegen $A$ abgeschlossen ist $a \in A$.
\end{proof}
\begin{definition}
Sei $\mathcal U \subseteq \mathcal P(X)$ und $A \subseteq X$. $\mathcal U$ ist {\em offene Überdeckung} von $A$, wenn gilt:
\begin{enumerate}
\item Jedes $U \in \mathcal U$ ist offen
\item Für alle $a \in A$ existiert $U \in \mathcal U$ mit $a \in U$.
\end{enumerate}
\end{definition}
\begin{theorem}[Heine-Borelscher Überdeckungssatz]
Eine Teilmenge $A$ von $X$ ist genau dann kompakt, wenn es für jede offene Überdeckung $\mathcal U$ von $A$ endlich viele $U_1,\ldots,U_n \in \mathcal U$ gibt mit $A \subseteq U_1 \cup \ldots \cup U_n$.
\end{theorem}
\begin{proof}
Von links nach rechts: Sei $A \subseteq X$ kompakt. Sei $\mathcal U$ eine offene Überdeckung von $A$. Für $\delta > 0$ setze $A_\delta = \{x \in A \colon \exists U \in \mathcal U \colon U_\delta(x) \subseteq U \}$. Wir zeigen zuerst ($*$) es existiert $\delta > 0$ mit $A_\delta = A$. \par
Beweis von ($*$): Nehme an, dass dies nicht der Fall ist. Dann existiert für alle $n \geq 1$ ein $x_n \in A$ mit $x_n \not\in A_{1/n}$. Wegen $A$ kompakt besitzt die Folge $(x_n)_{n \geq 1}$ einen Häufungspunkt $x \in A$. Dann existiert $U \in \mathcal U$ mit $x \in U$. Wegen $U$ offen gibt es ein $\varepsilon > 0$ mit $U_\varepsilon(x) \subseteq U$. Sei $m \in \mathbb N$ mit $1/m \leq \varepsilon/2$. Da $x$ ein Häufungspunkt von $(x_n)_{n\geq 1}$ ist, gibt es ein $k \geq m$ mit $d(x_k,x) < 1/m$. Dann ist aber für $z \in U_{1/k}(x_k)$
\[d(z,x) \leq d(z,x_k)+d(x_k,x) < 1/k + 1/m \leq 2/m \leq \varepsilon\]
Somit ist $U_{1/k}(x_k) \subseteq U_\varepsilon(x) \subseteq U$. Also $x_k \in A_{1/k}$, was ein Widerspruch zur Wahl von $x_k$ ist.
Wähle nun $\delta > 0$ wie in ($*$). Es genügt natürlich nun zu zeigen, dass es $x_1,\ldots,x_n \in A$ gibt mit $A \subseteq U_\delta(x_1) \cup \ldots \cup U_\delta(x_k)$. Nehme an, dass dies nicht der Fall ist. Dann können wir rekursiv eine Folge $(x_n)_{n\in\mathbb N}$ definieren mit $x_n \in A \setminus (U_\delta(x_0) \cup \ldots \cup U_\delta(x_{n-1}))$. Dann gilt aber für alle $m,n \in \mathbb N$ mit $m < n$, dass $d(x_m,x_n) \geq \delta$. Offenbar hat aber dann $(x_n)_{n\in\mathbb N}$ keinen Häufungspunkt. Dies ist aber ein Widerspruch zur Kompaktheit von $A$. \par
Von rechts nach links: Die andere Richtung des Satzes zeigen wir indirekt. Sei also $A \subseteq X$ nicht kompakt. Dann gibt es eine Folge $(x_n)_{n\in\mathbb N}$ aus $A$, die keinen Häufungspunkt in $A$ besitzt. Somit existiert für jedes $x \in A$ eine offene Umgebung $V_x$ von $x$ mit $\{n \in \mathbb N \colon x_n \in V_x\}$ ist endlich. Setze nun $\mathcal U = \{V_x \colon x \in A\}$. Dann ist $\mathcal U$ eine offene Überdeckung von $A$. Sind aber $V_{z_1},\ldots,V_{z_n}$ endlich viele Elemente von $\mathcal U$, so ist $\{n \in \mathbb N \colon x_n \in V_{z_1} \cup \ldots \cup V_{z_n}\}$ endlich. Also ist $A \not\subseteq V_{z_1} \cup \ldots \cup V_{z_n}$.
\end{proof}
\begin{theorem}
Sei $f \colon X \to Y$ stetig und $A \subseteq X$ kompakt. Dann ist $f[A]$ kompakt.
\end{theorem}
\begin{proof}
Sei $(y_n)_{n\in\mathbb N}$ eine Folge aus $f[A]$. Dann existiert für jedes $n \in \mathbb N$ ein $x_n \in A$ mit $y_n = f(x_n)$. Da $A$ kompakt ist, besitzt $(x_n)_{n\in\mathbb N}$ eine Teilfolge $(x_{n(k)})_{k \in\mathbb N}$, die gegen ein $x \in A$ konvergiert. Wegen $f$ stetig gilt aber dann
\[\lim_{k\to\infty}y_{n(k)} = \lim_{k\to\infty} f(x_{n(k)}) = f(x) \in f[A] \qedhere\]
\end{proof}
\begin{definition}
Sei $f \colon X \to Y$. $f$ ist {\em gleichmäßig stetig}, wenn gilt:
\[\forall \varepsilon > 0 \colon \exists \delta > 0 \colon \forall x,x' \in X \colon \left(d(x,x') < \delta \Longrightarrow d\left(f(x),f(x')\right) < \varepsilon\right)\]
\end{definition}
\begin{theorem}
Ist $f \colon X \to Y$ stetig und $X$ kompakt, so ist $f$ sogar gleichmäßig stetig.
\end{theorem}
\begin{proof}
Sei $\varepsilon > 0$. Wegen $f$ stetig gibt es zu jedem $x \in X$ ein $\delta(x) > 0$ mit $f\left[U_{\delta(x)}(x)\right] \subseteq U_{\varepsilon/2}\left(f(x)\right)$. Setze $\mathcal U = \left\{U_{\delta(x)/2}(x)\colon x \in X\right\}$. Dann ist $\mathcal U$ eine offene Überdeckung von $X$. Wegen $X$ kompakt gibt es also nach Satz 10 $x_1,\ldots,x_n \in X$ mit $X = U_{\delta(x_1)/2}(x_1) \cup \ldots \cup U_{\delta(x_n)/2}(x_n)$. Setze $\delta = \min \{ \delta(x_1)/2,\ldots,\delta(x_n)/2\} > 0$. Seien $a,a' \in X$ mit $d(a,a') < \delta$. Dann gibt es ein $1 \leq j \leq n$ mit $a \in U_{\delta(x_j)/2}(x_j)$. Wegen $d(a,a') < \delta(x_j)/2$ ist dann $a' \in U_{\delta(x_j)}(x_j)$, denn $d(a',x_j) \leq d(a',a) + d(a,x_j) < \delta(x_j)$. Somit
\[d\left((f(a),f(a')\right) \leq d\left(f(a),f(x_j)\right) + d\left(f(x_j),f(a')\right) < \varepsilon/2 + \varepsilon/2 = \varepsilon \qedhere\]
\end{proof}
\begin{definition}
Zwei Mengen $A$, $B$ heißen {\em disjunkt}, wenn $A \cap B = \varnothing$ gilt.
\end{definition}
\begin{definition}
Eine Teilmenge $A$ von $X$ ist {\em zusammenhängend}, wenn es keine disjunkten offenen Mengen $U,V$ gibt mit $A \subseteq U \cup V$, $U \cap A \neq \varnothing$ und $V \cap A \neq \varnothing$.
\end{definition}
\begin{theorem}
Eine Teilmenge von $\mathbb R$ ist genau dann zusammenhängend, wenn sie ein Intervall ist.
\end{theorem}
\begin{proof}
Die Richtung von links nach rechts zeigen wir indirekt. Sei also $A \subseteq \mathbb R$ kein Intervall. Dann gibt es Punkt $u,v \in A$ mit $u < v$ und ein $x \in X$ mit $u < x < v$ und $x \not\in A$. Setze $U = (-\infty,x)$ und $V = (x,\infty)$. Dann sind $U,V$ disjunkt, beide offen, und es gilt $A \subseteq U \cup V$, $U \cap A \neq \varnothing$ und $V \cap A \neq \varnothing$. Also ist $A$ nicht zusammenhängend. \\
Sei umgekehrt $I$ ein Intervall. Sien $U,V$ offen mit $I \in U \cup V$, $U \cap I \neq \varnothing$ und $V \cap I \neq \varnothing$. Wir müssen zeigen, dass $U$,$V$ nicht disjunkt sind. Wähle hierzu $u \in U \cap I$ und $v \in V \cap I$. Wenn $u = v$ sind wir fertig. Wir können also o.E. annehmen, dass $u < v$. Da $I$ ein Intervall ist, gilt $[u,v] \subseteq I$. Sei $s = \sup(U \cap [u,v])$. Ist $s \in U$, so wegen $U$ offen $s = v$. Also ist in diesem Fall $U \cap V \neq \varnothing$. Sei also $s \not\in U$. Wegen $s \in I$ ist dann $s \in V$. Wegen $V$ offen existiert dann $\varepsilon > 0$ mit $(s-\varepsilon,s+\varepsilon) \subseteq V$. Somit aber nach Definition von $s$ auch $U \cap V \neq \varnothing$.
\end{proof}
\begin{theorem}
Sei $f \colon X \to Y$ stetig und $A \subseteq X$ zusammenhängend. Dann ist $f[A]$ zusammenhängend.
\end{theorem}
\begin{proof}
Seien $U,V$ offene Teilmengen von $Y$ mit $f[A] \subseteq U \cup V$, $U \cap f[A] \neq \varnothing$ und $V \cap f[A] \neq \varnothing$. Wegen $f$ stetig sind $f^{-1}[U]$ und $f^{-1}[V]$ offen. Außerdem gilt $A \subseteq f^{-1}[U] \cup f^{-1}[V]$, $A \cap f^{-1}[U] \neq \varnothing$ und $A \cap f^{-1}[V] \neq \varnothing$. Wegen $A$ zusammenhängend ist also $f^{-1}[U] \cap f^{-1}[V] \neq \varnothing$. Also $U \cap V \neq \varnothing$.
\end{proof}
\begin{definition}
Für $n \in \mathbb N$ seien $f_n \colon X \to Y$ Funktionen. Weiterhin sei $f \colon X \to Y$ Funktion.
\begin{enumerate}
\item Die Folge $(f_n)_{n\in\mathbb N}$ {\em konvergiert punktweise} gegen $f$, wenn für alle $x \in X$ gilt, dass $\lim_{n\to\infty}f_n(x) = f(x)$.
\item Die Folge $(f_n)_{n\in\mathbb N}$ {\em konvergiert gleichmäßig} gegen $f$, wenn gilt:
\[\forall \varepsilon > 0 \colon \exists m \in \mathbb N \colon \forall x \in X \colon \forall n \geq m \colon d(f_n(x),f(x)) < \varepsilon\]
\end{enumerate}
\end{definition}
\begin{theorem}
Konvergiert eine Folge $(f_n)_{n\in\mathbb N}$ von stetigen Funktionen $f_n \colon X \to Y$ gleich\-mä\-ßig gegen $f$, so ist auch $f$ stetig.
\end{theorem}
\begin{proof}
Wie in §9.\vphantom{\qedhere}
\end{proof}
\section{Kurven}
\begin{definition}
Eine {\em Kurve} im $\mathbb R^n$ ist eine stetige Funktion $f \colon I \to \mathbb R^n$, wobei $I$ ein echtes Intervall ist. Sei $f = (f_1,\ldots,f_n)$. $f$ ist (stetig) {\em differenzierbar}, falls $f_1,\ldots,f_n$ (stetig) differenzierbar sind. Man definiert dann $f' \colon I \to \mathbb R^n$ durch $f'(t) = (f_1'(t),\ldots,f_n'(t))$ für $t \in I$.
\end{definition}
\begin{example}\
\begin{enumerate}
\item $f \colon [0,2\pi] \to \mathbb R^2$ definiert durch $f(t) = (r \cos t, r \sin t)$ (Kreis mit Radius $r > 0$)
\item Sei $g \colon I \to \mathbb R$ stetig, $I$ echtes Intervall. Dann ist $f \colon I \to \mathbb R^2$ definiert durch $f(t) = (t,g(t))$ eine Kurve.
\end{enumerate}
\end{example}
\begin{definition}
Sei $I = [a,b]$ ein kompaktes Intervall mit $a<b$.
\begin{enumerate}
\item Eine {\em Zerlegung} von $I$ ist eine endliche Folge $(t_0,\ldots,t_m)$ mit
\[a = t_0 < t_1 < t_2 < \ldots < t_m = b\]
\item Sei $f \colon I \to \mathbb R^n$ eine Kurve. Für eine Zerlegung $Z = (t_0,\ldots,t_m)$ von $I$ setze
\[p_f(Z) = \sum_{k=1}^m \|f(t_k) - f(t_{k-1})\|\]
\end{enumerate}
\end{definition}
\begin{definition}
Sei $f \colon I \to \mathbb R^n$ eine Kurve, wobei $I = [a,b]$ mit $a<b$. $f$ ist {\em rektifizierbar}, wenn $P_f := \{p_f(Z) \colon Z$ Zerlegung von $I\}$ beschränkt ist. Ist dies der Fall, so heißt $L := \sup P_f$ die Länge von $f$.
\end{definition}
\begin{notation}
Sei $f \colon [a,b] \to \mathbb R^n$ eine Kurve, und sei $f = (f_1,\ldots,f_n)$. Setze dann
\[\int_a^b f(t)\dd t = \left(\,\int_a^b f_1(t)\dd t\quad,\,\ldots\,,\quad\int_a^b f_n(t)\dd t\right)\]
\end{notation}
\begin{gelaber}
zur Erinnerung: Für $u =(u_1,\ldots,u_n) \in \mathbb R^n$ und $v = (v_1,\ldots,v_n) \in \mathbb R^n$ hatten wir gesetzt $\scalar{u}{v} = \sum_{i=1}^n u_iv_i$ und gezeigt $|\scalar{u}{v}| \leq \|u\| \|v\|$.
\end{gelaber}
\begin{lemma}
Sei $g \colon [a,b] \to \mathbb R^n$ eine Kurve. Dann gilt
\[\left\|\int_a^b g(t)\, dt \right\| \leq \int_a^b \|g(t)\|\dd t\]
\end{lemma}
\begin{proof}
Sei $g = (g_1,\ldots,g_n)$ und setze für $1 \leq k \leq n$ $u_k = \int_a^b g_k(t)\dd t$, sowie $u = (u_1,\ldots,u_n)$. Dann gilt
\[\|u\|^2 = \sum_{k=1}^n u_k \cdot \int_a^b g_k(t)\dd t = \int_a^b \sum_{k=1}^n u_k g_k(t)\dd t = \int_a^b \scalar{u}{g(t)}\dd t \leq \|u\| \int_a^b\|g(t)\|\dd t\]
Hieraus folgt die Behauptung, da sie für $u = 0$ trivial ist.
\end{proof}
\begin{theorem}
Jede stetig differenzierbare Kurve $f \colon [a,b] \to \mathbb R^n$ ist rektifizierbar und hat die Länge
\[L = \int_a^b \|f'(t)\|\dd t\]
\end{theorem}
\begin{proof}
Setze $L = \int_a^b\|f'(t)\|\dd t$ und $I = [a,b]$ und sei $f = (f_1,\ldots,f_n)$. Wir zeigen zuerst, dass $f$ rektifizierbar ist. Hierzu zeigen wir, dass $p_f(Z) \leq L$ für jede Zerlegung $Z$ von $I$. Sei also $Z = (t_0,\ldots,t_m)$ eine Zerlegung von $I$. Dann gilt
\begin{align*}
p_f(Z) &= \sum_{k=1}^m \|f(t_k) - f(t_{k-1})\| = \\
&= \sum_{k=1}^m \left\|\left(f_1(t_k)-f_1(t_{k-1}),\ldots,f_n(t_k)-f_n(t_{k-1})\right)\right\| = \\
&= \sum_{k=1}^m\left\|\left(\int_{t_{k-1}}^{t_k}f_1'(t)\dd t\,\,,\,\ldots\,,\,\int_{t_{k-1}}^{t_k}f_n'(t)\dd t\right)\right\| =\\
&= \sum_{k=1}^m\left\|\int_{t_{k-1}}^{t_k}f(t)\dd t\right\| \leq \sum_{k=1}^m\int_{t_{k-1}}^{t_k}\|f'(t)\|\dd t = \int_a^b\|f'(t)\|\dd t
\end{align*}
Wir zeigen nun, dass $L$ die Länge von $f$ ist. Hierzu müssen wir noch zeigen, dass für jedes $K < L$ eine Zerlegung $Z$ von $I$ existiert mit $p_f(Z) > K$. Sei also $K < L$ und setze $\varepsilon = L - K > 0$. Wegen $I$ kompakt sind $f_1',\ldots,f_k'$ gleichmäßig stetig. Also existiert ein $\delta > 0$ mit
\[|f_k'(c) - f_k'(d)| < \frac{\varepsilon}{\sqrt n (b-a)}\]
für alle $1 \leq k \leq n$ und alle $c,d \in I$ mit $|c-d| < \delta$. Wähle nun eine Zerlegung $Z = (t_0,\ldots,t_n)$ von $I$ so fein, dass für alle $1 \leq k \leq n$ $t_k - t_{k-1} < \delta$ gilt. Nach dem Mittelwertsatz der Integralrechnung gibt es $\eta_k \in [t_{k-1},t_k]$ mit $L = \sum_{k=1}^m \|f'(\eta_k)\|(t_k - t_{k-1})$. Nach dem Mittelwertsatz der Differentialrechnung gibt es $\xi_{k1},\ldots,\xi_{kn} \in [t_{k-1},t_k]$ mit $f_j(t_k) - f_j(t_{k-1}) = f_j'(\xi_{kj})(t_k-t_{k-1})$ für $j \in \{1,\ldots,n\}$. Dann gilt $|\eta_k - \xi_{kj}| < \delta$. Setzt man also $v_k = (f_1'(\xi_{k1}),\ldots,f_n'(\xi_{kn}))$, so gilt
\begin{align*}
\|f'(\eta_k) - v_k\| &= \sqrt{(f_1'(\eta_k)-f_1'(\xi_{k1}))^2 + \cdots + (f_n'(\eta_k)-f_n'(\xi_{kn}))^2} <\\
&< \sqrt{\frac{\varepsilon^2}{n(b-a)^2} + \cdots + \frac{\varepsilon^2}{n(b-a)^2}} = \frac{\varepsilon}{b-a}
\end{align*}
Somit erhalten wir
\begin{align*}
L-p_f(Z) &= \sum_{k=1}^m\|f'(\eta_k)\|(t_k-t_{k-1}) - \sum_{k=1}^m\|f(t_k)-f(t_{k-1})\| =\\
&= \sum_{k=1}^m\left(\|f'(\eta_k)(t_k-t_{k-1})\| - \|f(t_k)-f(t_{k-1})\|\right) \leq\\
&\leq \sum_{k=1}^m\|f'(\eta_k)(t_k-t_{k-1}) - (f(t_k) - f(t_{k-1}))\| =\\
&= \sum_{k=1}^m \|f'(\eta_k)(t_k-t_{k-1}) - v_k(t_k - t_{k-1})\| =\\
&= \sum_{k=1}^m \|f'(\eta_k) - v_k\|(t_k-t_{k-1}) < \frac{\varepsilon}{b-a} \cdot \sum_{k=1}^m(t_k-t_{k-1}) = \varepsilon
\end{align*}
Somit ist $p_f(Z) > K$.
\end{proof}
\begin{example}
Sei $f \colon [0,2\pi] \to \mathbb R^2, t \mapsto (r \cos t, r \sin t)$ der Kreis mit Radius $r$. Dann
\[ L = \int_0^{2\pi}\sqrt {r^2 \cos^2 t + r^2 \sin^2 t}\dd t = \int_0^{2\pi}r\dd t = 2 \pi r\]
\end{example}
\section{Mehrdimensionale Differenzierbarkeit}
\begin{gelaber}
Wir benötigen hier elementare Kenntnisse und Notationen aus der linearen
Algebra.
\end{gelaber}
\begin{convention}\
\begin{itemize}
\item Matrix = reelle Matrix
\item Im Zusammenhang mit Matrizenrechnungen betrachten wir Elemente von
$\mathbb R^n$ als Spaltenvektoren, d.h. für eine $m\times n$-Matrix A und
$x = (x_1,\ldots ,x_n) \in \mathbb R^n$ ist:
\[
Ax = A \begin{pmatrix} x_1 \\ \vdots \\ x_n \end{pmatrix}
\]
\item Außerdem unterscheiden wir nicht zwischen $m\times n$-Matrizen und
linearen Abbildungen $\mathbb R^n \to \mathbb R^m$. Ist also $A$ eine
$m\times n$-Matrix, so ist $A\colon \mathbb R^n \to \mathbb R^m, x \mapsto
Ax$. Beachte, dass $A$ stetig ist.
\end{itemize}
\end{convention}
\begin{question}
Sei $f\colon U \subseteq \mathbb R^n \to \mathbb R^m, a \in U$. Wann ist
$f$ differenzierbar in $a \in U$?
$\lim\limits_{x\to a} \frac{f(x) - f(a)}{x-a}$ gibt keinen Sinn.
\end{question}
\begin{gelaber}
Wir hatten im Fall $m = n =1$ aber schon umformuliert. Es gilt (falls $a$
Häufungspunkt von $U$):
$f$ ist differenzierbar in $a$ genau dann, wenn gilt:
Es gibt ein $c \in \mathbb R$ und eine in $a$ stetige Funktion $\tilde
r\colon U \to \mathbb R$ mit $\tilde r(a) = 0$ und $f(x) = f(a) + c(x-a) +
\tilde r(x)(x-a)$ für alle $x \in U$. Dabei ist $c$ eindeutig bestimmt und es gilt $c = f'(a)$.
Wir können (1) noch geringfügig äquivalent umformulieren zu:\par
Es gibt ein $c \in \mathbb R$ und eine $a$ stetige Funktion $r\colon U \to
\mathbb R$ mit $r(a) = 0$ und $f(x) = f(a) + c(x-a) + r(x)|x-a|$ für alle $x
\in U$.
Dies geht einfach durch die Festsetzung
\[
r(x) = \left\{\begin{array}{r l}\tilde r(x) & \quad \text{falls $a \leq x$} \\
-\tilde r(x) & \quad \text{falls $x < a$}\end{array}\right.
\]
Die Bedingung lässt sich kanonisch auf den mehrdimensionalen Fall
übertragen.
\end{gelaber}
\begin{definition}
Sei $f \colon U \to \mathbb R^m$, wobei $U \subseteq R^n$ offen sei. Weiterhin sei $a \in U$.
\begin{itemize}
\item $f$ ist {\em differenzierbar} in $a$, wenn es eine $m\times
n$-Matrix $C$ und eine in $a$ stetige Funktion $r\colon U \to \mathbb R^n$
gibt mit $r(a) = 0$ und $f(x) = f(a) + C(x-a) + r(x)\| x-a \|$ für alle $x
\in U$.
\item $f$ ist differenzierbar in einer Teilmenge $D \subseteq U$, wenn $f$ in jedem
$a \in D$ differenzierbar ist.
\item $f$ ist differenzierbar, wenn $f$ in jedem $a\in U$ differenzierbar ist.
\end{itemize}
\end{definition}
\begin{gelaber}
Für $m = n = 1$ ist dies also äquivalent zur früheren Definition. Wir
wollen zeigen, dass die Matrix $C$ durch $f$ und $a$ eindeutig bestimmt ist.
\end{gelaber}
\begin{lemma}
Sei $f \colon U\to \mathbb R^m$ mit $U \subseteq \mathbb R^n$ offen. Sei $f$
differenzierbar in $a \in U$ und seien daher $C \in \mathbb R^{m\times n}$ und
$r\colon U\to \mathbb R^m$ eine in $a$ stetige Funktion mit $r(a) = 0$ und
$f(x) = f(a) + C(x-a) + r(x)\| x-a \|$ für alle $x \in U$.\\
Dann gilt für alle $x\in \mathbb R^n$:
\[
Cx = \lim_{t\to 0} \frac{f(a + tx) - f(a)}{t}
\]
\end{lemma}
\begin{proof}
Für $t \neq 0$ mit $a + tx \in U$ gilt:
\begin{align*}
\frac{f(a + tx) - f(a)}{t} &= \frac{f(a) + Ctx + r(a+tx) \| tx \| - f(a)}{t}
=\\
&= Cx + r(a+tx) \frac{|t| \|x\|}{t}
\end{align*}
Wegen $r$ stetig in $a$ und $r(a) = 0$ ist aber $\lim_{t \to 0} r(a+tx) =
0$. Insgesamt folgt also die Behauptung.
\end{proof}
\begin{gelaber}
Ist also $f$ differenzierbar in $a$ und $C$ $m\times n$-Matrix wie in
Definition, so ist $C$ eindeutig bestimmt durch $f,a$. Wir nennen also $C$ die
{\em Ableitung} (Differential, Jacobimatrix) von $f$ im Punkt $a$ und setzen:
\[
C = f'(a) = \mathrm{D}f(a)
\]
\end{gelaber}
\begin{example}
\begin{enumerate}
\item Sei $f\colon \mathbb R^n \to \mathbb R^m$ eine konstante Abbildung,
d.h. etwa $f(x) = c$ für alle $x \in \mathbb R^n$. Dann ist für alle $a \in
\mathbb R^n$ $f'(a) = 0$, denn:
\[
f(x) = f(a) + 0(x-a) + 0\|x-a\|
\]
\item Sei $f\colon \mathbb R^n \to \mathbb R^m$ linear, d.h. etwa $f(x) = Bx$
für alle $x \in \mathbb R^n$. Dann ist für alle $a \in \mathbb R^n$ $f'(a) =
B$, denn:
\[
f(x) = f(a) + B(x-a) + 0\|x-a\| \quad\text{für alle $x\in\mathbb R^n$}
\]
\end{enumerate}
\end{example}
\begin{theorem}
Sei $f\colon U\to\mathbb R^m$ mit $U\subseteq \mathbb R^n$ offen, und sei $a\in
U$. Ist $f$ differenzierbar in $a$, so ist $f$ stetig in $a$.
\end{theorem}
\begin{proof}
Sei $f$ differenzierbar. Dann existiert $r\colon U\to\mathbb R^m$ mit $r$
stetig in $a$ und $r(a) = 0$ mit $f(x) = f(a) + \mathrm{D}\!f(a)(x-a) +
r(x)\|x-a\|$. Da $\mathrm{D}\!f(a)$ als lineare Abbildung stetig ist, ist also
auch $f$ in $a$ stetig.
\end{proof}
\begin{theorem}
Sei $f\colon U\to \mathbb R^m$ mit $U\subseteq\mathbb R^m$ offen, und sei
$a\in U$. Weiterhin sei $f = (f_1,\dotsc,f_m)$. Dann ist $f$ differenzierbar
in $a$ genau dann, wenn $f_1,\dotsc,f_m$ differenzierbar in $a$ sind.\\
Ist dies der Fall, so gilt:
\[
f'(a) = \begin{pmatrix}f_1'(a) \\ \vdots \\ f_m'(a)\end{pmatrix}
\]
\end{theorem}
\begin{proof}
Sei $f$ differenzierbar in $a \in U$. Dann existiert eine in $a$ stetige
Funktion $r\colon U\to \mathbb R^m$ mit $r(a) = 0$ und $f(x) = f(a) +
f'(a)(x-a) + r(x)\|x-a\|$ für alle $x \in U$. Seien $r = (r_1,\dotsc,r_m)$ und
$v_1,\dotsc,v_m$ die Zeilen von $f'(a)$. Ist dann $1 \leq k
\leq m$, so ist $r_k$ stetig in $a$, und es gilt $r_k(a) = 0$. Außerdem ist
$f_k(x) = f_k(a) + v_k(x-a) + r_k(x)\|x-a\|$ für alle $x \in U$. Also ist
$f_k$ differenzierbar in $a$, und es gilt $f'_k(a) = v_k$.\\
Die andere Richtung folgt analog.
\end{proof}
\begin{theorem}[Linearität]
Seien $f, g\colon U\to \mathbb R^m$ differenzierbar in $a$, $U \subseteq
\mathbb R^n$ offen, und sei $c \in \mathbb R$. Dann sind auch $f+g$ und $cf$
differenzierbar in $a$ und es gilt:
\begin{align*}
(f+g)'(a) &= f'(a) + g'(a)\\
(cf)'(a) &= cf'(a)
\end{align*}
\end{theorem}
\begin{proof}
Seien $r, s\colon U\to \mathbb R^m$ in $a$ stetig und $r(a) = s(a) = 0$ und
für alle $x\in U$:
\begin{align*}
f(x) &= f(a) + f'(a)(x-a) + r(x)\|x-a\|\\
g(x) &= g(a) + g'(a)(x-a) + s(x)\|x-a\|
\end{align*}
Dann ist für alle $x \in U$
\[
(f+g)(x) = f(x) + g(x) = (f+g)(a) + \left(f'(a) + g'(a)\right)(x-a) + (r(x) + s(x))\|x-a\|
\]
und
\[
(cf)(x) = cf(x) + cf'(a)(x-a) + cr(x)\|x-a\|
\]
Weiterhin sind $r+s$ und $cr$ in $a$ stetig und $(r+s)(a) = 0 =
cr(a)$. Hieraus folgt die Behauptung.
\end{proof}
\begin{definition}[Die Abbildungsnorm]
Sei $A$ eine lineare Abbildung von $\mathbb R^n$ nach $\mathbb R^m$. Wir
setzen dann:
\[
\|A\| = \sup\{\|Ax\|\colon x\in\mathbb R^n \text{ und } \|x\| \leq 1\}
\]
$\|A\|$ ist die Norm von $A$. Es ist $\|A\| < \infty$, denn $S = \{x\in\mathbb
R^n\colon \|x\|\leq 1\}$ ist abgeschlossen und beschränkt in $\mathbb R^n$,
also kompakt. Weiterhin ist $g\colon\mathbb R^n\to\mathbb R, x\mapsto \|Ax\|$
stetig. Also ist $g(S)$ kompakt und daher beschränkt, woraus $\|A\| = \sup
g(S) < \infty$ folgt.
\end{definition}
\begin{gelaber}
Man rechnet leicht nach, dass die Abbildungsnorm eine Norm auf dem Vektorraum
$\operatorname{Hom}(\mathbb R^n, \mathbb R^m)$ ist. Weiterhin gilt für alle
$x\in\mathbb R^n$:
\[
\|Ax\| \leq \|A\|\|x\|
\]
denn sei $x \in \mathbb R^n$. Für $x=0$ ist die Behauptung trivial. Sei also
$x\neq 0$. Setze dann $z = \frac{1}{\|x\|} x$. Also ist $\|Ax\| = \|A(\|x\|
z)\| = \| \|x\| Az \| = \|x\| \|Az\| \leq \|A\|\|x\|$.
\end{gelaber}
\begin{theorem}[Kettenregel]
Seien $U\subseteq\mathbb R^n$ und $V\subseteq\mathbb R^m$ offen, und sei
$f\colon U\to\mathbb R^m$ und $g\colon V\to\mathbb R^k$ mit $f(U) \subseteq
V$. Sei $f$ in $a$ differenzierbar und $g$ in $f(a)$ differenzierbar. Dann
ist $g\circ f$ in $a$ differenzierbar, und es gilt:
\[
(g\circ f)'(a) = g'\left(f(a)\right) f'(a)
\]
\end{theorem}
\begin{proof}
Seien $C := f'(a)$, $D := g'(f(a))$ und setze $b := f(a)$. Also ist zu zeigen,
dass $(g\circ f)'(a) = DC$. Es existieren Funktionen $r\colon U\to\mathbb R^m$
und $s\colon V\to\mathbb R^k$ mit $r$ stetig in $a$, $s$ stetig in $b$ und
$r(a) = 0 = s(b)$, sowie für alle $x\in U$ und $y\in V$:
\begin{align*}
f(x) &= f(a) + C(x-a) + r(x)\|x-a\|\\
g(y) &= g(b) + D(y-b) + s(y)\|y-b\|
\end{align*}
Dann ist für alle $x\in U$
\begin{align*}
(g\circ f)(x) &= g(f(x)) = g(b) + D(f(x) - b) + s(f(x))\|f(x) - b\|\\
&= g(b) + D(C(x-a) + r(x)\|x-a\|) + s(f(x))\|f(x) - b\|\\
&= g(b) + DC(x-a) + \eta(x)\|x-a\|
\end{align*}
mit
\[
\eta(x) = \begin{cases}
Dr(x) + s(f(x))\frac{\|f(x) - b\|}{\|x-a\|} &\quad\text{für $x\neq a$}\\
0 & \quad\text{für $x=a$}
\end{cases}
\]
Somit genüg es zu zeigen, dass $\eta$ stetig in $a$ ist, d.h. dass $\lim_{x\to
a}\eta(x) = 0$. Nun ist aber $\lim_{x\to a} r(x) = 0$, also $\lim_{x\to a}
Dr(x) = 0$. Weiterhin ist $f$ stetig in $a$, also ist wegen $s$ stetig in
$f(a)$ $\lim_{x\to a} s(f(x)) = s(f(a)) = 0$.\\
Also genügt es zu zeigen, dass eine Umgebung $W$ von $a$ existiert und ein
$K\in \mathbb R$ mit $\frac{\|f(x) - b\|}{\|x-a\|} \leq K$ für alle $x\in
U\cap W$ mit $x\neq a$. Nun ist aber für $x\in U, x\neq a$
\begin{align*}
\frac{\|f(x) - b\|}{\|x-a\|} &= \frac{\left\|C(x-a) +
r(x)\|x-a\|\right\|}{\|x-a\|}\\
&\leq \frac{\|C(x-a)\| + \left\| r(x)\|x-a\| \right\|}{\|x-a\|} \\
&\leq \frac{\|C\|\|x-a\| + \|r(x)\|\|x-a\|}{\|x-a\|} \\
&\leq \|C\| + \|r(x)\|
\end{align*}
Da $r$ stetig in $a$ ist, folgt also das Gewünschte.
\end{proof}
\begin{gelaber}
Sei $f\colon U\to\mathbb R^m$ differenzierbar in $a\in U$, wobei
$U\subseteq\mathbb R^n$ offen. Wie berechnet man $f'(a)$?\\
Ist $f = (f_1,\dots,f_m)$, so gilt nach Satz 3
\[
f'(a) = \begin{pmatrix}f_1'(a)\\\vdots\\f_m'(a)\end{pmatrix}
\]
Es genügt also den Fall $m=1$ zu betrachten. Sei also $f'(a) = v =
(c_1,\dots,c_n)$. Nach Lemma 1 gilt dann für alle $x\in\mathbb R^n$
\[
vx = \lim_{t\to 0}\frac{f(a + tx) - f(a)}{t}
\]
Speziell also für die Einheitsvektoren $e_1,\dots,e_n$
\[
c_i = v e_i = \lim_{t\to 0}\frac{f(a+te_i) - f(a)}{t}
\]
Setzt man also für $1 \leq i \leq n$ $E_i = \left\{x\in \mathbb R\colon
(a_1,\dots,a_{i-1},x,a_{i+1},\dots,a_n) \in U\right\}$ und definiert
$g_i\colon E_i\to \mathbb R,x \mapsto
f(a_1,\dots,a_{i-1},x,a_{i+1},\dots,a_n)$, so ist
\[
c_i = \lim_{t\to 0} \frac{f(a+te_i) + f(a)}{t} = \lim_{t\to 0}\frac{g_i(a_i +
t) - g_i(a_i)}{t} = g_i'(a_i)
\]
Damit ist alles auf den eindimensionalen Fall zurückgeführt, wenn wir wissen,
dass $f$ in $a$ differenzierbar ist.\par
Dies motiviert folgende Definitionen:
\end{gelaber}
\begin{definition}
Sei $U \subseteq\mathbb R^n$ offen, $f\colon U\to\mathbb R, a\in U$.
\begin{enumerate}
\item Sei $v\in \mathbb R^n$. Existiert der Grenzwert $\lim_{t\to 0}\frac{f(a
+ tv) - f(a)}{t}$, so nennt man ihn die {\em Ableitung von $f$ im Punkt $a$ in
Richtung $v$} und bezeichnet ihn mit $D_vf(a)$.
\item ist $e_i$ der $i$-te Einheitsvektor im $\mathbb R^n$, so setzen wir
$D_if(a) := D_{e_i}f(a)$. $D_if(a)$ heißt die {\em $i$-te partielle
Ableitung von $f$ in $a$}. Statt $D_if(a)$ schreibt man auch
$\frac{\partial f}{\partial x_i}$.
\item $f$ ist {\em partiell differenzierbar} in $a$, falls $D_if(a)$ für alle
$1\leq i \leq n$ existiert. Ist dies der Fall, so setzt man
\[
\grad f(a) = \left(D_1f(a), \dots, D_nf(a)\right)
\]
$\grad f(a)$ ist der {\em Gradient von $f$ im Punkt $a$}.
\item $f$ ist {\em partiell differenzierbar}, falls $f$ in jedem $a \in U$
partiell differenzierbar ist.
\end{enumerate}
\end{definition}
\begin{remark}
$f,U, a$ wie oben, $1\leq i\leq n$, $E_i = \{x\in\mathbb
R\colon (a_1,\dots,a_{i-1},x,a_{i+1},\dots,a_n) \in U\}$. Definiere
$g_i\colon E_i\to\mathbb R, x\mapsto
f(a_1,\dots,a_{i-1},x,a_{i+1},\dots,n)$. Dann ist $D_if(a) = g_i'(a_i)$.
\end{remark}
\begin{proof}
\[
D_if(a) = \lim_{t\to 0} \frac{f(a + te_i) - f(a)}{t} = \lim_{t\to 0}
\frac{g_i(a_i + t) - g_i(a_i)}{t} = g_i'(a_i) \qedhere
\]
\end{proof}
\begin{example}
Sei $f\colon\mathbb R^3\to \mathbb R, (x_1,x_2,x_3) \mapsto x_1x_2x_3 + x_1^2x_2 +
x_2x_3^2$. Dann ist für $x = (x_1,x_2,x_3) \in \mathbb R^3$:
\begin{align*}
D_1f(x) &= x_2x_3 + 2x_1x_2\\
D_2f(x) &= x_1x_3 + x_1^2 + x_3^2\\
D_3f(x) &= x_1x_2 + 2x_2x_3
\end{align*}
\end{example}
\begin{gelaber}
Der folgende Satz ist nur eine Umformulierung eines Spezialfalls von Lemma 1.
\end{gelaber}
\begin{theorem}
Sei $U\subseteq\mathbb R^n$ offen und $f\colon U\to\mathbb R$ sei
differenzierbar in $a$. Dann existiert für alle $v\in\mathbb R^n$ die
Ableitung von $f$ im Punkt $a$ in Richtung $v$, und es gilt $D_vf(a) =
f'(a)v$. Insbesondere gilt also $f'(a) = \grad f(a)$.
\end{theorem}
\begin{proof}
Nach Lemma 1 ist
\[
f'(a)v = \lim_{t\to 0}\frac{f(a + tv) - f(a)}{t} = D_vf(a)
\]
Sei $f'(a) = (c_1,\dots,c_n)$. Dann gilt für $1\leq i\leq n$
\[
c_i = f'(a)e_i = D_if(a)
\]
Also ist $f'(a) = (c_1,\dots,c_n) = \grad f(a)$.
\end{proof}
\begin{corollary}
Sei $U\subseteq \mathbb R^n$ offen und $f\colon U\to\mathbb R^m$
differenzierbar in $a$. Sei $f = (f_1,\dots,f_m)$. Dann gilt
\[
f'(a) = \begin{pmatrix}\grad f_1(a) \\ \vdots \\ \grad f_m(a)\end{pmatrix}
= \begin{pmatrix}D_1f_1(a) & \cdots & D_nf_1(a)\\ \vdots &&\vdots\\ D_1f_m(a)
& \cdots & D_nf_m(a)\end{pmatrix}
\]
\end{corollary}
\begin{proof}
Nach Satz 3 sind $f_1,\dots,f_m$ differenzierbar in $a$, und es gilt
\[
f'(a) = \begin{pmatrix}f_1'(a)\\ \vdots \\ f_m'(a)\end{pmatrix}
\]
Somit folgt aus Satz 6 die Behauptung.
\end{proof}
\begin{gelaber}
Aber aus der partiellen Differenzierbarkeit von einer Funktion $f\colon
U\to\mathbb R$ in $a$ folgt nicht die Differenzierbarkeit von $f$ in $a$. Es
folgt nicht einmal, dass $f$ stetig in $a$ ist.
\end{gelaber}
\begin{example}
Sei $f\colon\mathbb R^2\to\mathbb R$ definiert durch:
\[
f(x_1, x_2) = \begin{cases}\frac{x_1x_2}{x_1^2 + x_2^2} &\quad\text{für
$(x_1,x_2)\neq(0,0)$}\\
0&\quad\text{sonst}\end{cases}
\]
$f$ ist partiell differenzierbar, denn:\\
Sei $(x_1,x_2)\in\mathbb R^2$. Ist $(x_1,x_2) \neq (0,0)$, so ist $f$ offenbar
partiell differenzierbar in $(x_1,x_2)$. Weiterhin:
\begin{align*}
D_1f(0,0) &= \lim_{t\to 0}\frac{f(t,0) - f(0,0)}{t} = 0\\
D_2f(0,0) &= \lim_{t\to 0}\frac{f(0,t) - f(0,0)}{t} = 0
\end{align*}
$f$ ist jedoch in $0$ nicht stetig, denn sei $a_k = (1/k, 1/k)$. Dann ist
$\lim_{k\to\infty} a_k = 0$, aber $\lim_{k\to\infty} f(1/k, 1/k) =
\lim_{k\to\infty} 1/2 = 1/2 \neq 0$.
\end{example}
\begin{theorem}
Sei $U\subseteq\mathbb R^n$ offen und $f\colon U\to\mathbb R$ partiell
differenzierbar. Sind alle partiellen Ableitungen von $f$ in $a\in U$ stetig,
so ist $f$ differenzierbar in $a$.
\end{theorem}
\begin{proof}
Sei $v = \grad f(a) = (D_1f(a),\dots,D_nf(a))$. Definiere dann den Rest
$r\colon U\to\mathbb R$ durch
\[
r(x) = \begin{cases}
\frac{f(x) - f(a) - v(x-a)}{\|x-a\|} & \quad\text{falls $x\in U\setminus\{a\}$}\\
0 & \quad\text{falls $x=a$}
\end{cases}
\]
Dann ist für alle $x\in U$:
\[
f(x) = f(a) + v(x-a) + r(x)\|x-a\|
\]
Also genügt es zu zeigen, dass $r$ in $a$ stetig ist, d.h. dass gilt
$\lim_{x\to a} r(x) = 0$.\par
Sei hierzu $\varepsilon > 0$. Da $D_1f,\dots,D_nf$ in $a$ stetig sind,
existiert $\delta > 0$ mit $U_\delta(a)\subseteq U$ und
\[
|D_if(x) - D_if(a)| < \frac{\varepsilon}{n}\quad\text{für alle $x\in
U_\delta(a)$ und alle $1\leq i \leq n$}
\]
Wir zeigen, dass $|r(x)| < \varepsilon$ für alle $x\in U_\delta(a)$. Sei also
$x\in U_\delta(a)$, $x=(x_1,\dots,x_n)$. Weiterhin sei
$a=(a_1,\dots,a_n)$. Ohne Einschränkung sei $x\neq a$. Für $i\leq n$ setze
$v_i = (x_1,\dots,x_i,a_{i+1},\dots,a_n)$. Dann ist $d(v_i,a) =
\sqrt{\sum_{k=1}^i(x_k-a_k)^2} \leq \sqrt{\sum_{k=1}^n(x_k-a_k)^2} = d(x,a) <
\delta$. Also $v_i \in U_\delta(a)$. Beachte, dass $v_0 = a$ und $v_n = x$,
also $f(x) - f(a) = \sum_{i=1}^n f(v_i) - f(v_{i-1})$. Nun existiert für alle
$1\leq i\leq n$ eine $w_i\in U_\delta(a)$ mit
\[
f(v_i) - f(v_{i-1}) = D_if(w_i)(x_i - a_i)
\]
Ist $x_i = a_i$, so ist die Behauptung trivial. Sei also $x_i\neq a_i$ und
etwa $a_i < x_i$. Dann ist $(x_1,\dots,x_{i-1},t,a_{i+1},\dots,a_n) \in
U_\delta(a)$ für alle $t\in [a_i,x_i]$. Wir können also $g_i\colon
[a_i,x_i]\to \mathbb R$ definieren durch $g_i(t) =
f(x_1,\dots,x_{i-1},t,a_{i+1},\dots,a_n)$. Nach Voraussetzung ist dann $g_i$
differenzierbar, denn es ist $g_i'(t) =
D_if(x_1,\dots,x_{i-1},t,a_{i+1},\dots,a_n)$. Nach dem Mittelwertsatz der
Differentialrechnung existiert also ein $\xi_i \in (a_i,x_i)$ mit $g_i(x_i) -
g_i(a_i) = g_i'(\xi_i)(x_i - a_i)$. Setze dann $w_i =
(x_1,\dots,x_{i-1},\xi_i,a_{i+1},\dots,a_n)$. Dann ist
\[f(v_i) - f(v_{i-1}) = g_i(x_i) - g_i(a_i) = g_i'(\xi_i)(x_i-a_i) = D_if(w_i)(x_i-a_i)\]
und $w_i \in U_\delta(a)$. Falls $x_i < a_i$ betrachte analog $[x_i,
a_i]$. Insgesamt erhalten wir schließlich
\begin{align*}
|r(x)| &= \left|\frac{f(x) - f(a) - v(x-a)}{\|x-a\|}\right| = \\
&= \frac{\left|\sum_{i=1}^n f(v_i) - f(v_{i-1}) -
\sum_{i=1}^nD_if(a)(x_i-a_i)\right|}{\|x-a\|} = \\
&= \frac{\left|\sum_{i=1}^n(D_if(w_i) - D_if(a))(x_i-a_i)\right|}{\|x-a\|}
\leq \\
&\leq \sum_{i=1}^n |D_if(w_i) -
D_if(a)|\underbrace{\frac{|x_i-a_i|}{\|x-a\|}}_{\leq 1} <
n\frac{\varepsilon}{n} = \varepsilon \qedhere
\end{align*}
\end{proof}
\begin{corollary}
Sei $U\subseteq\mathbb R^n$ offen und $f\colon U\to\mathbb R^m$ und sei
$f=(f_1,\dots,f_m)$. Seien $f_1,\dots,f_m$ partiell differenzierbar. Sind alle
partiellen Ableitungen von $f_1,\dots,f_m$ in $a\in U$ stetig, so ist $f$ in
$a$ differenzierbar.
\end{corollary}
\begin{proof}
Nach Satz 7 sind $f_1,\dots,f_m$ differenzierbar in $a$. Also ist $f$
differenzierbar in $a$.
\end{proof}
\begin{definition}
Sei $U\subseteq\mathbb R^n$ offen, $f\colon U\to\mathbb R^m$ und sei
$f=(f_1,\dots,f_m)$. $f$ ist {\em stetig differenzierbar}, wenn $f$
differenzierbar ist und alle partiellen Ableitungen $D_if_j$ für $1\leq i \leq
n, 1\leq j\leq m$ stetig sind.
\end{definition}
\begin{remark}
Sei $f$ wie oben differenzierbar. Wir können eine $m\times n$-Matrix
$A=(a_{ij})_{i,j}$ mit dem Vektor
\[(a_{11},\dots,a_{1n},\dots,a_{m1},\dots,a_{mn}) \in \mathbb R^{mn}\]
identifizieren. Dann ist $f$ stetig differenzierbar genau dann, wenn die
Abbildung $f'\colon U\to\mathbb R^{mn}$ stetig ist. (Dies gilt auch für die Abbildungsnorm!)
\end{remark}
\begin{definition}
Für $a,b\in\mathbb R^n$ sei $[a,b] = \{a+t(b-a)\colon 0\leq t \leq
1\}$. $[a,b]$ ist die {\em Strecke} von $a$ nach $b$.
\end{definition}
\begin{remark}
Für $a,b \in\mathbb R, a\leq b$ stimmt diese Notation mit der
Intervallnotation überein.
\end{remark}
\begin{theorem}[Mittelwertsatz]
Sei $U\subseteq\mathbb R^n$ offen und $f\colon U\to\mathbb R^m$ stetig
differenzierbar. Weiterhin seien $a,b \in U$ und $[a,b]\subseteq U$. Dann
gilt:
\[
f(b) - f(a) = \int_0^1 f'(a + t(b-a))(b-a)\dd t
\]
\end{theorem}
\begin{proof}
Sei $V = \{t\in\mathbb R\colon a+t(b-a) \in U\}$. Dann ist $V$ offen und nach
Voraussetzung $[0,1]\subseteq V$. Definiere $g\colon V\to\mathbb R^m$ durch
$g(t) = f(a+t(b-a))$. Also ist $g(0) = f(a)$ und $g(1) = f(b)$. Nach
Kettenregel ist $g$ differenzierbar, und es gilt:
\[
g'(t) = f'(a+t(b-a))(b-a)
\]
Da $f'$ stetig ist, ist also auch $g'$ stetig. Sei jetzt
$g=(g_1,\dots,g_m)$. Dann gilt:
\begin{align*}
f(b) - f(a) &= g(1) - g(0)\\
&= (g_1(1) - g_1(0),\dots,g_m(1) - g_m(0))\\
&= \left( \int_0^1 g_1'(t)\dd t,\dots,\int_0^1 g_m'(t)\dd t \right)\\
&= \int_0^1g'(t)\dd t \qedhere
\end{align*}
\end{proof}
\begin{remark}
Sei oben $m=n=1$. Dann hat man
\[
f(b) - f(a) = \int_0^1 f'(a+t(b-a))(b-a) \dd t = (b-a)\int_0^1 f'(a + t(b-a))
\dd t
\]
Aber nach dem Mittelwertsatz der Integralrechnung existiert ein $0\leq t_0 \leq
1$ mit
\[
\int_0^1 f'(a + t(b-a))\dd t = f'(a+t_0(b-a))
\]
Setze also $\xi_0 = a + t_0(b-a)$. Dann gilt $f(b) - f(a) = f'(\xi_0)(b-a)$.
\end{remark}
\begin{theorem}[Schrankensatz]
Seien $U\subseteq\mathbb R^n$ offen und $f\colon U\to\mathbb R^m$ stetig
differenzierbar. Weiterhin seien $a,b\in U$ mit $[a,b]\subseteq U$. Setze $M =
\sup\{\|f'(x)\|\colon x\in [a,b]\} < \infty$. Dann gilt $\|f(b) - f(a)\| \leq M\|b-a\|$.
\end{theorem}
\begin{proof}
Beachte, dass $M = \sup\{\|f'(a+t(b-a))\|\colon t\in [0,1]\}$. Setze zur
Abkürzung $h(t) = f'(a + t(b-a))(b-a)$. Nach Mittelwertsatz gilt:
\[
\|f(b) - f(a)\| = \left\| \int_0^1 h(t) \dd t \right\|
\]
Da $h$ stetig ist, gilt nach Lemma 1 aus Paragraph 11
\[
\left\|\int_0^1 h(t)\dd t\right\| \leq \int_0^1\|h(t)\|\dd t
\]
Setze nun $M^* = \sup\{\|h(t)\|\colon t\in[0,1]\}$. Dann gilt
$\int_0^1\|h(t)\|\dd t \leq M^*$. Aber für $t\in[0,1]$ ist $\|h(t)\| = \|f'(a
+ t(b-a))(b-a)\| \leq \|f'(a + t(b-a))\|\|b-a\| \leq M \|b-a\|$. Also ist $M^*
\leq M\|b-a\|$.
Insgesamt $\|f(b)-f(a)\|\leq M\|b-a\|$.
\end{proof}
\begin{remark}
Beachte, dass in Satz 9 $M < \infty$, da die Abbildungsnorm stetig ist und
$[a,b]$ kompakt ist.
\end{remark}
\begin{remark}
Im Schrankensatz wird die Schranke $M$ mit Hilfe der Abbildungsnorm
definiert. Für $m=1$ oder $n=1$ stimmt diese aber mit der euklidischen Norm
überein. Sei zuerst $m=1$. Sei also $v=(v_1,\dots,v_n), v\neq 0$
und $\|v\|'$ die Abbildungsnorm, $\|v\|$ die euklidische Norm. Für
$(x_1,\dots,x_n) = x\in\mathbb R^n$ mit $\|x\|\leq 1$ gilt dann $\|v x\| =
\|\scalar{v}{x}\| \leq \|v\|\|x\| \leq \|v\|$. Also $\|v\|' \leq
\|v\|$. Andererseits gilt für $x = \frac{v}{\|v\|}$, dass $\|x\| = 1$
und $vx
= \frac{\scalar{v}{v}}{\|v\|} = \|v\|$. Also $\|v\| \leq \|v\|'$.
Sei nun $n=1$, $v = (v_1,\dots,v_n) \in \mathbb R^m$ und $\|v\|'$ die
Abbildungsnorm, $\|v\|$ die euklidische Norm. Dann gilt
\[
\|v\|' = \sup\{\|vx\|\colon x\in\mathbb R, |x| \leq 1\} = \sup\{|x|\|v\|\colon
x\in\mathbb R, |x| \leq 1\} = \|v\|
\]
\end{remark}
\begin{definition}
Für $a_0,\dots,a_k \in \mathbb R^n$ setze
\[
[a_0,a_1,\dots,a_k] := \bigcup_{i=1}^k [a_{i-1},a_i]
\]
$[a_0,a_1,\dots,a_k]$ ist ein \emph{Streckenzug von $a_0$ nach $a_k$}.
\end{definition}
\begin{lemma}
Sei $U\subseteq\mathbb R^n$ offen. Dann ist $U$ genau dann zusammenhängend,
wenn es für alle $a,b\in U$ einen Streckenzug $S$ von $a$ nach $b$ gibt mit
$S\subseteq U$.
\end{lemma}
\begin{proof}
Sei $U$ zusammenhängend und seien $a,b\in U$. Setze
\[
V_0 = \{x\in U\colon \exists S \text{ Streckenzug von $a$ nach
$x$}. S\subseteq U\}.
\]
\begin{enumerate}
\item $V_0$ ist offen, denn sei $x\in V_0$. Wegen $U$ offen existiert ein
$\varepsilon > 0$ mit $U_\varepsilon(x)\subseteq U$. Dann ist aber auch
$U_\varepsilon(x)\subseteq V_o$, denn sei $w\in U_\varepsilon(x)$. Wegen
$x\in V_0$ existiert ein Streckenzug $S = [a_0,\dots,a_k]$ von $a$ nach $x$
mit $S\subseteq U$. Wegen $w \in U_\varepsilon(x)$ ist aber $[x,w] \subseteq
U_\varepsilon(x) \subseteq U$. Also ist $T = [a_0,\dots,a_k,w]$ ein
Streckenzug von $a$ nach $w$ mit $T\subseteq U$. Somit ist $w\in V_0$. Also
ist $U_\varepsilon(x)\subseteq V_0$.
\item $V_1 = U\setminus V_0$ ist offen, denn sei $x \in V_1$. Wegen $U$ offen
existiert ein $\varepsilon > 0$ mit $U_\varepsilon(x)\subseteq U$. Dann ist
aber auch $U_\varepsilon(x)\subseteq V_1$, denn andernfalls existiert ein
$w\in U_\varepsilon(x)$ mit $w\not\in V_1$. Also ist wegen $w \in U$ $w \in
V_0$. Also existiert ein Streckenzug $S = [a_0,\dots,a_k]$ von $a$ nach $w$
mit $S\subseteq U$. Nun ist aber $[w,x]\subseteq U_\varepsilon(x)\subseteq
U$. Also ist $T = [a_0,\dots,a_k,x]$ ein Streckenzug von $a$ nach $x$ mit
$T\subseteq U$. Somit wäre $x \in V_0$, was ein Widerspruch ist.
\end{enumerate}
Somit ist $U = V_0\cup V_1$, $V_0$ und $V_1$ sind offen, $V_0\cap V_1 =
\emptyset$. Wegen $a \in V_0$ ist $V_0 \neq \emptyset$. Da $U$ zusammenhängend
ist, ist also $V_1 = \emptyset$, d.h. $V_0 = U$. Somit ist $b\in V_0$, woraus
das Gewünschte folgt.
Sei umgekehrt die rechte Seite von Lemma 10 erfüllt. Wir müssen zeigen, dass
$U$ zusammenhängend ist. Seien $V_0,V_1$ offen mit $U\subseteq V_0 \cup V_1$,
$U\cap V_0 \neq \emptyset \neq U\cap V_1$. Wir müssen zeigen, dass $V_0\cap
V_1 \neq \emptyset$. Wähle hierzu $a\in U\cap V_0$ und $b\in U\cap V_1$. Sei
also $S=[a_0,\dots,a_k]$ ein Streckenzug von $a$ nach $b$ mit $S\subseteq
U$. Definiere $f\colon[0,k]\to\mathbb R^n$ durch $f(j + t) = a_j + t(a_{j+1} -
a_j)$ für $j\in\{0,\dots,k-1\}$ und $0\leq t \leq 1$. Dann ist $f$ stetig und
$f\left([0,k]\right) = S$. Also sind $f^{-1}(V_0)$ und $f^{-1}(V_1)$ offen (in
$[0,k]$), $f^{-1}(V_0) \cap [0,k] \neq \emptyset \neq f^{-1}(V_1)\cap [0,k]$
und $[0,k] \subseteq f^{-1}(V_0) \cup f^{-1}(V_1)$. Wegen $[0,k]$
zusammenhängend ist also $f^{-1}(V_0) \cap f^{-1}(V_1) \neq \emptyset$ und
somit $V_0 \cap V_1 \neq \emptyset$.
\end{proof}
\begin{theorem}
Seien $U\subseteq\mathbb R^n$ offen und zusammenhängend und $f\colon
U\to\mathbb R^n$ differenzierbar. Ist $f' = 0$, so ist $f$ konstant.
\end{theorem}
\begin{proof}
Seien $a,b \in U$. Wir müssen zeigen, dass $f(a) = f(b)$. Nach Lemma 10
existiert ein Streckenzug $S = [a_0,\dots,a_k]$ von $a$ nach $b$ mit
$S\subseteq U$. Nach dem Schrankensatz gilt dann, dass $f(a_{j+1}) - f(a_j) =
0$ für alle $j < k$. Also $f(a) = f(a_0) = f(a_1) = \dots = f(a_k) = f(b)$.
\end{proof}
\begin{definition}
Seien $U \subseteq \mathbb R^n$ offen und $f \colon U \to \mathbb R$ differenzierbar.
\begin{enumerate}
\item $f$ ist {\em zweimal differenzierbar}, wenn $f'$ auch differenzierbar ist.
\item $f$ ist {\em zweimal stetig differenzierbar}, wenn $f'$ sogar stetig differenzierbar ist.
\end{enumerate}
\end{definition}
\begin{remark}
Sei $f$ zweimal differenzierbar. Dann ist nach Satz 6 $f' = (D_1f,\dots,D_nf)$. Wegen $f'$ differenzierbar ist also nach Satz 3 für $1 \leq i \leq n$ $D_if$ differenzierbar. Nach Satz 6 ist aber dann $D_if$ partiell differenzierbar. Für $1 \leq j \leq n$ existieren also $D_jD_if$. Ist $f$ sogar zweimal stetig differenzierbar, so ist $D_jD_if$ stetig.
\end{remark}
\begin{theorem}[Satz von Schwarz]
Seien $U \subseteq \mathbb R^n$ offen und $f \colon U \to \mathbb R$ zweimal stetig differenzierbar. Dann gilt für alle $1 \leq i,j \leq n$
\[D_jD_if = D_iD_jf\]
\end{theorem}
\begin{proof}
Da ja bei der partiellen Differentiation nach $x_i$ die anderen Variablen fest gehalten werden, können wir o.E. annehmen, dass $n=2$, $i=1$, $j=2$. Sei nun $a = (a_1,a_2) \in \mathbb R^2$. Wir wollen zeigen, dass $D_2D_1f(a) = D_1D_2f(a)$. Wegen $U$ offen existiert ein $\rho > 0$ mit $U_\rho(a) \subseteq U$. Setze $\varepsilon = \rho/\sqrt{2}$ und $V = \{(x_1,x_2) \in \mathbb R^2 \colon |x_1-a_1| < \varepsilon \wedge |x_2 - a_2| < \varepsilon\}$. Dann ist $V \subseteq U_\rho(a) \subseteq U$. Für $0 < \delta < \varepsilon$ setze $V_\delta = \{(x_1,x_2) \in \mathbb R^2 \colon |x_1-a_1| < \delta \wedge |x_2-a_2| < \delta\}$. Wir zeigen zuerst für alle $0 < \delta < \varepsilon$, dass $w,x \in V_\delta$ existieren mit $D_2D_1f(w) = D_1D_2f(x)$. Sei dafür $0 < \delta < \varepsilon$ und $b_k = a_k + \delta$ für $k = 1,2$. Definiere $g \colon [a_1,b_1] \to \mathbb R$ durch $g(t) = f(t,b_2) - f(t,a_2)$. Da $g$ differenzierbar ist, existiert ein $\xi \in [a_1,b_1]$ mit $g(b_1) - g(a_1) = g'(\xi)(b_1-a_1) = (D_1f(\xi,b_2) - D_1f(\xi,a_2))\cdot \delta$. Definiere nun $h \colon [a_2,b_2] \to \mathbb R$ durch $h(t) = D_1f(\xi,t)$. Da auch $h$ differenzierbar ist, existiert nach dem Mittelwertsatz ein $\eta \in [a_2,b_2]$ mit $h(b_2) - h(a_2) = h'(\eta)(b_2-a_2) = D_2D_1f(\xi,\eta)\cdot \delta$. Insgesamt erhalten wir also $(\xi,\eta) \in V_\delta$ und
\begin{align*}
f(b_1,b_2) - f(b_1,a_2) - f(a_1,b_2) + f(a_1,a_2) &= g(b_1) - g(a_1) =\\
&= (D_1f(\xi,b_2) - D_1f(\xi,a_2)) \cdot \delta =\\
&= (h(b_2) - h(a_2)) \cdot \delta = D_2D_1f(\xi,\eta) \cdot \delta^2
\end{align*}
Indem wir analog die Funktion $\tilde g \colon [a_2,b_2] \to \mathbb R$ definiert durch $\tilde g(t) = f(b_1,t) - f(a_1,t)$ betrachten, finden wir $(\tilde \xi, \tilde \eta) \in V_\delta$ mit
\[f(b_1,b_2) - f(a_1,b_2) - f(b_1,a_2) + f(a_1,a_2) = \tilde g(b_2) - \tilde g(a_2) = D_1D_2f(\tilde \xi, \tilde \eta) \cdot \delta^2\]
Setze nun $w = (\xi,\eta)$, $x = (\tilde \xi, \tilde \eta)$. Dann sind $w,x \in V_\delta$ und damit $D_2D_1f(w) = D_1D_2f(x)$. Also können wir nun zwei Folgen $(w_k)_{k\in\mathbb N}$ und $(x_k)_{k \in \mathbb N}$ aus $U$ definieren mit $\lim_{k\to\infty} w_k = a = \lim_{k\to\infty}x_k$ und $D_2D_1f(w_k) = D_1D_2f(x_k)$. Da $D_2D_1f$ und $D_1D_2f$ stetig sind, folgt dann
\[D_2D_1f(a) = \lim_{k\to\infty}D_2D_1f(w_k) = \lim_{k\to\infty}D_1D_2f(x_k) = D_1D_2f(a) \qedhere\]
\end{proof}
\begin{definition}
Seien $U \subseteq R^n$ offen und $f \colon U \to \mathbb R$ zweimal differenzierbar. Für $a \in U$ setzen wir dann
\[\hess f(a) = \left(D_iD_jf(a)\right)_{1 \leq i,j \leq n}\]
$\hess f(a)$ ist die {\em Hessesche Matrix} von $f$ im Punkt $a$. $\hess f(a)$ ist also eine $n \times n$-Matrix. Ist $f$ zweimal stetig differenzierbar, so ist nach Satz 12 $\hess f(a)$ symmetrisch, d.h. falls $\hess f(a) = (a_{ij})_{1 \leq i,j \leq n}$, so $a_{ij} = a_{ji}$ für alle $1 \leq i,j \leq n$.
\end{definition}
\begin{remark}
Es ist einfach $\hess f(a) = f''(a)$.
\end{remark}
\begin{theorem}[Taylorformel vom Grad 2]
Seien $U \subseteq \mathbb R^n$ offen und $f \colon U \to \mathbb R$ zweimal stetig differenzierbar. Weiterhin sei $a \in U$ und sei $A = \hess f(a)$. Dann existiert eine in $a$ stetige Funktion $r \colon U \to \mathbb R$ mit $r(a) = 0$ und $f(x) = f(a) + f'(a)(x-a) + \frac{1}{2}(x-a)^TA(x-a) + r(x)\|x-a\|^2$
\end{theorem}
\begin{proof}
Definiere $r \colon U \to \mathbb R$ durch
\[r(x) = \left\{\begin{matrix}\displaystyle\frac{f(x)-f(a)-f'(a)(x-a) - \frac{1}{2}(x-a)^TA(x-a)}{\|x-a\|^2} & \text{falls $x \neq a$} \\ 0 & \text{falls $x = a$}\end{matrix}\right.\]
Wir müssen zeigen, dass $r$ in $a$ stetig ist. Hierzu zeigen wir: Sei $\delta > 0$ mit $U_\delta(a) \subseteq U$. Dann existiert für alle $x = (x_1,\dots,x_n) \in U_\delta(a) \setminus \{a\}$ ein $\xi \in [a,x]$ mit
\[r(x) = \frac{1}{2}\sum_{i,j = 1}^n\left(D_iD_jf(\xi) - D_iD_jf(x)\right) \cdot \frac{x_i-a_i}{\|x-a\|} \cdot \frac{x_j-a_j}{\|x-a\|}\]
Hieraus folgt das Gewünschte. Denn sei $\varepsilon > 0$. Wegen $D_iD_jf$ stetig für $1 \leq i,j \leq n$ existiert dann $\delta > 0$ mit $U_\delta(a) \subseteq U$ und $|D_iD_jf(w) - D_iD_jf(a)| < \varepsilon/n^2$ für alle $1 \leq i,j \leq n$ und alle $w$ mit $\|w-a\| < \delta$. Sei nun $x = (x_1,\dots,x_n) \in U_\delta(a) \setminus \{a\}$. Wähle hierzu $\xi \in [a,x]$ wie oben. Dann ist $\xi \in U_\delta(a)$, also $\|\xi-a\| < \delta$. Somit gilt
\begin{align*}
|r(x)| &\leq \left|\sum_{i,j=1}^n\left(D_iD_jf(\xi)-D_iD_jf(a)\right)\cdot\frac{x_i-a_i}{\|x-a\|}\cdot\frac{x_j-a_j}{\|x-a\|}\right| \leq\\
& \leq \sum_{i,j=1}^n\left|D_iD_jf(\xi)-D_iD_jf(a)\right|\cdot\frac{|x_i-a_i|}{\|x-a\|}\cdot\frac{|x_j-a_j|}{\|x-a\|} < n^2 \cdot \frac{\varepsilon}{n^2} = \varepsilon
\end{align*}
Jetzt bleibt noch die obige Behauptung zu zeigen. Sei hierzu $\delta > 0$ mit $U_\delta(a) \subseteq U$ und $x = (x_1,\dots,x_n) \in U_\delta(a) \setminus \{a\}$. Setze $z = x - a$, und sei $z = (z_1,\ldots,z_n)$. Sei $V = \{t \in \mathbb R \colon a + t z \in U\}$ und definiere $g \colon V \to \mathbb R$ durch $g(t) = f(a+tz)$. Dann ist $V$ offen und nach Kettenregel ist
\[g'(t) = f'(a+tz) \cdot z = \sum_{j=1}^nD_jf(a+tz) \cdot z_j\]
Somit ist auch $g'$ differenzierbar und es gilt
\[g''(t) = \sum_{j=1}^n((D_jf)'(a+tz) \cdot z) \cdot z_j = \sum_{i=1}^n\sum_{j=1}^nD_iD_jf(a+tz)z_iz_j\]
Nach der Taylorformel aus §9 (Lagrangesches Restglied) angewandt auf $g$ im Punkt $0$ existiert ein $t_0 \in [0,1]$ mit $g(1) = g(0) + g'(0) + \frac{1}{2}g''(t_0) = g(0) + g'(0) + \frac{1}{2}g''(0) + \frac{1}{2}(g''(t_0) - g''(0))$. Setze nun $\xi = a + t_0 z \in [a,x]$. Dann gilt
\[f(x) = g(1) = f(a) + f'(a)z + \frac{1}{2}z^T\!\!Az + \frac{1}{2}\sum_{i,j=1}^n(D_iD_jf(\xi) - D_iD_jf(a))z_iz_j\]
also
\[r(x) = \frac{1}{2}\sum_{i,j=1}^n(D_iD_jf(\xi) - D_iD_jf(a))\frac{z_i}{\|z\|}\frac{z_j}{\|z\|}\qedhere\]
\end{proof}
\begin{definition}
Seien $U \subseteq \mathbb R^n$ offen, $f \colon U \to \mathbb R$ und $a \in U$.
\begin{itemize}
\item $f$ hat in $a$ ein {\em lokales Maximum}, wenn eine Umgebung $W$ von $a$ existiert mit $f(x) \leq f(a)$ für alle $x \in W \cap U$.
\item $f$ hat in $a$ ein {\em lokales Minimum}, wenn eine Umgebung $W$ von $a$ existiert mit $f(x) \geq f(a)$ für alle $x \in W \cap U$.
\item $f$ hat in $a$ ein {\em lokales Extremum}, wenn $f$ in $a$ ein lokales Maximum oder ein lokales Minimum hat.
\end{itemize}
\end{definition}
\begin{theorem}
Seien $U \subseteq \mathbb R^n$ offen und $f \colon U \to \mathbb R$ partiell differenzierbar in $a \in U$. Besitzt $f$ in $a$ ein lokales Extremum so gilt $\grad f(a) = 0$.
\end{theorem}
\begin{proof}
Sei o.E $a \in U$ lokales Maximum von $f$ (sonst betrachte $-f$). Dann existiert $\varepsilon > 0$ mit $U_\varepsilon(a) \subseteq U$ und $f(x) \leq f(a)$ für alle $x \in U_\varepsilon(a)$. Sei nun $1 \leq j \leq n$. Wir müssen zeigen, dass $D_jf(a) = 0$. Nun ist für alle $t \in (- \varepsilon, \varepsilon)$ $a + t e_j \in U_\varepsilon(a) \subseteq U$. Wir können also $g_j \colon (- \varepsilon, \varepsilon) \to \mathbb R$ definieren durch $g_j(t) = f(a + t e_j)$. $g_j$ besitzt in $0$ ein lokales Maximum und ist in $0$ differenzierbar, da $g'(0) = D_jf(a)$. Also ist $0 = g_j'(0) = D_jf(a)$.
\end{proof}
\begin{definition}
Sei $A$ eine symmetrische $n \times n$-Matrix.
\begin{itemize}
\item $A$ ist {\em positiv definit}, falls $x^T\!\!Ax > 0$ für alle $x \in \mathbb R^n \setminus \{0\}$.
\item $A$ ist {\em negativ definit}, falls $x^T\!\!Ax < 0$ für alle $x \in \mathbb R^n \setminus \{0\}$.
\item $A$ ist {\em indefinit}, falls es $x,y \in \mathbb R^n$ gibt mit $x^T\!\!Ax > 0$ und $y^T\!\!Ay < 0$.
\end{itemize}
\end{definition}
\begin{theorem}
Seien $U \subseteq \mathbb R^n$ offen und $f \colon U \to \mathbb R$ zweimal stetig differenzierbar. Weiterhin sei $a \in U$ mit $f'(a) = 0$. Dann gilt
\begin{enumerate}[(a)]
\item Ist $\hess f(a)$ positiv definit, so hat $f$ in $a$ ein lokales Minimum
\item Ist $\hess f(a)$ negativ definit, so hat $f$ in $a$ ein lokales Maximum
\item Ist $\hess f(a)$ indefinit, so hat $f$ in $a$ kein lokales Extremum
\end{enumerate}
\end{theorem}
\begin{proof}
Sei $A = \hess f(a)$. Nach der Taylorformel existiert wegen $f'(a) = 0$ eine in $a$ stetige Funktion $r \colon U \to \mathbb R$ mit $r(a) = 0$ und $f(x) = f(a) + \frac{1}{2}(x-a)^TA(x-a) + r(x)\|x-a\|^2$ für alle $x \in U$.
\begin{enumerate}[zu (a):]
\item Sei $A$ positiv definit. Setze $K = \{x \in \mathbb R^n \colon \|x\| = 1\}$. Da $K$ kompakt und $x \mapsto x^T\!\!Ax$ stetig ist, existiert ein $z \in K$ mit $z^T\!\!Az = \min \{x^T\!\!Ax \colon x \in K\} =: \alpha$. Da $A$ positiv definit ist, ist $\alpha > 0$. Wegen $\lim_{x \to a}r(x) = 0$ existiert also ein $\delta > 0$ mit $U_\delta(a) \subseteq U$ und $|r(x)| < \alpha/2$ für alle $x \in U_\delta(a)$. Nun gilt aber für alle $y \in \mathbb R^n$ $y^T\!\!Ay \geq \alpha \|y\|^2$, denn für $y \neq 0$ ist $\frac{y}{\|y\|} \in K$, also $\alpha \leq \frac{y^T}{\|y\|}A\frac{y}{\|y\|}$. Somit erhalten wir für alle $x \in U_\delta(a)$
\begin{align*}
f(x) &= f(a) + \textstyle\frac{1}{2}(x-a)^TA(x-a) + r(x)\|x-a\|^2 \\
&\leq f(a) + \textstyle\frac{\alpha}{2}\|x-a\|^2 + r(x)\|x-a\|^2 \\
&= f(a) + \textstyle(\frac{\alpha}{2} + r(x))\|x-a\|^2 \geq f(a)
\end{align*}
Also hat $f$ in $a$ ein lokales Minimum.
\item Wegen $\hess (-f)(a) = - \hess f(a)$ und ($-A$ positiv definit gdw. $A$ negativ definit) können wir einfach (a) auf $-f$ anwenden.
\item Sei $A$ indefinit. Wähle also $u_0,u_1 \in \mathbb R^n$ mit $u_0^T\!Au_0 > 0$ und $u_1^T\!Au_1 < 0$. Sei $W$ Umgebung von $a$. Wir müssen zeigen, dass es $v_0,v_1 \in U \cap W$ gibt mit $f(v_0) < f(a) < f(v_1)$. Setze hierzu $\alpha := u_0^T\!Au_0$. Dann existiert $t > 0$ mit $a + t u_0 \in U \cap W$ und $|r(a + tu_0)| < \alpha/(2\|u_0\|^2)$. Somit gilt
\begin{align*}
f(a+tu_0) &= f(a) + \frac{1}{2}tu_0Atu_0 + r(a+tu_0)\|tu_0\|^2 =\\
&= f(a) + \frac{1}{2}t^2\alpha + r(a+tu_0)t^2\|u_0\|^2 =\\
&= f(a) + t^2\|u_0\|^2\left(\frac{\alpha}{2 \|u_0\|^2} + r(a+tu_0)\right) > f(a)
\end{align*}
Analog findet man $v_0 \in U \cap W$ mit $f(v_0) < f(a)$, indem man $u_1$ betrachtet. \qedhere
\end{enumerate}
\end{proof}
\begin{remark}
Sei $A$ eine symmetrische $n \times n$-Matrix. Ist $n = 1$ und $A = (a)$, so gilt natürlich:
\begin{enumerate}[(1)]
\item $A$ positiv definit gdw. $\alpha > 0$
\item $A$ negativ definit gdw. $\alpha < 0$
\item $A$ ist niemals indefinit
\end{enumerate}
Sei nun $n=2$ und etwa $A = \binom{\alpha\ \beta}{\beta\ \gamma}$. Setze $\Delta = \det A = \alpha \gamma - \beta^2$. Dann gilt:
\begin{enumerate}[(1)]
\item Ist $\Delta > 0$ und $\alpha > 0$, so ist $A$ positiv definit
\item Ist $\Delta > 0$ und $\alpha < 0$, so ist $A$ negativ definit
\item Ist $\Delta < 0$, so ist $A$ indefinit
\end{enumerate}
\end{remark}
\begin{proof}
Für $w = (x,y) \in \mathbb R^2$ gilt
\begin{align*}
\alpha w^T\!\! A w &= \alpha(\alpha x^2 + 2 \beta x y + \gamma y^2) =\\
&= \alpha^2x^2 + 2\alpha\beta xy + \alpha \gamma y^2 = \\
&= (\alpha^2 x^2 + 2 \alpha \beta x y + \beta^2 y^2) + (\alpha \gamma y^2 - \beta^2 y^2) =\\
&= (\alpha x + \beta y)^2 + \Delta y^2 \geq 0
\end{align*}
Hieraus folgt (1) und (2). Sei nun $\Delta < 0$. Ist $\alpha = 0$, so $\beta \neq 0$ und $(x,1)^T\!A(x,1) = 2 \beta x + \gamma$. Also $A$ indefinit. Ist $\alpha \neq 0$, so gilt für $x = - \beta/\alpha$
\[\alpha (x,1)^T\! A (x,1) = \Delta < 0\quad\text{und}\quad\alpha(1,0)^T\!A(1,0) = \alpha^2 > 0\]
Also ist $A$ indefinit.
\end{proof}
\begin{example}
Sei $f \colon \mathbb R^2 \to \mathbb R$ definiert durch $f(x,y) = x^3 + xy^2 + x^2 - y^2$. Es ist
\[f'(x,y) = (3x^2 + y^2 + 2x, 2(x-1)y)\]
Also sind die Nullstellen von $f'$ $(0,0)$ und $(-2/3,0)$. Weiterhin ist
\[\hess f(x,y) = \begin{pmatrix}6x+2 & 2y \\ 2y & 2x - 2\end{pmatrix}\]
Es gilt $\det \hess f(0,0) = -4 < 0$ und $\det \hess f(-2/3,0) = 20/3 > 0$ und die erste Komponente von $\hess f(-\frac{2}{3},0)$: $6(-2/3) + 2 = -2 < 0$, also ist $(-2/3,0)$ ein lokales Maximum.
\end{example}
\section{Umkehrsatz, Implizite Funktionen}
\begin{gelaber}
Sei $\mathbb R^{m \times n}$ der Vektorraum der $m \times n$-Matrizen. Wir können natürlich $\mathbb R^{m \times n}$ kanonisch mit $\mathbb R^{m \cdot n}$ identifizieren, aber wir nehmen auf $\mathbb R^{m \times n}$ die Abbildungsnorm, die definiert war durch
\[\|A\| = \sup \{\|Ax\| \colon x \in \mathbb R^n \wedge \|x\| \leq 1\}\]
Nun hatten wir viele Sätze nur für den $\mathbb R^n$ mit der euklidischen Norm bewiesen. Es gilt aber
\end{gelaber}
\begin{theorem}[Normäquivalenzsatz]
Sei $\| \cdot \|$ die euklidische Norm auf $\mathbb R^n$ und $\| \cdot \|^*$ eine weitere Norm auf $\mathbb R^n$. Dann existieren $c_0,c_1 > 0$ mit $c_0\|x\| \leq \|x\|^* \leq c_1\|x\|$ für alle $x \in \mathbb R^n$.
\end{theorem}
\begin{proof}
Sei $e_1,\dots,e_n$ die kanonische Basis des $\mathbb R^n$. Für $x = (x_1,\dots,x_n) \in \mathbb R^n$ gilt dann
\begin{align*}
\|x\|^* &= \left\|\sum_{k=1}^n x_k e_k\right\|^* \leq \sum_{k=1}^n\|x_k e_k\|^* = \sum_{k=1}^n|x_k|\|e_k\|^* = \\
&= \scalar{(|x_1|,\dots,|x_n|)}{(\|e_1\|^*,\dots,\|e_n\|^*)} \leq \\
&\leq \|(|x_1,\dots,|x_n|)\| \cdot \|(\|e_1\|^*,\dots,\|e_n\|^*)\| = \|(\|e_1\|^*,\dots,\|e_n\|^*)\| \cdot \|x\|
\end{align*}
Wir können also $c_1 = \|(\|e_1\|^*,\dots,\|e_n\|^*)\|$ wählen. Somit gilt also auch $\|x-y\|^* \leq c_1\|x-y\|$ für alle $x,y \in \mathbb R^n$. Also ist $\| \cdot \|^*$ stetig (bzgl. $\| \cdot \|$). Sei nun $S = \{x \in \mathbb R^n \colon \|x\| = 1\}$. Wegen $S$ kompakt und $\| \cdot \|^*$ stetig nimmt also $\| \cdot \|^*$ auf $S$ ihr Minimum. Setze also $c_0 = \min \{\|x\|^* \colon x \in S\}$. Dann ist $c_0 > 0$. Sei nun $x \in \mathbb R^n, x \neq 0$. Dann ist $x/\|x\| \in S$. Somit gilt $c_0 \leq \|x/\|x\|\|^* = \|x\|^*/\|x\|$ und daher $c_0\|x\| \leq \|x\|^*$. Für $x = 0$ gilt dies natürlich auch.
\end{proof}
\begin{gelaber}
Damit hängt aber z.B. der Konvergenzbegriff auf $\mathbb R^n$ nicht von der speziell gewählten euklidischen Norm auf $\mathbb R^n$ ab. Ist $\| \cdot \|^*$ eine weitere Norm auf $\mathbb R^n$, so gilt für eine Folge $(x_k)_{k\in\mathbb N}$: $(\|x_k\|)_{k\in\mathbb N}$ ist Nullfolge genau dann wenn $(\|x_k\|^*)_{k\in\mathbb N}$ eine Nullfolge ist. \par
\end{gelaber}
\begin{definition}
Sei $x = (x_1,\dots,x_n) \in \mathbb R^n$. Setze dann $\|x\|_\infty = \max \{|x_i| \colon 1 \leq i \leq n\}$. $\| \cdot \|_\infty$ ist die {\em Maximumsnorm}.
\end{definition}
\begin{remark}
Sei $U \in \mathbb R^n$ offen und $f \colon U \to \mathbb R^m$ differenzierbar. Dann ist $f$ stetig differenzierbar genau dann, wenn $f' \colon U \to \mathbb R^{m \times n}$ stetig ist. Dies erhält man durch Anwendung des Äquivalenzsatzes auf die Abbildungsnorm.
\end{remark}
\begin{remark}
Seien $A \in \mathbb R^{k \times m}$ und $B \in \mathbb R^{m \times n}$. Dann gilt $\|AB\| \leq \|A\| \|B\|$.
\end{remark}
\begin{proof}
Sei $x \in \mathbb R^n$. Dann gilt $\|ABx\| \leq \|A\| \|Bx\| \leq \|A\| \|B\| \|x\|$. Also
\begin{align*}
\|AB\| &= \sup \{\|ABx\| \colon x \in \mathbb R^n \wedge \|x\| \leq 1\} \\
&\leq \sup \{\|A\|\|B\|\|x\| \colon x \in \mathbb R^n \wedge \|x\| \leq 1\} \\
&= \|A\|\|B\|\qedhere
\end{align*}
\end{proof}
\begin{definition}
Für $n \in \mathbb N$ sei $\GL(n) = \{A \in \mathbb R^{n \times n} \colon A \text{ invertierbar}\}$.
\end{definition}
\begin{lemma}
$\GL(n)$ ist offen und die Abbildung $\inv \colon \GL(n) \to \GL(n)$ definiert durch $\inv(A) = A^{-1}$ ist stetig.
\end{lemma}
\begin{proof}
Die Determinantenabbildung $\det \colon \mathbb R^{n \times n} \to \mathbb R$ ist stetig und $\GL(n) = \{A \in \mathbb R^{n \times n} \colon \det(A) \neq 0\} = \det^{-1}(\mathbb R \setminus \{0\})$. Also ist $\GL(n)$ offen. Nach der Cramerschen Regel sind die Komponentenfunktionen von $\inv$ rationale Funktionen, also stetig.
\end{proof}
\begin{gelaber}
Wir untersuchen nun die Differenzierbarkeit der Umkehrfunktion.
\end{gelaber}
\begin{theorem}
Seien $U \subseteq \mathbb R^n$ und $V \subseteq \mathbb R^m$ offen und sei $f \colon U \to V$ bijektiv. Weiterhin sei $a \in U$ und seien $f$ in $a$ differenzierbar und $f^{-1}$ in $f(a)$ differenzierbar. Dann gilt $m = n$, $Df(a)$ ist invertierbar und es ist $Df^{-1}(f(a)) = (Df(a))^{-1}$.
\end{theorem}
\begin{proof}
Setze $A = Df(a)$ und $B = Df^{-1}(f(a))$. Weiterhin seien $\id_U$ die identische Abbildung auf $U$ und $\id_V$ die identische Abbildung auf $V$. Dann gilt natürlich $D\id_U(x) = E_n$, die $n$-te Einheitsmatrix, für alle $x \in U$ und $D \id_V(y) = E_m$, die $m$-te Einheitsmatrix, für alle $y \in V$. Wegen $f^{-1} \circ f = \id_U$ und $f \circ f^{-1} = \id_V$ gilt somit nach Kettenregel $BA = E_n$ und $AB = E_m$. Hieraus folgt nach linearer Algebra die Behauptung.
\end{proof}
\begin{question}
Wann ist $f^{-1}$ differenzierbar? Das folgende Kriterium werden wir später noch wesentlich verstärken.
\end{question}
\begin{lemma}
Seien $U,V \in \mathbb R^n$ offen und sei $f \colon U \to V$ bijektiv und stetig differenzierbar. Weiterhin sei $f^{-1}$ stetig und für alle $x \in U$ sei $Df(x)$ invertierbar. Dann ist $f^{-1}$ stetig differenzierbar.
\end{lemma}
\begin{proof}
Wir zeigen zuerst, dass $f^{-1}$ in jedem Punkt $b = f(a) \in V$ differenzierbar ist. Dabei können wir o.E. $a=0$ und $f(a) = 0$ annehmen, denn sonst betrachte die Funktion $g(x) = f(x+a) - f(a)$. Außerdem genügt es die Differenzierbarkeit von $(C \circ f)^{-1}$ in $0$ zu zeigen, wobei $C = (Df(0))^{-1}$. Es ist aber $D(C \circ f)(0) = CDf(0) = E_n$, wobei $E_n$ die $n$-te Einheitsmatrix ist. Also können wir auch o.E. annehmen, dass $Df(0) = E_n$. Wegen $f$ differenzierbar in $0$ existiert eine in $0$ stetige Funktion $r \colon U \to \mathbb R^n$ mit $r(0)=0$ und $f(x) = f(0) + E_n x + r(x)\|x\| = x + r(x)\|x\|$ für alle $x \in U$. Definiere nun $s \colon V \to \mathbb R^n$ durch
\[s(y) = \begin{cases}-\frac{r(x)\|x\|}{\|y\|}&\quad\text{falls $y \neq 0$, $y=f(x)$}\\0&\quad\text{falls $y=0$}\end{cases}\]
Dann gilt für alle $y = f(x) \in V$ mit $y \neq 0$
\begin{align*}
f^{-1}(y) = x &= f(x) - r(x)\|x\| = \\
&= y - \frac{r(x)\|x\|}{\|y\|}\|y\| = \\
&= y + s(y)\|y\| = \\
&= f^{-1}(0) + E_n y + s(y)\|y\|
\end{align*}
Natürlich gilt dies auch für $y = 0$. Also genügt es zu zeigen, dass $s$ in $0$ stetig ist. Sei also $\varepsilon > 0$, wobei o.E. $\varepsilon \leq 1$. Da $r$ stetig ist in $0$ und $r(0) = 0$ gibt es ein $\eta > 0$ mit $\|r(x)\| < \varepsilon/2$ für alle $x$ mit $\|x\| < y$. Da $f^{-1}$ in $0$ stetig ist und $f^{-1}(0) = 0$ sowie $V$ offen gibt es ein $\delta > 0$ mit $\|f^{-1}(y)\| < \eta$ für alle $y$ mit $\|y\| < \delta$. Dann gilt für alle $y = f(x)$ mit $\|y\| < \delta$ und $y \neq 0$
\[\|x\| = \|y - r(x)\|x\|\| \leq \|y\| + \|r(x)\|\|x\| \leq \|y\| + \|x\|/2\]
also $\|x\| \leq 2 \|y\|$ und somit auch
\[\|s(y)\| = \frac{\|r(x)\|\|x\|}{\|y\|} \leq 2 \|r(x)\| < \varepsilon\]
Somit ist $f^{-1}$ differenzierbar.
Wir zeigen nun noch, dass $Df^{-1}$ stetig ist. Nach Satz 2 ist $Df^{-1} \circ f = \inv \circ Df$, also $Df^{-1} = Inv \circ Df \circ f^{-1}$. Nach Lemma 2 ist $\inv$ stetig. $Df$ und $f^{-1}$ sind auch stetig. Also ist $Df^{-1}$ stetig.
\end{proof}
\begin{gelaber}
Wir werden später zeigen, dass man in Lemma 4 die Voraussetzungen, dass $V$ offen ist und $f^{-1}$ stetig ist, weglassen können.
\end{gelaber}
\begin{definition}
Sei $X$ ein metrischer Raum und $f \colon X \to X$. $f$ ist eine {\em Kontraktion}, wenn ein $c < 1$ existiert mit $d(f(x),f(y)) \leq c\,d(x,y)$ für alle $x,y \in X$.
\end{definition}
\begin{remark}
Jede Kontraktion ist stetig.
\end{remark}
\begin{theorem}[Banachscher Fixpunktsatz]
Sei $X \neq \varnothing$ ein vollständiger metrischer Raum. Weiterhin sei $f \colon X \to X$ eine Kontraktion. Dann besitzt $f$ genau einen Fixpunkt, d.h. ein $x \in X$ mit $f(x) = x$.
\end{theorem}
\begin{proof}
Sei $c < 1$ mit $d(f(x),f(y)) \leq c\,d(x,y)$ für alle $x,y \in X$. Wir zeigen zuerst die Eindeutigkeit. Seien dazu $x,y \in X$ Fixpunkte von $f$. Dann gilt $d(x,y) = d(f(x),f(y)) \leq c\,d(x,y)$. Wegen $c < 1$ also $d(x,y) = 0$, d.h. $x = y$. Sei für die Existenz $a \in X$ beliebig. Definiere dann eine Folge $(x_n)_{n\in\mathbb N}$ rekursiv durch $x_0 = a$ und $x_{n+1} = f(x_n)$. Wir sagen zuerst durch Induktion, dass für alle $n \in \mathbb N$ gilt
\[d(x_n,x_{n+1}) \leq c^n d(x_0,x_1)\]
Der Fall $n = 0$ ist trivial. Außerdem gilt nach Induktionsvoraussetzung
\[d(x_{n+1},x_{n+2}) = d(f(x_n),f(x_{n+1})) \leq c\,d(x_n,x_{n+1}) \leq c^{n+1}\,d(x_0,x_1)\]
Somit gilt für $k,n \in \mathbb N$
\[d(x_n,x_{n+k}) \leq \sum_{j=0}^{k-1}d(x_{n+j},x_{n+j+1}) \leq \sum_{j=0}^{k-1}c^{n+j}d(x_0,x_1) = \frac{c^n}{1-c}d(x_0,x_1)\]
Wegen $c < 1$ ist aber $(\frac{c^n}{1-c}d(x_0,x_1)_{n\in\mathbb N}$ eine Nullfolge. Somit ist $(x_n)_{n\in\mathbb N}$ eine Cauchyfolge, denn sei $\varepsilon > 0$. Dann existiert $n \in \mathbb N$ mit $\frac{c^n}{1-c}d(x_0,x_1) < \varepsilon$. Also ist $d(x_n,x_{n+k}) \leq \frac{c^n}{1-c}d(x_0,x_1) < \varepsilon$ für alle $k \in \mathbb N$. Wegen der Vollständigkeit von $X$ ist somit $(x_n)_{n\in\mathbb N}$ konvergent. Sei also $x = \lim_{n\to\infty} x_n$. Da $f$ stetig ist, gilt $f(x) = \lim_{n\to\infty}f(x_n) = \lim_{n\to\infty}x_{n+1} = x$.
\end{proof}
\begin{gelaber}
Um den folgenden Satz zu motivieren, betrachten wir folgende Situation im eindimensionalen Fall. Seien $U\subseteq \mathbb R$ offen und $f\colon U\to\mathbb R$ stetig differenzierbar. Weiterhin sei $a \in U$ mit $f'(a) \neq 0$. Sei etwa $f'(a) > 0$. Da $f'$ stetig ist, existiert ein offenes Intervall $I\subseteq U$ mit $a\in I$ und $f'(x) > 0$ für alle $x\in I$. Somit ist $h = f|_I$ streng monoton wachsend. Also ist $W := f(I)$ offen und $h^{-1} \colon W\to\mathbb R$ ist stetig differenzierbar, denn $(h^{-1})'(y) = \frac{1}{f'(f^{-1}(y))}$.\par
Wir verallgemeinern dies auf den mehrdimensionalen Fall.
\end{gelaber}
\begin{theorem}[Lokaler Umkehrsatz]
Seien $U\subseteq\mathbb R^n$ offen und $f\colon U\to\mathbb R^n$ stetig differenzierbar. Weiterhin sei $a\in U$ mit $Df(a)$ invertierbar. Dann gibt es eine offene Umgebung $V \subseteq U$ von $a$ derart, dass $W := f(V)$ offen ist, die Einschränkung $h = f|_V$ injektiv ist und $h^{-1}\colon W\to\mathbb R^n$ stetig differenzierbar ist.
\end{theorem}
\begin{proof}
Sei $C = Df(a)^{-1}$. Es genügt den Satz für $C\circ f$ zu beweisen. Nun ist aber $D(C\circ f)(a) = C\,Df(a) = E_n$. Weiterhin können wir ohne Einschränkung annehmen, dass $a = 0 = f(a)$, denn sonst betrachte die Funktion $g(x) = f(x+a) - f(a)$. Somit nehmen, wir also insgesamt an, dass $a = f(a) = 0$ und $Df(0) = E_n$.\par
Wegen $Df$ stetig in $0$ und $Df(0) = E_n$ sowie $U$ offen existiert eine $\varepsilon > 0$ mit $K = \{x \in \mathbb R^n\colon \|x\| \leq \varepsilon\} \subseteq U$ und $\|E_n - Df(x)\| \leq 1/2$ für alle $x \in K$. Beachte, dass $K$ abgeschlossen ist.\par
Für $y \in \mathbb R^n$ definiere $g_y\colon U\to\mathbb R^n, x \mapsto y + x - f(x)$. Es gilt also
\[
g_y(x) = x \Longleftrightarrow f(x) = y
\]
Außerdem ist $g_y(0) = y - f(0) = y$. Weiterhin ist $Dg_y = E_n - Df$. Mit dem Schrankensatz erhalten wir
\begin{enumerate}[(1)]
\item $\displaystyle \|g_y(x_2) - g_y(x_1)\| \leq \frac{1}{2}\|x_2 - x_1\|$ für alle $x_1, x_2\in K$.
\end{enumerate}
denn sind $x_1, x_2 \in K$, so ist
\[
\|g_y(x_1) - g_y(x_2)\| \leq \sup\{\|Dg_y(x)\|\colon x \in [x_1, x_2]\} \|x_2 - x_2\| \leq \frac{1}{2} \|x_2 - x_1\|
\]
Somit gilt
\begin{enumerate}[(1)]
\setcounter{enumi}{1}
\item $\displaystyle \|g_y(x)\| < \varepsilon$ für alle $x, y$ mit $\|x\| \leq \varepsilon$ und $\|y\| < \frac{\varepsilon}{2}$.
\end{enumerate}
denn für solche $x,y$ ist
\[
\|g_y(x)\| = \|(g_y(x) - g_y(0)) + y\| \leq \|g_y(x) - g_y(0)\| + \|y\| \underset{(1)}{\leq} \frac{\|x\|}{2} + \|y\| < \varepsilon
\]
Setze nun $W = U_{\varepsilon/2}(0)$. $W$ ist offen. Für $y \in W$ gilt nach (2), dass $g_y \colon K \to K$. Da $K$ abgeschlossen ist und $\mathbb R^n$ vollständig, ist $K$ ein vollständiger metrischer Raum. Weiterhin ist nach (1) für $y \in W$ $g_y$ (eingeschränkt auf $K$) eine Kontraktion. Somit existiert nach dem Fixpunktsatz für jedes $y \in W$ genau ein $x \in K$ mit $g(x) = x$, d.h. mit $f(x) = y$. Setze nun $V = f^{-1}[W]$. Dann ist wegen $f$ stetig $V$ eine offene Umgebung ovn $O$ mit $V \subseteq K \subseteq U$ und für die Einschränkung $h$ von $f$ auf $V$ ist $h \colon V \to W$ bijektiv. Außerdem ist $W$ offen. Wir müssen noch zeigen, dass $h^{-1}$ stetig differenzierbar ist. Hierzu wollen wir Lemma 4 auf $h$ anwenden. Wir müssen also noch zeigen, dass $h^{-1}$ stetig ist und für alle $x \in V$ $Dh(x)$ invertierbar ist. \par
Wir zeigen zuerst die Stetigkeit von $h^{-1}$. Seien $y_1,y_2 \in W$ und setze $x_1 = h^{-1}(y_1)$, $x_2 = h^{-1}(y_2)$. Dann ist $x_2 - x_1 = (g_0(x_2) - g_0(x_1)) + (f(x_2) - f(x_1))$. Also nach (1) $\|x_2 - x_1\| \leq \frac{1}{2}\|x_2 - x_1\| + \|f(x_2) - f(x_1)\|$ d.h. $\|h^{-1}(y_2) - h^{-1}(y_1)\| \leq 2 \|y_2-y_1\|$. Hieraus folgt die Stetigkeit von $h^{-1}$ sofort. \par
Sei schließlich $x \in V$. Wir müssen zeigen, dass $Dh(x) = Df(x)$ invertierbar ist. Wegen $V \subseteq K$ gilt $\|E_n - Df(x)\| \leq \frac{1}{2}$. Also gilt für alle $v \in \mathbb R^n$ $\|v - Df(x)v\| \leq \frac{1}{2}\|v\|$ und somit $Df(x)v \neq 0$ für alle $v \neq 0$. Somit ist $Df(x)$ injektiv, d.h. invertierbar.
\end{proof}
\begin{corollary}
Seien $U \subseteq \mathbb R^n$ offen und $f \colon U \to \mathbb R^n$ stetig differenzierbar und $Df(x)$ invertierbar für alle $x \in U$. Dann ist $f[U]$ offen.
\end{corollary}
\begin{proof}
Sei $b \in f[U]$. Wähle $a \in U$ mit $b = f(a)$. Nach Satz 6 existiert eine offene Umgebung $V \subseteq U$ von $a$ mit $W = f[V]$ offen. Wegen $b \in W$ ist $W$ eine offene Umgebung von $b$ und $W = f[V] \subseteq f[U]$. Also ist $f[U]$ offen.
\end{proof}
\begin{corollary}
Seien $U \subseteq \mathbb R^n$ offen und $f \colon U \to \mathbb R^n$ eine injektive stetig differenzierbare Funktion mit $Df(x)$ invertierbar für alle $x \in U$. Dann ist $f[U]$ offen und $f^{-1} \colon f[U] \to \mathbb R^n$ ist stetig differenzierbar.
\end{corollary}
\begin{proof}
Nach obigem Korollar ist $f[U]$ offen. Sei nun $b \in f[U]$ und sei $a = f^{-1}(b)$. Nach Satz 6 existiert eine offene Umgebung $W \subseteq f[U]$ von $b$ derart, dass $f^{-1}$ eingeschränkt auf $W$ stetig differenzierbar ist. Hieraus folgt die Behauptung.
\end{proof}
\begin{example}[Polarkoordinaten]
Sei $f \colon (0,\infty) \times (0,2\pi) \to \mathbb R^2$ definieret durch $f(r,\varphi) = (r \cos \varphi, r \sin \varphi)$. $f$ ist injektiv und stetig differenzierabr. Es ist
\[f'(r, \varphi) = \begin{pmatrix}\cos \varphi & -r \sin \varphi \\ \sin \varphi & r \cos \varphi\end{pmatrix}\]
Somit $\det f'(r,\varphi) = r \cos^2 \varphi + r \sin^2 \varphi = r > 0$. Also ist $f'(r,\varphi)$ invertierbar. Sei $g = f^{-1}$. Für $(x,y) = f(r,\varphi)$ gilt
\[g'(x,y) = (f'(r,\varphi))^{-1} = \begin{pmatrix}\cos \varphi & \sin \varphi \\ - \frac{1}{r} \sin \varphi & \frac{1}{r} \cos \varphi\end{pmatrix} = \begin{pmatrix}\frac{x}{\|(x,y\|} & \frac{y}{\|(x,y\|} \\ -\frac{y}{\|(x,y\|^2} & \frac{x}{\|(x,y\|^2}\end{pmatrix}\]
\end{example}
\begin{gelaber}
Sei nun $F \colon \mathbb R^2 \to \mathbb R$ und sei $F(a,b) = 0$. Wir suchen Bedingungen für die eindeutige Lösbarkeit der Gleichung $F(x,y) = 0$ in Abhängigkeit von $x$ in einer Umgebung von $(a,b)$.
\end{gelaber}
\begin{example}
$F(x,y) = x - y^2$. Es ist $F(1,1) = 0$. Definiere $g \colon (0,\infty) \to \mathbb R$ durch $g(x) = \sqrt x$ ist die Lösung in Umgebung von $(1,1)$.
\end{example}
\begin{gelaber}
Wir machen dies etwas allgemeiner und führen hierzu einige Notationen ein.
\end{gelaber}
\begin{notation}
Für die Funktion $g \colon X \to Y$ sei $\graph(g) = \{(x,g(x)) \colon x \in X\}$ der Graph von $g$.
\end{notation}
\begin{remark}
Seien $(u,v) \in \mathbb R^k \times R^m$ und $W$ eine Umgebung von $(u,v)$. Dann existieren Umgebungen $W_0$ von $u$ und $W_1$ von $v$ mit $W_0 \times W_1 \subseteq W$.
\end{remark}
\begin{proof}
Für $x = (x_1,\dots,x_k) \in \mathbb R^k$ und $y = (y_1,\dots,y_m) \in \mathbb R^m$ ist $\|(x,y)\|^2 = \|x\|^2 + \|y\|^2 \leq (\|x\| + \|y\|)^2$ also $\|(x,y)\| \leq \|x\| + \|y\|$. Wähle also $\varepsilon > 0$ mit $U_\varepsilon((u,v)) \subseteq W$. Dann ist $U_{\varepsilon/2}(u) \times U_{\varepsilon/2}(v) \subseteq U_\varepsilon((u,v)) \subseteq W$.
\end{proof}
\begin{notation}
Seien nun $U_1 \subseteq \mathbb R^k$ und $U_2 \subseteq \mathbb R^m$ offen und sei $F \colon U_1 \times U_2 \to \mathbb R^m$ differenzierbar. Weiterhin sei $F=(F_1,\dots,F_m)$. Für $(a,b) \in U_1 \times U_2$ setze
\[\frac{\partial F}{\partial x}(a,b) = \begin{pmatrix}D_1F_1(a,b) & \dots & D_kF_1(a,b) \\ \vdots & \ddots & \vdots \\ D_1F_m(a,b) & \dots & D_kF_m(a,b)\end{pmatrix}\]
\[\frac{\partial F}{\partial y}(a,b) = \begin{pmatrix}D_{k+1}F_1(a,b) & \dots & D_{k+m}F_1(a,b) \\ \vdots & \ddots & \vdots \\ D_{k+1}F_m(a,b) & \dots & D_{k+m}F_m(a,b)\end{pmatrix}\]
Es gilt also
\[DF(a,b) = \left(\frac{\partial F}{\partial x}(a,b)\;\bigg|\;\frac{\partial F}{\partial y}(a,b)\right)\]
Somit ist für $(u,v) \in \mathbb R^k \times \mathbb R^m$
\[DF(a,b)\cdot(u,v) = \frac{\partial F}{\partial x}(a,b) \cdot u + \frac{\partial F}{\partial y}(a,b) \cdot v\]
\end{notation}
\begin{theorem}[Implizite Funktionen]
Seien $U_1 \subseteq \mathbb R^k$ und $U_2 \subseteq \mathbb R^m$ offen, und sei $F \colon U_1 \times U_2 \to \mathbb R^m$ stetig differenzierbar. Weiterhin sei $(a,b) \in U_1 \times U_2$ mit $F(a,b) = 0$ und $\frac{\partial F}{\partial y}(a,b)$ invertierbar. Dann gibt es offene Umgebungen $V_1 \subseteq U_1$ von $a$ und $V_2 \subseteq U_2$ von $b$ sowie eine stetig differenzierbare Funktion $g \colon V_1 \to V_2$ mit
\[\graph(g) = \{(x,y) \in V_1 \times V_2 \colon F(x,y) = 0\}\]
Weiterhin gilt
\[g'(a) = -\left(\frac{\partial F}{\partial y}(a,b)\right)^{-1} \frac{\partial F}{\partial x}(a,b)\]
\end{theorem}
\begin{proof}
Definiere $H \colon U_1 \times U_2 \to \mathbb R^{k+m}$ durch $H(x,y) = (x,F(x,y))$. Wegen $F$ stetig differenzierbar ist auch $H$ stetig differenzierbar. Es ist
\[DH(a,b) = \begin{pmatrix}E_k & 0 \\ \frac{\partial F}{\partial x}(a,b) & \frac{\partial F}{\partial y}(a,b)\end{pmatrix}\]
wobei $E_k$ die $k$-te Einheitsmatrix ist. Es ist $\det(DH(a,b)) \cdot \det(\frac{\partial F}{\partial y}(a,b)) = \det ( \frac{\partial F}{\partial y}(a,b))$. Wegen $\frac{\partial F}{\partial y}(a,b)$ invertierbar ist also auch $DH(a,b)$ invertierbar. Wir können also auf $H$ den lokalen Umkehrsatz in $(a,b)$ anwenden. Somit gibt es eine offene Umgebung $V \subseteq U_1 \times U_2$ von $(a,b)$ und $W \subseteq \mathbb R^{k+m}$ von $H(a,b)$ derart, dass die Einschränkung $h$ von $H$ auf $V$ eine Bijektion von $V$ auf $W$ ist, für die $h^{-1}$ stetig differenzierbar ist. Natürlich existiert eine Funktion $h^* \colon W \to \mathbb R^m$ mit $h^{-1}(u,v) = (u,h^*(u,v))$ für alle $(u,v) \in W$. Dann gilt
\[\forall (x,y) \in V \colon \Big(F(x,y) = 0 \Longleftrightarrow H(x,y) = (x,0) \Longleftrightarrow y= h^*(x,0)\Big)\tag{$*$}\]
Nach Bemerkung existieren offene Umgebungen $W_1$ von $A$ und $V_2$ von $b$ mit $W_1 \times V_2 \subseteq V$. Nun ist $h^*(a,0) = b$, da $F(a,b) = 0$, und wegen $h^{-1}$ stetig ist die Abbildung $x \mapsto h^*(x,0)$ stetig. Also existiert eine offene Umgebung $V_1 \subseteq W_1$ von $a$ mit $h^*(x,0) \in V_2$ für alle $x \in V_1$. Definiere nun $g \colon V_1 \to V_2$ durch $g(x) = h^*(x,0)$. Wegen $h^{-1}$ stetig differenzierbar ist auch $g$ stetig differenzierbar. Weiterhin gilt
\[\graph(g) = \{(x,y) \in V_1 \times V_2 \colon F(x,y) = 0\}\]
\begin{itemize}
\item["`$\subseteq$"']
Sei $x \in V_1$. Dann $(x,g(x)) \in V_1 \times V_2 \subseteq V$ und $g(x) = h^*(x,0)$. Also nach ($*$) $F(x,(g(x)) = 0$.
\item["`$\supseteq$"']
Sei $(x,y) \in V_1 \times V_2$ mit $F(x,y) = 0$. Dann $(x,y) \in V$. Also nach ($*$) $y = h^*(x,0) = g(x)$, d.h. $(x,y) = (x,g(x)) \in \graph(g)$.
\end{itemize}
Nun noch zum Zusatz. Es ist $F(a,g(a)) = 0$, da $g(a) = b$, und $F$ differenzierbar in $(a,g(a))$ und $g$ differenzierbar in $a$. Also gilt nach Kettenregel für $G(x) = F(x,g(x))$, da $G$ in der Umgebung von $a$ konstant null ist
\[ 0 = DG(a) = DF(a,b)\begin{pmatrix}E_k \\ Dg(a)\end{pmatrix}\]
Nun ist $DF(a,b) = \left(\frac{\partial F}{\partial x}(a,b) \Big| \frac{\partial F}{\partial y}(a,b)\right)$. Also erhält man
\[0 = \frac{\partial F}{\partial x}(a,b) + \frac{\partial F}{\partial y}(a,b) \cdot Dg(a)\]
und daher
\[Dg(a) = - \left(\frac{\partial F}{\partial y}(a,b)\right)^{-1} \frac{\partial F}{\partial x}(a,b)\qedhere\]
\end{proof}
\begin{example}
$F(x,y) = x^2 + y^2 -1$. Definiere $g_0 \colon (-1,1) \to \mathbb R$ durch $g_0(x) = \sqrt{1-x^2}$ und $g_1 \colon (-1,1) \to \mathbb R$ durch $g_1(x) = - \sqrt{1-x^2}$.
\begin{itemize}
\item $g_0$ ist Lösung an den Stellen $(a,b)$ mit $b > 0$.
\item $g_1$ ist Lösung an den Stellen $(a,b)$ mit $b < 0$.
\item An den Stellen $(-1,0)$ und $(1,0)$ gibt es keine Lösung, da $\frac{\partial F}{\partial y}(-1,0) = 0 = \frac{\partial F}{\partial y}(1,0)$.
\end{itemize}
\end{example}
\begin{theorem}[Lokale Extrema mit Nebenbedingung]
Seien $U \subseteq \mathbb R^n$ offen und sei $f \colon U \to \mathbb R$ stetig differenzierbar. Setze $M = \{x \in U \colon f(x) = 0\}$. Sei $a \in M$ mit $f'(a) \neq 0$. Weiterhin sei $h \colon U \to \mathbb R$ eine stetig differenzierbare Funktion, die in $a$ ein lokales Maximum (bzw. Minimum) unter der Nebenbedingung $f = 0$ besitzt, d.h. es gebe eine Umgebung $V \subseteq U$ von $a$ mit $h(a) \geq (x)$ (bzw. $h(a) \leq h(x)$) für alle $x \in V \cap M$. Dann gibt es ein $\lambda \in \mathbb R$ mit $h'(a) = \lambda f'(a)$. (Solch ein $\lambda$ heißt {\em Lagrangescher Multiplikator})
\end{theorem}
\begin{proof}
Wir nehmen o.E. an, dass $D_nf(a) \neq 0$. Sonst nummeriere die Koordinaten um. Sei o.E. $n \geq 2$, da sonst die Behauptung trivial ist. Sei $a = (a_1,\dots,a_n)$ und setze $c = (a_1,\dots,a_{n-1})$. Nach Satz 7 gibt es offene Umgebungen $V$ von $c$ und $W$ von $a_n$ mit $V \times W \subseteq U$ und eine stetig differenzierbare Funktion $g \colon V \to W$ mit $\graph(g) = M \cap (V \times W)$. Außerdem gilt
\[D_i g(c) = - \frac{D_i f(a)}{D_n f(a)}\quad\text{für $1 \leq i \leq n -1$}\tag{$*$}\]
Sei nun $h^*$ definiert durch $h^*(x) = h(x,g(x))$. Da für alle $x \in V$ $(x,g(x)) \in M$, besitzt nach Voraussetzung $h^*$ in $c$ ein lokales Extremum. Weil $h^*$ differenzierbar ist, ist also $Dh^*(c) = 0$. Somit gilt nach Kettenregel
\[0 = D_i h^*(c) = D_ih(a) + D_nh(a) \cdot D_ig(c)\quad\text{für $1 \leq i \leq n-1$}\]
Setze nun $\lambda = D_nh(a)/D_nf(a)$. Für $1 \leq i \leq n-1$ gilt dann
\[D_ih(a) = - D_nh(a) \cdot D_ig(c) \overset{(*)}= \lambda D_if(a)\]
Diese Gleichung gilt auch für $i = n$. Also ist $h'(a) = \lambda f'(a)$.
\end{proof}
\begin{example}
Man bestimme diejenigen Punkte auf der Kugeloberfläche $S^2 = \{(x,y,z) \colon\!x^2 + y^2 + z^2 = 1 \}$, die von dem Punkt $a = (1,1,1)$ den kleinsten bzw. größten Abstand haben. Definiere hierzu $f, h \colon \mathbb R^3 \to \mathbb R$ durch
\begin{align*}
f(x,y,z) &= x^2 + y^2 + z^2 - 1 \\
h(x,y,z) &= \|(x,y,z) - a\|^2 = (x-1)^2 + (y-1)^2 + (z-1)^2
\end{align*}
Gesucht sind globale Extrema von $h$ mit der Nebenbedingung $f = 0$. Es ist $Df(x,y,z) = (2x,2y,2z)$ und $Dh(x,y,z) = \big(2(x-1),2(y-1),2(z-1)\big)$. Ist $Dh(x,y,z) = \lambda Df(x,y,z)$ und $(x,y,z) \in S^2$, so ist $(x-1) = \lambda x$, $y-1 = \lambda y$ und $z-1 = \lambda z$ und $x^2 + y^2 + z^2 = 1$. Also $x = y = z = 1/(1-\lambda)$. Wegen $(x,y,z) \in S^2$ also $3/(1-\lambda)^2 = 1$, also $\lambda = 1 \pm \sqrt 3$. Somit ist $(x,y,z) = \pm \frac{1}{\sqrt 3}(1,1,1)$. Setze $a_1 = \frac{1}{\sqrt 3}(1,1,1)$ und $a_2 = -\frac{1}{\sqrt 3}(1,1,1)$. Da $h$ stetig ist und $S^2$ kompakt ist, existieren $b_1,b_2 \in S^2$ mit $h(b_1) \leq h(x) \leq h(b_2)$ für alle $x \in S^2$. Nun ist aber $Df(b_1) \neq 0$ und $Df(b_2) \neq 0$, da $b_1, b_2 \in S^2$. Nach Satz 7 existieren also $\lambda_1,\lambda_2 \in \mathbb R$ mit $Dh(b_1) = \lambda_1 Df(b_1)$ und $Dh(b_2) = \lambda_2 Df(b_2)$. Wegen $h(a_1) < h(a_2)$ ist also nach obiger Rechnung $b_1 = a_1$ und $b_2 = a_2$. Somit gilt
\begin{itemize}
\item $\frac{1}{\sqrt 3}(1,1,1)$ ist der Punkt aus $S^2$ mit kleinstem Abstand von $(1,1,1)$
\item $-\frac{1}{\sqrt 3}(1,1,1)$ ist der Punkt aus $S^2$ mit größtem Abstand von $(1,1,1)$
\end{itemize}
\end{example}
\myclearpage %ACHTUNG, BEI ÄNDERUNGEN WIEDER RAUSNEHMEN!!
\section{Parameterabhängige Integrale}
\begin{theorem}
Seien $a,b \in \mathbb R$ mit $a < b$, $D \subseteq \mathbb R^n$ und $\varphi, \psi \colon D \to \mathbb R$ stetig mit $a \leq \varphi(y) \leq \psi(y) \leq b$ für alle $y \in D$. Weiterhin sei $f \colon [a,b] \times D \to \mathbb R$ stetig. Dann ist die Funktion $g \colon D \to \mathbb R$ stetig, welche definiert ist durch
\[g(y) = \int\limits_{\varphi(y)}^{\psi(y)}f(x,y)\,\dd x\]
\end{theorem}
\begin{proof}
Sei $c \in D$ und $(y_k)_{k\in\mathbb N}$ eine Folge in $D$ mit $\lim_{k\to\infty}y_k = c$. Wir müssen zeigen, dass $\lim_{k\to\infty}g(y_k) = g(c)$. Sei hierzu $\varepsilon > 0$. Setze nun $Q = \{y_k \colon k \in \mathbb N\} \cup \{c\}$. Dann ist $Q$ kompakt. Also ist auch $K = [a,b] \times Q$ kompakt. Somit ist die Einschränkung von $f$ auf $K$ gleichmäßig stetig. Daher gibt es ein $\delta > 0$ mit
\begin{enumerate}
\item[(1)] $|f(x,y) - f(x,z)| < \frac{\varepsilon}{3(b-a)}$ für alle $x \in [a,b]$ und alle $y,z \in Q$ mit $\|y-z\| < \delta$.
\end{enumerate}
Weiterhin existiert $M$ mit
\begin{enumerate}
\item[(2)] $|f(x,y)| < M$ für alle $(x,y) \in K$.
\end{enumerate}
Wegen $\lim_{k\to\infty}y_k = c$ und $\varphi$,$\psi$ stetig existiert $m \in \mathbb N$ mit für alle $k \geq m$
\begin{enumerate}
\item[(3)] $\|y_k - c\| < \delta$ und $|\varphi(y_k) - \varphi(c)|,|\psi(y_k) - \psi(c)| < \frac{\varepsilon}{3M}$.
\end{enumerate}
Dann gilt für alle $k \geq m$
\begin{align*}
|g(y_k) - g(c)| &= \left|\int_{\varphi(y_k)}^{\psi(y_k)}\!f(x,y_k)\dd x - \int_{\varphi(c)}^{\psi(c)}\!f(x,c)\dd x\right| \leq\\
&\leq \left|\int_{\varphi(y_k)}^{\psi(y_k)}\!f(x,y_k)\dd x - \int_{\varphi(c)}^{\psi(c)}\!f(x,y_k)\dd x\right| + \left|\int_{\varphi(c)}^{\psi(c)}\!f(x,y_k) - f(x,c)\dd x\right| \leq\\
&\leq \left|\int_{\varphi(c)}^{\psi(y_k)}\!f(x,y_k)\dd x + \int_{\varphi(y_k)}^{\psi(c)}\!f(x,y_k)\dd x\right| + \frac{\varepsilon}{3(b-a)}|\psi(c) - \varphi(c)| \leq\\
&\leq M \cdot |\varphi(y_k) - \varphi(c)| + M \cdot |\psi(c) - \psi(y_k)| + \frac{\varepsilon}{3} < \frac{\varepsilon}{3} + \frac{\varepsilon}{3} + \frac{\varepsilon}{3} = \varepsilon\qedhere
\end{align*}
\end{proof}
\begin{theorem}
Seien $a,b \in \mathbb R$ mit $a < b$, $U \subseteq \mathbb R^n$ offen und $f \colon [a,b] \times U \to \mathbb R, (x,y_1,\dots,y_n) \mapsto f(x,y_1,\dots,y_n)$ stetig. Ist $f$ bezüglich $y_i$ stetig partiell differenzierbar, so ist auch die Funktion $g \colon U \to \mathbb R$ definiert durch $g(y) = \int_a^bf(x,y)\dd x$ bezüglich $y_i$ stetig partiell differenzierbar und es gilt
\[\frac{\partial g}{\partial y_i}(y) = \int_a^b\frac{\partial f}{\partial y_i}(x,y)\dd x\]
\end{theorem}
\begin{proof}
o.E. sei $n=1$. Sei $c \in U$ und $(c_k)_{k\in\mathbb N}$ eine Folge aus $U \setminus \{c\}$, die gegen $c$ konvergiert. Wir müssen zeigen
\[\lim_{k\to 0} \frac{g(c_k)-g(c)}{c_k-c} = \int_a^b D_2f(x,c)\dd x\]
Sei also $\varepsilon > 0$. Setze $f_k(x) = \big(f(x,c_k)-f(x,c)\big)/\big(c_k-c\big)$. Dann gilt
\[\frac{g(c_k)-g(c)}{c_k-c} - \int_a^bD_2f(x,c)\dd x = \int_a^b\big(f_k(x)-D_2f(x,c)\big)\dd x\tag{$1$}\]
Wähle $\rho > 0$ mit $Q = [c-\rho,c+\rho] \subseteq U$. Nach dem Mittelwertsatz gilt
\[\text{für alle $k$ und alle $x \in [a,b]$ existiert $y \in [c_k,c]$ mit $f_k(x) = D_2f(x,y)$}\tag{2}\]
Setze $K = [a,b] \times Q$. $K$ ist kompakt und daher $D_2f$ eingeschränkt auf $K$ gleichmäßig stetig. Somit gibt es ein $0 < \delta \leq \rho$ mit
\[\left|D_2f(x,y) - D_2f(x,c)\right| < \frac{\varepsilon}{b-a}\quad\text{für alle $x \in [a,b]$ und alle $y$ mit $|y-c| < \delta$}\tag{3}\]
Wegen $\lim_{k\to\infty}c_k = c$ existiert ein $m$ mit
\[|c_k - c| < \delta\quad\text{für alle $k \geq m$}\tag{4}\]
Für $k \geq m$ gilt dann
\begin{align*}
&\left|\frac{g(c_k)-g(c)}{c_k-c} - \int_a^bD_2f(x,c)\right| \leq\\
\overset{(1)}\leq&\sup\{|f_k(x) - D_2f(x,c)| \colon x \in [a,b]\}\cdot(b-a) \leq\\
\overset{(2)}\leq&\sup\{|D_2f(x,y) - D_2f(x,c)| \colon x \in [a,b] \wedge y \in [c_k,c]\} \cdot (b-a) \leq\\
\overset{(3,4)}\leq& \frac{\varepsilon}{b-a}\cdot(b-a) = \varepsilon\qedhere
\end{align*}
\end{proof}
\section{Approximationssätze}
\begin{gelaber}
Sei $X$ ein kompakter metrischer Raum. Sei dann $C(X)$ die Menge aller stetigen Funktionen von $X$ nach $\mathbb R$. Für $f,g \in C(X)$ und $\alpha \in \mathbb R$ definiere $f + g$, $\alpha f$ durch
\begin{align*}
(f+g)(x) &= f(x) + g(x)\\
(\alpha f)(x) &= \alpha f(x)
\end{align*}
für alle $x \in X$. Mit dieser Operation ist $C(X)$ ein $\mathbb R$-Vektorraum. Wir können auf $C(X)$ eine Norm definieren durch (für $f \in C(X)$)
\[\|f\| = \sup\{|f(x)|\colon x \in X\}\]
Weil $X$ kompakt ist, ist auch $f[X]$ kompakt und daher beschränkt. Also $\|f\| < \infty$.( Wir benutzen die obige Notation auch für beliebige Funktionen von $X$ nach $\mathbb R$.) Man rechnet leicht nach, dass $\| \cdot \|$ eine Norm ist (die Supremumsnorm). Somit ist $C(X)$ mit $\| \cdot \|$ ein normierter Vektorraum. Insbesondere ist es also ein metrischer Raum mit der Metrik $d(f,g) = \|f-g\|$.
\end{gelaber}
\begin{theorem}
$C(X)$ ist vollständig.
\end{theorem}
\begin{proof}
Sei $(f_n)_{n\in\mathbb N}$ eine Cauchy-Folge in $C(X)$. Da ja für alle $m,n \in \mathbb N$ und $x \in X$ $|f_m(x) - f_n(x)| \leq \|f_m-f_n\|$ gilt, ist für jedes $x \in X$ $(f_n(x))_{n\in\mathbb N}$ eine Cauchy-Folge in $\mathbb R$ und daher konvergent. Sei für $x \in X$ $f(x) = \lim_{n\to\infty}f_n(x)$. Wir zeigen, dass $f \colon X \to \mathbb R$ stetig ist und $(f_n)_{n\in\mathbb N}$ gegen $f$ konvergiert (in $C(X)$). Hierzu zeigen wir
\[\text{für alle $\varepsilon > 0$ existiert ein $m \in \mathbb N$ mit $\|f_n-f\| \leq 2 \varepsilon$ für alle $n \geq m$}\tag{$*$}\]
Dann konvergiert also $f_n$ "`gleichmäßig"' gegen $f$. Wie in §9 folgt dann, dass $f$ stetig ist, da alle $f_n$ stetig sind. Somit konvergiert $(f_n)_{n\in\mathbb N}$ gegen $f$ (in $C(X)$). \par
Nun zum Beweis von ($*$). Sei $m \in \mathbb N$ mit $\|f_n - f_k\| < \varepsilon$ für alle $k,n \geq m$. Sei nun $n \geq m$ und $x \in X$. Wähle ein $k \geq m$ mit $|f_k(x) - f(x)| < \varepsilon$. Dann ist $|f_n(x) - f(x)| \leq |f_k(x) - f(x)| + |f_n(x) - f_k(x)| < \varepsilon + \|f_n-f_k\| < \varepsilon + \varepsilon = 2 \varepsilon$. Also $\|f_n-f\| \leq 2\varepsilon$.
\end{proof}
\begin{definition}
Sei $Y$ ein metrischer Raum und $A \subseteq Y$. $A$ ist {\em dicht} in $Y$, wenn für alle $y \in Y$ und alle $\varepsilon > 0$ ein $z \in A$ existiert mit $d(y,z) < \varepsilon$.
\end{definition}
\begin{remark}
Seien $A,Y$ wie oben. Dann gilt:
$A$ ist dicht in $Y$ genau dann, wenn für alle $y \in Y$ eine Folge $(a_n)_{n\in\mathbb N}$ aus $A$ existiert, die gegen $y$ konvergiert.
\end{remark}
\begin{gelaber}
Sei weiterhin $X$ ein kompakter metrischer Raum. Wir interessieren uns für dichte Teilmengen von $C(X)$.
\end{gelaber}
Für $f,g \in C(X)$ definiere $fg \colon X \to \mathbb R$ durch $(fg)(x) = f(x)g(x)$ für $x \in X$. Also $fg \in C(X)$.
\begin{definition}
Sei $A \subseteq C(X)$. $A$ ist eine {\em Algebra}, wenn $A \neq \varnothing$ und für alle $f,g \in A$ und $c \in \mathbb R$ gilt, dass $f + g, fg, cf \in A$.
\end{definition}
\begin{example}
Sei $X = [a,b]$ ein kompaktes Intervall. Dann ist die Menge aller Polynomfunktionen auf $X$ eine Algebra.
\end{example}
\begin{definition}
Sei $A \subseteq C(X)$. $A$ {\em trennt die Punkte} von $X$, wenn für alle $x,y \in X$ mit $x \neq y$ ein $f \in A$ mit $f(x) \neq f(y)$ existiert.
\end{definition}
\begin{remark}
Ist $A$ wie im obigen Beispiel, so trennt $A$ die Punkte von $X$, denn wir können einfach als $f$ die Identität wählen.
\end{remark}
\begin{remark}
Sei $A \subseteq C(X)$ eine Algebra. Setze
\[\overline A = \{f \in C(X) \colon \text{es existiert eine Folge $(f_n)_{n\in\mathbb N}$ aus $A$, die gegen $f$ konvergiert}\}\]
Dann ist $\overline A$ eine Algebra.
\end{remark}
\begin{proof}
Um z.B. zu zeigen, dass $f + g \in \overline A$ für $f,g \in \overline A$, benutze die Tatsache, dass wenn $(f_n)_{n\in\mathbb N}$ gegen $f$ und $(g_n)_{n\in\mathbb N}$ gegen $g$ konvergiert, folgt, dass $(f_n + g_n)$ gegen $f + g$ konvergiert.
\end{proof}
\begin{lemma}
Sei $X = [a,b]$ ein kompaktes Intervall. Definiere $f \colon X \to \mathbb R$ durch $f(x) = |x|$. Dann existiert eine Folge von Polynomfunktionenen auf $X$, die gleichmäßig gegen $f$ konvergiert.
\end{lemma}
\begin{proof}
Der Beweis folgt am Ende der Vorlesung.
\end{proof}
\begin{definition}
Seien $f, g \colon X \to \mathbb R$. Definiere die Funktionen $\max(f,g)$ und $\min(f,g)$ von $X$ nach $\mathbb R$ durch (für $x \in \mathbb R$)
\begin{align*}
\max(f,g)(x) &= \max(f(x),g(x))\\
\min(f,g)(x) &= \min(f(x),g(x))
\end{align*}
(entsprechend für endlich viele Funktionen)
\end{definition}
\begin{remark}
Es gelten
\begin{align*}
\max(f,g) &= \frac{f+g}{2} + \frac{|f-g|}{2}\\
\min(f,g) &= \frac{f+g}{2} - \frac{|f-g|}{2}
\end{align*}
\end{remark}
\begin{proof}
Nur die erste Gleichung. Aus Symmetriegründen gilt o.E. $\max(f(x),g(x)) = f(x)$. Aber $f(x) = \frac{1}{2}(f(x)+g(x))+\frac{1}{2}(f(x)-g(x))$.
\end{proof}
\begin{theorem}[Satz von Stone-Weierstraß]
Sei $X$ ein kompakter metrischer Raum, und sei $A \subseteq C(X)$ eine Algebra, welche die konstanten Funktionen enthält und die Punkte von $X$ trennt. Dann ist $A$ dicht in $C(X)$.
\end{theorem}
\begin{proof}
Wir setzen zuerst voraus, dass für $A$ zusätzlich gilt:
\[\forall f,g \in A \colon \max(f,g),\min(f,g) \in A\tag{$*$}\]
Nun gilt
\[\forall x,y \in X, \alpha,\beta \in \mathbb R \colon x \neq y \Longrightarrow \exists h \in A \colon h(x) = \alpha \wedge h(y) = \beta\tag{$+$}\]
Denn seien $x,y, \alpha,\beta$ wie in ($+$). Da $A$ die Punkte von $X$ trennt, gibt es ein $g \in A$ mit $g(x) \neq g(y)$. Definiere nun $h \colon X \to \mathbb R$ durch
\[h(z) = \alpha + (\beta - \alpha)\frac{g(z)-g(x)}{g(y)-g(x)}\]
Da $A$ eine Algebra ist und alle konstanten Funktionen enthält, ist $h \in A$. Außerdem $h(x) = \alpha$, $h(y) = \beta$. \\
Sei nun $f \in C(X)$ und $\varepsilon > 0$. Wir suchen ein $g \in A$ mit $f(x) - \varepsilon < g(x) < f(x) + \varepsilon$ für alle $x \in X$. Solch ein $g$ finden wir in zwei Schritten. Gemäß ($+$) wähle für je zwei $x,y \in X$ ein $h_{x,y} \in A$ mit $h_{x,y}(x) = f(x)$ und $h_{x,y}(y) = f(y)$. (für $x=y$ wähle die konstante Funktion $f(x)$). Sei nun $x \in X$. Für $y \in X$ ist $(h_{x,y} - f)(y) = 0$ und $h_{x,y}-f$ ist stetig. Also existiert eine offene Umgebung $U_y$ von $y$ mit
\[\forall z \in U_y \colon h_{x,y} < f(z) + \varepsilon\tag{$\Delta$}\]
Setze $\mathcal U = \{U_y \colon y \in X\}$. Dann ist $\mathcal U$ eine offene Überdeckung von $X$. Wegen $X$ kompakt existieren also endlich viele $y_1,\dots,y_n \in X$ mit $X = U_{y_1} \cup \dots \cup U_{y_n}$. Setze nun $h_x = \min(h_{x,y_1},\dots,h_{x,y_n})$. Wegen ($*$) ist dann $h_x \in A$ und nach ($\Delta$) gilt
\[\forall z \in X \colon h_x(z) < f(z) + \varepsilon\tag{$\circ$}\]
Weiterhin ist $h_x(x) = f(x)$, also $(h_x-f)(x) = 0$. Wegen Stetigkeit existiert also für alle $x \in X$ eine offene Umgebung $V_x$ von $x$ mit
\[\forall z \in U_x \colon f(z) - \varepsilon < h_x(z)\tag{$\heartsuit$}\]
Setze nun $\mathcal V = \{v_x \colon x \in X\}$. Dann ist $\mathcal V$ eine offene Überdeckung von $X$. Wegen $X$ kompakt existieren also endlich viele $x_1,\dots,x_n \in X$ mit $X = V_{x_1} \cup \dots \cup V_{x_n}$. Setze nun $g = \max(h_{x_1},\dots,h_{x_n})$. Wegen ($*$) ist $g \in A$ und nach ($\circ$),($\heartsuit$)
\[\forall z \in X \colon f(z) - \varepsilon < g(z) < f(z) + \varepsilon\]
Sei nun $A$ beliebig wie im Satz und sei $\overline A$ der Abschluss von $A$ (wie in früherer Bemerkung). Es genügt zu zeigen, dass $\overline A$ dicht in $C(X)$ liegt. Nach früherer Bemerkung ist $\overline A$ eine Algebra. Nach dem ersten Teil des Beweises genügt es also zu zeigen, dass für alle $f,g \in \overline A$ $\max(f,g),\min(f,g) \in \overline A$ gilt. Hierzu reicht es aber aus, dass für alle $f,g \in A$ gilt, dass $\max(f,g), \min(f,g) \in \overline A$. Nach obiger Bemerkung ist aber
\begin{align*}
\max(f,g) &= \frac{f+g}{2} + \frac{|f-g|}{2}\\
\min(f,g) &= \frac{f+g}{2} - \frac{|f-g|}{2}
\end{align*}
Da $\overline A$ eine Algebra ist, genügt es also zu zeigen, dass für $f \in A$ $|f| \in \overline A$ gilt. Sie hierzu $f \in A$ und setze $c = \|f\|$. Es genügt zu zeigen, dass für alle $\varepsilon > 0$ ein $g \in A$ existiert mit $\|g-|f|\| < \varepsilon$. Sei hierzu $\varepsilon > 0$. Nach Lemma 2 existiert ein Polynom $p$ mit
$|p(t) - |t|| \leq \varepsilon$ für alle $t \in [-c,c]$. Dann ist aber $|p(f(x)) - |f(x)|| \leq \varepsilon$ für alle $x \in X$. Aber $p \circ f \in A$, da $A$ eine Algebra ist.
\end{proof}
\begin{corollary}
Sei $X \subseteq \mathbb R^n$ kompakt und sei $P$ die Menge aller Polynomfunktionen auf $X$. Dann ist $P$ dicht in $C(X)$.
\end{corollary}
\begin{proof}
Offenbar ist $P$ eine Algebra, die alle konstanten Funktionen enthält. Um zu zeigen, dass $P$ die Punkte von $X$ trennt, betrachte für $1 \leq i \leq n$ die Polynomfunktionen $p_i(x_1,\dots,x_n) = x_i$. Sind $x = (x_1,\dots,x_n),y = (y_1,\dots,y_n) \in X$ mit $x \neq y$, so existiert $i$ mit $x_i \neq y_i$. Dann ist $p_i(x) = x_i \neq y_i = p_i(y)$. Also folgt die Behauptung aus Satz 3.
\end{proof}
\begin{gelaber}
Es gibt noch eine komplexwertige Version von Satz 3. Sei dann für einen kompakten metrischen Raum $X$ $C(X,\mathbb C)$ die Menge aller stetigen Funktionen von $X$ nach $\mathbb C$. Wir können auf $C(X,\mathbb C)$ die Supremumsnorm analog definieren durch
\[\|f\| = \sup\{|f(x)| \colon x \in X\}\]
$C(X,\mathbb C)$ ist dann ein normierter $\mathbb C$-Vektorraum. Wir sagen, dass $A \subseteq C(X,\mathbb C)$ eine $\mathbb C$-Algebra ist, wenn für alle $f,g \in A$ und $c \in \mathbb C$ $f+g,fg,cf \in A$ gilt. Für $f \colon X \to \mathbb C$ definiere die Konjugierte $\overline f$ durch $\overline f(x) = \overline{f(x)}$ für $x \in X$. Wir sagne, dass $A$ selbstkonjugiert ist, wenn für alle $f \in A$ gilt $\overline f \in A$.
\end{gelaber}
\begin{theorem}
Sei $X$ ein kompakter metrischer Raum und sei $A \subseteq C(X,\mathbb C)$ eine selbstkonjugierte $\mathbb C$-Algebra, welche die konstanten Funktionen enthält und die Punkte von $X$ trennt. Dann ist $A$ dicht in $C(X,\mathbb C)$.
\end{theorem}
\begin{proof}
Sei $A(\mathbb R) = A \cap C(X)$. Dann ist $A$ eine Algebra.
\[\text{$A(\mathbb R)$ trennt die Punkte von $X$}\tag{1}\]
Seien hierzu $x,y \in X$ mit $x \neq y$. Wähle $f \in A$ mit $f(x) \neq f(y)$. Definiere $g \colon X \to \mathbb C$ durch $g(z) = (f(z)-f(x))/(f(y)-f(x))$. Dann ist $g \in A$ und $g(x) = 0$, $g(y) = 1$. Setze nun $h = g + \overline g$. Wegen $A$ selbstkonjugiert ist dann $h \in A(\mathbb R)$ und $h(x) = 0 \neq 2 = h(y)$\hskip 0pt plus1fill\qedsymbol(1)
Somit folgt aus Satz 3
\[\text{$A(\mathbb R)$ ist dicht in $C(X)$}\]
Sei nun $\varphi \in C(X,\mathbb C)$ und $\varepsilon > 0$. Dann existieren $\psi_0, \psi_1 \in C(X)$ mit $\varphi = \psi_0 + i\psi_1$. Gemäß (2) wähle $f_0,f_1 \in A(\mathbb R)$ mit $\|\psi_0 - f_0\| \leq \varepsilon$ und $\|\psi_1 - f_1\| \leq \varepsilon$. Setze $f = f_0 + if_1$. Dann ist $f \in A$ und $\|\varphi - f\| \leq 2\varepsilon$.
\end{proof}
\begin{definition}
Sei $S = \{z \in \mathbb C \colon |z| = 1\}$. Eine Funktion $f \colon S \to \mathbb C$ ist ein {\em trigonometrisches Polynom} (auf $S$), wenn es ein $n \in \mathbb N$ gibt und $c_k \in \mathbb C$ für $k \in \mathbb Z$ mit $-n \leq k \leq n$, sodass für alle $z \in S$ gilt
\[f(z) = \sum_{k=-n}^nc_kz^k\]
\end{definition}
\begin{theorem}
Sei $S = \{z \in \mathbb C \colon |z| = 1\}$, und sei $T$ die Menge aller trigonometrischen Polynome auf $S$. Dann ist $T$ dicht in $C(S,\mathbb C)$.
\end{theorem}
\begin{proof}
Offenbar ist $T$ eine $\mathbb C$-Algebra, welche alle konstanten Funktionen enthält und die die Punkte von $S$ trennt. Wegen Satz 4 brauchen wir also nur noch zu zeigen, dass $T$ selbstkonjugiert ist. Sei hierzu $f \in T$ und etwa $f(z) = \sum_{k=-n}^nc_kz^k$ für $z \in \mathbb C$. Nun ist aber für $z \in S$ $\overline z = z^{-1}$. Also gilt für $z \in S$
\[\overline f(z) = \sum_{k=-n}^nc_kz^{-k} = \sum_{k=-n}^nc_{-k}z^k\]
Somit ist $\overline f \in T$.
\end{proof}
\begin{gelaber}
Der Kreis $S$ wird ja parametrisiert durch die Funktion $g \colon [0,2\pi] \to S$ definiert durch $g(t) = e^{it} = \cos t + i \sin t$. Jedem Element von $C(S,\mathbb C)$ entspricht dann kanonisch eine stetige Funktion $f^* \colon [0,2\pi] \to \mathbb C$ mit $f^*(0) = f^*(2\pi)$ definiert durch $f^*(t) = f(e^{it})$. $f^*$ kann man dann zu einer $2\pi$-periodischen Funktion $f^{**}$ fortsetzen, die auf ganz $\mathbb R$ definiert ist, indem man $f^{**}(2\pi n + t) = f^*(t)$ für $n \in \mathbb Z$ und $t \in [0,2\pi]$ setzt. Auf diese Weise erhält man alle $2\pi$-periodischen stetigen Funktionen $h \colon \mathbb R \to \mathbb C$. Beim Übergang von $f$ zu $f^*$ zu $f^{**}$ verändert sich die Supremumsnorm nicht. \par
Wir sagen nun $f \colon \mathbb R \to \mathbb C$ ist ein trigonometrisches Polynom auf $\mathbb R$, wenn ein $n \in \mathbb N$ existiert und $c_k \in \mathbb C$ für $k \in \mathbb Z$ mit mit $-n \leq k \leq n$, sodass gilt
\[f(t) = \sum_{k=-n}^n c_k e^{ikt}\]
\end{gelaber}
\begin{corollary}
Sei $B$ die Menge aller stetigen $2\pi$-periodischen Funktionen von $\mathbb R$ nach $\mathbb C$ (mit Supremumsnorm) und sei $T$ die Menge aller trigonometrischen Polynome (auf $\mathbb R$). Dann ist $T$ dicht in $B$.
\end{corollary}
\begin{gelaber}
Beachte noch, dass sich wegen $e^{ix} = \cos x + i \sin x$ jedes trigonometrische Polynom schreiben lässt als
\[f(t) = \frac{a_0}{2} + \sum_{k=1}^na_k\cos(kt) + i\sum_{k=1}^n b_k \sin(kt)\]
\end{gelaber}
\begin{definition}
Sei $(K_n)_{n\in\mathbb N}$ eine Folge von Funktionen $\mathbb R\to\mathbb R$. Dann ist $(K_n)_{n\in\mathbb N}$ eine {\em Diracfolge}, wenn gilt
\begin{enumerate}[(D{I}R1)]
\item Für alle $x\in\mathbb R$ und alle $n\in\mathbb N$ ist $K_n(x) \geq 0$.
\item Für alle $n\in\mathbb N$ ist $K_n$ stetig und $\int_{-\infty}^\infty K_n(t)\dd t = 1$.
\item Für alle $\varepsilon,\delta > 0$ existiert ein $m\in\mathbb N$, sodass für alle $n\geq m$ gilt:
\[
\int_{-\infty}^{-\delta}K_n(t)\dd t + \int_{\delta}^\infty K_n(t)\dd t < \varepsilon
\]
\end{enumerate}
Sei $(K_n)_{n\in\mathbb N}$ eine Diracfolge. Für eine stetige und beschränkte Funktion $f\colon\mathbb R\to\mathbb R$ definiere die {\em Faltung} $f*K_n$ von $f$ und $K_n$ durch
\[
(f*K_n)(x) = \int_{-\infty}^\infty f(t)K_n(x - t)\dd t
\]
\end{definition}
\begin{theorem}
Sei $(K_n)_{n\in\mathbb N}$ eine Diracfolge. Weiterhin sei $S\subseteq\mathbb R$ beschränkt und sei $f\colon\mathbb R\to\mathbb R$ stetig und beschränkt. Dann konvergiert die Folge $(f*K_n)_{n\in\mathbb N}$ auf $S$ gleichmäßig gegen $f$.
\end{theorem}
\begin{proof}
Setze $f_n = f*K_n$. Durch einfache lineare Substitution erhält man
\[
f_n(x) = \int_{-\infty}^\infty f(x-t) K_n(t)\dd t
\]
Wegen (DIR2) gilt aber
\[
f(x) = f(x) \int_{-\infty}^\infty K_n(t)\dd t = \int_{-\infty}^\infty f(x)K_n(t)\dd t
\]
Also ist
\[
f_n(x) - f(x) = \int_{-\infty}^\infty \big(f(x - t) - f(x)\big) K_n(t)\dd t
\]
Sei nun $\varepsilon > 0$. Wegen $S$ beschränkt existiert ein kompaktes Intervall $I = [c, d]$ mit $S\subseteq [c+\mu, d-\mu]$ für ein $\mu > 0$. Dann ist $f$ auf $I$ gleichmäßig stetig. Also existiert ein $\delta > 0$ mit $\big| f(x-t) - f(x) \big| < \frac{\varepsilon}{2}$ für alle $x\in S$ und $t\in \mathbb R$ mit $|t| < \delta$. Sei nun $M > 0$ eine Schranke für $f$, d.h. $|f(x)| \leq M$ für alle $x\in\mathbb R$. Gemäß (DIR3) wähle $m$ so, dass für alle $n\geq m$ gilt
\[
\int_{-\infty}^{-\delta} K_n(t)\dd t + \int_{\delta}^\infty K_n(t)\dd t < \frac{\varepsilon}{4M}
\]
Wir erhalten dann für $x\in S$
\begin{align*}
\big|f_n(x) - f(x)\big| &= \left| \int_{-\infty}^\infty \big(f(x - t) - f(x)\big) K_n(t)\dd t\right| \leq \\
& \leq \int_{-\infty}^\infty \big| f(x-t) - f(x)\big| K_n(t)\dd t =\\
&= \int_{-\infty}^{-\delta} \big|f(x-t) - f(x)\big| K_n(t)\dd t + \int_{-\delta}^\delta \big|f(x-t) - f(x)\big| K_n(t)\dd t+\mbox{}\\
& \text{\hphantom{$\mbox{=}$}}\mbox{}+{}\int_\delta^\infty \big| f(x-t) - f(x) \big| K_n(t)\dd t \leq \\
&\leq 2M\left( \int_{-\infty}^{-\delta} K_n(t)\dd t + \int_\delta^\infty K_n(t)\dd t \right) + \frac{\varepsilon}{2} \int_{-\delta}^\delta K_n(t)\dd t <\\
& < \frac{\varepsilon}{2} + \frac{\varepsilon}{2} = \varepsilon \qedhere
\end{align*}
\end{proof}
\begin{proof}[Beweis von Lemma 2]
Wir zeigen, dass für ein kompaktes Intervall $[a,b]$ und eine stetige Funktion $f\colon[a,b]\to\mathbb R$ eine Folge von Polynomfunktionen auf $[a,b]$ existiert, die gleichmäßig gegen $f$ konvergiert.\par
Sei o.E. $a\neq b$. Wir reduzieren die Behauptung zuerst auf den Fall $[a,b] = [0,1]$ und $f(a) = f(b) = 0$. Wir müssen ja zeigen:
\begin{itemize}
\item[$(*)$] für alle $\varepsilon > 0$ existiert ein Polynom $P$ mit $\|f - P\| \leq \varepsilon$.
\end{itemize}
Definiere $g\colon[0,1]\to\mathbb R, t\mapsto f\big((b-a) t + a\big)$. Falls ein Polynom $P$ existiert mit $\|g - P\| \leq \varepsilon$, so gilt $\left|f(x) - P\left(\frac{x-a}{b-a}\right)\right| \leq \varepsilon$ für alle $x\in [a,b]$. Aber $P\left(\frac{x-a}{b-a}\right)$ ist ein Polynom. Somit können wir voraussetzen, dass $[a,b] = [0,1]$. Setze nun $h(x) = f(x) - f(0) - x\big(f(1) - f(0)\big)$ für alle $x\in [0,1]$. Wenn wir $(*)$ für $h$ beweisen, so gilt es auch für $f$. Aber $h(0) = h(1) = 0$. Wir können also auch $f(a) = f(b) = 0$ voraussetzen.\par
Wir setzen $f$ auf ganz $\mathbb R$ fort, indem wir es außerhalb von $[0,1]$ gleich $0$ setzen. Wir nennen dies immer noch $f$. Dann ist $f$ stetig und beschränkt. Für $n\in\mathbb N$ setze
\[
c_n = \int_{-1}^1 \left(1-t^2\right)^n\dd t
\]
Definiere $K_n\colon\mathbb R\to\mathbb R$ durch
\[
K_n(t) = \begin{cases}
\frac{(1-t^2)^n}{c_n}&\qquad\text{falls $-1 \leq t \leq 1$}\\
0 &\qquad\text{sonst}
\end{cases}
\]
Beachte, dass $K_n(t) = K_n(-t)$ gilt. Wir zeigen, dass $(K_n)_{n\in\mathbb N}$ eine Dirac-Folge ist. (DIR1) und (DIR2) sind klar. Es ist außerdem
\[
\frac{c_n}{2} = \int_0^1 (1-t^2)^n\dd t = \int_0^1 (1+t)^n(1-t)^n\dd t \geq \int_0^1 (1-t)^n\dd t = \frac{1}{n+1}
\]
d.h. $c_n \geq \frac{2}{n+1}$. Für $1\geq \delta > 0$ folgt
\begin{align*}
\int_\delta^1 K_n(t)\dd t &= \int_\delta^1 \frac{(1-t^2)^n}{c_n}\dd t \leq \int_\delta^1\frac{n+1}{2}(1-\delta^2)^n\dd t =\\
&= \frac{n+1}{2}(1-\delta^2)^n (1-\delta) \underset{n\to\infty}\longrightarrow 0
\end{align*}
Also gilt auch (DIR3).
Schließlich zeigen wir, dass $f*K_n|_{[0,1]}$ ein Polynom ist. Sei also $f*K_n = f_n$. Es ist
\[
f_n(x) = \int_{-\infty}^\infty f(t)K_n(x-t)\dd t
\]
Da $f(t)K_n(x-t)$ für $t\in\mathbb R\setminus[0,1]$ gleich $0$ ist, ist
\[
f_n(x) = \int_0^1 f(t)K_n(x-t)\dd t
\]
Nun ist aber $K_n$ in dem Intervall $[-1,1]$ ein Polynom. Somit ist $K_n(x-t)$ ein Polynom in $x$ und $t$ und daher darstellbar als
\[
K_n(x-t) = \sum_{k=0}^{2n} g_k(t)x^k
\]
wobei $g_0,\dots,g_{2n}$ Polynome in $t$ sind. Daher gilt
\[
f_n(x) = \int_0^1f(t)\sum_{k=0}^{2n} g_k(t) x^k \dd t = \sum_{k=0}^{2n}\left(\int_0^1 f(t) g_k(t) \dd t\right) x^k
\]
Also ist $f_n$ in $[0,1]$ ein Polynom. Somit folgt $(*)$ aus Satz 6.
\end{proof}
\end{document}
|
http://bumble.sourceforge.net/books/java/win-dev/java-book.txt.x.tex
|
sourceforge.net
|
CC-MAIN-2018-09
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2018-09/segments/1518891813431.5/warc/CC-MAIN-20180221044156-20180221064156-00470.warc.gz
| 58,555,278
| 75,112
|
% -------------------------------------------
% latex generated by: booktolatex.cgi
% from source file : ../htdocs/books/java/win-dev/java-book.txt
% on: 21 February 2018, 5:27am
% querystring: books/java/win-dev/java-book.txt
% document-root: /var/www/html
% script-name: /cgi-bin/booktolatex.cgi
% Server-name: bumble.sourceforge.net
% Sed-script: booktolatex.sed
% -------------------------------------------
\documentclass[a4paper,12pt]{article}
\usepackage[margin=0.4cm,noheadfoot]{geometry}
\usepackage{color} %% to use colours, use "xcolor" for more
\usepackage{multicol} %% for multiple columns
\usepackage{keystroke} %% for keyboard key images
\usepackage[toc]{multitoc} %% for multi column table of contents
\usepackage{tocloft} %% to customize the table of contents
\setcounter{tocdepth}{2} %% only display 2 levels in the contents
\setlength{\cftbeforesecskip}{0cm} %% make the toc more compact
\usepackage{listings} %% for nice code listings
%\lstset{language={},
\lstset{language=java,
%% define special comment delimiters '##(' and ')'
moredelim=[s][\color{grey}\itshape\footnotesize\ttfamily]{~(}{)},
basicstyle=\ttfamily, %% fixed pitch font
xleftmargin=1cm, %% margin on the left outside the frames
breaklines=true, %% break long code lines
breakatwhitespace=false, %% break long code lines anywhere
breakindent=10pt, %% reduce the indent from 20pt to 10
postbreak=\mbox{{\color{blue}\small$\Rightarrow$\space}}, %% mark with arrow
showstringspaces=false, %% dont show spaces within strings
framerule=5pt, %% thickness of the frames
rulecolor=\color{lightgrey}, frame=l} %% source code settings
\usepackage{graphicx} %% to include images
\usepackage{fancybox} %% boxes with rounded corners
\usepackage{wrapfig} %% flow text around tables, images
\usepackage{tabularx} %% change width of tables
\usepackage[table]{xcolor} %% alternate row colour tables
\usepackage{booktabs} %% for heavier rules in tables
\usepackage[small,compact]{titlesec} %% sections more compact, less space
\usepackage{enumitem} %% more compact and better lists
\setlist{noitemsep} %% reduce list item spacing
\usepackage{hyperref} %% make urls into hyperlinks
\hypersetup{ %% add "pdftex," if only pdf output is required
colorlinks=true, %% set up the colours for the hyperlinks
linkcolor=black, %% internal document links black
urlcolor=black, %% url links black
filecolor=red,
citecolor=red,
bookmarks=true, pdfpagemode=UseOutlines}
% define some colours to use
\definecolor{lightgrey}{gray}{0.70}
\definecolor{grey}{gray}{0.30}
\titleformat{\section}[frame] %% titlesec: create framed section headings
{\normalfont}
{\filleft \footnotesize \enspace Section \thesection\enspace\enspace}
{3pt} {\bfseries\itshape\filright}
\title{The Java Programming Language}
\author{}
\date{21 July 2012, 5:36pm}
\setlength{\parindent}{0pt}
% \setlength{\parskip}{1ex}
% label lists with stars
\renewcommand{\labelitemi}{$\star$}
\begin{document}
\centerline{\Large \bf The Java Programming Language} \medskip
\begin{center}
{\huge ``}\textit{A world in itself}{\huge ''}
\textsc{anon}
\end{center}
% -----------------------------------
% the toc should be 2 columns because of the \multitoc package
\tableofcontents
Stroustrup: ``bloated and inefficient''
This booklet attempts to provide 'recipes' for how to carry out
common tasks with the java language. The idea of this and other
booklets at bumble.sf.net is to provide the most succint but complete
code snippets which will get the job done. But the java language
doesnt really lend itself to this type of succintness. Complete
examples are given where possible..
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{http://www.exampledepot.com/egs/}]
short examples
\item[\url{http://www.kodejava.org/examples/28.html}]
\item[\url{http://www.java2s.com/}]
a lot of examples
\item[\url{http://leepoint.net/notes-java/}]
good notes
\item[\url{www.java-tips.org}]
good tips
\end{description}
\section{History}
Bill Joy was an influential figure in the elaboration of the
Berkeley Standard Distribution (BSD) of the Unix operating system at
the University of California, Berkeley in the late 1960s / 1970s. He
was also involved in writing one of the first implementations of the
tcp/ip protocol while still a student as well as creating the 'vi'
text editor which is one of the most popular terminal unix text
editors (especially in its modern 'vim' version).
He then went on to co-found Sun Microsystems, where he sponsored the
development of the Java language. James Gosling, who had previously
worked on the development of the emacs text editor worked on Java.
\section{Installing Java}
There are several versions of the java 'run-time engine', librarys
and 'java development kit', but the most complete still seems
to be the version from Sun Microsystems, the inventors of Java
\subsection{On Microsoft Windows}
On Microsoft windows computers one needs to set the 'path'
environment variable manually after the installer has completed
\subsection{On Unix}
The process is basically: download a .tar.gz file, unpack and
uncompress it with tar xvzf ...., copy the files to somewhere, maybe
/opt/ set permissions, and more.
All this is necessary because Sun/Oracle do not provide a .deb or
.rpm package file which would make the process much simpler.
Download the 32bit or 64bit Linux ``compressed binary file'' - it has a
``.tar.gz'' file extension and uncompress it
\emph{ Unpack the .tar.gz file }
\begin{lstlisting}
tar -xvf jre-7-linux-i586.tar.gz
\end{lstlisting}
a folder such as ./jre1.7.0 is created
\emph{ Move this new folder into the /usr/lib/jvm/ folder }
\begin{lstlisting}
sudo mv ./jre1.7.0* /usr/lib/jvm/jre1.7.0
\end{lstlisting}
\emph{ Choose the sun version of the jre }
\begin{lstlisting}
sudo update-alternatives --config java
\end{lstlisting}
and more stuff ....
\section{Basic Java}
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{www.java2s.com/Code/Java/Language-Basics/CatalogLanguage-Basics.htm}]
examples of language basics
\end{description}
\emph{ Possibly the simplest java program }
\begin{lstlisting}
public class Test {
public static void main(String[] args) {
System.out.println("hello");
}
}
\end{lstlisting}
The parameter to the main method is necessary.
\section{Classes}
\emph{ A simple class with a constructor }
\begin{lstlisting}
public class Name {
public String first;
public String last;
public Name(String f, String l) {
this.first = f; this.last = l;
}
}
\end{lstlisting}
\emph{ Another simple class with a constructor }
\begin{lstlisting}
public class Name {
private String first;
private String last;
public Name(String f, String l)
{ this.first = f; this.last = l; }
public void print()
{ System.out.println(this.first + " " + this.last); }
public static void main(String[] args) {
Name t = new Name("Bill", "King");
t.print();
}
}
\end{lstlisting}
\subsection{Inheriting From Classes}
The process of inheriting from a class is also known as
'extending' a class.
\emph{ Create a class 'Circle' which inherits from the 'Shape' class }
\begin{lstlisting}
public class Circle extends Shape {}
\end{lstlisting}
\section{Objects}
An object is an instance of a class which has been created
(that is: allocated memory, and initialized). Objects in java
are created with the 'new' keyword and one of the classes
constructors.
\emph{ Check if an object is an instance of a class }
\begin{lstlisting}
BufferedImage bufImg = null;
if (origImage instanceof BufferedImage) {
bufImg = (BufferedImage) origImage;
} else { bugImg = new BufferedImage(...); }
\end{lstlisting}
\section{Declarations}
\emph{ Declare 2 variables as type integer }
\begin{lstlisting}
int x, y;
\end{lstlisting}
\section{Methods}
\emph{ A simple method declaration and body }
\begin{lstlisting}
public string getAge(String name)
{
return this.age;
}
\end{lstlisting}
\section{Reflection}
Reflection allows a program to find out information about
java classes. This is also known as 'introspection' and allows
a program at run-time to find out what methods a particular
class or object has.
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{http://java.sun.com/developer/technicalArticles/ALT/Reflection/}]
a good article about using reflection with java
\end{description}
\subsection{Display Methods}
We can use reflection to find out and display all the
methods, whether public or private which belong to a particular
class.
\emph{ Display the public methods for the 'String' class including inherited }
\begin{lstlisting}
import java.lang.reflect.*;
public class Test
{
public static void main(String args[]) throws Exception
{
Class c = Class.forName("java.lang.String");
Method m[] = c.getMethods();
for (int i = 0; i < m.length; i++)
System.out.println(m[i]);
}
}
\end{lstlisting}
\emph{ Display public and private methods declared in the 'String' class }
\begin{lstlisting}
import java.lang.reflect.*;
public class Test
{
public static void main(String args[]) throws Exception
{
Class c = Class.forName("java.lang.String");
Method m[] = c.getDeclaredMethods();
for (int i = 0; i < m.length; i++)
System.out.println(m[i]);
}
}
\end{lstlisting}
This technique, however, doesnt display the methods which are
inherited from super-classes, which in some cases is a serious
deficiency.
\emph{ Display the public methods for the 'String' class in a list box }
\begin{lstlisting}
import java.lang.reflect.*;
import javax.swing.*;
public class PublicMethodsTest
{
public static void main(String args[]) throws Exception
{
Class c = Class.forName("java.lang.String");
Method mm[] = c.getMethods();
Object r = JOptionPane.showInputDialog(
null, "Choose a method:", "Methods",
JOptionPane.PLAIN_MESSAGE, null, mm, mm[0]);
System.out.println( "value selected: " + r );
}
}
\end{lstlisting}
\emph{ Public methods in a listbox with a scroll pane }
\begin{lstlisting}
import javax.swing.*;
import java.awt.Font;
import java.lang.reflect.*;
public class MethodList extends JFrame {
public MethodList() {
super("A method Box");
try {
Class c = Class.forName("java.lang.String");
Method mm[] = c.getMethods();
JList list = new JList(mm);
//list.setFont(new Font("Georgia", Font.PLAIN, 20));
JPanel p = new JPanel(); p.add(new JScrollPane(list));
this.getContentPane().add(p);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.pack(); this.setLocationRelativeTo(null);
this.setVisible(true);
}
catch (ClassNotFoundException e)
{ System.out.println(e); }
}
public static void main(String[] args) {
MethodList t = new MethodList();
}
}
\end{lstlisting}
\emph{ Display all the public methods for the current class }
\begin{lstlisting}
import java.lang.reflect.*;
import javax.swing.*;
public class Test
{
public static void main(String args[]) throws Exception
{
Test t = new Test();
Class c = t.getClass();
Method mm[] = c.getMethods();
Object r = JOptionPane.showInputDialog(
null, "Choose method:", "Methods", JOptionPane.PLAIN_MESSAGE,
null, mm, mm[0]);
System.out.println( "Method selected was: " + r );
}
}
\end{lstlisting}
\emph{ Display all the methods for the 'Integer' class }
\begin{lstlisting}
import java.lang.reflect.*;
public class Test
{
public static void main(String args[]) throws Exception
{
Class c = Integer.TYPE;
Method m[] = c.getMethods();
for (int i = 0; i < m.length; i++)
System.out.println(m[i].toString());
}
}
\end{lstlisting}
This does not display any results for me.
\emph{ Display the public method names and return type for the 'Method' class }
\begin{lstlisting}
import java.lang.reflect.*;
public class Test
{
public static void main(String args[]) throws Exception
{
Class c = Class.forName("java.lang.reflect.Method");
Method m[] = c.getMethods();
for (int i = 0; i < m.length; i++)
System.out.println(m[i].getReturnType() + " " + m[i].getName());
}
}
\end{lstlisting}
\emph{ Display a list of methods with checkboxes for the 'URL' class }
\begin{lstlisting}
import java.lang.reflect.*;
import javax.swing.*;
import java.awt.GridLayout;
public class Test {
public static void main(String[] args) throws Exception
{
JFrame f = new JFrame("Methods with checkboxes for 'URL'");
JPanel p = new JPanel(new GridLayout(0,1));
Class c = Class.forName("java.net.URL");
Method mm[] = c.getDeclaredMethods();
for (int ii = 0; ii < mm.length; ii++)
{
p.add(new JCheckBox(mm[ii].toString()));
}
f.getContentPane().add(new JScrollPane(p));
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ useful methods of the Method class }} \\
\hline
\texttt{ m.getParameterTypes() } & The types of all the method parameters \\
\texttt{ m.getDeclaringClass() } & The class which declared the method \\
\texttt{ m.getReturnType() } & The method return type \\
\hline
\end{tabular}
\end{center}
\emph{ Display the constructors for the 'String' class }
\begin{lstlisting}
import java.lang.reflect.*;
public class Test
{
public static void main(String args[]) throws Exception
{
Class c = Class.forName("java.lang.String");
Constructor co[] = c.getDeclaredConstructors();
for (int i = 0; i < co.length; i++)
System.out.println(co[i].toString());
}
}
\end{lstlisting}
\emph{ Display all the field variables for the 'String' class }
\begin{lstlisting}
import java.lang.reflect.*;
public class Test
{
public static void main(String args[]) throws Exception
{
Class c = Class.forName("java.lang.String");
Field f[] = c.getDeclaredFields();
for (int i = 0; i < f.length; i++)
System.out.println(f[i].toString());
}
}
\end{lstlisting}
\section{Compiling Java Programs}
\emph{ Compile and run a java program }
\begin{lstlisting}
javac Test.java
\end{lstlisting}
\begin{lstlisting}
java Test
\end{lstlisting}
\subsection{Runtime Compiling Of Java Code}
http://www.javabeat.net/2007/04/the-java-6-0-compiler-api/
a very good article about doing this
http://juixe.com/techknow/index.php/2006/12/13/java-se-6-compiler-api/
another article about this
\emph{ Compiling java code using the compiler api }
\begin{lstlisting}
JavaCompiler jc = ToolProvider.getSystemJavaCompiler();
StandardJavaFileManager sjfm = jc.getStandardFileManager(null, null, null);
File javaFile = new File(¿c:/src/com/juixe/Entity.java¿);
// by default is compiled to c:/src
// getJavaFileObjects¿ param is a vararg, a variable number of arguments
Iterable fileObjects = sjfm.getJavaFileObjects(javaFile);
String[] options = new String[] {¿-d¿, ¿c:
/bin¿};
jc.getTask(null, sjfm, null, Arrays.asList(options), null, fileObjects).call();
// Add more compilation tasks
sjfm.close();
\end{lstlisting}
\emph{ Load a class at runtime }
\begin{lstlisting}
File outputDir = new File(¿c:/bin¿);
URL[] urls = new URL[]{outputDir.toURL()};
URLClassLoader ucl = new URLClassLoader(urls, cl);
Class clazz = ucl.loadClass(¿com.juixe.Entity¿);
\end{lstlisting}
\emph{ Another better example of compiling at runtime }
MyClass.java: the class that will be compiled
package test;
public class MyClass $\{$
public void myMethod()$\{$
System.out.println(``My Method Called'');
$\}$
$\}$
SimpleCompileTest.java: the class which compiles the other at runtime
package test;
import javax.tools.*;
public class SimpleCompileTest $\{$
public static void main(String[] args) $\{$
String fileToCompile = ``test'' + java.io.File.separator +``MyClass.java'';
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
int compilationResult = compiler.run(null, null, null, fileToCompile);
if(compilationResult == 0)$\{$
System.out.println(``Compilation is successful'');
$\}$else$\{$
System.out.println(``Compilation Failed'');
$\}$
$\}$
$\}$
,,,
But the jdk is required for the above to work because it accesses
the tools.jar file in the jdk lib/tools folder
\emph{ Before java 6 compile java code at runtime }
\begin{lstlisting}
//put tools.jar from the jdk in your classpath,
com.sun.tools.javac.Main javac = new com.sun.tools.javac.Main();
String[] options = new String[] {
¿-classpath¿, classpath, ¿-d¿, outputDir, filename
};
javac.compile(options);
\end{lstlisting}
\subsection{Building Projects}
For large projects with many source files a build tool is often used
to ensure that all files are properly built.
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ tools }} \\
\hline
\texttt{ Ant } & \\
\texttt{ make } & \\
\texttt{ maven } & Finds and solves class dependencies \\
\hline
\end{tabular}
\end{center}
The Maven Central repository maybe the closest things Java
has to the Perl cpan repository.
\section{If Conditionals}
The 'if' statement is used to branch pogram flow
depending on a particular condition.
\section{Ternary Operator}
The ternary operator is a compact form of the if / else statement
\emph{ Find the minimum value }
\begin{lstlisting}
minVal = a < b ? a : b;
\end{lstlisting}
\begin{lstlisting}
minVal = (a < b) ? a : b;
\end{lstlisting}
\emph{ A print statement using a the ternary operator }
\begin{lstlisting}
System.out.println("will last " + icecreamLife +
\end{lstlisting}
\begin{lstlisting}
" month" + (icecreamLife==1?"":"s") +" and " + icecreamFate);
\end{lstlisting}
\emph{ Use the ternary operator }
\begin{lstlisting}
int i = 1; String s = (i==0?"zero":"non-zero");
\end{lstlisting}
\section{Switch Statement}
\emph{ A simple switch statement }
\begin{lstlisting}
int result = 0;
switch (result)
{
case 0:
break;
case 1:
break;
default:
break;
}
\end{lstlisting}
\section{Loops}
Java does not have a 'map' function, which transforms each
element of a collection using a function and without looping.
\subsection{For Loops}
\emph{ Since java 1.5 the extended for loop or foreach loop }
\begin{lstlisting}
for (type var : arr) {
body-of-loop
}
\end{lstlisting}
\emph{ Loop over any type of collection (implements iterable) }
\begin{lstlisting}
for (Iterator<type> iter = coll.iterator(); iter.hasNext(); ) {
type var = iter.next();
body-of-loop
}
\end{lstlisting}
\emph{ The same as above, but only since java 1.5 }
\begin{lstlisting}
for (type var : coll) {
body-of-loop
}
\end{lstlisting}
\emph{ A simple counting loop }
\begin{lstlisting}
for (int ii = 0; ii < 7; ii++)
{
System.out.println("ii=" + ii + " ");
}
\end{lstlisting}
\emph{ A loop which runs until the user enters 'q' }
\begin{lstlisting}
import java.util.Scanner;
public class Test {
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
for (String s = ""; !s.equals("q"); s = scan.nextLine())
{
System.out.println("You entered: " + s);
System.out.println("Type q to quit");
}
} }
\end{lstlisting}
\subsection{While Loops}
\emph{ A while loop }
\begin{lstlisting}
String s = "";
Scanner scan = new Scanner(System.in);
while (!s.equals("q"))
{
System.out.print("type q to quit> ");
s = scan.nextLine();
}
\end{lstlisting}
\section{Arrays}
Arrays can be passed to methods or functions, but changes made
to the elements are permanent (no copy of the array is made
when it is passed to the method).
\emph{ Declare a method 'do' which takes an integ }
\begin{lstlisting}
public void do(int [] array);
\end{lstlisting}
\subsection{Declaring Arrays}
\emph{ Create an array of 4 integers, with the values initialized }
\begin{lstlisting}
int[] ii = {100, 200, 300, 400};
\end{lstlisting}
\emph{ Declare an array of 30 integers }
\begin{lstlisting}
int[30] a;
\end{lstlisting}
\emph{ Declare an array with space for 25 strings }
\begin{lstlisting}
String[] ss = new String[25]; ~(???)
\end{lstlisting}
\emph{ Declare an array of characters }
\begin{lstlisting}
char[] c = {'a', 'b', 'c'};
\end{lstlisting}
\emph{ Declare an array of strings }
\begin{lstlisting}
String[] ss = {"oak", "alder", "amber"};
\end{lstlisting}
\subsection{Displaying Arrays}
\emph{ Print an array with Arrays.toString (since 1.5) }
\begin{lstlisting}
import java.util.Arrays;
public class ArrayTest {
public static void main(String[] args) {
String[] ss = {"gold", "green", "red"};
System.out.println(Arrays.toString(ss));
}
}
\end{lstlisting}
\emph{ Display an array with a JOptionPane list-box }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
String[] ss = {"gold", "green", "red"};
Object r = JOptionPane.showInputDialog(
null, "Choose one element:", "Displaying arrays",
JOptionPane.PLAIN_MESSAGE, null, ss, ss[0]);
System.out.println("element selected: " + r);
}
}
\end{lstlisting}
\subsection{Looping Through Arrays}
Java does have a way to apply a function to all elements
of an array at once (although apparently scala does), so you
have to loop through the array one element at a time.
\emph{ Add all elements of the array nn }
\begin{lstlisting}
int sum = 0;
for (int v : nn) { sum += v; }
\end{lstlisting}
The above loop cannot be used to set the values of the array
\emph{ Assign random numbers to the elements of an array }
\begin{lstlisting}
int[] a = new int[1000];
for (int i = 0; i < a.length(); i++) {
// Random number 0-99999
a[i] = (int)(Math.random() * 100000);
}
\end{lstlisting}
\subsection{Comparing Arrays}
\emph{ Check if 2 arrays are equal (contain the same objects) }
\begin{lstlisting}
import java.util.Arrays;
public class Test {
public static void main(String[] args) {
String[] ss = {"gold", "green", "red"};
String[] tt = {"gold", "green", "red"};
System.out.println("equal? " + Arrays.equals(ss, tt));
}
}
\end{lstlisting}
\emph{ Sort an array of integers into ascending order }
\begin{lstlisting}
import java.util.Arrays;
public class Test {
public static void main(String[] args) {
int[] ii = {5, 3, 8, 1};
System.out.println("array: " + Arrays.toString(ii));
Arrays.sort(ii);
System.out.println("sorted: " + Arrays.toString(ii));
}
}
\end{lstlisting}
\emph{ Concatenate 2 arrays of strings }
\begin{lstlisting}
String[] concat(String[] aa, String[] bb) {
String[] C= new String[A.length+B.length];
System.arraycopy(aa, 0, cc, 0, aa.length);
System.arraycopy(B, 0, C, A.length, B.length);
return C;
}
,,,,
* create an array of 10 integers
>> anArray = new int[10];
* copy one array to another
\begin{lstlisting}
public class Test {
public static void main(String[] args) {
char[] copyFrom = { 'd', 'e', 'c', 'a', 'f', 'f', 'e'};
char[] copyTo = new char[7];
System.arraycopy(copyFrom, 2, copyTo, 0, 3);
System.out.println(new String(copyTo));
}
}
\end{lstlisting}
\subsection{Searching Arrays}
\emph{ Determine if an array contains a certain element }
\begin{lstlisting}
String ss = {"a","b","c"}; Arrays.asList(ss).contains("b");
\end{lstlisting}
\subsection{More Arrays}
CAN create and return an array from a method
arrays passed in are changed by methods.
\emph{ Different ways to initialize arrays }
\begin{lstlisting}
int[] ii = {100, 200, 300, 400};
\end{lstlisting}
\begin{lstlisting}
int[30] a;
\end{lstlisting}
\begin{lstlisting}
char[] c = {'a', 'b', 'c'};
\end{lstlisting}
\begin{lstlisting}
double[] d = new double[5];
\end{lstlisting}
\begin{lstlisting}
String[] ss = new String[25];
\end{lstlisting}
\begin{lstlisting}
int[] aa = {1, 2, 3}; ob.doo(aa);
\end{lstlisting}
All c is initialised to (int)0
char[] c = new char[20];
for (int i=0; i $<$ c.length; i++)
System.out.println(``c1='' + (int)c[i]);
\section{Collections}
Collections are used for arrays of objects where the
number or type of objects which need to be stored is not known
by the program writer.
In modern Java, use is made of 'generics' which allow an easier
use of objects within collections.
\emph{ Use ArrayList for resizable arrays }
\emph{ Create and add a mutable string to an array list. }
\begin{lstlisting}
List l = new ArrayList();
l.add(new StringBuffer());
\end{lstlisting}
\emph{ Loop through each element of an array list by index number }
\begin{lstlisting}
import java.util.ArrayList;
import java.util.List;
public class Test {
public static void main(String[] args) {
List list = new ArrayList();
for (int jj = 0; jj < list.size(); jj++) {
System.out.println("[" + jj + "] - " + list.get(jj));
}
}
}
\end{lstlisting}
\emph{ Get the first element (an integer) from the array list }
\begin{lstlisting}
Integer one = (Integer) arrayList.get(0)
\end{lstlisting}
\emph{ Vector is older (synchronised for multi threads?) }
\subsection{Arraylists}
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{www.java2s.com/Code/Java/Collections-Data-Structure/ArrayList.htm}]
arraylist examples
\end{description}
\section{Numbers}
\subsection{Random Numbers}
\emph{ Generate a random integer }
\begin{lstlisting}
Random rand = new Random();
selected = rand.nextInt(100);
\end{lstlisting}
\emph{ Generate a random number from 0 to 100 }
\begin{lstlisting}
int r = (int)(Math.random() * 100)
\end{lstlisting}
\section{Characters}
\emph{ Get information about a character }
\begin{lstlisting}
import java.text.*;
char cc = 'a'; if (Character.isLowerCase(cc)) { //true }
\end{lstlisting}
\section{Unicode}
One of the great strength of java is that it was designed
with the unicode character set in mind.
The font Droid Sans Fallback seems to have the largest
number of glyphs and therefore is the font to use for displaying
weird and wonderful characters
\emph{ Displays some unicode characters in a grid, with descriptions }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
public class Glyphs {
public static void main(String[] args) {
JFrame t = new JFrame();
Font font; JLabel label;
String name = new String();
JPanel p = new JPanel(new GridLayout(0, 10));
font = new Font("Georgia", Font.PLAIN, 30);
for (int i = 0; i < 10000 && font.hasGlyph(i); i++)
{
label = new JLabel("" + (char)i);
label.setFont(font);
label.setToolTipText("decimal:" + i +
" " + Character.getName(i));
p.add(label);
}
t.getContentPane().add(new JScrollPane(p));
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.setExtendedState(Frame.MAXIMIZED_BOTH); t.pack();
t.setVisible(true);
}
}
\end{lstlisting}
The code above takes a long time to display, several seconds
on a netbook computer.
\section{Interesting Unicode Characters}
http://unicode.org/Public/UNIDATA/NamesList.txt
the official list of unicode character names.
Helpful for finding something
U+2620 skull and cross bones
U+2603 snow man
U+2368 APL FUNCTIONAL SYMBOL TILDE DIAERESIS, looks like a sad face
U+0E5B a spirally curly symbol, thai character khomut
http://coolunicodecharacters.blogspot.com/
some interesting fancy letter unicode characters
http://fsymbols.com/
graphical unicode characters, such as an aeroplane etc organised by
type. Have to look at the source code for the numbers
The miscelaneous technical page has some clock symbols
592 to \#780 linguistic phonetic symbols
note:
jdk7 will have a String getName(int codepoint) function
(READ: a ¿static method¿ in class java.lang.Character) that will turn a codepoint
into its official Unicode name.
\section{Strings}
\emph{ Determine of a string contains a character }
\begin{lstlisting}
if ("abcd".indexOf('e') == -1) System.out.println("not in the string");
\end{lstlisting}
\emph{ Check if a string is an integer }
\begin{lstlisting}
boolean isInteger = Pattern.matches("^\\d*$", "1245");
\end{lstlisting}
\subsection{Converting Strings}
\emph{ Convert a String to a double }
\begin{lstlisting}
double d = Double.valueOf("2.333").doubleValue();
\end{lstlisting}
\emph{ Convert a double to a String }
\begin{lstlisting}
String s = String.valueOf(2.333);
\end{lstlisting}
\emph{ Convert a string to an integer (throws NumberFormatException) }
\begin{lstlisting}
int i = Integer.parseInt("124")
\end{lstlisting}
\emph{ Parse a string with whitespace into an integer }
\begin{lstlisting}
int test= Integer.parseInt(s.trim());
\end{lstlisting}
\subsection{Substituting In Strings}
\emph{ Substitute in strings }
\begin{lstlisting}
String t = new String("Content: one"
String s = t.replace("Content:", "").replace("o", "O");
\end{lstlisting}
\subsection{String Buffers}
\emph{ Create and append something to a string buffer }
\begin{lstlisting}
StringBuffer s = new StringBuffer("");
s.append("hi");
\end{lstlisting}
\emph{ Concatenate 2 strings }
\begin{lstlisting}
"A" + "B"
\end{lstlisting}
\emph{ Concatenate a string and an integer }
\begin{lstlisting}
"A" + 2
\end{lstlisting}
\section{Files And Directories}
\emph{ Get the absolute file name from a relative name. }
\begin{lstlisting}
file = new File("dir" + File.separatorChar + "filename.txt");
file = file.getAbsoluteFile(); // c:\temp\dir\filename.txt
\end{lstlisting}
\emph{ Print a list of files in the current directory }
\begin{lstlisting}
import java.io.File;
import java.util.Arrays;
public class Test {
public static void main(String[] args) {
File[] ff = (new File(".")).listFiles();
System.out.println(Arrays.toString(ff));
}
}
\end{lstlisting}
\emph{ Print a list of files and their sizes in the current directory }
\begin{lstlisting}
import java.io.File;
import java.util.Arrays;
public class Test {
public static void main(String[] args) {
File[] ff = (new File(".")).listFiles();
for (int ii = 0; ii < ff.length; ii++)
{
System.out.println(ff[ii] + " " + ff[ii].length());
}
}
}
\end{lstlisting}
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ useful methods of the File class }} \\
\hline
\texttt{ File[] listFiles() } & Returns all the files in the folder \\
\texttt{ long length() } & Returns the size of the file in bytes \\
\texttt{ boolean isDirectory() } & If the file is a folder \\
\texttt{ boolean isFile() } & If the file is not a folder \\
\texttt{ boolean renameTo(File) } & Rename the file object \\
\hline
\end{tabular}
\end{center}
\emph{ Open a file within a jar file or in the local file system. }
\begin{lstlisting}
URL url = this.getClass().getClassLoader().getResource("gameover.wav");
\end{lstlisting}
\subsection{Reading Files}
\emph{ Read and display text file line by line, using default encoding }
----
import java.io.*;
public class FileReadTest $\{$
public static void main(String[] args) throws Exception $\{$
String line;
File f = new File(``FileReadTest.java'');
BufferedReader in = new BufferedReader(new FileReader(f));
while ((line = in.readLine()) != null)
System.out.println(line);
in.close();
$\}$
$\}$
,,,
\emph{ Read a text file into a string buffer line by line }
\begin{lstlisting}
import java.io.*;
public class FileReadTest {
public static void main(String[] args) throws Exception {
String line;
File f = new File("FileReadTest.java");
BufferedReader in = new BufferedReader(new FileReader(f));
StringBuffer result = new StringBuffer();
while ((line = in.readLine()) != null)
result.append(line + "\n");
in.close();
System.out.println(result);
}
}
\end{lstlisting}
----
BufferedReader br = new BufferedReader(fr);
String buffer;
StringBuffer result = new StringBuffer();
while ((buffer = br.readLine()) != null)
$\{$
result.append(buffer);
$\}$
,,,
It would probably be faster to read into a larger buffer (8k ?) rather than
just one line.
\section{Standard Input Stream}
\section{Urls}
\emph{ Connect through a proxy host to the net }
\begin{lstlisting}
java -Dhttp.proxyHost=proxyhost [-Dhttp.proxyPort=portNumber] URLReader
\end{lstlisting}
\emph{ Read a url }
----
import java.net.*;
import java.io.*;
public class Test $\{$
public static void main(String[] args) throws Exception $\{$
URL url = new URL("http://bumble.sf.net/notes/index.txt");
BufferedReader in = new BufferedReader(
new InputStreamReader(url.openStream()));
String line;
while ((line = in.readLine()) != null)
System.out.println(line);
in.close();
$\}$
$\}$
,,,
\emph{ Check if a url host is valid and the file exists }
\begin{lstlisting}
import java.net.*;
import java.io.*;
public class Test {
public static void main(String[] args) throws Exception {
URL url = new URL("http://bumble.sf.net/ntes/index.txt");
try
{
url.openStream();
System.out.println("ok");
}
catch (UnknownHostException e)
{ System.out.println("unknown host"); }
catch (FileNotFoundException e)
{ System.out.println("file not found"); }
}
}
\end{lstlisting}
\section{Input And Output}
\emph{ Get one line of input from the user }
\begin{lstlisting}
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
in.readLine();
\end{lstlisting}
\emph{ Use the Scanner class to get and parse user input }
\begin{lstlisting}
import java.util.Scanner;
public class Test {
public static void main(String[] args)
{
String s = "";
Scanner input = new Scanner(System.in);
System.out.println("enter something, 'q' to end");
while (!s.equals("q")) {
s = input.next();
System.out.println("entered: " + s);
}
}
}
\end{lstlisting}
\emph{ Read all numbers from a string, ignoring anything else }
-----
import java.util.Scanner;
public class Test $\{$
public static void main(String args[]) $\{$
String s = "10 99.88 scanning 44.1 is easy.";
Scanner scan = new Scanner(s);
while (scan.hasNext()) $\{$
if (scan.hasNextDouble())
System.out.println(scan.nextDouble());
else
scan.next();
$\}$
$\}$
$\}$
,,,
\section{Text Files}
\emph{ Read long integers from a text file }
\begin{lstlisting}
// since 1.6
Scanner scanner = new Scanner(new File("numbers.txt"));
while (scanner.hasNextLong())
{ long aLong = scanner.nextLong(); }
\end{lstlisting}
\emph{ Read a textfile line by line }
\begin{lstlisting}
try
{
BufferedReader in =
new BufferedReader (new FileReader ("infilename"));
String s;
while ((s = in.readLine()) != null)
{ System.out.println(s); }
in.close ();
} catch (IOException e) { }
\end{lstlisting}
\emph{ Read either a file or a Url (file://c:/.. or http://) }
\begin{lstlisting}
URL url = new URI(http://www.google.com).toURL();
URLConnection conn = url.openConnection ();
Reader rd = new InputStreamReader (conn.getInputStream ());
\end{lstlisting}
\emph{ Reading a utf-8 file in a non utf-8 locale }
\begin{lstlisting}
FileInputStream fis = new FileInputStream("test.txt");
InputStreamReader in = new InputStreamReader(fis, "UTF-8");
\end{lstlisting}
\subsection{Working With Html}
http://www.exampledepot.com/egs/javax.swing.text.html/pkg.html
an example of getting the links in an html document
\section{Fonts}
The default fonts for Java are not very pleasant. They dont seem
to be well antialiases or smoothed and this does alot to put
people of developing in Java even before they get started
Fonts bundled with the Java development kit are stored in
\begin{lstlisting}
J:\Program Files\java\jdk1.7.0_04 \jre\lib\fonts\.
\end{lstlisting}
They are only available to java applications unless they are
explicitly installed in the Windows or Unix font repositories
\emph{ Create a new monospace courier font, size 20 points }
\begin{lstlisting}
Font font = new Font("Courier", Font.PLAIN, 20);
\end{lstlisting}
\emph{ Make a bold serifed font, 10 points in size }
\begin{lstlisting}
Font font = new Font("Serif", Font.BOLD, 10);
\end{lstlisting}
\emph{ Create a 24 point italic font }
\begin{lstlisting}
Font f = new Font("Times New Roman", Font.ITALIC, 24);
\end{lstlisting}
\emph{ Get all available font family names }
\begin{lstlisting}
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
String fontNames[] = ge.getAvailableFontFamilyNames();
\end{lstlisting}
\emph{ Show a list of all available font families and select one }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
public class FontList {
public static void main(String[] args) {
SwingUtilities.invokeLater( new Runnable() {
public void run() {
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
String fontNames[] = ge.getAvailableFontFamilyNames();
Object r = JOptionPane.showInputDialog(
null, "Choose a font:", "Available Fonts",
JOptionPane.PLAIN_MESSAGE, null, fontNames, fontNames[0]);
System.out.println("font selected: " + r);
}
});
}
}
\end{lstlisting}
\emph{ Displays fonts in a listbox and uses the font for the item }
\begin{lstlisting}
import java.awt.*;
import javax.swing.*;
public class ShowFonts {
public static void main(String[] args) {
SwingUtilities.invokeLater( new Runnable() {
public void run() {
GraphicsEnvironment ge = GraphicsEnvironment.
getLocalGraphicsEnvironment();
String[] fonts = ge.getAvailableFontFamilyNames();
JList fontChooser = new JList(fonts);
fontChooser.setCellRenderer(new FontCellRenderer());
JOptionPane.showMessageDialog(null, fontChooser);
}
});
}
}
class FontCellRenderer extends DefaultListCellRenderer {
public Component getListCellRendererComponent(
JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus)
{
JLabel label = (JLabel)super.getListCellRendererComponent(
list,value,index,isSelected,cellHasFocus);
Font font = new Font((String)value, Font.PLAIN, 20);
label.setFont(font);
return label;
}
}
\end{lstlisting}
\emph{ Displays fonts in a combobox and uses the font for the item }
\begin{lstlisting}
import java.awt.*;
import javax.swing.*;
public class ShowFonts {
public static void main(String[] args) {
SwingUtilities.invokeLater( new Runnable() {
public void run() {
GraphicsEnvironment ge = GraphicsEnvironment.
getLocalGraphicsEnvironment();
String[] fonts = ge.getAvailableFontFamilyNames();
JComboBox fontChooser = new JComboBox(fonts);
fontChooser.setRenderer(new FontCellRenderer());
JOptionPane.showMessageDialog(null, fontChooser);
}
});
}
}
class FontCellRenderer extends DefaultListCellRenderer {
public Component getListCellRendererComponent(
JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus)
{
JLabel label = (JLabel)super.getListCellRendererComponent(
list,value,index,isSelected,cellHasFocus);
Font font = new Font((String)value, Font.PLAIN, 20);
label.setFont(font);
return label;
}
}
\end{lstlisting}
\emph{ Displays a list of fonts available in a list box }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
public class FontList {
public static void main(String[] args) {
JFrame t = new JFrame();
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
String fontNames[] = ge.getAvailableFontFamilyNames();
JList lb = new JList(fontNames);
JPanel p = new JPanel();
p.add(new JScrollPane(lb));
t.getContentPane().add(p);
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.pack(); t.setLocationRelativeTo(null);
t.setVisible(true);
}
}
\end{lstlisting}
\emph{ Displays all fonts in labels }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
public class FontList {
public static void main(String[] args) {
JFrame t = new JFrame();
Font font; JLabel label;
String name = new String();
Font[] fonts =
GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
JPanel p = new JPanel(new GridLayout(0, 1));
for (int i = 0; i < fonts.length; i++)
{
name = fonts[i].getFamily();
font = new Font(name, Font.PLAIN, 20);
label = new JLabel(name + " glyphs:" + font.getNumGlyphs());
label.setFont(font);
p.add(label);
}
t.getContentPane().add(new JScrollPane(p));
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.setExtendedState(Frame.MAXIMIZED_BOTH); t.pack();
t.setVisible(true);
}
}
\end{lstlisting}
\emph{ Create a JLabel with a large Georgia font in grey colour }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
public class LabelFont {
public static void main(String[] args) {
JFrame t = new JFrame();
Font font = new Font("Georgia", Font.PLAIN, 40);
JLabel l = new JLabel("This is the Georgia Font size 40");
l.setFont(font);
l.setForeground(Color.gray);
JPanel p = new JPanel(); p.add(l);
t.getContentPane().add(p);
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.pack(); t.setVisible(true);
}
}
\end{lstlisting}
By using grey instead of black the java fonts dont look quite as bad
as normal.
\emph{ Print something like ``mono bold'' etc }
\begin{lstlisting}
fonts.getName ();
\end{lstlisting}
\emph{ Print all font family names to standard output }
\begin{lstlisting}
import java.awt.Font;
import java.awt.GraphicsEnvironment;
public class FontTest {
public static void main(String[] args) {
Font[] fonts =
GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
for (int i = 0; i < fonts.length; i++)
{
String familyName = fonts[i].getFamily();
System.out.println(i + ": " + familyName);
}
}
}
\end{lstlisting}
\subsection{Drawing With Fonts}
\emph{ Create shapes from character glyphs and then use those shapes to draw }
\begin{lstlisting}
Font font = new Font("Serif", Font.BOLD, 10); // a basic font
// a scaled up version
Font bigfont =
font.deriveFont(AffineTransform.getScaleInstance(30.0, 30.0));
GlyphVector gv = bigfont.createGlyphVector(g.getFontRenderContext(), "JAV");
Shape jshape = gv.getGlyphOutline(0); // Shape of letter J
Shape ashape = gv.getGlyphOutline(1); // Shape of letter A
Shape vshape = gv.getGlyphOutline(2); // Shape of letter V
g.fill(jshape);
\end{lstlisting}
http://www.javadocexamples.com/java\_source/\_\_/tt/TTFontDemo.java.html
an example of loading a true type font from an input stream
http://www.javadocexamples.com/java/awt/Font/deriveFont(int\%20style,float\%20size).html
some interesting java examples
\subsection{Loading Fonts}
\emph{ How to load a font from a file }
\begin{lstlisting}
// First, see if we can load the font file.
InputStream is = this.getClass().getResourceAsStream(fontFileName);
if (is == null) {
throw new IOException("Cannot open " + fontFileName);
}
// createFont makes a 1-point font, bit hard to read :-)
Font ttfBase = Font.createFont(Font.TRUETYPE_FONT, is);
// So scale it to 24 pt.
Font ttfReal = ttfBase.deriveFont(Font.PLAIN, 24);
\end{lstlisting}
\emph{ Check whether a font has a glyph to display a specified character }
\begin{lstlisting}
font.canDisplay(char c)
\end{lstlisting}
there are a number of other canDisplay methods
\emph{ Create a font from a file or stream bundled with an application }
\begin{lstlisting}
font.createFont(int fontFormat, InputStream fontStream)
\end{lstlisting}
\subsection{Transforming Fonts}
\emph{ We apply rotates/scales/shears to fonts }
\begin{lstlisting}
deriveFont(AffineTransform trans)
\end{lstlisting}
\emph{ Create a backward slanting font with a shear transform }
\begin{lstlisting}
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
Font font = new Font("Serif", Font.PLAIN, 24);
float x = 20, y = 20;
AffineTransform at = new AffineTransform();
at.shear(.2, 0);
Font fontShear = font.deriveFont(at);
g2.setFont(fontShear);
g2.drawString("font.deriveFont(at)", x, y += 30);
\end{lstlisting}
\subsection{Derived Fonts}
\emph{ Increase the size of a font by 2 points }
\begin{lstlisting}
font = font.deriveFont(font.getSize2D() + 2.0f);
\end{lstlisting}
getSize2D returns a float value
\emph{ Make a bold italic version of the current font }
\begin{lstlisting}
font = font.deriveFont(Font.ITALIC + Font.BOLD);
\end{lstlisting}
\emph{ Create a derived font with a map of text attributes }
\begin{lstlisting}
Font font = new Font("Serif", Font.PLAIN, 24);
float x = 20, y = 20;
Hashtable attributes = new Hashtable();
attributes.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
Font fontBold = font.deriveFont(attributes);
g2.setFont(fontBold);
g2.drawString("font.deriveFont(attributes)", x, y += 30);
\end{lstlisting}
\subsection{Font Metrics}
\emph{ Create a new image and determine its font metrics }
\begin{lstlisting}
BufferedImage image =
new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
Graphics2D g = (Graphics2D)image.getGraphics();
FontMetrics fm = g.getFontMetrics();
int w = fm.stringWidth("Hello");
int h = fm.getHeight() + fm.getMaxDescent();
\end{lstlisting}
\subsection{Font Information}
\emph{ Get the number of glyphs contained in a font }
\begin{lstlisting}
font.getNumGlyphs()
\end{lstlisting}
\section{Colours}
In Java colours are colors. And grey is gray.
In general when creating rgb (red, green, blue) colours, the higher
the numbers the lighter the colour, and the lower the numbers the darker
the colours.
\emph{ Create a new rgb colour }
\begin{lstlisting}
Color c = new Color(int red, int green, int blue)
\end{lstlisting}
\emph{ Create a light turqoisy colour }
\begin{lstlisting}
Color c = new Color(0, 230, 230);
\end{lstlisting}
\emph{ Set the background for a component using a hex string for the colour }
\begin{lstlisting}
this.setBackground(new Color(Integer.decode("#eeff99")));
\end{lstlisting}
\emph{ Set the foreground and background colours of a jtextarea }
\begin{lstlisting}
final JTextArea ta = new JTextArea();
ta.setForeground(Color.green);
ta.setBackground(Color.black);
\end{lstlisting}
\emph{ Colours in rgb format }
\begin{lstlisting}
red is (255, 0, 0)
\end{lstlisting}
\begin{lstlisting}
green is (0, 255, 0)
\end{lstlisting}
\begin{lstlisting}
white is (255, 255, 255)
\end{lstlisting}
\begin{lstlisting}
black is (0,0,0)
\end{lstlisting}
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ some java colour names }} \\
\hline
Color.black Color.lightGray Color.blue Color.magenta Color.cyan Color.orange Color.darkGray Color.pink Color.gray Color.red Color.green Color.white Color.yellow
\hline
\end{tabular}
\end{center}
\emph{ Mix colors using the HSB color model when creating a new colour }
\begin{lstlisting}
Color c = Color.getHSBColor(hue, saturation, brightness)
\end{lstlisting}
The hue parameter is a decimal number between 0.0 and 1.0 which indicates
the hue of the color. You'll have to experiment with the hue number to find
out what color it represents.
The saturation is a decimal number between 0.0 and 1.0 which indicates how
deep the color should be. Supplying a "1" will make the color as deep as
possible, and to the other extreme, supplying a ``0,'' will take all the color
out of the mixture and make it a shade of gray.
The brightness is also a decimal number between 0.0 and 1.0 which obviously
indicates how bright the color should be. A 1 will make the color as light
as possible and a 0 will make it very dark.
\emph{ A swing textarea with a foreground and background colour }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
public class ColourArea {
public static void main(String[] args) {
JFrame t = new JFrame();
Font font = new Font("Georgia", Font.PLAIN, 30);
JTextArea ta = new JTextArea("Botany and Trees");
ta.setForeground(Color.gray);
ta.setBackground(Color.white);
ta.setFont(font);
JPanel p = new JPanel(); p.add(ta);
t.getContentPane().add(p);
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.pack(); t.setVisible(true);
}
}
\end{lstlisting}
\section{Internationalization}
\subsection{Localizing Messages}
\emph{ An example of using a properties file for messages in other languages }
\begin{lstlisting}
file 'MyResources_en.properties':
hello = Hello bye = Goodbye
...
file 'MyResources_fr.properties':
hello = Bonjour bye = Au Revoir
...
try
{
// Get the resource bundle for the default locale
ResourceBundle rb = ResourceBundle.getBundle ("MyResources");
String key = "hello"; String s = rb.getString (key);
key = "bye"; s = rb.getString(key);
rb = ResourceBundle.getBundle ("MyResources, Locale.FRENCH);
key = "hello"; s = rb.getString (key); // Bonjour
key = "bye"; s = rb.getString (key); // Au Revoir
}
catch (MissingResourceException e)
{
// The resource bundle or no key
}
\end{lstlisting}
\section{Packages}
\emph{ How to create a package }
\begin{itemize}
\item put 'package namea.nameb;' at the top of the .java file
\item place the .java file in the folder namea/nameb
\item compile from 'nameb' with javac class.java
\item run with java namea.nameb.class
\end{itemize}
\section{Gui Applications}
The term 'gui' application refers to an application which uses
'windows' in order to display various graphical components to
interact with the user, such as 'text boxes', 'buttons', 'labels'
and various other elements.
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{http://www.rgagnon.com/topics/java-swing.html}]
good practical examples of using swing
\end{description}
\emph{ Create a windowed application }
\begin{lstlisting}
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class ApplicationPanel extends JPanel {
public ApplicationPanel() {
super();
JLabel label = new JLabel("Hello World");
this.add(label);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame frame = new JFrame("LabelDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(new ApplicationPanel());
frame.pack();
frame.setVisible(true);
}
});
}
}
\end{lstlisting}
\emph{ Another way to start a swing gui (correct) }
\begin{lstlisting}
public static void main(String[] args) {
Runnable r = new Runnable() {
public void run() {
final JFrame frame = new JFrame("...");
...
}
};
SwingUtilities.invokeLater(r);
}
\end{lstlisting}
\emph{ Possibly the simplest java gui application }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "Hello!");
}
}
\end{lstlisting}
\emph{ A very simple gui application, just a window }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("a simple window");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A application which extends JFrame }
\begin{lstlisting}
import javax.swing.*;
public class Test extends JFrame {
public Test () {
super();
JLabel label = new JLabel("extending a jframe");
this.getContentPane().add(label);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.pack();
this.setVisible(true);
}
public static void main(String[] args) {
Test f = new Test();
}
}
\end{lstlisting}
\emph{ Make an application exit when the window is closed }
\begin{lstlisting}
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
\end{lstlisting}
\subsection{Jframe Windows}
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html}]
\end{description}
Application windows are created using the JFrame class. These are also known
as top level windows because they are not contained by any other element
(window, container component ...). In order to create a new window, which will
in turn contain panels, buttons, textboxes and all the other bricabrac, there
are 2 choices: Create a JFrame within a main method (or other suitable method)
\begin{lstlisting}
JFrame f = new JFrame();
\end{lstlisting}
and then add stuff to it, or else subclass the JFrame, for example
\begin{lstlisting}
public class NewFrame extends JFrame { ...
\end{lstlisting}
and add the bricabrac within the constructor method of the of the NewFrame class
\emph{ Create a 300x300 Window which is centered in the screen }
\begin{lstlisting}
import javax.swing.*;
public class NewFrame {
public static void main(String[] args) {
JFrame f = new JFrame();
f.setSize(new java.awt.Dimension(300, 300));
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
It is necessary to call the ``pack'' method before the ``setLocationRelativeTo''
because java uses the pack method to work out how big the window will need
to be in order to contain all its elements, so it wont be able to centre the
window on the screen before that.
\emph{ Set the size of a window. Its better to call .pack() }
\begin{lstlisting}
jframe.setSize(220, 90);
\end{lstlisting}
If you call setSize, its difficult to know if the window will be big enough
to display all the stuff it contains.
\emph{ Set the image icon in a window }
\begin{lstlisting}
jframe.setIconImage(new ImageIcon(imgURL).getImage());
\end{lstlisting}
\emph{ Set the absolute location of the window }
\begin{lstlisting}
f.setLocation(200,300);
\end{lstlisting}
\emph{ Make a JFrame open in the centre of the screen }
\begin{lstlisting}
jframe.setLocationRelativeTo(null);
\end{lstlisting}
\emph{ Make the jframe open big enough to contain its components }
\begin{lstlisting}
jframe.pack();
\end{lstlisting}
\emph{ Make the application exit when the window is closed }
\begin{lstlisting}
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
\end{lstlisting}
\emph{ Set the size of a jframe window }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame();
f.setSize(new java.awt.Dimension(300, 300));
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\subsection{Full Screen Windows}
\emph{ Make the application window as big as the screen (but not maximized) }
\begin{lstlisting}
import javax.swing.JFrame;
import java.awt.Toolkit;
public class Test
{
JFrame frame;
public Test()
{
frame = new JFrame("Test");
Toolkit tk = Toolkit.getDefaultToolkit();
int xSize = ((int) tk.getScreenSize().getWidth());
int ySize = ((int) tk.getScreenSize().getHeight());
frame.setSize(xSize,ySize);
frame.show();
}
public static void main(String[] args)
{ Test app = new Test(); }
}
\end{lstlisting}
\emph{ Make the application window maximized }
\begin{lstlisting}
import java.awt.Frame;
import javax.swing.*;
public class MaxFrame
{
JFrame frame;
public MaxFrame()
{
frame = new JFrame("Test");
frame.setExtendedState(Frame.MAXIMIZED_BOTH);
frame.show();
}
public static void main(String[] args)
{ MaxFrame app = new MaxFrame(); }
}
\end{lstlisting}
The frame.show method is probably not very good anymore
\emph{ Make the application window maximized and no window decorations }
\begin{lstlisting}
import java.awt.Frame;
import javax.swing.*;
public class MaxFrame
{
JFrame frame;
public MaxFrame()
{
frame = new JFrame("Test");
frame.setExtendedState(Frame.MAXIMIZED_BOTH);
frame.setUndecorated(true);
frame.show();
}
public static void main(String[] args)
{ MaxFrame app = new MaxFrame(); }
}
\end{lstlisting}
For complete full screen applications (to change the screen resolution etc)
search for the sun tutorial on fullscreen applications
\section{Dialog Boxes}
A dialog box or window is a window which displays some message
and refuses to go away until you click one of its buttons. They
are intensely annoying and should be avoided like botulism.
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ Alternative tools }} \\
\hline
\texttt{ tk } & A script based dialog tool \\
\texttt{ perl-tk } & The perl version of the 'tk' tool \\
\texttt{ zenity } & A linux command line dialog tool \\
\hline
\end{tabular}
\end{center}
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ JOptionPane dialog boxes }} \\
\hline
\texttt{ JOptionPane.showMessageDialog() } \\
\texttt{ JOptionPane.showInputDialog() } \\
\texttt{ JOptionPane.showConfirmDialog() } \\
\texttt{ JOptionPane.showOptionDialog() } \\
\hline
\end{tabular}
\end{center}
\emph{ A simple use of a joptionpane dialog box }
\begin{lstlisting}
import javax.swing.*;
public class MessageDialog {
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "Hello!");
}
}
\end{lstlisting}
According to Oracle, there are some thread problems with directly
executing the showMessageDialog() method. The following technique
is supposed to solve these problems.
\emph{ Display a message dialog using a 'thread-safe' technique }
\begin{lstlisting}
import javax.swing.*;
public class MessageDialog {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run()
{ JOptionPane.showMessageDialog(null, "A thread safe dialog"); }
});
}
}
\end{lstlisting}
\emph{ A dialog box with no icon and a window title }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JOptionPane.showMessageDialog(
null, "Hello!", "Testing Dialogs", JOptionPane.PLAIN_MESSAGE);
}
}
\end{lstlisting}
\emph{ A dialog box with a custom icon image }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
int messageType = JOptionPane.PLAIN_MESSAGE;
String s = "/usr/share/icons/gnome/24x24/apps/config-users.png";
ImageIcon icon = new ImageIcon(s, "blob");
JOptionPane.showMessageDialog(
null, "New User", "User System", messageType, icon);
}
}
\end{lstlisting}
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ Option Pane button configuration }} \\
\hline
\texttt{ JOptionPane.DEFAULT\_OPTION } & OK button \\
\texttt{ JOptionPane.YES\_NO\_OPTION } & YES and NO buttons \\
\texttt{ JOptionPane.YES\_NO\_CANCEL\_OPTION } & YES, NO, and CANCEL buttons \\
\texttt{ JOptionPane.OK\_CANCEL\_OPTION } & OK and CANCEL buttons \\
\hline
\end{tabular}
\end{center}
\subsection{Input Dialogs}
\emph{ An inputbox which returns the text }
\begin{lstlisting}
import javax.swing.*;
public class InputBox {
public static void main(String[] args) {
String r = JOptionPane.showInputDialog(
"Enter address:", "<your address>");
System.out.println("text entered: " + r);
}
}
\end{lstlisting}
\subsection{Combobox Dialog}
In Java a combobox is a small box with one line of text in it, and
a down-arrow which allows the user to select a different value to
place in the combobox. In html these are called ``select boxes''.
\emph{ A combobox dialog with an array of values which return the selected value }
\begin{lstlisting}
import javax.swing.*;
public class ListBoxDialog {
public static void main(String[] args) {
Object[] values = { "Almond", "Oak", "Cork Oak" };
Object result = JOptionPane.showInputDialog(
null, "Choose a tree to plant:", "Testing the Combobox Dialog",
JOptionPane.PLAIN_MESSAGE, null, values, values[0]);
System.out.println("value selected: " + result);
}
}
\end{lstlisting}
\emph{ A list box with an array of values with a custom icon image }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
Object[] selValues = { "abc", "def", "ghi" };
ImageIcon icon = new ImageIcon("blob.gif", "blob");
Object res = JOptionPane.showInputDialog(
null, "Enter value:", "Message Title",
JOptionPane.PLAIN_MESSAGE, icon, selValues, selValues[0]);
System.out.println( "value selected: " + res );
}
}
\end{lstlisting}
\subsection{Option Dialogs}
\emph{ A dialog box with a series of buttons to choose from }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
Object[] vv = { "a", "b", "c" };
int r = JOptionPane.showOptionDialog(
null, "Which letter do you choose?", "Select One",
JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null,
vv, vv[0]);
System.out.println("you selected: " + r);
}
}
\end{lstlisting}
\emph{ A dialog with a series of option buttons and a custom image }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
int optionType = JOptionPane.DEFAULT_OPTION;
int messageType = JOptionPane.PLAIN_MESSAGE; // no standard icon
ImageIcon icon = new ImageIcon("blob.gif", "blob");
Object[] vv = { "abc", "def", "ghi" };
int res = JOptionPane.showOptionDialog(
null, "Hello!", "Message Title",
JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, icon,
vv, vv[0]);
}
}
\end{lstlisting}
\section{Colorchooser}
\emph{ Create a swing colorchooser component }
\begin{lstlisting}
colorChooser = new JColorChooser();
\end{lstlisting}
\subsection{Colorchooser Dialog}
\section{Filechooser}
The JFileChooser and JColorChooser components can be used either as
components added to a container, such as a panel, or else as dialog
boxes, that is, contained within a new window.
\subsection{Filechooser Dialog}
\emph{ Show a file chooser dialog and determine the result }
\begin{lstlisting}
import javax.swing.*;
public class ChooseFile {
public static void main(String[] args) {
JFrame f = new JFrame("test file chooser");
JFileChooser chooser = new JFileChooser();
int result = chooser.showOpenDialog(f);
java.io.File file = chooser.getSelectedFile();
switch (result)
{
case JFileChooser.APPROVE_OPTION:
break;
case JFileChooser.CANCEL_OPTION:
break;
}
}
}
\end{lstlisting}
Using setFont to set the font for a builtin dialog box doesnt work. The
Another technique is to set the FileChooser font in the UIManager defaults.
\emph{ Display only directories in a file chooser box }
\begin{lstlisting}
import javax.swing.*;
public class ChooseFile {
public static void main(String[] args) {
JFrame f = new JFrame("test file chooser");
JFileChooser c = new JFileChooser();
c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int result = c.showOpenDialog(f);
java.io.File file = c.getSelectedFile();
switch (result)
{
case JFileChooser.APPROVE_OPTION:
break;
case JFileChooser.CANCEL_OPTION:
System.exit(-1);
break;
}
}
}
\end{lstlisting}
\emph{ Display a file chooser with the native look and feel }
\begin{lstlisting}
import javax.swing.*;
public class NiceFileDialog {
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
JFrame f = new JFrame("Trying to make the FileChooser look nicer");
JFileChooser c = new JFileChooser();
if (c.showOpenDialog(f) == JFileChooser.CANCEL_OPTION)
System.exit(-1);
}
}
\end{lstlisting}
\subsection{Jcombobox}
\emph{ Displays fonts in a combobox and uses the font for the item }
\begin{lstlisting}
import java.awt.*;
import javax.swing.*;
public class ShowFonts {
public static void main(String[] args) {
SwingUtilities.invokeLater( new Runnable() {
public void run() {
GraphicsEnvironment ge = GraphicsEnvironment.
getLocalGraphicsEnvironment();
String[] fonts = ge.getAvailableFontFamilyNames();
JComboBox fontChooser = new JComboBox(fonts);
fontChooser.setRenderer(new FontCellRenderer());
JOptionPane.showMessageDialog(null, fontChooser);
}
});
}
}
class FontCellRenderer extends DefaultListCellRenderer {
public Component getListCellRendererComponent(
JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus) {
JLabel label = (JLabel)super.getListCellRendererComponent(
list,value,index,isSelected,cellHasFocus);
Font font = new Font((String)value, Font.PLAIN, 20);
label.setFont(font);
return label;
}
}
\end{lstlisting}
\section{Jlist List Boxes}
Swing list boxes can use a model, view, controller pattern or else
they can be initialized with a simple array.
In order to use a 'model' to populate the swing listbox, it is
necessary to implement the AbstractListModel, which involves
implementing two functions. Otherwise you can use the
DefaultListModel, which is the easiest or the ListModel which is the
hardest.
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ important methods for the swing listbox }} \\
\hline
\texttt{ getSelectedIndex } & Get the index number of the selected item \\
\texttt{ getSelectedValue } & Get the value (usually text) associated with selected item \\
\hline
\end{tabular}
\end{center}
\emph{ Set some parameters for a listbox }
\begin{lstlisting}
list = new JList(data); //data has type Object[]
list.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
list.setLayoutOrientation(JList.HORIZONTAL_WRAP);
list.setVisibleRowCount(-1);
\end{lstlisting}
\emph{ Set the selectmode, but is all this necessary? }
\begin{lstlisting}
list.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
\end{lstlisting}
\emph{ Get the value of an element in a list at in 4 }
\begin{lstlisting}
s = (String)list.getModel().getElementAt(4);
\end{lstlisting}
\emph{ A simple example of using a swing listbox }
\begin{lstlisting}
import javax.swing.*;
import java.io.*;
public class Box {
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
JFrame t = new JFrame();
String[] ss = {"Eucalypt", "Oak", "Apple", "Walnut"};
JList trees = new JList(ss);
JPanel pl = new JPanel();
pl.add(new JScrollPane(trees));
t.getContentPane().add(pl);
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.pack(); t.setLocationRelativeTo(null);
t.setVisible(true);
}
}
\end{lstlisting}
\emph{ A listbox with a different font and colour }
\begin{lstlisting}
import javax.swing.*;
import java.awt.Font;
public class Box {
public static void main(String[] args) {
JFrame t = new JFrame();
String[] ss = {"Eucalypt", "Cork Oak", "Apple", "Walnut"};
JList trees = new JList(ss);
trees.setFont(new Font("Georgia", Font.PLAIN, 30));
JPanel p = new JPanel(); p.add(trees);
t.getContentPane().add(p);
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.setLocationRelativeTo(null);
t.pack(); t.setVisible(true);
}
}
\end{lstlisting}
If we explicitly use the DefaultListModel as the 'data model' for the
swing listbox, then we can add and remove elements from the listbox
after it has been created.
\emph{ Create a list box to which elements can be added or removed }
\begin{lstlisting}
import javax.swing.*;
import java.awt.Font;
public class Box {
public static void main(String[] args) {
JFrame t = new JFrame();
DefaultListModel listModel = new DefaultListModel();
listModel.addElement("Tibouchina");
listModel.addElement("Siete Cueros");
listModel.addElement("Hevea Brasiliensis");
JList trees = new JList(listModel);
trees.setFont(new Font("Georgia", Font.PLAIN, 30));
JPanel p = new JPanel(); p.add(trees);
t.getContentPane().add(p);
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.setLocationRelativeTo(null);
t.pack(); t.setVisible(true);
}
}
\end{lstlisting}
\emph{ Displays a file list in the center of the screen }
\begin{lstlisting}
import javax.swing.*;
import java.io.*;
import java.awt.Font;
public class Test {
public static void main(String[] args) {
JFrame t = new JFrame();
JList fileList = new JList((new File(".")).listFiles());
fileList.setFont(new Font("Georgia", Font.PLAIN, 50));
JPanel pl = new JPanel();
pl.add(new JScrollPane(fileList));
t.getContentPane().add(pl);
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.pack(); t.setLocationRelativeTo(null);
t.setVisible(true);
}
}
\end{lstlisting}
\emph{ Jlist box with lots of numbers using a list model }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
ListModel bigData = new AbstractListModel() {
public int getSize() { return Short.MAX_VALUE; }
public Object getElementAt(int index) { return "Index " +
index; }
};
JList dataList = new JList(bigData);
// the following makes rendering quicker
dataList.setPrototypeCellValue("Index 1234567890");
JFrame f = new JFrame();
f.getContentPane().add(new JScrollPane(dataList));
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A list box with a model and unicode characters }
\begin{lstlisting}
import javax.swing.*;
public class UnicodeBox {
public static void main(String[] args) {
ListModel bigData = new AbstractListModel() {
public int getSize() { return Short.MAX_VALUE; }
public Object getElementAt(int index)
{ return "unicode " + index + 1000 + ":" + (char)(index + 1000); }
};
JList unicodeList = new JList(bigData);
unicodeList.setPrototypeCellValue("Index 1234567890");
JPanel p = new JPanel();
p.add(new JScrollPane(unicodeList));
JFrame f = new JFrame();
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\subsection{Listbox Elements}
It is possible to customize the way that each list element in a swing list
box is rendered by implementing the ListCellRenderer interface. This involves
writing a body for the getListCellRendererComponent method
\emph{ An example of a ListCellRenderer implementation }
\begin{lstlisting}
import javax.swing.*;
class ColourCell extends JLabel implements ListCellRenderer {
public ColourCell() { setOpaque(true); }
public Component getListCellRendererComponent(
JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
{
this.setText(value.toString());
// Is the listbox item currently selected?
if (isSelected)
{
this.setBackground(Color.RED);
this.setForeground(Color.WHITE);
} else {
this.setBackground(Color.WHITE);
this.setForeground(Color.GRAY);
}
return this;
}
}
\end{lstlisting}
Investigate the significance of the 'drop location'
\emph{ Check if this cell represents the current DnD drop location }
\begin{lstlisting}
JList.DropLocation dropLocation = list.getDropLocation();
\end{lstlisting}
\emph{ Attach the custom cell render to the jlistbox or jcombobox }
\begin{lstlisting}
JList listbox = new JList(aa);
ColourCell renderer = new ColourCell();
renderer.setPreferredSize(new Dimension(200, 130));
listbox.setRenderer(renderer);
\end{lstlisting}
\emph{ Create a cellrenderer to make the selection white on red and the font big }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
import java.io.File;
public class Test {
public static void main(String[] args) {
JFrame t = new JFrame();
JList fileList = new JList((new File(".")).listFiles());
ColourCell renderer = new ColourCell();
//renderer.setPreferredSize(new Dimension(200, 130));
fileList.setCellRenderer(renderer);
JPanel pl = new JPanel();
pl.add(new JScrollPane(fileList));
t.getContentPane().add(pl);
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.setLocationRelativeTo(null);
t.pack(); t.setVisible(true);
}
}
class ColourCell extends JLabel implements ListCellRenderer {
public ColourCell() {
this.setOpaque(true);
this.setFont(new Font("Georgia", Font.PLAIN, 30));
}
public Component getListCellRendererComponent(
JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
{
this.setText(value.toString());
// Is the listbox item currently selected?
if (isSelected)
{
this.setBackground(Color.RED);
this.setForeground(Color.WHITE);
} else {
this.setBackground(Color.WHITE);
this.setForeground(Color.GRAY);
}
return this;
}
}
\end{lstlisting}
According to the Sun java tutorial site the índex param to the
getListCellRendererComponent is not alway valid. Which seems odd.
So instead we can use
\begin{lstlisting}
int selectedIndex = ((Integer)value).intValue(); ???
\end{lstlisting}
\emph{ Create a cellrenderer to colour alternate rows light blue in the jlistbox }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
import java.io.File;
public class Test {
public static void main(String[] args) {
JFrame t = new JFrame();
JList fileList = new JList((new File("..")).listFiles());
ColourCell renderer = new ColourCell();
fileList.setCellRenderer(renderer);
JPanel pl = new JPanel();
pl.add(new JScrollPane(fileList));
t.getContentPane().add(pl);
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.setLocationRelativeTo(null);
t.pack(); t.setVisible(true);
}
}
class ColourCell extends JLabel implements ListCellRenderer {
public ColourCell() {
this.setOpaque(true);
this.setFont(new Font("Georgia", Font.PLAIN, 20));
}
public Component getListCellRendererComponent(
JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
{
this.setText(value.toString());
if (isSelected) /* if the listbox element is currently selected */
{
this.setBackground(Color.blue);
this.setForeground(Color.white);
} else {
this.setForeground(Color.darkGray);
if ((index % 2) == 0)
this.setBackground(Color.white);
else
//this.setBackground(new Color(0, 220, 250));
this.setBackground(new Color(Integer.decode("#ffffdd")));
}
return this;
}
}
\end{lstlisting}
If the opacity of the cell renderer is false then the renderer doesnt
seem to do its job properly
\begin{lstlisting}
this.setOpaque(true);
\end{lstlisting}
\subsection{Jlist Events}
In order to fire events when an item is selected in a JListBox you need
to implement an ListSelectionListener by defining one method 'public void valueChanged(ListSelectionEvent e). Using a mouseadaptor may be another way
The getValueIsAdjusting() method returns true if the user is still manipulating the selection for example, is dragging the selection to include more elements.
\emph{ An example of a valueChanged method for responding to listbox selections }
\begin{lstlisting}
public void valueChanged(ListSelectionEvent e) {
if (e.getValueIsAdjusting() == false) {
if (list.getSelectedIndex() == -1) { /* No selection */ }
else { /* do something */ }
}
}
\end{lstlisting}
\emph{ Create a listbox which reacts to changes of the selected item(s) }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
public class BoxEvent extends JFrame implements ListSelectionListener {
String[] ss = {"Yew", "Oak", "Elder", "Myoporum"};
JList list;
public BoxEvent() {
list = new JList(ss);
list.addListSelectionListener(this);
list.setFont(new Font("Georgia", Font.PLAIN, 40));
JPanel p = new JPanel(); p.add(list);
this.getContentPane().add(p);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.pack(); this.setVisible(true);
}
public void valueChanged(ListSelectionEvent e) {
if (e.getValueIsAdjusting() == false) {
if (list.getSelectedIndex() == -1) { /* No selection */ }
else {
System.out.println(list.getSelectedIndex());
}
}
}
public static void main(String[] args)
{ BoxEvent b = new BoxEvent(); }
}
\end{lstlisting}
\emph{ Do something when a jlist item is double clicked }
\begin{lstlisting}
final JList list = new JList(dataModel);
MouseListener mouseListener = new MouseAdapter() {
public void mouseClicked(MouseEvent e)
{
if (e.getClickCount() == 2) {
int index = list.locationToIndex(e.getPoint());
System.out.println("Double clicked on Item " + index);
}
}
};
list.addMouseListener(mouseListener);
\end{lstlisting}
\section{Panels}
Panels are important for grouping and laying out graphical components on
a window. Panels can be created with a 'layout' which determines how the
components (such as text-boxes, labels list boxes etc will be placed
within the panel when the the 'add()' method of the panel is used.
Panels, unless they have a border, are usually invisible to the user.
\emph{ Create a panel with a 2 by 2 gridlayout }
\begin{lstlisting}
JPanel p = new JPanel(new GridLayout(2, 2));
\end{lstlisting}
\emph{ Create a panel with 2 columns and unlimited rows }
\begin{lstlisting}
JPanel p = new JPanel(new GridLayout(0, 2);
\end{lstlisting}
\emph{ A simple frame window with a panel and 3 labels }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("a simple window");
JPanel p = new JPanel(new GridLayout(0, 1));
p.add(new JLabel("1st label"));
p.add(new JLabel("2nd label"));
p.add(new JLabel("3rd label"));
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Create a 2 column grid layout, 5px vertical separation, 1px horizontal }
\begin{lstlisting}
java.awt.GridLayout g = new GridLayout(0, 2, 5, 1));
\end{lstlisting}
\emph{ A panel containing a user-name and password entry fields }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("a simple window");
JPanel p = new JPanel(new GridLayout(0, 2, 5, 1));
p.add(new JLabel("user"));
p.add(new JTextField());
p.add(new JLabel("password"));
p.add(new JPasswordField());
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
The problem with the window above, it that it doesnt resize
is a pleasant fashion, the text boxes become very large and
the space between the labels increases.
\section{Borders}
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{http://leepoint.net/notes-java/GUI-appearance/borders/15bordersex.html}]
some good notes about creating borders
\end{description}
\emph{ A panel with a titled, etched border }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("a simple window");
JPanel p = new JPanel(new GridLayout(0, 2, 5, 1));
Border eb = BorderFactory.createEtchedBorder();
Border tb = BorderFactory.createTitledBorder(eb, "Login");
p.setBorder(tb);
p.add(new JLabel("User")); p.add(new JTextField());
p.add(new JLabel("Password")); p.add(new JPasswordField());
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
The problem with the panel above is that it doesnt resize
well. The text boxes become very large.
\emph{ A panel with a title etched border with some extra space around it }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("a simple window");
JPanel p = new JPanel(new GridLayout(0, 2, 5, 1));
Border etchedBdr = BorderFactory.createEtchedBorder();
Border titledBdr =
BorderFactory.createTitledBorder(etchedBdr, "Login");
Border emptyBdr = BorderFactory.createEmptyBorder(5,5,5,5);
Border compoundBdr =
BorderFactory.createCompoundBorder(titledBdr, emptyBdr);
p.setBorder(compoundBdr);
p.add(new JLabel("User")); p.add(new JTextField());
p.add(new JLabel("Password")); p.add(new JPasswordField());
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Use a static method to create an etched border with extra space }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
public class Test {
static final Border spaceBorder =
BorderFactory.createEmptyBorder(5,5,5,5);
static final Border etchedBorder =
BorderFactory.createEtchedBorder();
public static Border titledBorder(String title) {
return BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder(etchedBorder, title),
spaceBorder);
}
public static void main(String[] args) {
JFrame f = new JFrame("a simple window");
JPanel p = new JPanel(new GridLayout(0, 2, 5, 1));
p.setBorder(titledBorder("Login"));
p.add(new JLabel("User")); p.add(new JTextField());
p.add(new JLabel("Password")); p.add(new JPasswordField());
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Create an etched border, with a title and some extra space }
\begin{lstlisting}
import javax.swing.border.*;
. . .
JPanel p = new JPanel();
Border etchedBdr = BorderFactory.createEtchedBorder();
Border titledBdr =
BorderFactory.createTitledBorder(etchedBdr, "Process");
Border emptyBdr = BorderFactory.createEmptyBorder(10,10,10,10);
Border compoundBdr =
BorderFactory.createCompoundBorder(titledBdr, emptyBdr);
processPanel.setBorder(p);
\end{lstlisting}
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ different kinds of borders }} \\
\hline
\texttt{ BorderFactory.createLineBorder(Color.black); } \\
\texttt{ BorderFactory.createEtchedBorder(); } \\
\texttt{ BorderFactory.createRaisedBevelBorder(); } \\
\texttt{ BorderFactory.createLoweredBevelBorder(); } \\
\hline
\end{tabular}
\end{center}
\emph{ Putting a title in the border }
\begin{lstlisting}
TitledBorder titledBorder = BorderFactory.createTitledBorder ("Title");
//titledBorder = BorderFactory.createTitledBorder (border, "Title");
titledBorder.setTitleJustification (TitledBorder.CENTER);
titledBorder.setTitlePosition (TitledBorder.BELOW_TOP);
component.setBorder (titledBorder);
\end{lstlisting}
\emph{ A panel with a titled, rounded corner border }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("a simple window");
JPanel p = new JPanel(new GridLayout(0, 2, 5, 1));
Border eb = new LineBorder(Color.gray, 1, true);
//Border eb = BorderFactory.createLineBorder(Color.gray, 2, true);
Border tb = BorderFactory.createTitledBorder(eb, "Login");
p.setBorder(tb);
p.add(new JLabel("User")); p.add(new JTextField());
p.add(new JLabel("Password")); p.add(new JPasswordField());
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A green italic center aligned title border with extra space }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("a simple window");
JPanel p = new JPanel(new GridLayout(0, 2, 5, 1));
Border eb = BorderFactory.createEtchedBorder();
Border tb = BorderFactory.createTitledBorder(
eb, "Login", TitledBorder.CENTER, TitledBorder.TOP,
new Font("Serif", Font.ITALIC, 10), Color.blue);
Border sb = BorderFactory.createEmptyBorder(5,5,5,5);
Border cb = BorderFactory.createCompoundBorder(tb, sb);
p.setBorder(cb);
p.add(new JLabel("User")); p.add(new JTextField());
p.add(new JLabel("Password")); p.add(new JPasswordField());
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A green italic center aligned title border }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("a simple window");
JPanel p = new JPanel(new GridLayout(0, 2, 5, 1));
Border eb = BorderFactory.createEtchedBorder();
Border tb = BorderFactory.createTitledBorder(
eb, "Login", TitledBorder.CENTER, TitledBorder.TOP,
new Font("Serif", Font.ITALIC, 10), Color.blue);
p.setBorder(tb);
p.add(new JLabel("User")); p.add(new JTextField());
p.add(new JLabel("Password")); p.add(new JPasswordField());
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\section{Tabbed Panes}
Tabbed panes are useful, and represent a modern and simple user
interface element.
\emph{ A simple tabbed pane example }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Testing Tabs");
JTabbedPane jtp = new JTabbedPane();
JPanel p1 = new JPanel(); p1.add(new JLabel("The 1st Tab Area"));
JPanel p2 = new JPanel(); p2.add(new JLabel("The 2nd Tab Area"));
jtp.addTab("Tab1", p1);
jtp.addTab("Tab2", p2);
f.getContentPane().add(jtp);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A tabbed pane with tool tip text for the tabs }
\begin{lstlisting}
import javax.swing.*;
import java.awt.event.KeyEvent;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Testing Tabs");
JTabbedPane tp = new JTabbedPane();
JPanel p1 = new JPanel();
p1.add(new JLabel("The 1st Tab Area"));
JPanel p2 = new JPanel();
p2.add(new JLabel("The 2nd Tab Area"));
tp.addTab("Tab1", null, p1, "View the first");
tp.addTab("Tab2", null, p2, "View the second");
f.getContentPane().add(tp);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A tabbed pane with tabs at the right of the pane }
\begin{lstlisting}
import javax.swing.*;
import java.awt.event.KeyEvent;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Testing Tabs");
JTabbedPane tp = new JTabbedPane();
tp.setTabPlacement(JTabbedPane.RIGHT);
JPanel p1 = new JPanel();
p1.add(new JLabel("The 1st Tab Area"));
JPanel p2 = new JPanel();
p2.add(new JLabel("The 2nd Tab Area"));
tp.addTab("Tab1", null, p1);
tp.addTab("Tab2", null, p2);
f.getContentPane().add(tp);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A tabbed pane with icons for the tabs and short cut keys (alt s/d) }
\begin{lstlisting}
import javax.swing.*;
import java.awt.event.KeyEvent;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Testing Tabs");
JTabbedPane tp = new JTabbedPane();
JPanel p1 = new JPanel();
p1.add(new JLabel("This the screen Tab Area (first)"));
JPanel p2 = new JPanel();
p2.add(new JLabel("This is the drive Tab Area (second)"));
ImageIcon icon1 = new ImageIcon(
"/usr/share/icons/gnome/24x24/devices/chardevice.png");
tp.addTab("Screen", icon1, p1, "View the screen tab");
tp.setMnemonicAt(0, KeyEvent.VK_S);
ImageIcon icon2 = new ImageIcon(
"/usr/share/icons/gnome/24x24/devices/drive-cdrom.png");
tp.addTab("Drive", icon2, p2, "View the drive tab");
tp.setMnemonicAt(1, KeyEvent.VK_D);
f.getContentPane().add(tp);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Set the shortcut key for first tab on the pane to 'alt' + s }
\begin{lstlisting}
tp.setMnemonicAt(0, KeyEvent.VK_S);
\end{lstlisting}
If the text for the first tab on the tabbed pane contains an
's' then that letter will be automatically underlined.
\emph{ Set the shortcut key for second tab on the pane to 'alt' + D }
\begin{lstlisting}
tp.setMnemonicAt(0, KeyEvent.VK_D);
\end{lstlisting}
\emph{ A tabbed pane with icons but no text on the tabs }
\begin{lstlisting}
import javax.swing.*;
import java.awt.event.KeyEvent;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Testing Tabs");
JTabbedPane tp = new JTabbedPane();
JPanel p1 = new JPanel();
p1.add(new JLabel("The 1st Tab Area"));
JPanel p2 = new JPanel();
p2.add(new JLabel("The 2nd Tab Area"));
ImageIcon icon1 = new ImageIcon(
"/usr/share/icons/gnome/24x24/devices/chardevice.png");
tp.addTab(null, icon1, p1, "View the screen tab");
ImageIcon icon2 = new ImageIcon(
"/usr/share/icons/gnome/24x24/devices/drive-cdrom.png");
tp.addTab(null, icon2, p2, "View the drive tab");
f.getContentPane().add(tp);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A tabbed pane with icons and grid layout panels }
\begin{lstlisting}
import javax.swing.*;
import java.awt.event.KeyEvent;
import java.awt.GridLayout;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Testing Tabs");
JTabbedPane tp = new JTabbedPane();
JPanel p1 = new JPanel(new GridLayout(0, 1));
p1.add(new JLabel("The 1st Tab Area"));
p1.add(new JLabel(" another label"));
p1.add(new JLabel(" another label"));
JPanel p2 = new JPanel(new GridLayout(0, 1));
p2.add(new JLabel("The 2nd Tab Area"));
p2.add(new JLabel(" another label"));
p2.add(new JLabel(" another label"));
ImageIcon icon1 = new ImageIcon(
"/usr/share/icons/gnome/24x24/devices/chardevice.png");
tp.addTab(null, icon1, p1, "View the screen tab");
ImageIcon icon2 = new ImageIcon(
"/usr/share/icons/gnome/24x24/devices/drive-cdrom.png");
tp.addTab(null, icon2, p2, "View the drive tab");
f.getContentPane().add(tp);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ useful methods for tabbed panes }} \\
\hline
\texttt{ insertTab(String, Icon, Component, String, int) } & Insert a tab \\
\texttt{ removeTabAt(3) } & Remove the 3rd tab \\
\texttt{ pane.removeAll() } & Remove all the tabs \\
\texttt{ pane.setSelectedIndex(2) } & Select the 2nd tab \\
\texttt{ pane.setTitleAt(2, ``file'') } & Set the title of the 2nd tab to 'file' \\
\texttt{ pane.setIconAt(2, icon) } & Set the icon for the 2nd tab \\
\section{Layout Managers}
A layout manager is a way of managing the way the components are
arranged in a panel or other container component. The idea is to
arrange components (buttons, boxes etc) in a way that is both
aesthetically pleasing and reflects the logic of the application.
\subsection{Border Layout}
A border layout is a simple design consisting of a centre location
and north, south, east, west locations
\emph{ A panel with a border layout }
\begin{lstlisting}
JPanel panel = new JPanel(new BorderLayout());
panel.add(comp, BorderLayout.CENTER);
\end{lstlisting}
\emph{ A borderlayout with gaps and a title }
\begin{lstlisting}
JPanel p = new JPanel(new BorderLayout(5,5));
p.setBorder(new TitledBorder("Main GUI"));
\end{lstlisting}
\emph{ Create a panel with a border layout }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.plaf.FontUIResource;
import java.awt.*;
public class BorderPanel extends JPanel {
public BorderPanel() {
super(new BorderLayout());
JButton b = new JButton("Center");
this.add(b, BorderLayout.CENTER);
JButton bn = new JButton("North");
this.add(bn, BorderLayout.NORTH);
JButton bw = new JButton("West");
this.add(bw, BorderLayout.WEST);
}
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(
"javax.swing.plaf.nimbus.NimbusLookAndFeel");
UIManager.put(
"Button.font", new FontUIResource("Georgia", Font.PLAIN, 18));
JFrame f = new JFrame("");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new BorderPanel());
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\subsection{Gridlayout}
It's not possible to add a component to a grid layout at
a particular cell. One must add all components to the layout
sequencially (left to right, top to bottom). Use empty labels
to not add anything to a partiular cell.
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{http://leepoint.net/notes-java/GUI/layouts/30gridlayout.html}]
notes about grid layouts
\end{description}
\emph{ Create a layout with 1 column and unlimited rows }
\begin{lstlisting}
GridLayout layout = new GridLayout(0, 1);
\end{lstlisting}
\emph{ Create a layout with a horizontal gap of 10 and vertical gap of 20 }
\begin{lstlisting}
GridLayout layout = new GridLayout(0, 1, 10, 20);
\end{lstlisting}
\emph{ Create a swing panel with a gridlayout and a titled border }
JPanel p = new JPanel(new GridLayout(0,1));
p.setBorder(new TitledBorder(``Main GUI''));
,,,
\emph{ A 2 by 2 grid layout with gaps between cells }
\begin{lstlisting}
import javax.swing.*;
import java.awt.GridLayout;
public class TwoByTwoGrid {
public static void main(String[] args) {
JFrame f = new JFrame("A 2x2 Grid Layout");
JPanel content = new JPanel(new GridLayout(2, 2, 5, 5));
content.add(new JButton("Walnut"));
content.add(new JButton("Eucalypt"));
content.add(new JLabel("")); // for empty cell
content.add(new JButton("Myoporum"));
f.getContentPane().add(content);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Create a panel with a 3 by 2 grid layout }
\begin{lstlisting}
JPanel content = new JPanel(new GridLayout(3, 2, 10, 10));
\end{lstlisting}
\emph{ Combine 2 gridlayout panels in a single frame }
\begin{lstlisting}
import javax.swing.*;
import java.awt.GridLayout;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Testing Grid Layouts");
JPanel content = new JPanel(new GridLayout(2, 1));
JPanel buttonPane = new JPanel(new GridLayout(3, 3, 5, 5));
for (int ii = 0; ii < 9; ii++)
{ buttonPane.add(new JButton("" + ii)); }
JPanel textPane = new JPanel(new GridLayout(3, 1, 5, 5));
for (int ii = 0; ii < 3; ii++)
{ textPane.add(new JTextField(20)); }
content.add(buttonPane);
content.add(textPane);
f.getContentPane().add(content);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\section{Gridbaglayout}
The GridBagLayout is possibly the most flexible of the layout
managers. See also the 'GroupLayout' or use a graphical tool.
\emph{ A simple use of GridBayLayout and GridBagConstraints }
\begin{lstlisting}
GridBagConstraints c = new GridBagConstraints ();
c.gridwidth = GridBagConstraints.REMAINDER;
c.fill = GridBagConstraints.HORIZONTAL;
add (textField, c);
c.fill = GridBagConstraints.BOTH;
c.weightx = 1.0;
c.weighty = 1.0;
\end{lstlisting}
\section{Jscrollpanes}
\emph{ If an element is likely to be too big, add a scrollpane to it }
\begin{lstlisting}
JScrollPane scrollpane = new JScrollPane(element);
\end{lstlisting}
\emph{ Set the height of a scroll pane to 1/3 of what it would be }
\begin{lstlisting}
Dimension tablePreferred = tableScroll.getPreferredSize();
tableScroll.setPreferredSize(
new Dimension(tablePreferred.width, tablePreferred.height/3) );
\end{lstlisting}
\section{Jspinner}
A JSpinner element is a small box which allows a user to
select a value by clicking the increment or decrement arrows
\emph{ Connect a JSpinner and a JSlider }
\begin{lstlisting}
import java.awt.*;
import javax.swing.*;
import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
/** @see http://stackoverflow.com/questions/6067898 */
public class SpinSlider extends JPanel {
public static void main(String args[]) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
JFrame f = new JFrame("SpinSlider!");
f.add(new SpinSlider());
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack();
f.setVisible(true);
}
});
}
public SpinSlider() {
this.setLayout(new FlowLayout());
final JSpinner spinner = new JSpinner();
final JSlider slider = new JSlider();
slider.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
JSlider s = (JSlider) e.getSource();
spinner.setValue(s.getValue());
}
});
this.add(slider);
spinner.setModel(new SpinnerNumberModel(50, 0, 100, 1));
spinner.setEditor(new JSpinner.NumberEditor(spinner, "0'%'"));
spinner.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
JSpinner s = (JSpinner) e.getSource();
slider.setValue((Integer) s.getValue());
}
});
this.add(spinner);
}
}
\end{lstlisting}
\subsection{Events For Jspinner}
addChangeLister()
\section{Jslider}
\emph{ How to use sliders }
\begin{lstlisting}
http://docs.oracle.com/javase/tutorial/uiswing/components/slider.html
\end{lstlisting}
\emph{ A JSlider example }
\begin{lstlisting}
JSlider slider= new JSlider(JSlider.HORIZONTAL,0,100,50);
//min value 0, max value 100, initial value 50
slider.addChangeListener(this)
JTextFox text = new JTextFox("50");
//...
public void stateChanged(ChangeEvent e)
{
JSlider source = (JSlider)e.getSource();
int value = (int)source.getValue();
text.setText(Integer.toString(value));
}
\end{lstlisting}
\emph{ Create a JSlider and set some of its properties }
\begin{lstlisting}
gui = new JPanel(new BorderLayout(3,4));
quality = new JSlider(JSlider.VERTICAL, 0, 100, 75);
quality.setSnapToTicks(true);
quality.setPaintTicks(true);
quality.setPaintLabels(true);
quality.setMajorTickSpacing(10);
quality.setMinorTickSpacing(5);
quality.addChangeListener( new ChangeListener(){
public void stateChanged(ChangeEvent ce) {
// do something when the slider slides
}
} );
gui.add(quality, BorderLayout.WEST);
\end{lstlisting}
\section{Jprogressbar}
Shows the progress for some activity which takes a noticeable amount
of time, such as downloading a file
\emph{ How to use progress bars }
\begin{lstlisting}
http://docs.oracle.com/javase/tutorial/uiswing/components/progress.html
\end{lstlisting}
\emph{ An example of using jprogress bar and a timer }
\begin{lstlisting}
import java.awt.event.*;
import javax.swing.*;
public class CountDownProgressBar {
Timer timer;
JProgressBar progressBar;
CountDownProgressBar() {
progressBar = new JProgressBar(JProgressBar.VERTICAL, 0, 10);
progressBar.setValue(10);
ActionListener listener = new ActionListener() {
int counter = 10;
public void actionPerformed(ActionEvent ae) {
counter--;
progressBar.setValue(counter);
if (counter<1) {
JOptionPane.showMessageDialog(null, "Kaboom!");
timer.stop();
}
}
};
timer = new Timer(1000, listener);
timer.start();
JOptionPane.showMessageDialog(null, progressBar);
}
public static void main(String[] args) {
SwingUtilities.invokeLater( new Runnable() {
public void run() {
CountDownProgressBar cdpb = new CountDownProgressBar();
}
});
}
}
\end{lstlisting}
\section{Jcheckbox}
A check box is a small box in which the user can place a 'tick' or
'check' by clicking with the mouse. These elements are usually used in
order to select more than one item in a list.
\emph{ Create a simple checkbox which is initially selected }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args)
{
JFrame f = new JFrame("one button");
JCheckBox b = new JCheckBox("Shopping");
b.setSelected(true);
f.getContentPane().add(b);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A check box with a short cut key alt 's' and a tool tip }
\begin{lstlisting}
import javax.swing.*;
import java.awt.event.*;
public class Test {
public static void main(String[] args)
{
JFrame f = new JFrame("one button");
JCheckBox b = new JCheckBox("Grow Trees");
b.setSelected(true);
b.setMnemonic(KeyEvent.VK_S);
b.setToolTipText(
"<html><body bgcolor=white><big><big>Click here: you will find that " +
" you <br>will start to want to grow some trees");
JPanel p = new JPanel(); p.add(b);
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
The font bgcolor html doesnt work well be setting the
\emph{ A check box with a large font }
\begin{lstlisting}
import javax.swing.*;
import java.awt.Font;
import java.awt.event.*;
public class Test {
public static void main(String[] args)
{
JFrame f = new JFrame("one button");
JCheckBox b = new JCheckBox("Shopping");
b.setMnemonic(KeyEvent.VK_S);
b.setToolTipText("click to go shopping");
b.setFont(new Font("Serif", Font.PLAIN, 20));
JPanel p = new JPanel();
p.add(b);
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A check box with html text for the tool tip and the display text }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args)
{
JFrame f = new JFrame("Check-boxes");
JCheckBox b = new JCheckBox("<html>Vi<u>m</u></html>");
b.setToolTipText("<html><em>Click</em> to go shopping</html>");
JPanel p = new JPanel();
p.add(b);
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A list of files with check boxes in the current folder }
\begin{lstlisting}
import java.io.File;
import javax.swing.*;
import java.awt.GridLayout;
public class Test {
public static void main(String[] args)
{
JFrame f = new JFrame("one button");
JPanel p = new JPanel(new GridLayout(0,1));
File[] ff = (new File(".")).listFiles();
for (int ii = 0; ii < ff.length; ii++)
{
p.add(new JCheckBox(ff[ii].getName()));
}
f.getContentPane().add(new JScrollPane(p));
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Create a checkbox and do something when it is checked }
\begin{lstlisting}
JCheckBox antialiasing = new JCheckBox("Anti-aliasing", false);
ItemListener itemListener = new ItemListener(){
public void itemStateChanged(ItemEvent e) {
// do something
}
};
antialiasing.addItemListener(itemListener);
\end{lstlisting}
\section{Jradiobutton}
Radio Buttons are similar to check boxes but may be configured
to only allow one to be 'checked' at once. Only one button within
a group may be selected.
\emph{ A list of files with radio buttons }
\begin{lstlisting}
import java.io.File;
import javax.swing.*;
import java.awt.GridLayout;
public class Test {
public static void main(String[] args)
{
JFrame f = new JFrame("one button");
JPanel p = new JPanel(new GridLayout(0,1));
ButtonGroup group = new ButtonGroup();
JRadioButton r;
File[] ff = (new File(".")).listFiles();
for (int ii = 0; ii < ff.length; ii++)
{
p.add(r = new JRadioButton(ff[ii].getName()));
group.add(r);
}
f.getContentPane().add(new JScrollPane(p));
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\section{Buttons}
A button is a graphical component which can be 'clicked' with
the users mouse device in order to carry out some action.
In java buttons are implemented with the swing JButton class.
\emph{ Add an 'access key' to a button (pressing the key, 'clicks' the button) }
\begin{lstlisting}
jbutton.setMnemonic(KeyEvent.VK_I);
\end{lstlisting}
\emph{ Create a button with 2 lines of text }
\begin{lstlisting}
JButton b = new JButton("<html><b><u>T</u>wo</b><br>lines</html>");
\end{lstlisting}
\emph{ Create a button with underlined 20 point text and a tool tip }
\begin{lstlisting}
import javax.swing.*;
import java.awt.Font;
public class Test {
public static void main(String[] args)
{
JFrame f = new JFrame("one button");
JButton button = new JButton("<html><u>Click</u></html>");
button.setToolTipText("click to start the game");
button.setFont(new Font("Serif", Font.PLAIN, 20));
JPanel p = new JPanel();
p.add(button);
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Put a button in a JFrame window }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args)
{
JFrame f = new JFrame("one button");
JButton button = new JButton("hello");
JPanel p = new JPanel();
p.add(button);
f.add(p);
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Set the font and colour for the button text }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
public class Test {
public static void main(String[] args)
{
JFrame f = new JFrame("one button");
JButton button = new JButton("hello");
button.setFont(new Font("Serif", Font.ITALIC, 20));
button.setForeground(Color.green);
f.getContentPane().add(button);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Extend the jframe class and place a button in it }
\begin{lstlisting}
import javax.swing.*;
public class Test extends JFrame {
public Test () {
JButton button = new JButton("hello");
JPanel p = new JPanel();
p.add(button);
this.getContentPane().add(p);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.pack();
this.setVisible(true);
}
public static void main(String[] args)
{
Test t = new Test();
}
}
\end{lstlisting}
\emph{ A jframe class which contains a button and listens for clicks }
\begin{lstlisting}
import javax.swing.*;
import java.awt.event.*;
public class Test extends JFrame implements ActionListener {
public Test () {
JButton button = new JButton("hello");
button.addActionListener(this);
this.getContentPane().add(button);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.pack();
this.setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
JOptionPane.showMessageDialog(
this, "clicked " + e.getActionCommand());
}
public static void main(String[] args)
{ Test t = new Test(); }
}
\end{lstlisting}
\emph{ Change a label when a button is clicked }
\begin{lstlisting}
import java.awt.event.*;
import javax.swing.*;
public class Test {
public static void main(String[] args)
{
JFrame f = new JFrame("one button");
JButton button = new JButton("click");
final JLabel label = new JLabel("hello");
button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{ label.setText("bye"); }});
JPanel p = new JPanel();
p.add(button); p.add(label);
f.add(p);
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack(); f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Make a click event handler for the button }
\begin{lstlisting}
final JButton b = new JButton("click");
b.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
b.setText("click");
}
});
\end{lstlisting}
\emph{ Make an action which is executed when a button is pushed }
\begin{lstlisting}
Action showMessage = new AbstractAction() {
{ putValue(Action.NAME, "Message"); }
public void actionPerformed(ActionEvent e) { }
};
JButton loadButton = new JButton(loadAction);
panel.add(loadButton);
\end{lstlisting}
\emph{ Set the gap between the text and the icon in a button }
\begin{lstlisting}
button.setIconTextGap(8);
\end{lstlisting}
\emph{ The position of the icon and text in the button. }
\begin{lstlisting}
button.setVerticalAlignment(SwingConstants.TOP);
button.setHorizontalAlignment(SwingConstants.LEFT);
\end{lstlisting}
\emph{ Position the text relative to the icon in the button }
\begin{lstlisting}
http://www.exampledepot.com/egs/javax.swing/button_MoveIcon.html?l=rel
\end{lstlisting}
\section{Jlabels}
Swing labels or JLabels are used to display a small amount
of text and/or an ImageIcon. They are also used as the element
in JLists and JComboBoxes
\emph{ Declare a new JLabel }
\begin{lstlisting}
JLabel testLabel;
\end{lstlisting}
\emph{ Create a new JLabel with some initial text }
\begin{lstlisting}
testLabel = new JLabel("A new label");
\end{lstlisting}
\emph{ Change the text for the JLabel }
\begin{lstlisting}
testLabel.setText("new file");
\end{lstlisting}
\emph{ Create a label with an icon }
\begin{lstlisting}
Icon icon = new Icon(...); JLabel l = new JLabel(icon);
\end{lstlisting}
\begin{lstlisting}
label.setIcon(...);
\end{lstlisting}
\emph{ A label with text and an image }
\begin{lstlisting}
l = new JLabel("Image and Text", icon, JLabel.CENTER);
\end{lstlisting}
\emph{ Add a label to a window }
\begin{lstlisting}
import javax.swing.*;
public class LabelTest {
public static void main(String[] args) {
JFrame f = new JFrame("a simple window");
JLabel label = new JLabel("Just A Label");
f.getContentPane().add(label);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Add a label with text and an image }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("a simple window");
ImageIcon icon = new ImageIcon(
"/usr/share/icons/gnome/24x24/devices/chardevice.png");
JLabel label = new JLabel("Image and Text", icon, JLabel.CENTER);
f.getContentPane().add(label);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Create a label with just an icon image and no text }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("a simple window");
ImageIcon icon = new ImageIcon(
"/usr/share/icons/gnome/24x24/devices/chardevice.png");
JLabel label = new JLabel(icon);
f.getContentPane().add(label);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Add a label and text field to a window frame }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Testing Labels");
JLabel label = new JLabel("Enter Name");
JTextField box = new JTextField(10);
JPanel pl = new JPanel();
pl.add(label);
pl.add(box);
f.getContentPane().add(pl);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Display a 48pt centre aligned label in the default serifed font }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Testing Label Fonts");
JLabel title = new JLabel("A Big Label", JLabel.CENTER);
title.setFont(new Font("Serif", Font.BOLD, 48));
f.getContentPane().add(title);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Display a label with a rounded corner border }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Testing Label Fonts");
JLabel label = new JLabel("Rounded Corners");
label.setHorizontalAlignment(JLabel.CENTER);
LineBorder line = new LineBorder(Color.blue, 2, true);
label.setBorder(line);
label.setFont(new Font("Serif", Font.BOLD, 48));
f.getContentPane().add(label);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Create a label with right aligned text }
\begin{lstlisting}
JLabel label = new JLabel("label text", SwingConstants.RIGHT);
\end{lstlisting}
\emph{ Set the preferred size of a label }
\begin{lstlisting}
jlabel.setPreferredSize(100, 100);
\end{lstlisting}
\emph{ Put an image in a label }
\begin{lstlisting}
jlabel.setIcon(new ImageIcon("imagefilename");
\end{lstlisting}
\emph{ Set the border for a label }
\begin{lstlisting}
jlabel.setBorder(BorderFactory.createLineBorder(Color.black));
\end{lstlisting}
\emph{ Set the background colour for a label }
\begin{lstlisting}
jlabel.setBackground(color); setOpaque(true);
\end{lstlisting}
\emph{ Make text in a JLabel wrap to a particular pixel width }
\begin{lstlisting}
import javax.swing.*;
class FixedWidthLabel {
public static void main(String[] srgs) {
String s = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eu nulla urna. Donec sit amet risus nisl, a porta enim. Quisque luctus, ligula eu scelerisque gravida, tellus quam vestibulum urna, ut aliquet sapien purus sed erat. Pellentesque consequat vehicula magna, eu aliquam magna interdum porttitor...";
String html1 = "<html><body style='width: ";
String html2 = "px'>";
JOptionPane.showMessageDialog(null, new JLabel(html1+"200"+html2+s));
JOptionPane.showMessageDialog(null, new JLabel(html1+"300"+html2+s));
}
\end{lstlisting}
\subsection{Jtextfield Text Fields}
A JTextField is a one line text box
\emph{ Put a text field in a JFrame window containing text 'hello' }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args)
{
JFrame f = new JFrame();
JTextField t = new JTextField("hello");
f.getContentPane().add(t);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Create a text field with 30 columns which does something }
\emph{ When \Enter is pressed. }
\begin{lstlisting}
JTextField textfield = new JTextField ("Initial Text", 30);
textfield.addActionListener (new MyActionListener ());
class MyActionListener implements ActionListener
{
public void actionPerformed (ActionEvent e)
{
JTextField textfield = (JTextField) e.getSource ();
process (textfield.getText ());
}
}
\end{lstlisting}
\emph{ Right justify the text in the JTextField }
\begin{lstlisting}
textfield.setHorizontalAlignment(JTextField.RIGHT);
\end{lstlisting}
\subsection{Password Boxes}
A password box, or field is a field with one line of
text which does not display the text which is typed.
\emph{ A simple password box }
\begin{lstlisting}
import javax.swing.*;
public class Test {
public static void main(String[] args)
{
JFrame f = new JFrame();
JPasswordField t = new JPasswordField("hello");
f.getContentPane().add(t);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack();
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Make a password field which listens to the \Enter key }
\begin{lstlisting}
JPasswordField textfield = new JPasswordField("Initial Text");
textfield.setEchoChar('#');
textfield.addActionListener(actionListener);
\end{lstlisting}
\section{Text Areas}
A text area is a box with several lines in which text can be
entered.
\emph{ Create a text area with 20 rows and 30 columns }
\begin{lstlisting}
JTextArea textarea = new JTextArea ("Initial Text");
textarea = new JTextArea ("Initial Text", 20, 30);
\end{lstlisting}
\emph{ Set the background colour of a JTextArea }
\begin{lstlisting}
JTextArea t = new JTextArea("hi");
t.setBackground (Color.green);
\end{lstlisting}
\emph{ Set the font, forground and background colours of a jtextarea }
\begin{lstlisting}
final JTextArea ta = new JTextArea();
Font font = new Font("Courier", Font.PLAIN, 20);
ta.setFont(font);
ta.setForeground(Color.green);
ta.setBackground(Color.black);
\end{lstlisting}
\section{Jtextpanes}
A JTextPane is a devlishly complicated thing which can display all sorts of
different types of text. But it seems quite difficult to use.
\emph{ Show an html page in a JTextPane }
-----
import javax.swing.*;
import java.net.*;
public class WebPane $\{$
public static void main(String args[]) throws Exception $\{$
JFrame f = new JFrame();
JScrollPane scroll = new JScrollPane();
JTextPane tp = new JTextPane();
tp.setText(``loading...'');
scroll.getViewport().add(tp);
f.getContentPane().add(scroll);
//jf.pack();
f.setDefaultCloseOperation(JFrame.EXIT\_ON\_CLOSE);
//jf.setSize(400,500);
f.setVisible(true);
URL url = new URL(``http://bumble.sf.net'');
tp.setPage(url);
$\}$
$\}$
,,,
\section{Jeditorpane}
Complicated but useful
\emph{ Make hyperlinks work in a JEditorPane }
\begin{lstlisting}
final JEditorPane editor = new JEditorPane();
editor.setEditorKit(JEditorPane.createEditorKitForContentType("text/html"));
editor.setEditable(false);
editor.setText("<a href=\"http://www.google.com/finance?q=NYSE:C\">C</a>, <a href=\"http://www.google.com/finance?q=NASDAQ:MSFT\">MSFT</a>");
editor.addHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent e) {
if(e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
// java 1.6+
if(Desktop.isDesktopSupported()) {
Desktop.getDesktop().browse(e.getURL().toURI());
}
}
}
});
\end{lstlisting}
\section{Menus}
\emph{ Build menus with JMenuBar, JMenu, JMenuItem }
\emph{ Add a JMenuBar to a Window (JFrame) }
\begin{lstlisting}
JMenuBar menubar = new JMenuBar(); frame.setJMenuBar(menubar);
\end{lstlisting}
\emph{ Create a menu with control 0 shortcut key and an action listener }
\begin{lstlisting}
JMenuItem screenshot = new JMenuItem("Screenshot");
screenshot.setAccelerator(
KeyStroke.getKeyStroke(
KeyEvent.VK_0, InputEvent.CTRL_DOWN_MASK));
screenshot.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae) {
}};
JMenu menu = new JMenu("Other");
menu.add(screenshot);
JMenuBar mb = new JMenuBar();
mb.add(menu);
jframe.setJMenuBar(mb);
\end{lstlisting}
\section{Mouse}
\emph{ Mouse click listeners, and motion listeners. drawing in a panel }
\begin{lstlisting}
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
public class JavaPaintUI extends JFrame {
private int tool = 1;
int currentX, currentY, oldX, oldY;
public JavaPaintUI() {
initComponents();
}
private void initComponents() {
// we want a custom Panel2, not a generic JPanel!
jPanel2 = new Panel2();
jPanel2.setBackground(new java.awt.Color(255, 255, 255));
jPanel2.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
jPanel2.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent evt) {
jPanel2MousePressed(evt);
}
public void mouseReleased(MouseEvent evt) {
jPanel2MouseReleased(evt);
}
});
jPanel2.addMouseMotionListener(new MouseMotionAdapter() {
public void mouseDragged(MouseEvent evt) {
jPanel2MouseDragged(evt);
}
});
// add the component to the frame to see it!
this.setContentPane(jPanel2);
// be nice to testers..
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pack();
}// </editor-fold>
private void jPanel2MouseDragged(MouseEvent evt) {
if (tool == 1) {
currentX = evt.getX();
currentY = evt.getY();
oldX = currentX;
oldY = currentY;
System.out.println(currentX + " " + currentY);
System.out.println("PEN!!!!");
}
}
private void jPanel2MousePressed(MouseEvent evt) {
oldX = evt.getX();
oldY = evt.getY();
System.out.println(oldX + " " + oldY);
}
//mouse released//
private void jPanel2MouseReleased(MouseEvent evt) {
if (tool == 2) {
currentX = evt.getX();
currentY = evt.getY();
System.out.println("line!!!! from" + oldX + "to" + currentX);
}
}
public static void main(String args[]) {
EventQueue.invokeLater(new Runnable() {
public void run() {
new JavaPaintUI().setVisible(true);
}
});
}
// Variables declaration - do not modify
private JPanel jPanel2;
// End of variables declaration
// This class name is very confusing, since it is also used as the
// name of an attribute!
//class jPanel2 extends JPanel {
class Panel2 extends JPanel {
Panel2() {
// set a preferred size for the custom panel.
setPreferredSize(new Dimension(420,420));
}
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawString("BLAH", 20, 20);
g.drawRect(200, 200, 200, 200);
}
}
}
\end{lstlisting}
\section{Components}
All the swing components are subclasses of Component. We
can therefore manipulate components in a gui in a generic way.
\emph{ Get a component from a built gui and cast it to its type. }
\begin{lstlisting}
Component c = tabPane.getComponentAt(tabPane.getSelectedIndex());
JScrollPane sp = (JScrollPane)c;
\end{lstlisting}
\section{Calenders}
java.util.Calender and java.util.Timezone are useful classes for
getting information about times and dates.
\emph{ Use some methods of the Calender class }
\begin{lstlisting}
Calender c = Calendar.getInstance();
miliSecond = c.get(Calendar.MILLISECOND);
second = c.get(Calendar.SECOND);
minute = c.get(Calendar.MINUTE);
hour = c.get(Calendar.HOUR_OF_DAY);
dayOfMonth = c.get(Calendar.DAY_OF_MONTH);
dayOfYear = c.get(Calendar.DAY_OF_YEAR);
dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
month = c.get(Calendar.MONTH);
daysInMonth = c.getActualMaximum(Calendar.DAY_OF_MONTH);
daysInYear = c.getActualMaximum(Calendar.DAY_OF_YEAR);
\end{lstlisting}
\section{Time}
\emph{ Get the current time in nanoseconds }
\begin{lstlisting}
long lastTime = System.nanoTime();
\end{lstlisting}
\emph{ Get the current time in milli seconds }
\begin{lstlisting}
long startTime = System.currentTimeMillis();
\end{lstlisting}
\subsection{Timers}
A javax.swing.Timer can be used to execute an action periodically. They are
said to be superior to using a technique such as 'Thread.sleep()'
\emph{ Use a timer to update the text of a label each second }
\begin{lstlisting}
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class TimerTest {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
final JLabel label = new JLabel("Timed Label");
ActionListener listener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
label.setText(String.valueOf(System.nanoTime()));
label.repaint();
}
};
Timer timer = new Timer(1000, listener);
timer.start();
JOptionPane.showMessageDialog(null, label);
}
});
}
}
\end{lstlisting}
\emph{ Use a timer to change the color of textfield text every second }
\begin{lstlisting}
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class BlinkColorTextField {
BlinkColorTextField() {
final JTextField blinkingText = new JTextField("Red & Blue");
ActionListener blinker = new ActionListener() {
boolean isRed = true;
public void actionPerformed(ActionEvent ae) {
if (isRed) {
blinkingText.setForeground(Color.BLUE);
} else {
blinkingText.setForeground(Color.RED);
}
isRed = !isRed;
}
};
Timer timer = new Timer(1000, blinker);
timer.start();
JOptionPane.showMessageDialog(null, blinkingText);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable(){
public void run() {
new BlinkColorTextField();
}
});
}
}
\end{lstlisting}
\section{Events}
\emph{ A button which beeps when clicked }
\begin{lstlisting}
import java.awt.*;
import javax.swing.*;
import java.awt.Toolkit;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class Beeper extends JPanel implements ActionListener {
JButton button;
public Beeper() {
super(new BorderLayout());
button = new JButton("Beep Button");
button.setPreferredSize(new Dimension(200, 80));
add(button, BorderLayout.CENTER);
button.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
Toolkit.getDefaultToolkit().beep();
}
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame frame = new JFrame("Beeper");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JComponent newContentPane = new Beeper();
newContentPane.setOpaque(true);
frame.setContentPane(newContentPane);
frame.pack();
frame.setVisible(true);
}
});
}
}
\end{lstlisting}
\subsection{Actions}
\emph{ A modern way to add an action to a button }
JButton button = new JButton(new AbstractAction(``Close'') $\{$
@Override
public void actionPerformed(ActionEvent e) $\{$
System.exit(0);
$\}$
$\}$);
,,,
\emph{ Create an action class with icon, text, tooltip text and alt/shortcut key. }
leftAction = new LeftAction(
``Go left'', anIcon, ``This is the left button.'', new Integer(KeyEvent.VK\_L));
JButton test = new JButton(leftAction);
class LeftAction extends AbstractAction $\{$
public LeftAction(String text, ImageIcon icon,
String desc, Integer mnemonic) $\{$
super(text, icon);
putValue(SHORT\_DESCRIPTION, desc);
putValue(MNEMONIC\_KEY, mnemonic);
$\}$
public void actionPerformed(ActionEvent e) $\{$
displayResult("Action for first button/menu item", e);
$\}$
$\}$
,,,
If this action is used on a button and menu item, both use the Alt-L
key combination as a shortcut and the short description as a tool tip.
The text and icon are used on both the menu item and the button. The
advantage of creating Action classes is said to be that all gui
components which use the Action are updated when a value of the Action
is updated.
\emph{ Some notes for connecting through an http proxy }
System.setProperty(``http.proxyHost'', ``proxy.utas.edu.au'');
// System.setProperty(``http.proxyPort'', ``8080'');
,,,
\emph{ Remove the icon from a menu item initialized with an Action }
menuItem = new JMenuItem();
menuItem.setAction(leftAction);
menuItem.setIcon(null);
,,,
\emph{ Remove the text from a button itialized with an Action }
button = new JButton();
button.setAction(leftAction);
button.setText("");
,,,
\emph{ Another way to create a new Action using an anonymous class }
Action colourAction = new AbstractAction() $\{$
// This defines the constructor within the anonymous class
$\{$ putValue(Action.NAME, ``Green On Black''); $\}$
public void actionPerformed(ActionEvent e)
$\{$ /* do something */ $\}$
$\}$;
,,,
The strange curly braces without any method signature are actually a
way to define the constructor within an anonymous inner class. How
odd.
\section{Drag And Drop}
Drag and Drop or DnD is the ability to click on a component
and holding the mouse button down, move the mouse to another
location on the screen and release the mouse button. The component
should then be ``imported'' into the new part of the gui.
A number of swing elements have a built in drag or drop
functionality. For example you can drag a selected row from a
JTable to a JTextArea and the row will be copied as text into the
textarea. However if you wish to control how the information is
dragged or dropped you need to implement a TransferHandler class.
\emph{ Enable drag and drop on various components }
\begin{lstlisting}
textArea.setDragEnabled(toggle);
textField.setDragEnabled(toggle);
list.setDragEnabled(toggle);
table.setDragEnabled(toggle);
tree.setDragEnabled(toggle);
colorChooser.setDragEnabled(toggle);
,,,,
In the following example it is possible to drag a listbox item ontop
of another (thereby replacing it) or drag it between two listbox
items, inserting a new item (with the same text as the dragged
item). It is also possible to drag a multiple selection. The several
items get concatenated as a string and become the new element. This
is not very useful but demonstrates what can be done within the
createTransferable() method.
* a drag and drop list box,
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
import java.awt.datatransfer.*;
public class Box {
public static void main(String[] args) {
JFrame t = new JFrame();
DefaultListModel listModel = new DefaultListModel();
listModel.addElement("Cork Oak");
listModel.addElement("Elm");
listModel.addElement("Yew");
listModel.addElement("Siete Cueros");
listModel.addElement("Hevea Brasiliensis");
final JList list = new JList(listModel);
list.setFont(new Font("Georgia", Font.PLAIN, 30));
list.setTransferHandler(new TransferHandler() {
public boolean canImport(TransferHandler.TransferSupport info) {
if (!info.isDataFlavorSupported(DataFlavor.stringFlavor)) {
return false;
}
JList.DropLocation dl = (JList.DropLocation)info.getDropLocation();
if (dl.getIndex() == -1) { return false; }
return true;
}
public boolean importData(TransferHandler.TransferSupport info) {
if (!info.isDrop()) { return false; }
if (!info.isDataFlavorSupported(DataFlavor.stringFlavor)) {
JOptionPane.showMessageDialog(null,
"List doesn't accept a drop of this type.");
return false;
}
JList.DropLocation dl = (JList.DropLocation)info.getDropLocation();
DefaultListModel listModel = (DefaultListModel)list.getModel();
// Get the string that is being dropped.
Transferable t = info.getTransferable();
String data;
try { data = (String)t.getTransferData(DataFlavor.stringFlavor); }
catch (Exception e) { return false; }
if (dl.isInsert()) {
System.out.println("'" + data + "' inserted at index " + dl.getIndex());
} else {
System.out.println("'" + data + "' replacing index " + dl.getIndex());
}
if (dl.isInsert()) { listModel.add(dl.getIndex(), data); }
else { listModel.set(dl.getIndex(), data); }
return true;
}
public int getSourceActions(JComponent c) { return COPY; }
protected Transferable createTransferable(JComponent c) {
JList list = (JList)c;
Object[] values = list.getSelectedValues();
StringBuffer buff = new StringBuffer();
for (int i = 0; i < values.length; i++) {
Object val = values[i];
buff.append(val == null ? "" : val.toString());
if (i != values.length - 1) { buff.append("\n"); }
}
return new StringSelection(buff.toString());
}
});
list.setDropMode(DropMode.ON_OR_INSERT);
list.setDragEnabled(true);
JPanel p = new JPanel(); p.add(list);
t.getContentPane().add(p);
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.pack(); t.setLocationRelativeTo(null);
t.setVisible(true);
}
}
\end{lstlisting}
\subsection{Dataflavors}
A dataflavor is the rather strange name that java gives to the
mechanism by which it knows what type of data is being dragged,
dropped cut or pasted.
\emph{ Create a new dataflavor for colour objects }
\begin{lstlisting}
String colorType = DataFlavor.javaJVMLocalObjectMimeType +
";class=java.awt.Color";
DataFlavor colorFlavor = new DataFlavor(colorType);
\end{lstlisting}
The dataflavor above will only funtion for drag and drop or cut and
paste within the java application, not to other applications running
on the system.
\section{Look And Feel Of The Windows}
The ``look and feel'' of a windowed application refers to the
general style of the graphics used to display the application and
the way that buttons change when they are clicked with the mouse
Generally each look and feel may correspond to the visual style of an
operating system. The default look and feel for java is not particularly
attractive, which is why we want to change it.
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ commonly installed look and feel classes }} \\
\hline
\texttt{ Metal } & Javax.swing.plaf.metal.MetalLookAndFeel \\
\texttt{ Nimbus } & Javax.swing.plaf.nimbus.NimbusLookAndFeel \\
\texttt{ CDE/Motif } & Com.sun.java.swing.plaf.motif.MotifLookAndFeel \\
\texttt{ Windows } & Com.sun.java.swing.plaf.windows.WindowsLookAndFeel \\
\texttt{ Windows Classic } & Com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel \\
\hline
\end{tabular}
\end{center}
The Windows classic is basically Windows 95 style components,
Windows looks a lot better, Motif is an old X windows style, Metal
is the default java style quite ugly, and Nimbus is the Apple osx
style and therefor quite pretty.
\emph{ The className is used with UIManager.setLookAndFeel() }
\begin{lstlisting}
String className = info[i].getClassName();
\end{lstlisting}
\emph{ Print out the names and classnames of available look and feels }
\begin{lstlisting}
import javax.swing.UIManager;
public class LookAndFeel
{
public static void main(String[] args) throws Exception
{
UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels();
for (int i = 0; i < info.length; i++)
{
System.out.println("L & F name:" + info[i].getName());
System.out.println("L & F classname:" + info[i].getClassName());
}
}
}
\end{lstlisting}
\emph{ Print the name of the native look and feel }
\begin{lstlisting}
import javax.swing.UIManager;
public class LookAndFeel {
public static void main(String[] args) throws Exception
{
System.out.println("Native look and feel: " +
UIManager.getSystemLookAndFeelClassName());
}
}
\end{lstlisting}
\emph{ Display a file chooser with the native operating system look and feel }
\begin{lstlisting}
import javax.swing.*;
public class NiceFileDialog {
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
JFrame f = new JFrame("Trying to make the FileChooser look nicer");
JFileChooser c = new JFileChooser();
if (c.showOpenDialog(f) == JFileChooser.CANCEL_OPTION)
System.exit(-1);
}
}
\end{lstlisting}
The result on a windows computer of using the system look and feel is much
more aesthetically pleasing. Nimbus has a nice rounded corners but the colours
are very cold and the fonts dont seem very good.
\emph{ Display a file chooser with the nimbus look and feel }
\begin{lstlisting}
import javax.swing.*;
import java.awt.Font;
public class NiceFileDialog {
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
JFrame f = new JFrame("A Nimbus Style File Chooser");
JFileChooser c = new JFileChooser("C:\\");
c.setFont(new Font("Georgia", Font.PLAIN, 40));
if (c.showOpenDialog(f) == JFileChooser.CANCEL_OPTION)
System.exit(-1);
}
}
\end{lstlisting}
\emph{ A listbox with names of looks and feels }
\begin{lstlisting}
import javax.swing.*;
import java.awt.*;
public class LookAndFeelBox {
public static void main(String[] args) {
ListModel looks = new AbstractListModel() {
UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels();
public int getSize() { return info.length; }
public Object getElementAt(int index)
{ return info[index].getClassName(); }
};
Font font = new Font("Georgia", Font.PLAIN, 30);
JList list = new JList(looks);
list.setFont(font); list.setForeground(Color.gray);
//JPanel p = new JPanel(); p.add(l);
JFrame f = new JFrame();
f.getContentPane().add(list);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLocationRelativeTo(null);
f.pack(); f.setVisible(true);
}
}
\end{lstlisting}
The Look and Feel does not effect the window decorations, which
are controlled by the host operating system.
The following fragment works but generates runtime exceptions,
possible because I update the gui from within a function rather
than from within the paint method. The nimbus look and feel seems
to be the most pleasant at least on an ms windows computer.
\emph{ Show look and feels and change the look and feel when clicked }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
public class LookAndFeel extends JFrame implements ListSelectionListener {
JList list;
ListModel looks = new AbstractListModel() {
UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels();
public int getSize() { return info.length; }
public Object getElementAt(int index)
{ return info[index].getClassName(); }
};
public LookAndFeel()
{
Font font = new Font("Georgia", Font.PLAIN, 20);
list = new JList(looks);
list.addListSelectionListener(this);
list.setFont(font);
list.setForeground(Color.gray);
JButton button = new JButton("Does Nothing");
JPanel p = new JPanel();
p.add(list);
p.add(button);
JFrame f = new JFrame();
this.getContentPane().add(p);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.pack();
this.setVisible(true);
}
public void valueChanged(ListSelectionEvent e) {
if (e.getValueIsAdjusting() == false) {
if (list.getSelectedIndex() == -1) { /* No selection */ }
else {
try
{
UIManager.setLookAndFeel(list.getSelectedValue().toString());
SwingUtilities.updateComponentTreeUI(this.getContentPane());
}
catch (Exception ex) {}
}
}
}
public static void main(String[] args)
{
LookAndFeel t = new LookAndFeel();
}
}
\end{lstlisting}
\emph{ Set the native system look and feel. }
\begin{lstlisting}
public static void main(String[] args) {
SwingUtilities.invokeLater( new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
} catch (Exception useDefault) {}
initGui();
}
});
}
\end{lstlisting}
\emph{ Install a new look and feel. }
\begin{lstlisting}
try {
UIManager.
setLookAndFeel ("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}
catch (InstantiationException e) { }
catch (ClassNotFoundException e) { }
catch (UnsupportedLookAndFeelException e) { }
catch (IllegalAccessException e) { }
\end{lstlisting}
\emph{ Change the look and feel }
\begin{lstlisting}
UIManager.setLookAndFeel("...");
\end{lstlisting}
\begin{lstlisting}
SwingUtilities.updateComponentTreeUI(getContentPane());
\end{lstlisting}
\emph{ Set native look and feel }
\begin{lstlisting}
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
\end{lstlisting}
\emph{ Set java look and feel }
\begin{lstlisting}
Manager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
\end{lstlisting}
\emph{ Set the window decorations to the host system look and feel }
\begin{lstlisting}
JFrame.setDefaultLookAndFeelDecorated(true);
\end{lstlisting}
\begin{lstlisting}
JFrame frame = new JFrame("A window");
\end{lstlisting}
\subsection{Modifying A Look And Feel}
We can modify any look and feel by changing its default attributes. For
example we can change the default font or the default panel colours etc.
\emph{ Show the default font for a textfield in the current look and feel }
\begin{lstlisting}
Font font = UIManager.getFont("TextField.font");
\end{lstlisting}
\emph{ Change the default font for all textfield components }
\begin{lstlisting}
UIManager.put("TextField.font", new FontUIResource(<font>));
\end{lstlisting}
\emph{ Change the default font for a colorchooser }
\begin{lstlisting}
UIManager.put("ColorChooser.font", new FontUIResource(new Font("Georgia", Font.PLAIN, 18)));
\end{lstlisting}
\emph{ Change the default font for all labels }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.plaf.*;
import java.awt.*;
public class LabelFont {
public static void main(String[] args) {
Font font = new Font("Georgia", Font.PLAIN, 40);
UIManager.put("Label.font", new FontUIResource(font));
JFrame f = new JFrame();
JPanel p = new JPanel();
for (int ii = 0; ii < 4; ii++) {
JLabel l = new JLabel("This is the Georgia Font"); p.add(l);
}
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A method to set the default font for all swing elements }
\begin{lstlisting}
public static void setUIFont (javax.swing.plaf.FontUIResource f){
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof javax.swing.plaf.FontUIResource)
UIManager.put(key, f);
}
}
}
\end{lstlisting}
\emph{ List the UIManager keys in a listbox }
\begin{lstlisting}
import java.util.Enumeration;
import javax.swing.plaf.*;
import javax.swing.*;
import java.awt.Font;
public class Box {
public static void main(String[] args) {
JFrame t = new JFrame();
DefaultListModel listModel = new DefaultListModel();
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements())
listModel.addElement(keys.nextElement().toString());
JList list = new JList(listModel);
list.setFont(new Font("Georgia", Font.PLAIN, 30));
JPanel p = new JPanel(); p.add(new JScrollPane(list));
t.getContentPane().add(p);
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.pack(); t.setLocationRelativeTo(null);
t.setVisible(true);
}
}
\end{lstlisting}
\emph{ List the UIManager keys in a listbox }
\begin{lstlisting}
import java.util.Enumeration;
import javax.swing.plaf.*;
import javax.swing.*;
import java.awt.Font;
public class KeysBox extends JList {
public KeysBox() {
super();
DefaultListModel model = new DefaultListModel();
Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements())
model.addElement(keys.nextElement().toString());
this.setModel(model);
this.setFont(new Font("Georgia", Font.PLAIN, 25));
}
public static void main(String[] args) {
JFrame t = new JFrame();
JPanel p = new JPanel();
p.add(new JScrollPane(new KeysBox()));
t.getContentPane().add(p);
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.pack(); t.setLocationRelativeTo(null);
t.setVisible(true);
}
}
\end{lstlisting}
\emph{ The above method can be executed with }
\begin{lstlisting}
setUIFont(new javax.swing.plaf.FontUIResource("Serif",Font.ITALIC,12));
\end{lstlisting}
\emph{ Set the default font for all swing components. }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.plaf.*;
import java.awt.*;
public class LabelFont {
public static void setUIFont (FontUIResource f){
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof javax.swing.plaf.FontUIResource)
UIManager.put(key, f);
}
}
public static void main(String[] args) {
Font font = new Font("Georgia", Font.PLAIN, 40);
LabelFont.setUIFont(new FontUIResource("Georgio",Font.ITALIC,25));
JFrame f = new JFrame();
JPanel p = new JPanel();
JLabel l = new JLabel("This is the Georgia Font"); p.add(l);
JButton b = new JButton("Elm Trees"); p.add(b);
f.getContentPane().add(p);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Show a file chooser dialog and determine the result }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.plaf.*;
import java.awt.Font;
public class ChooseFile {
public static void main(String[] args) {
Font font = new Font("Georgia", Font.PLAIN, 30);
UIManager.put("FileChooser.font", new FontUIResource(font));
JFrame f = new JFrame("test file chooser");
JFileChooser chooser = new JFileChooser();
int result = chooser.showOpenDialog(f);
java.io.File file = chooser.getSelectedFile();
}
}
\end{lstlisting}
\section{Java Documentation}
\emph{ Includes a link to a method using suns online api documentation }
\begin{lstlisting}
http://java.sun.com/javase/6/docs/api/javax/sound/sampled/AudioSystem.html#getAudioInputStream(java.io.File)
\end{lstlisting}
\emph{ Consult the java 1.5 documentation for the sound 'Clip' class }
\begin{lstlisting}
http://java.sun.com/j2se/1.5.0/docs/api/javax/sound/sampled/Clip.html
\end{lstlisting}
\emph{ Look up the online api documentation for the 'Class' class }
\begin{lstlisting}
firefox java.sun.com/javase/6/docs/api/java/lang/Class.html
\end{lstlisting}
This will open the javadoc documentation for the 'Class' class
(used with the reflection classes) in a new firefox tab if firefox
is already running
\emph{ Look up the java 6 documentation for the 'File' class }
\begin{lstlisting}
firefox java.sun.com/javase/6/docs/api/java/io/File.html
\end{lstlisting}
\emph{ A bash function to look up the documentation for a class }
\begin{lstlisting}
jdoc(){ firefox "java.sun.com/javase/6/docs/api/java/lang/$1.html"; }
\end{lstlisting}
This function can be used by typing 'jdoc String' to look up
the Sun documentation for the 'String' class
\emph{ A better java api documentation look-up bash function }
\begin{lstlisting}
jdoc() {
[ -z "$1" ] && echo "usage: $FUNCNAME <java-class>" && return 1
c=$1; [[ $c != *.* ]] && c=java/lang/$c || c=${c//./\/}
firefox "java.sun.com/javase/6/docs/api/$c.html";
}
jdoc java.io.File; jdoc String
\end{lstlisting}
\section{Sound}
Java programs using sound can be written with javax.sound.sampled
Since the early days, computers have been able to beep, and they still can.
\emph{ Play the classic beep }
\begin{lstlisting}
java.awt.Toolkit.getDefaultToolkit().beep();
\end{lstlisting}
\subsection{Playing Sound}
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{http://forums.sun.com/thread.jspa?threadID=5401845}]
A Thread which talks about using Applet audioClip etc.
\item[\url{http://forums.sun.com/thread.jspa?messageID=10780561\#10780561}]
Simple code to play a sound file (as a 'clip')
\end{description}
AndrewThompson65 (forums.sun.com)
http://forums.sun.com/profile.jspa?userID=590366
his posts on the sun forums, read and learn
Richard G. Baldwin wrote some java audio tutorials
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{http://forums.sun.com/thread.jspa?forumID=31&threadID=792949}]
Simple code for playing a sound using a SourceDataLine (not a Clip)
\end{description}
PLAYING MP3 AND OGG VORBIS ....
\emph{ Example code for using mp3plugin.jar to play mp3s }
\begin{lstlisting}
https://blogs.oracle.com/kashmir/entry/java_sound_api_2_mp3
\end{lstlisting}
\emph{ Download mp3plugin.jar (from sun) and put in the current folder }
\begin{lstlisting}
mp3plugin.jar
\end{lstlisting}
\emph{ Run your mp3 application with jar in current folder }
\begin{lstlisting}
java -cp "mp3plugin.jar:." Mp3App ~(Linux)
\end{lstlisting}
\begin{lstlisting}
java -cp "mp3plugin.jar;." Mp3App ~(Windows)
\end{lstlisting}
See below for code that actually plays mp3s. The mp3 format
must be first converted to something that the java sound api
can deal with.
\emph{ Copy the mp3plugin.jar to the extensions folder }
\begin{lstlisting}
cp mp3plugin.jar /usr/lib/jvm/jdk1.7.0/jre/lib/ext/
\end{lstlisting}
The above procedure avoids having to set the classpath on the
command line, since the jre automatically loads classes from the
/lib/ext folder. The jar file above does not need the JMF Java Media
Framework in order to run.
Strangely, even with the plugin you cant use the same code
to play an mp3 as a wav. You need to convert the format first
\emph{ Play an mp3 with the mp3plugin.jar }
\begin{lstlisting}
import javax.sound.sampled.*;
import java.io.File;
public class Player2 {
// Buffer size = 44100 x 16 x 2 / 8
private static final int BUFFER_SIZE = 176400;
public static void main(String[] args) throws Exception {
byte[] buffer = new byte[BUFFER_SIZE];
AudioInputStream in =
AudioSystem.getAudioInputStream(
AudioFormat.Encoding.PCM_SIGNED,
//AudioSystem.getAudioInputStream(new File(args[0])));
AudioSystem.getAudioInputStream(new File("abuztuan.mp3")));
AudioFormat audioFormat = in.getFormat();
SourceDataLine line =
(SourceDataLine) AudioSystem.getLine(
new DataLine.Info(SourceDataLine.class, audioFormat));
line.open(audioFormat);
line.start();
while (true) {
int n = in.read(buffer, 0, buffer.length);
if (n < 0) { break; }
line.write(buffer, 0, n);
}
line.drain();
line.close();
}
}
\end{lstlisting}
Success! The above code works. After many tries
\emph{ The only difference in the code above is }
\begin{lstlisting}
AudioInputStream in = AudioSystem.getAudioInputStream(
AudioFormat.Encoding.PCM_SIGNED,
AudioSystem.getAudioInputStream(new File("abuztuan.mp3")));
\end{lstlisting}
\subsection{Using Tritonius}
This procedure is untested.
\emph{ Play an mp3 file }
\begin{itemize}
\item get http://www.javazoom.net/javalayer/sources.html
\item put the jar in the class path or current directory
\item see http://www.cs.princeton.edu/introcs/faq/mp3/MP3.java.html
\end{itemize}
put these in your classpath
tritonus\_share.jar, ....
\emph{ Put the tritonus class on the class path and run 'Test' }
\begin{lstlisting}
java -cp ".:tritonus_share.jar:..." Test
\end{lstlisting}
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{www.javazoom.net/mp3spi/documents.html}]
example code for playing mp3s
\item[\url{www.jsresources.org}]
More examples of how to play mp3 sound files using the
tritonius decoder classes. These examples tend to be difficult
to understand because they include so much unnecessary code
\end{description}
\subsection{Formats And Encoders}
Service Provider Interface
The Java Sound API uses a Service Provider Interface to identify
encoders \& decoders for sound formats and sequence types. This way,
adding support for a new format or type is as simple as providing a
decoder and/or encoder for it, adding an SPI file to the manifest of
the Jar it is in, then adding the Jar to the run-time class-path of
the application.
The mp3plugin.jar of the Java Media Framework supports decoding MP3s.
\subsection{Audio Information}
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ sound glossary }} \\
\hline
\texttt{ PCM } & Pulse-code modulation, a simple encoding technique \\
\texttt{ encoding } & Eg PCM, mu-law, a-law. Turns wave pressure into numbers \\
\texttt{ herz } & The a frequency (eg samples/frames) per second \\
\texttt{ sample } & A digital approximation of a sound wave at a point in time \\
\texttt{ frame } & Contains stereo samples and possibly other information \\
\texttt{ frame rate } & The number of frames per second (herz) \\
\texttt{ sample rate } & The number of samples per second (herz) \\
\hline
\end{tabular}
\end{center}
Sound files consist of a file format (which in java is represented
by the AudioFileFormat class). This file format contains header
information and other metadata such as frame length. The sound file
also has an audio format (represented by the class AudioFormat)
which consists of the sampling rate, the sample bit size, mono or
stereo etc.
An audio format consists of the number of samples per second (hz),
number of channels (stereo=2), bits per sample, and sample
encoding
\emph{ Show the audio format for the file 'test.wav' }
\begin{lstlisting}
import javax.sound.sampled.*;
import java.io.File;
public class Test
{
public static void main(String[] args) throws Exception
{
File file = new File("test.wav");
AudioInputStream ais = AudioSystem.getAudioInputStream(file);
AudioFormat format = ais.getFormat();
System.out.println(format);
}
}
\end{lstlisting}
This produces output such as
\begin{lstlisting}
PCM_SIGNED 22050.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian
\end{lstlisting}
\emph{ Show more detailed audio format information }
\begin{lstlisting}
import javax.sound.sampled.*;
import java.io.File;
public class Test
{
public static void main(String[] args) throws Exception
{
File file = new File("test.wav");
AudioInputStream ais = AudioSystem.getAudioInputStream(file);
AudioFormat format = ais.getFormat();
System.out.println(
"encoding: " + format.getEncoding());
System.out.println(
"frame rate: " + format.getFrameRate());
System.out.println(
"frame size: " + format.getFrameSize() + "(bytes)");
System.out.println(
"sample rate: " + format.getSampleRate());
System.out.println(
"sample size: " + format.getSampleSizeInBits() + "(bits)");
System.out.println(
"channels: " + format.getChannels());
System.out.println(
"big endian: " + format.isBigEndian());
}
}
\end{lstlisting}
\emph{ Show the audio file format for an audio file }
\begin{lstlisting}
import javax.sound.sampled.*;
import java.io.File;
public class Test
{
public static void main(String[] args) throws Exception
{
File file = new File("abuztuan.mp3");
AudioFileFormat af = AudioSystem.getAudioFileFormat(file);
System.out.println("Audio Type: " + af.getType());
System.out.println("Audio File Format: " + af);
}
}
\end{lstlisting}
\emph{ Show what audio file formats can be written by the java sound system }
\begin{lstlisting}
import javax.sound.sampled.*;
public class FileFormatList
{
public static void main(String[] args) throws Exception
{
AudioFileFormat.Type[] aa = AudioSystem.getAudioFileTypes();
for (int i = 0; i < aa.length; i++)
System.out.println(aa[i].toString());
}
}
\end{lstlisting}
\emph{ Check for a particular type of audio format }
\begin{lstlisting}
af = AudioSystem.getAudioFileFormat(new File("Test.wav");
if (af.getType() != AudioFileFormat.Type.AIFF)
\end{lstlisting}
\emph{ Open a local file or within a jar file }
\begin{lstlisting}
URL url = this.getClass().getClassLoader().getResource("test.wav");
\end{lstlisting}
\emph{ New audioformat in PCM encoding }
\begin{lstlisting}
new AudioFormat(sampleRate, sampleSizeInBits, channels, signed, bigEndian);
\end{lstlisting}
\emph{ Create an 8khz 8bit sample mono signed bigendian PCM format }
\begin{lstlisting}
AudioFormat format = new AudioFormat(8000, 8, 1, true, true);
\end{lstlisting}
This is a very low quality audioformat, but also of a small
file size.
\emph{ Audio format constructor }
\begin{lstlisting}
AudioFormat(AudioFormat.Encoding encoding, float sampleRate, int sampleSizeInBits, int channels, int frameSize, float frameRate, boolean bigEndian)
\end{lstlisting}
\emph{ A PCM format at 44100 hz stereo, 16 bit sample, 4 byte frame }
\begin{lstlisting}
AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 44100.0, 16, 2, 4, 44100.0, false)
\end{lstlisting}
\emph{ Calculate bytes per second }
\begin{lstlisting}
format.getFrameRate() * format.getFrameSize();
\end{lstlisting}
The above calculation is important if you wish to read, play
or record a certain number of seconds of audio, which is a
reasonably common request.
\subsection{Source Data Lines}
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{http://forums.sun.com/thread.jspa?forumID=31&threadID=5310813}]
very clear code for using source data lines in a class
\end{description}
\emph{ A simple example of playing a sound found with a SourceDataLine }
\begin{lstlisting}
import java.io.*;
import javax.sound.sampled.*;
public class SoundLineTest {
public static void main(String[] args) throws Exception {
SourceDataLine line = null;
int BUFFERSIZE = 64*1024; // 64 KB
File f = new File("rec.wav");
AudioInputStream stream = AudioSystem.getAudioInputStream(f);
AudioFormat format = stream.getFormat();
DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
line = (SourceDataLine) AudioSystem.getLine(info);
line.open(format); line.start();
int nBytesRead = 0;
byte[] sampledData = new byte[BUFFERSIZE];
boolean stopped = false;
while (!stopped) {
nBytesRead = stream.read(sampledData, 0, sampledData.length);
if (nBytesRead == -1) break;
line.write(sampledData, 0, nBytesRead);
}
line.drain();
line.close();
}
}
\end{lstlisting}
The boolean 'stopped' variable in the code above can be used to
stop the play back if the user presses a button (which will set
the stopped variable to true)
\emph{ Play a sound using a SourceDataLine catching Exceptions }
\begin{lstlisting}
import java.io.*;
import javax.sound.sampled.*;
public class SoundLineTest {
public static void main(String[] args) {
SourceDataLine soundLine = null;
int BUFFER_SIZE = 64*1024; // 64 KB
try {
File soundFile = new File("test.wav");
AudioInputStream audioInputStream =
AudioSystem.getAudioInputStream(soundFile);
AudioFormat audioFormat = audioInputStream.getFormat();
DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat);
soundLine = (SourceDataLine) AudioSystem.getLine(info);
soundLine.open(audioFormat);
soundLine.start();
int nBytesRead = 0;
byte[] sampledData = new byte[BUFFER_SIZE];
while (nBytesRead != -1) {
nBytesRead = audioInputStream.read(sampledData, 0, sampledData.length);
if (nBytesRead >= 0) {
soundLine.write(sampledData, 0, nBytesRead);
}
}
} catch (UnsupportedAudioFileException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
} catch (LineUnavailableException ex) {
ex.printStackTrace();
} finally {
soundLine.drain();
soundLine.close();
}
}
}
\end{lstlisting}
In the code above if the nBytesRead $>$ 0 test is removed then an
IllegalArgumentException is thrown at the end of the sound file
\subsection{Cutting Sound Files}
One strategy for cutting an audio file is to construct a new
AudioInputStream from another but limit the number of frames
\emph{ Create a new shorter stream }
\begin{lstlisting}
AudioInputStream newStream =
new AudioInputStream(
oldStream, format, seconds * (int)format.getFrameRate());
AudioSystem.write(shortenedStream, fileFormat.getType(), destinationFile);
\end{lstlisting}
Another strategy is to write bytes to an output stream. Then create an
audio input stream from those bytes.
\emph{ Cut a section of a wav file and save to a new file }
\begin{lstlisting}
import java.io.*;
import javax.sound.sampled.*;
class AudioFileProcessor {
public static void copyAudio(
String sourceFileName, String destinationFileName,
int startSecond, int secondsToCopy) {
AudioInputStream inputStream = null;
AudioInputStream shortenedStream = null;
try {
File file = new File(sourceFileName);
AudioFileFormat fileFormat = AudioSystem.getAudioFileFormat(file);
AudioFormat format = fileFormat.getFormat();
inputStream = AudioSystem.getAudioInputStream(file);
int bytesPerSecond = format.getFrameSize() * (int)format.getFrameRate();
inputStream.skip(startSecond * bytesPerSecond);
long framesOfAudioToCopy = secondsToCopy * (int)format.getFrameRate();
shortenedStream = new AudioInputStream(inputStream, format, framesOfAudioToCopy);
File destinationFile = new File(destinationFileName);
AudioSystem.write(shortenedStream, fileFormat.getType(), destinationFile);
} catch (Exception e) {
println(e);
} finally {
if (inputStream != null)
try { inputStream.close(); }
catch (Exception e) { println(e); }
if (shortenedStream != null)
try { shortenedStream.close(); }
catch (Exception e) { println(e); }
}
}
public static void main(String[] args) {
copyAudio("/tmp/uke.wav", "/tmp/uke-shortened.wav", 2, 1);
}
}
\end{lstlisting}
\emph{ A technique to write a byte array to a wav file, incomplete example }
\begin{lstlisting}
File f = new File(exportFileName + ".tmp");
File f2 = new File(exportFileName);
long l = f.length();
//byte[] buffer;
// read into byte array using AudioInputStream
ByteArrayInputStream bs = new ByteArrayInputStream(buffer);
AudioInputStream ai = new AudioInputStream(bs,mainFormat,l/4);
AudioSystem.write(ai, Type.WAVE, f2);
fi.close();
f.delete();
\end{lstlisting}
\emph{ Another technique for writing bytes to an audio file, incomplete example }
\begin{lstlisting}
ByteArrayOutputStream b_out = new ByteArrayOutputStream();
// Read a frame from the file.
while (audioInputStream.read(audioBytes) != -1) {
//Do stuff here....
b_out.write(outputvalue);
}
// Hook output stream to output file
ByteArrayInputStream b_in = new ByteArrayInputStream(b_out.toByteArray());
AudioInputStream ais = new AudioInputStream(b_in, format, length);
AudioSystem.write(ais, inFileFormat.getType(), outputFile);
\end{lstlisting}
\subsection{Convert Raw Audio Data To Wav}
File f = new File(exportFileName+``.tmp'');
File f2 = new File(exportFileName);
long l = f.length();
FileInputStream fi = new FileInputStream(f);
AudioInputStream ai = new AudioInputStream(fi,mainFormat,l/4);
AudioSystem.write(ai, Type.WAVE, f2);
fi.close();
f.delete();
\subsection{Joining Sound Files}
\emph{ Join 2 wav files }
\begin{lstlisting}
import java.io.File;
import java.io.IOException;
import java.io.SequenceInputStream;
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
public class WavAppender {
public static void main(String[] args) {
String wavFile1 = "wav1.wav";
String wavFile2 = "wav2.wav";
try {
AudioInputStream clip1 = AudioSystem.getAudioInputStream(new File(wavFile1));
AudioInputStream clip2 = AudioSystem.getAudioInputStream(new File(wavFile2));
AudioInputStream appendedFiles = new AudioInputStream(
new SequenceInputStream(clip1, clip2), clip1.getFormat(),
clip1.getFrameLength() + clip2.getFrameLength());
AudioSystem.write(appendedFiles, AudioFileFormat.Type.WAVE,
new File("joinwav.wav"));
} catch (Exception e) {
e.printStackTrace();
}
}
}
\end{lstlisting}
\subsection{Playing Audio}
\emph{ Use a JToggleButton to stop and start a sound clip }
\begin{lstlisting}
import java.net.URL;
import java.awt.event.*;
import javax.swing.*;
import javax.sound.sampled.*;
public class RestartableLoopSound {
public static void main(String[] args) throws Exception {
URL url = new URL("http://pscode.org/media/leftright.wav");
final Clip clip = AudioSystem.getClip();
AudioInputStream ais = AudioSystem.getAudioInputStream(url);
clip.open(ais);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
final JToggleButton b = new JToggleButton("Loop");
ActionListener listener = new ActionListener() {
public void actionPerformed(ActionEvent ae) {
if (b.isSelected()) {
clip.loop(Clip.LOOP_CONTINUOUSLY);
} else { clip.stop(); }
}
};
b.addActionListener(listener);
JOptionPane.showMessageDialog(null, b);
}
});
}
}
\end{lstlisting}
\subsection{Clips}
Clips are used for non streamed audio data. That is, all audio
data is loaded into memory before playback
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ Things doable with a javax.sound.sampled.Clip }} \\
\hline
\texttt{ getMicrosecondLength() } & How many microseconds long is the audio \\
\texttt{ getFrameLength() } & How many sound frames the audio has \\
\texttt{ setMicrosecondPosition(long) } & Set the current play position \\
\texttt{ setLoopPoints(int, int) } & Loop between 2 particular frames in the audio \\
\texttt{ long getMicrosecondPosition() } & How long the audio has been playing for \\
\texttt{ long getLongFramePosition() } & The current frame position of the audio \\
\texttt{ AudioFormat getFormat() } & The format of the playing audio \\
\hline
\end{tabular}
\end{center}
If a sound file/url is too large then the Clip will throw a
javax.sound.sampled.LineUnavailableException with the message "Failed to
allocate clip data: Requested buffer too large."
\emph{ Play a clip catching exceptions }
\begin{lstlisting}
import java.io.*;
import java.net.URL;
import javax.sound.sampled.*;
import javax.swing.*;
public class SoundClipTest extends JFrame {
public SoundClipTest() {
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setTitle("Test Sound Clip");
this.setSize(300, 200);
this.setVisible(true);
try {
File f = new File("test.wav");
AudioInputStream audioIn = AudioSystem.getAudioInputStream(f);
Clip clip = AudioSystem.getClip();
clip.open(audioIn);
clip.start();
} catch (UnsupportedAudioFileException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (LineUnavailableException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
new SoundClipTest();
}
}
\end{lstlisting}
\emph{ Play an audio file (obtained from the web) continuously }
\begin{lstlisting}
import javax.sound.sampled.*;
import java.net.URL;
import javax.swing.JOptionPane;
public class AudioClipTest {
public static void main(String[] args) throws Exception {
URL url = new URL("http://pscode.org/media/100_2817.au");
AudioInputStream ais = AudioSystem.getAudioInputStream(url);
Clip clip = AudioSystem.getClip();
clip.open(ais);
clip.loop(Clip.LOOP_CONTINUOUSLY);
JOptionPane.showMessageDialog(null, "Close to end..");
}
}
,,,,,
\end{lstlisting}
\emph{ Play an audio clip beginning 1/2 a second after the beginning (using code above) }
\begin{lstlisting}
clip.open(); clip.setMicrosecondPosition(); clip.start();
\end{lstlisting}
\emph{ Play a sound file starting just after the beginning }
\begin{lstlisting}
import javax.sound.sampled.*;
import java.io.File;
import javax.swing.JOptionPane;
public class ClipTest {
public static void main(String[] args) throws Exception {
File f = new File("asagohan.wav");
AudioInputStream ais = AudioSystem.getAudioInputStream(f);
Clip clip = AudioSystem.getClip();
clip.open(ais);
clip.setMicrosecondPosition(500000); clip.start();
JOptionPane.showMessageDialog(null, "Close to end..");
}
}
\end{lstlisting}
\emph{ Play the local file 'sound.wav' (in the current folder) 6 times }
\begin{lstlisting}
import javax.sound.sampled.*;
import java.io.File;
import javax.swing.JOptionPane;
public class MpgPlay {
public static void main(String[] args) throws Exception {
File f = new File("abuztuan.mp3");
AudioInputStream ais = AudioSystem.getAudioInputStream(f);
Clip clip = AudioSystem.getClip();
clip.open(ais); clip.loop(6); clip.start();
JOptionPane.showMessageDialog(null, "Close to end..");
}
}
\end{lstlisting}
\emph{ Check if the system supports playing mp3 sound files }
\begin{lstlisting}
import javax.sound.sampled.*;
import java.io.File;
public class MpgSupport {
public static void main(String[] args) throws Exception {
File f = new File("abuztuan.mp3");
try
{
AudioInputStream ais = AudioSystem.getAudioInputStream(f);
System.out.println("Mp3 is Ok to play");
}
catch (UnsupportedAudioFileException e)
{
System.out.println("Mp3 is NOT supported");
}
}
}
\end{lstlisting}
The following may fail if the sound file is too big
\emph{ Create a simple loop to pause and restart a sound clip }
\begin{lstlisting}
import javax.sound.sampled.*;
import java.util.*;
import java.io.File;
public class PauseClip {
public static void main(String[] args) throws Exception {
File file = new File("test.wav");
AudioInputStream ais = AudioSystem.getAudioInputStream(file);
Clip clip = AudioSystem.getClip();
clip.open(ais); clip.loop(1); clip.start();
Scanner scan = new Scanner(System.in);
String s = "";
while (!s.equals("q"))
{
System.out.print("what? (p/s/q)>");
s = scan.nextLine();
if (s.equals("p")) { clip.stop(); }
if (s.equals("s")) {
//clip.flush();
clip.start();
}
}
}
}
\end{lstlisting}
\subsection{Recording Sound}
\begin{description}[labelindent=1cm, leftmargin=2cm, style=nextline]
\item[\url{www.jsresources.org}]
terribly complicated examples of using the javax.sound.sampled
api. This will put you right off ever trying to use it.
\item[\url{http://www.developer.com/java/other/article.php/2105421/Java-Sound-Capturing-Microphone-Data-into-an-Audio-File.htm}]
A tutorial on recording sound by Baldwin.
\end{description}
\emph{ Record cd quality stereo audio }
\begin{lstlisting}
AudioFormat format = new AudioFormat(
\end{lstlisting}
\begin{lstlisting}
AudioFormat.Encoding.PCM_SIGNED,
\end{lstlisting}
\begin{lstlisting}
44100.0F, 16, 2, 4, 44100.0F, false);
\end{lstlisting}
\emph{ Record a sound file from the computer microphone }
\begin{lstlisting}
import java.io.*;
import javax.sound.sampled.*;
public class RecordAudio
{
public static void main(String[] args) throws Exception
{
/* Cd quality PCM 44.1 kHz, 16 bit signed, stereo. */
AudioFormat format = new AudioFormat(
AudioFormat.Encoding.PCM_SIGNED,
44100.0F, 16, 2, 4, 44100.0F, false);
DataLine.Info info = new DataLine.Info(TargetDataLine.class, format);
TargetDataLine line = (TargetDataLine) AudioSystem.getLine(info);
line.open(format); line.start();
AudioInputStream ais = new AudioInputStream(line);
System.out.println("Recording into 't.wav', [Cntrl] c to stop");
AudioSystem.write(ais, AudioFileFormat.Type.WAVE, new File("rec.wav"));
line.stop();
line.close();
} }
\end{lstlisting}
\emph{ Record audio in a thread, this code is very messy and redundant }
\begin{lstlisting}
import javax.sound.sampled.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
public class RecordAudio {
private File audioFile;
protected boolean running;
private ByteArrayOutputStream out;
private AudioInputStream inputStream;
private AudioFormat format;
private float level;
private int frameSize;
public RecordAudio(){ getFormat(); }
private AudioFormat getFormat() {
File file = new File("test.wav");
AudioInputStream stream;
try {
stream = AudioSystem.getAudioInputStream(file);
format=stream.getFormat();
frameSize=stream.getFormat().getFrameSize();
return stream.getFormat();
}
catch (UnsupportedAudioFileException e) {}
catch (IOException e) { }
return null;
}
public void stopRecording() { running = false; }
public void recordAudio() {
try {
final AudioFormat format = getFormat();
DataLine.Info info = new DataLine.Info(TargetDataLine.class, format);
final TargetDataLine line = (TargetDataLine)
AudioSystem.getLine(info);
line.open(format);
line.start();
Runnable runner = new Runnable() {
int bufferSize = (int) format.getSampleRate()
* format.getFrameSize();
byte buffer[] = new byte[bufferSize];
public void run() {
int readPoint = 0;
out = new ByteArrayOutputStream();
running = true;
int sum=0;
while (running) {
int count = line.read(buffer, 0, buffer.length);
System.out.println(level);
if (count > 0) { out.write(buffer, 0, count); }
}
line.stop();
}
};
Thread captureThread = new Thread(runner);
captureThread.start();
} catch (LineUnavailableException e) {
System.err.println("Line unavailable: " + e);
System.exit(-2);
}
}
public File getAudioFile() {
byte[] audio = out.toByteArray();
InputStream input = new ByteArrayInputStream(audio);
try {
final AudioFormat format = getFormat();
final AudioInputStream ais =
new AudioInputStream(input, format,
audio.length / format.getFrameSize());
AudioSystem.write(ais, AudioFileFormat.Type.WAVE, new File("rec.wav"));
input.close();
System.out.println("New file created!");
} catch (IOException e) {
System.out.println(e.getMessage());
}
return new File("rec.wav");
}
public static void main(String[] args) throws Exception {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
final RecordAudio a = new RecordAudio();
final JToggleButton b = new JToggleButton("start recording");
ActionListener listener = new ActionListener() {
public void actionPerformed(ActionEvent ae) {
if (b.isSelected()) {
a.recordAudio();
b.setText("stop recording");
} else {
b.setText("start recording");
a.stopRecording();
File f = a.getAudioFile();
}
}
};
b.addActionListener(listener);
JOptionPane.showMessageDialog(null, b);
}
});
}
}
\end{lstlisting}
\subsection{Silence}
Silence can be calculated either by decibel dB levels or else
by the RMS, or Root Mean Square.
\emph{ Computes the Root Mean Square volume of signal sizes ranging from -1 to 1. */ }
\begin{lstlisting}
public double volumeRMS(double[] raw) {
double sum = 0d;
if (raw.length==0) {
return sum;
} else {
for (int ii=0; ii<raw.length; ii++) {
sum += raw[ii];
}
}
double average = sum/raw.length;
double sumMeanSquare = 0d;
for (int ii=0; ii<raw.length; ii++) {
sumMeanSquare += Math.pow(raw[ii]-average,2d);
}
double averageMeanSquare = sumMeanSquare/raw.length;
double rootMeanSquare = Math.pow(averageMeanSquare,0.5d);
return rootMeanSquare;
}
\end{lstlisting}
\subsection{Mixers}
\emph{ Show the available audio mixers on a system }
\begin{lstlisting}
import javax.sound.sampled.*;
public class MixerTest
{
public static void main(String[] args) throws Exception
{
Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
System.out.println("Available mixers:");
for (int ii = 0; ii < mixerInfo.length; ii++)
{
System.out.println(mixerInfo[ii].getName());
} } }
\end{lstlisting}
\subsection{Tones}
\emph{ Code for generating tones }
\begin{lstlisting}
http://stackoverflow.com/questions/7782721/java-raw-audio-output/7782749#7782749
\end{lstlisting}
\subsection{Midi}
Midi is a way of representing electronic music, symbolically rather than
as a series of samples.
\emph{ Playing a MIDI Sequence (a song) }
\begin{lstlisting}
import javax.sound.midi.*;
import javax.swing.JOptionPane;
import java.net.URL;
public class PlayMidi {
public static void main(String[] args) throws Exception {
URL url = new URL("http://pscode.org/media/EverLove.mid");
Sequence sequence = MidiSystem.getSequence(url);
Sequencer sequencer = MidiSystem.getSequencer();
sequencer.open();
sequencer.setSequence(sequence);
sequencer.start();
JOptionPane.showMessageDialog(null, "Everlasting Love");
}
}
\end{lstlisting}
\section{Running Java Applications}
\section{Deploying Java Applications}
Maven may be a valuable tool for deploying apps. It allows dependencies
to be automatically downloaded from the internet.
\section{Jar Archives}
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ tools }} \\
\hline
\texttt{ fastjar } & Creates jar files \\
\hline
\end{tabular}
\end{center}
\subsection{An Example Jar Manifest}
\emph{ An example manifest file with the class path set }
----
Main-Class: org.mypackage.HelloWorld
Class-Path: lib/supportLib.jar
,,,
\section{Classpath}
The classpath is the mechanism which the jre using to locate
classes which are used in an application. The current directory
is always included in the classpath. The classpath has a reputation
for giving rise to tricky configuration problems.
\emph{ Place multiple jar files on the classpath (windows) }
\begin{lstlisting}
java -cp "Test.jar;lib/*" my.package.MainClass
\end{lstlisting}
\emph{ The same on Linux (colons and not semicolons!) }
\begin{lstlisting}
java -cp "Test.jar:lib/*" my.package.MainClass
\end{lstlisting}
\emph{ Jar files can also be placed in the extension directory }
\begin{lstlisting}
C:\JDK1.2.2\JRE\LIB\EXT ~(windows, very old java runtime)
\end{lstlisting}
\emph{ A typical extension folder list for java 1.7 on Linux }
\begin{lstlisting}
/usr/lib/jvm/jdk1.7.0/jre/lib/ext:/usr/java/packages/lib/ext
\end{lstlisting}
\emph{ Another way of copying a jar file to the extensions folder }
\begin{lstlisting}
cp mp3plugin.jar ${JAVA_HOME}/jre/lib/ext
\end{lstlisting}
\emph{ Display the java classpath and the extensions folder }
----
import java.util.Properties;
public class GetClassPath
$\{$
static Properties p = System.getProperties();
public static void main(String[] args) $\{$
System.out.println(p.getProperty(``java.class.path'', null));
System.out.println(p.getProperty(``java.ext.dirs'', null));
$\}$
$\}$
,,,
\section{Modern Loops}
More recent versions of Java have introduced new ways
of looping through arrays and collections
\emph{ Loop through a the words of a string }
\begin{lstlisting}
public class Test
{
public static void main(String[] args)
{
String s = "red yellow blue";
String[] splitString = (s.split("\\s+"));
for (String ss: splitString) {
System.out.println(ss);
}
}
}
\end{lstlisting}
\section{Threads}
\emph{ Create an anonymous thread }
\begin{lstlisting}
new Thread() {
public void run()
{
// do something
}
}.start();
\end{lstlisting}
\section{Using The Operating System}
\emph{ On windows execute the 'notepad' text editor in a new thread }
\begin{lstlisting}
proc = Runtime.getRuntime().exec("notepad");
\end{lstlisting}
\emph{ Get the operating system name and version }
\begin{lstlisting}
String s =
"os.name: " + System.getProperty("os.name") +
"\nos.version: " + System.getProperty("os.version");
\end{lstlisting}
\section{Regular Expressions}
\emph{ See if a string starts with a space (this prints 'false') }
\begin{lstlisting}
System.out.println("A big tree".matches("^ .*"));
\end{lstlisting}
\emph{ Test if a string starts with a 'word' character (letter) }
\begin{lstlisting}
System.out.println("A big tree".matches("^\\w.*"));
\end{lstlisting}
This prints 'true'
\emph{ Replace all whitespace with tab characters }
\begin{lstlisting}
System.out.println("the green grass".replaceAll("\\s+", "\t"));
\end{lstlisting}
\emph{ Replace all whitespace with a dot '.' }
\begin{lstlisting}
System.out.println("the green grass".replaceAll("\\s+", "."));
\end{lstlisting}
\emph{ Split a string into words using the 'split' method }
\begin{lstlisting}
public class Test
{
public static void main(String[] args) {
String[] splitString = ("Some new words".split("\\s+"));
for (String word : splitString) {
System.out.println(word);
}
}
}
\end{lstlisting}
\emph{ Use compiled patterns and matching loops }
\begin{lstlisting}
Pattern pattern = Pattern.compile("\\w+");
// Pattern.compile("\\s+", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher("some test string");
// Check all occurance
while (matcher.find()) {
System.out.print("Start index: " + matcher.start());
System.out.print(" End index: " + matcher.end() + " ");
System.out.println(matcher.group());
}
\end{lstlisting}
\emph{ Replace all occurances of whitespace with tabs }
\begin{lstlisting}
Pattern pat = Pattern.compile("\\s+");
Matcher m = pat.matcher("The green grass");
System.out.println(m.replaceAll("\t"));
\end{lstlisting}
\section{Constructors}
\emph{ Make 2 object contructors, of which one uses a default value }
----
public FileSystemModel()
$\{$ this( System.getProperty(``user.home'')); $\}$
public FileSystemModel( String startPath ) $\{$
root = startPath;
$\}$
,,,
\section{Jtree Tree Component}
Like many of the other swing components which display a significant
amount of information, the swing tree component uses a ``model'' interface
to supply data to the tree component. To the new-comer to interface or
object oriented programming this may seem daunting, but its not. There
arrangement is simple: The model has a series of methods which allow the
tree component to display each node or leaf on the tree. But the tree
doesnt mind where that data comes from. This gives a great deal of flexibility
to the programmer, who can use any kind of data to create a tree.
\emph{ Put a default jtree in a JFrame window }
\begin{lstlisting}
import javax.swing.*;
public class DefaultTree {
public static void main(String[] args)
{
JFrame f = new JFrame();
JTree t = new JTree();
f.getContentPane().add(t);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A file and directory TreeModel for use with a JTree element }
---------
import javax.swing.*;
import java.awt.Font;
import javax.swing.plaf.FontUIResource;
import javax.swing.tree.*;
import javax.swing.event.*;
import java.io.*;
public class FileSystemModel implements TreeModel $\{$
String root;
public FileSystemModel() $\{$
this( System.getProperty( ``user.home'' ) );
$\}$
public FileSystemModel( String startPath )
$\{$ root = startPath; $\}$
public Object getRoot()
$\{$ return new File( root ); $\}$
public Object getChild( Object parent, int index ) $\{$
File directory = (File)parent;
String[] children = directory.list();
return new File( directory, children[index] );
$\}$
public int getChildCount( Object parent ) $\{$
File fileSysEntity = (File)parent;
if ( fileSysEntity.isDirectory() ) $\{$
String[] children = fileSysEntity.list();
if (children == null) return 0;
return children.length;
$\}$
return 0;
$\}$
public boolean isLeaf( Object node )
$\{$ return ((File)node).isFile(); $\}$
public void valueForPathChanged( TreePath path, Object newValue ) $\{$$\}$
public void removeTreeModelListener(TreeModelListener l) $\{$$\}$
public void addTreeModelListener(TreeModelListener l) $\{$$\}$
public int getIndexOfChild( Object parent, Object child ) $\{$
File directory = (File)parent;
File fileSysEntity = (File)child;
String[] children = directory.list();
int result = -1;
for ( int i = 0; i $<$ children.length; ++i ) $\{$
if ( fileSysEntity.getName().equals( children[i] ))
result = i; break;
$\}$
return result;
$\}$
public static void main(String[] args) throws Exception
$\{$
UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
UIManager.put(``Tree.font'', new FontUIResource(``Georgia'', Font.PLAIN, 18));
JFrame f = new JFrame(``A File System Tree'');
JTree t = new JTree(new FileSystemModel(``..''));
f.getContentPane().add(new JScrollPane(t));
f.setDefaultCloseOperation(JFrame.EXIT\_ON\_CLOSE);
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
$\}$
$\}$
,,,
\subsection{Jtable Swing Table Component}
If you do not add a swing table to a scrollpane, then it is
necessary to add the table header seperately to the container
component.
\emph{ Using tables and cell renderers }
\begin{lstlisting}
http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#editrender
\end{lstlisting}
\emph{ Create a swing table using a default table model }
\begin{lstlisting}
DefaultTableModel tm = new DefaultTableModel();
tm.addColumn("Column 0");
tm.addColumn("Column 1");
tm.addColumn("Column 2");
tm.addRow(new String[]{"Table 00", "Table 01", "Table 02"});
tm.addRow(new String[]{"Table 10", "Table 11", "Table 12"});
tm.addRow(new String[]{"Table 20", "Table 21", "Table 22"});
tm.addRow(new String[]{"Table 30", "Table 31", "Table 32"});
table = new JTable(tm);
\end{lstlisting}
\emph{ Create a table using the DefaultTableModel }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.plaf.FontUIResource;
import java.awt.Font;
public class TableTest extends JPanel {
JTable table;
public TableTest() {
super();
DefaultTableModel m = new DefaultTableModel();
m.addColumn("Tree");
m.addColumn("Origin");
m.addRow(new String[]{"Eucalypt", "Australia"});
m.addRow(new String[]{"Cork Oak", "Europe"});
m.addRow(new String[]{"Siete Cueros", "Colombia"});
m.addRow(new String[]{"Walnut", "Europe"});
table = new JTable(m);
this.table = new JTable(m);
this.add(new JScrollPane(this.table));
}
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
UIManager.put("Table.font", new FontUIResource("Georgia", Font.PLAIN, 18));
JFrame f = new JFrame("A Table with the default table model");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new TableTest());
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Create a table using the AbstractTableModel }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.plaf.FontUIResource;
import java.awt.Font;
public class TableTest extends JPanel {
JTable table;
TableModel model = new AbstractTableModel() {
public int getColumnCount() { return 10; }
public int getRowCount() { return 10;}
public Object getValueAt(int row, int col) {
return new Integer(row*col);
//return "row
}
};
public TableTest() {
super();
this.table = new JTable(this.model);
this.add(new JScrollPane(this.table));
}
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
UIManager.put("Table.font", new FontUIResource("Georgia", Font.PLAIN, 18));
JFrame f = new JFrame("A Table with an AbstractTableModel");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new TableTest());
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ A swing table with java properties values in it, sortable }
\begin{lstlisting}
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.table.*;
import javax.swing.plaf.FontUIResource;
import java.awt.*;
public class PropertiesTable extends JPanel {
public PropertiesTable() {
super();
this.setBorder(new TitledBorder("Properties Table"));
String[] header = {"Name", "Value"};
String[] a = new String[0];
String[] names =
System.getProperties().stringPropertyNames().toArray(a);
String[][] data = new String[names.length][2];
for (int ii=0; ii<names.length; ii++) {
data[ii][0] = names[ii];
data[ii][1] = System.getProperty(names[ii]);
}
DefaultTableModel model = new DefaultTableModel(data, header);
JTable table = new JTable(model);
try { // java version 1.6+
table.setAutoCreateRowSorter(true);
} catch (Exception continuewithNoSort) { }
this.add(new JScrollPane(table));
}
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JOptionPane.showMessageDialog(null, new PropertiesTable());
}
});
}
}
\end{lstlisting}
\section{Drawing}
In order to draw using the Graphics2D class, one uses the following
basic procedure. Create a new shape with, for example
\begin{lstlisting}
new Ellipse2D.Double(x, y, rectwidth, rectheight));
\end{lstlisting}
then set the stroke and the fill on the graphics objects, and then draw
the shape, more or less.
All drawing seems to have to take place within the 'paint' method of an awt
component, or within the 'paintComponent' method of a swing component. This
seems to mean that you have to subclass a component in order to draw. See
below for specific examples.
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ creating shapes in the Graphics2D class }} \\
\hline
\texttt{ straight line } & New Line2D.Double(x1, y1, x2, y2) \\
\texttt{ oval } & New Ellipse2D.Double(x, y, rect-width, rect-height) \\
\texttt{ rectangle } & New Rectangle2D.Double(x1, y1, x2, y2); \\
\texttt{ round rectangle } & New RoundRectangle2D.Double(x1, y1, x2, y2, r1, r2)); \\
\texttt{ quadratic curve } & QuadCurve2D q = new QuadCurve2D.Float(); q.setCurve(...) \\
With ovals or ellipses, the x and y parameters represent the top left
hand corner of the bounding rectangle for the ellipse (not its centre).
\subsection{Drawing Text}
\emph{ Draw some rotated text }
\begin{lstlisting}
radians = (vars[i]) * HPI;
g.rotate(radians, x, y);
g.drawString(s, x - w / 2, y + h);
\end{lstlisting}
\subsection{Antialiasing}
Antialiasing is a technique for smoothing curves. Antialiasing makes
everything look much nicer so there is really no reason why you would not use
it, ever.
\emph{ Turn on antialiasing for all drawing operations }
\begin{lstlisting}
g2.setRenderingHint(
\end{lstlisting}
\begin{lstlisting}
RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
\end{lstlisting}
\emph{ Draw shapes with antialiasing and without, to see the difference }
\begin{lstlisting}
import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class AntialiasDraw extends Component {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setStroke(new BasicStroke(20));
g2.draw(new RoundRectangle2D.Double(0, 0, 200, 200, 40, 40));
g2.draw(new Ellipse2D.Double(10, 20, 180, 120));
CubicCurve2D c = new CubicCurve2D.Double();
c.setCurve(80, 80, 100, 100, 120, 60, 150, 80);
g2.draw(c);
g2.setRenderingHint(
RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.draw(new RoundRectangle2D.Double(240, 0, 440, 200, 40, 40));
g2.draw(new Ellipse2D.Double(250, 20, 420, 120));
CubicCurve2D d = new CubicCurve2D.Double();
d.setCurve(320, 80, 340, 100, 360, 60, 390, 80);
g2.draw(d);
}
public AntialiasDraw() {}
public Dimension getPreferredSize() { return new Dimension(800, 300); }
public static void main(String[] args) {
JFrame f = new JFrame("Drawing Shapes");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new AntialiasDraw());
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\subsection{Arcs}
\emph{ Draw a filled arc and get its start point }
\begin{lstlisting}
Graphics2D g2 = (Graphics2D) g;
Arc2D arc = new Arc2D.Float(x, y, n, m, w, z, Arc2D.PIE);
g2.fill(arch);
Point2D p = arch.getStartPoint();
\end{lstlisting}
\subsection{Quadratic Curves}
A parabola is an example of a quadratic curve. In java, these curves have
2 end points and a point of inflexion (where the curve bends).
\emph{ Draw a quadratic curve }
\begin{lstlisting}
QuadCurve2D q = new QuadCurve2D.Float();
q.setCurve(0, 0, 80, 80, 160, 0);
g2.draw(q);
\end{lstlisting}
\begin{lstlisting}
q.setCurve(x1, y1, controlx, controly, x2, y2);
\end{lstlisting}
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ quadratic curve parameters }} \\
\hline
\texttt{ x1 y1 } & The first end point of the curve \\
\texttt{ controlx controly } & The point of inflexion of the curve \\
\texttt{ x2 y2 } & The 2nd end point of the curve \\
\hline
\end{tabular}
\end{center}
\subsection{Cubic Curves}
// c.setCurve(x1, y1, ctrlx1, ctrly1, ctrlx2, ctrly2, x2, y2);
\subsection{General Paths}
General paths allow for the drawing of complex lines curves and shapes
moveTo(float x, float y) Moves the current path point to the given point
lineTo(float x, float y) Adds a line segment to the current path
quadTo(float ctrlx, float ctrly, float x2, floaty2) Adds a quadratic curve segment to the current path
curveTo(float ctrlx1, float ctrly1, float ctrlx2, float ctrly2, float x3, floaty3) Adds a cubic curve segment to the current path
closePath() Closes the current path
\emph{ Draw a polygon using the GeneralPath class }
\begin{lstlisting}
import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class PolyDraw extends Component {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setStroke(new BasicStroke(5));
int x1Points[] = {0, 100, 0, 100};
int y1Points[] = {0, 50, 50, 0};
GeneralPath polygon =
new GeneralPath(GeneralPath.WIND_EVEN_ODD, x1Points.length);
polygon.moveTo(x1Points[0], y1Points[0]);
for (int index = 1; index < x1Points.length; index++) {
polygon.lineTo(x1Points[index], y1Points[index]);
};
polygon.closePath();
g2.draw(polygon);
}
public PolyDraw() { }
public Dimension getPreferredSize() { return new Dimension(250, 250); }
public static void main(String[] args) {
JFrame f = new JFrame("Drawing a Polygon");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new PolyDraw());
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\subsection{Examples}
\emph{ Draw a line }
\begin{lstlisting}
public void paint (Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.draw(new Line2D.Double(x1, y1, x2, y2));
}
\end{lstlisting}
The getPreferredSize() method is necessary because otherwise the java jre
doesnt know how big to make the window, and makes it very small.
\emph{ Draw a line on a component using the Graphics2D class }
\begin{lstlisting}
import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class LineDraw extends Component {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.draw(new Line2D.Double(0, 0, 200, 200));
}
public LineDraw() { }
public Dimension getPreferredSize() { return new Dimension(220, 220); }
public static void main(String[] args) {
JFrame f = new JFrame("Drawing a Line");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new LineDraw());
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Draw a rounded rectangle, an oval and a quadratic curve }
\begin{lstlisting}
import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class LineDraw extends Component {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(
RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.setStroke(new BasicStroke(5));
g2.draw(new RoundRectangle2D.Double(0, 0, 200, 200, 40, 40));
g2.draw(new Ellipse2D.Double(10, 20, 180, 120));
QuadCurve2D q = new QuadCurve2D.Float();
q.setCurve(0, 0, 80, 80, 160, 0);
g2.draw(q);
CubicCurve2D c = new CubicCurve2D.Double();
c.setCurve(80, 80, 100, 100, 120, 60, 150, 80);
g2.draw(c);
}
public LineDraw() { }
public Dimension getPreferredSize() { return new Dimension(250, 250); }
public static void main(String[] args) {
JFrame f = new JFrame("Drawing a Line");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new LineDraw());
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Draw with a thick stroke and colours and gradient colours }
\begin{lstlisting}
import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class Draw extends Component {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
Line2D line = new Line2D.Double(10, 10, 40, 40);
g2.setColor(Color.blue);
g2.setStroke(new BasicStroke(10));
g2.draw(line);
Rectangle2D rect = new Rectangle2D.Double(20, 20, 100, 100);
g2.draw(rect);
g2.setPaint(new GradientPaint(0, 0, Color.blue, 50, 25, Color.green, true));
g2.fill(rect);
}
public Draw() { }
public Dimension getPreferredSize() { return new Dimension(150, 150); }
public static void main(String[] args) {
JFrame f = new JFrame("Drawing a Line");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new Draw());
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\subsection{Strokes}
The stroke of a line or curve refers to its thickness, texture etc. By
defining new strokes it is possible to create dotted lines, textured lines.
The simplest technique is to use the BasicStroke class, and for more
complicated needs, one can implement a stroke class. The stroke is set on
the graphics object and then applies for all drawing operations until the
stroke is changed.
\emph{ Draw with a thick stroke using the BasicStroke class }
\begin{lstlisting}
import java.awt.*;
import java.awt.geom.*;
import javax.swing.JFrame;
public class Draw extends Component {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(
RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
RoundRectangle2D rect =
new RoundRectangle2D.Double(40, 40, 300, 300, 80, 80);
g2.setStroke(new BasicStroke(40));
g2.setColor(Color.darkGray);
g2.draw(rect);
}
public Draw() { }
public Dimension getPreferredSize() { return new Dimension(400, 400); }
public static void main(String[] args) {
JFrame f = new JFrame("Strokes");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new Draw());
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
There doesnt appear to be any antialiasing on the rounded corners of
the above example
\emph{ Draw a rounded rectangle with a dashed line 6 pixels wide }
\begin{lstlisting}
import java.awt.*;
import java.awt.geom.*;
import javax.swing.JFrame;
public class Draw extends Component {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(
RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
RoundRectangle2D rect =
new RoundRectangle2D.Double(40, 40, 300, 300, 80, 80);
float dash1[] = {10.0f};
BasicStroke dashed = new BasicStroke(
6, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash1, 0.0f);
g2.setStroke(dashed);
g2.setColor(Color.darkGray);
g2.draw(rect);
}
public Draw() { }
public Dimension getPreferredSize() { return new Dimension(400, 400); }
public static void main(String[] args) {
JFrame f = new JFrame("Strokes");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new Draw());
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\subsection{Filling Shapes}
Filling refers to painting the interior of a shape with a colour,
a colour gradient or a texture.
The .fill method draws the interior of a shape but not its border
To create a GradientPaint, you specify a beginning position and color and an
ending position and color. The gradient changes proportionally from one color
to the other color along the line connecting the two positions.
The position parameters for the gradient paint appear to be absolute, not
relative to the shape you are trying to paint.
\emph{ Paint a rounded rectangle with gradient paint with no border }
\begin{lstlisting}
import java.awt.*;
import java.awt.geom.*;
import javax.swing.JFrame;
public class Draw extends Component {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
GradientPaint grad = new GradientPaint(20,20,Color.BLUE,180, 180,Color.WHITE);
g2.setPaint(grad);
g2.fill(new RoundRectangle2D.Double(40, 40, 140, 140, 30, 30));
}
public Draw() { }
public Dimension getPreferredSize() { return new Dimension(200, 200); }
public static void main(String[] args) {
JFrame f = new JFrame("Strokes");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new Draw());
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
The example above uses the technique of placing the gradient end points
outside of the shape to make the gradient more subtle. A better way would
be to use colour shades which are closer together
The following is an attempt to produce the bulgeing effect that is common
in interfaces these days, but doesnt quite work.
\emph{ A horizontal bar with a vertical green gradient paint }
\begin{lstlisting}
import java.awt.*;
import java.awt.geom.*;
import javax.swing.JFrame;
public class Draw extends Component {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
Color limeGreen = new Color(Integer.decode("#32cd32"));
Color drabOlive = new Color(Integer.decode("#6b8e23"));
//Color lawnGreen = new Color(Integer.decode("#7CFC00"));
//Color yellowGreen = new Color(Integer.decode("#ADFF2F"));
GradientPaint grad =
new GradientPaint(20, 20, limeGreen, 20, 40, drabOlive);
g2.setPaint(grad);
g2.fill(new Rectangle2D.Double(20, 20, 500, 40));
}
public Draw() { }
public Dimension getPreferredSize() { return new Dimension(550, 100); }
public static void main(String[] args) {
JFrame f = new JFrame("Strokes");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new Draw());
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Draw a dashed rounded rectangle and filled with a gradient paint }
\begin{lstlisting}
import java.awt.*;
import java.awt.geom.*;
import javax.swing.JFrame;
public class Draw extends Component {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
RoundRectangle2D rect =
new RoundRectangle2D.Double(40, 40, 200, 200, 80, 80);
float dash1[] = {10.0f};
BasicStroke dashed = new BasicStroke(
6, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash1, 0.0f);
g2.setStroke(dashed);
g2.draw(rect);
GradientPaint grad = new GradientPaint(0,0,Color.GREEN,200, 0,Color.WHITE);
g2.setPaint(grad);
g2.fill(rect);
}
public Draw() { }
public Dimension getPreferredSize() { return new Dimension(400, 400); }
public static void main(String[] args) {
JFrame f = new JFrame("Strokes");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new Draw());
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\subsection{Shapes}
\emph{ Create a shape (based on some text) and draw it on an image with a stroke }
\begin{lstlisting}
final BufferedImage textImage = new BufferedImage(
width, height, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = textImage.createGraphics();
FontRenderContext frc = g.getFontRenderContext();
Font font = new Font("Arial", Font.BOLD, 250);
GlyphVector gv = font.createGlyphVector(frc, "Cat");
Rectangle2D box = gv.getVisualBounds();
int xOff = 25+(int)-box.getX();
int yOff = 80+(int)-box.getY();
Shape shape = gv.getOutline(xOff,yOff);
g.setColor(Color.WHITE);
//g.setClip(null);
g.setStroke(new BasicStroke(2f));
g.setColor(Color.BLACK);
g.setRenderingHint(
RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g.draw(shape);
g.dispose();
\end{lstlisting}
The code above draws the word cat in a big hollow font (its not really a font)
\subsection{Gradient Paints}
\emph{ A gradient paint from red to orange, top left to bottom right }
\begin{lstlisting}
Graphics2D imageGraphics = image.createGraphics();
GradientPaint gp = new GradientPaint(
20f, 20f, Color.red, 380f, 280f, Color.orange);
imageGraphics.setPaint(gp);
imageGraphics.fillRect(0, 0, 400, 300);
\end{lstlisting}
The above is a reasonably nice effect
\emph{ Another type of gradient paint with several colors\ }
\begin{lstlisting}
Color[] colors = { Color.RED, Color.YELLOW, Color.GREEN };
g2.setPaint(new LinearGradientPaint(start, end, dist, colors));
g2.fillRect(x, y, 100, 10);
\end{lstlisting}
\emph{ Draw a box with a green gradient paint }
\begin{lstlisting}
// This one alternates between deep opaque green and transparent green.
// Note: the 4th arg to Color() constructor specifies color opacity
g.setPaint(new GradientPaint(0, 0, new Color(0, 150, 0),
20, 20, new Color(0, 150, 0, 0), true));
g.setStroke(new BasicStroke(15)); // use wide lines
g.drawRect(25, 25, WIDTH-50, HEIGHT-50); // draw the box
\end{lstlisting}
\emph{ Make a radial paint }
\begin{lstlisting}
RadialPaint
\end{lstlisting}
\emph{ CompoundPaint can use several different types of paint }
\subsection{Texture Paints}
Another technique for filling shapes is to tile an image within the
shape. This uses the TexturePaint class.
The pattern for the tiling of a TexturePaint class is defined by a
BufferedImage class. To create a TexturePaint object, you specify
the image that contains the pattern and a rectangle that is used to
replicate and anchor the pattern. Then you use the setPaint() method
as for gradient paints
\subsection{Advanced Painting}
If none of the available painting classes is suitable, you may
implement the Paint interface, and pass your class to the setPaint
method of the graphics object
\subsection{Drawing Onto Images}
It is possible to draw onto a blank image. The purpose of this is to
allow you to save the drawing.
\emph{ Skeleton code }
\begin{lstlisting}
import java.awt.image.*;
class Painting extends JPanel {
BufferedImage grid; // declare the image
public void paintComponent(Graphics g) {
super.paintComponent(g); // paint background
Graphics2D g2 = (Graphics2D)g; // we need a Graphics2D context
if (grid == null) {
// Compute the grid only one time
int w = this.getWidth();
int h = this.getHeight();
grid = (BufferedImage)(this.createImage(w,h));
Graphics2D gc = grid.createGraphics();
for (int x=0; x<w; x+=10) {
gc.drawLine(x, 0, x, h);
}
for (int y=0; y<h; y+=10) {
gc.drawLine(0, y, w, y);
}
}
// Draw the grid from the precomputed image
g2.drawImage(grid, null, 0, 0);
. . . // d
incomplete
\end{lstlisting}
\emph{ Draw a filled rectangle onto a buffered image and display in JLabel }
\begin{lstlisting}
BufferedImage bi = new BufferedImage(200,200,BufferedImage.TYPE_INT_ARGB);
Graphics2D g = bi.createGraphics();
GradientPaint gp = new GradientPaint(
20f,20f,Color.red, 180f,180f,Color.yellow);
g.setPaint(gp);
g.fillRect(0,0,200,200);
ImageIcon ii = new ImageIcon(bi);
JLabel imageLabel = new JLabel(ii);
\end{lstlisting}
Why does A. Thompson use an argb image here, and not an rgb image?
that is the question.
\subsection{Transforms}
\emph{ A tutorial on transforming shapes with Graphics2D }
\begin{lstlisting}
http://docs.oracle.com/javase/tutorial/2d/advanced/transforming.html
\end{lstlisting}
\emph{ How to use the AffineTransform with Graphics2D }
\begin{lstlisting}
http://docs.oracle.com/javase/7/docs/api/java/awt/geom/AffineTransform.html
\end{lstlisting}
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ some transformation methods for the Graphics2D class }} \\
\hline
\texttt{ rotate() } \\
\texttt{ scale() } \\
\texttt{ translate() } \\
\texttt{ translate(AffineTransform) } \\
\hline
\end{tabular}
\end{center}
\subsection{Awt Drawing}
The old awt drawing methods are extremely limited. Here is an
example
\emph{ Draw a some shapes using the old awt graphics class (limited) }
\begin{lstlisting}
import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class ShapeDraw extends Component {
public void paint(Graphics g) {
g.drawLine(10,10,40,40);
g.drawRect(20, 20, 100, 100);
g.fillRect(120, 120, 200, 200);
}
public ShapeDraw() {}
public Dimension getPreferredSize() { return new Dimension(400, 600); }
public static void main(String[] args) {
JFrame f = new JFrame("Drawing Stuff");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new ShapeDraw());
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\section{Images}
\subsection{Image Information}
\emph{ Read an image from a url and get its height and width }
\begin{lstlisting}
URL url = new URL("http://i.stack.imgur.com/Nqf3H.jpg");
final BufferedImage originalImage = ImageIO.read(url);
int width = originalImage.getWidth();
int height = originalImage.getHeight();
\end{lstlisting}
\emph{ Create a new image icon }
\begin{lstlisting}
ImageIcon i = new ImageIcon(imgURL, "some image");
\end{lstlisting}
\emph{ Get an image size without reading the whole image }
\begin{lstlisting}
ImageInputStream in = ImageIO.createImageInputStream(resourceFile);
try {
final Iterator readers = ImageIO.getImageReaders(in);
if (readers.hasNext()) {
ImageReader reader = (ImageReader) readers.next();
try {
reader.setInput(in);
return new Dimension(reader.getWidth(0), reader.getHeight(0));
}
finally { reader.dispose(); }
}
}
finally {if (in != null) in.close(); }
\end{lstlisting}
\emph{ A small app which allows to load a set of images from a folder }
\begin{lstlisting}
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
import javax.swing.*;
public class ImageApp extends Component implements KeyListener {
BufferedImage img;
File[] imageList;
public void paint(Graphics g) {
//g.drawImage(img, 0, 0, null);
g.drawImage(img, 0, 0, 400, 600, null);
g.setFont(new Font("Georgia", Font.ITALIC, 20));
g.drawString("Hello graphics", 20, 30);
}
public ImageApp() {
try { img = ImageIO.read(new File("villa.jpg"));}
catch (IOException e) { System.out.println("Image File not found"); }
this.addKeyListener(this);
}
public void keyTyped(KeyEvent e)
{
char key = e.getKeyChar();
System.out.println("key typed:" + key);
switch (key)
{
case 'h':
this.setVisible(false);
break;
case 'l':
JFileChooser c = new JFileChooser();
c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int result = c.showOpenDialog(this);
java.io.File folder = c.getSelectedFile();
System.out.println("folder selected:" + folder );
this.imageList = folder.listFiles();
System.out.println("Files:" + java.util.Arrays.toString(this.imageList));
break;
default:
break;
}
}
public void keyPressed(KeyEvent e) {}
public void keyReleased(KeyEvent e) {}
public Dimension getPreferredSize() {
if (img == null) {
return new Dimension(100,100);
} else {
//return new Dimension(img.getWidth(null), img.getHeight(null));
return new Dimension(400, 600);
}
}
public static void main(String[] args) {
JFrame f = new JFrame("Load Image Sample");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ImageApp li = new ImageApp();
f.add(li);
li.requestFocusInWindow();
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\subsection{Loading Images}
\emph{ Load an image }
\begin{lstlisting}
try { img = ImageIO.read(new File("villa.jpg"));}
catch (IOException e) { System.out.println("Image File not found"); }
\end{lstlisting}
\emph{ Load an image: }
\begin{lstlisting}
java.net.URL imgURL = ImageDemo.class.getResource("path/to/image");
if (imgURL != null)
{ return new ImageIcon(imgURL, "a description"); }
else
{
System.err.println("Couldn't find file: " + path);
return null;
}
\end{lstlisting}
\subsection{Displaying Images}
\emph{ Load an image and display it scaled to 400 by 600 }
\begin{lstlisting}
import java.awt.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
import javax.swing.*;
public class DisplayImage extends Component {
BufferedImage img;
public void paint(Graphics g) {
g.drawImage(img, 0, 0, 400, 600, null);
}
public DisplayImage() {
try { img = ImageIO.read(new File("villa.jpg"));}
catch (IOException e) { System.out.println("Image File not found"); }
}
public Dimension getPreferredSize() { return new Dimension(400, 600); }
public static void main(String[] args) {
JFrame f = new JFrame("Load and Display Image Example");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new DisplayImage());
f.pack(); f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
\end{lstlisting}
\emph{ Displaying an image in a tooltip for a JLabel using swing html (A. Thompson) }
\begin{lstlisting}
import javax.swing.*;
import java.awt.GridLayout;
class ThumbTip {
private static final String HTML = "<html><body>";
ThumbTip(String[] album) {
JPanel p = new JPanel(new GridLayout(1,0,2,2));
for (String url : album) {
String s = HTML + "<img src='" + url.toString() + "'";
String size = " width=200 height=150";
JLabel l = new JLabel(s + size + ">");
l.setToolTipText(s + ">");
p.add(l);
}
JOptionPane.showMessageDialog(null, p);
}
public static void main(String[] args) {
final String[] urls = {
"http://pscode.org/media/stromlo1.jpg",
"http://pscode.org/media/stromlo2.jpg"
};
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new ThumbTip(urls);
}
});
}
}
\end{lstlisting}
\subsection{Scaling Images}
\emph{ Scale an image: }
\begin{lstlisting}
Image image = imageIcon.getImage ();
int width = (int) (factor * image.getWidth (null));
int height = (int) (factor * image.getHeight (null));
Image newImage = image.getScaledInstance (width, height, Image.SCALE_SMOOTH);
ImageIcon newImageIcon = new ImageIcon (newImage);
\end{lstlisting}
\emph{ Draw an image scaling to frame size }
\begin{lstlisting}
g.drawImage(BuffImg,0,0,getWidth(),getHeight(),this):
\end{lstlisting}
\emph{ Resize (scale) an image }
\begin{lstlisting}
BufferedImage resizedImage = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, type);
Graphics2D g = resizedImage.createGraphics();
g.drawImage(originalImage, 0, 0, IMG_WIDTH, IMG_HEIGHT, null);
g.dispose();
\end{lstlisting}
This example is incomplete, because you still need to actually write
the new image to file- but that is not difficult
\emph{ Scale all image files in a folder }
\begin{lstlisting}
import java.awt.*;
import java.awt.image.*;
import javax.imageio.ImageIO;
import java.io.File;
/**
* ImageScaler
*
* This class loads all images in a given directory and scales them to the
* given sizes, saving the results as JPEG files in a new "scaled/" subdirectory
* of the original directory.
*/
public class ImageScaler {
// Default w/h values; overriden by command-line -width/-height parameters
static int IMAGE_W = 150;
static int IMAGE_H = 250;
public static void main(String args[]) {
// Default directory is current directory, overridden by -dir parameter
String imagesDir = ".";
for (int i = 0; i < args.length; ++i) {
if (args[i].equals("-dir") && ((i + 1) < args.length)) {
imagesDir = args[++i];
} else if (args[i].equals("-width") && ((i + 1) < args.length)) {
IMAGE_W = Integer.parseInt(args[++i]);
} else if (args[i].equals("-height") && ((i + 1) < args.length)) {
IMAGE_H = Integer.parseInt(args[++i]);
}
}
// new subdirectory for scaled images
String scaledImagesDir = imagesDir + File.separator + "scaled";
// directory that holds original images
File cwd = new File(imagesDir);
// directory for scaled images
File subdir = new File(scaledImagesDir);
subdir.mkdir();
File files[] = cwd.listFiles();
// temporary image for every scaled instance
BufferedImage scaledImg = new BufferedImage(IMAGE_W, IMAGE_H,
BufferedImage.TYPE_INT_RGB);
Graphics2D gScaledImg = scaledImg.createGraphics();
// Note the use of BILNEAR filtering to enable smooth scaling
gScaledImg.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
for (int i = 0; i < files.length; ++i) {
try {
// For every file in the directory, assume it's an image and
// load it
BufferedImage img = ImageIO.read(files[i]);
// If we get here, we must have read the image file successfully.
// Create a new File in the scaled subdirectory
File scaledImgFile = new File(scaledImagesDir + File.separator +
files[i].getName());
// Scale the original image into the temporary image
gScaledImg.drawImage(img, 0, 0, IMAGE_W, IMAGE_H, null);
// Save the scaled version out to the file
ImageIO.write(scaledImg, "jpeg", scaledImgFile);
} catch (Exception e) {
System.out.println("Problem with " + files[i]);
}
}
}
}
\end{lstlisting}
http://weblogs.java.net/blog/chet/archive/2004/07/imageio\_just\_an.html
good stuff about image scaling
\subsection{Translucency}
\emph{ Code for making translucent images, and extending a JLabel }
\begin{lstlisting}
import java.awt.*;
import java.awt.image.*;
import javax.swing.*;
import javax.imageio.ImageIO;
import java.net.URL;
class TransparentIcon {
public static void main(String[] args) throws Exception {
String imgURL =
"http://www.gravatar.com/avatar/" +
"a1ab0af4997654345d7a949877f8037e";
final BufferedImage image = ImageIO.read(new URL(imgURL));
SwingUtilities.invokeLater(new Runnable() {
public void run() {
ImageIcon icon = new ImageIcon(image);
JPanel p = new JPanel(new GridLayout(2,3));
for (int ii=0; ii<6; ii++) {
TransparentLabel tl = new TransparentLabel();
tl.setOpacity((ii+1)/6f);
tl.setIcon(icon);
p.add(tl);
}
JOptionPane.showMessageDialog(null, p);
}
});
}
}
class TransparentLabel extends JLabel {
float opacity = 1f;
public void setOpacity(float opacity) {
this.opacity = opacity;
}
private Icon getTranslucentIcon(Icon icon) {
if (icon!=null) {
BufferedImage bi = new BufferedImage(
icon.getIconWidth(),
icon.getIconHeight(),
BufferedImage.TYPE_INT_ARGB);
Graphics2D g = bi.createGraphics();
AlphaComposite ac = AlphaComposite.getInstance(
AlphaComposite.SRC_OVER,
opacity);
g.setComposite(ac);
icon.paintIcon(this,g,0,0);
g.dispose();
return new ImageIcon(bi);
} else {
return null;
}
}
public void setIcon(Icon icon) {
super.setIcon( getTranslucentIcon(icon) );
}
}
\end{lstlisting}
\subsection{Clipping Images}
Clipping in this context refers to drawing an image within
a particular shape, such as an oval or within the shape of text.
\emph{ Draw an image in the shape of some text using a clip, save image as png file }
\begin{lstlisting}
// get the width and the height from the original image
URL url = new URL("http://i.stack.imgur.com/Nqf3H.jpg");
final BufferedImage originalImage = ImageIO.read(url);
int width = originalImage.getWidth();
int height = originalImage.getHeight();
final BufferedImage textImage = new BufferedImage(
width, height, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = textImage.createGraphics();
FontRenderContext frc = g.getFontRenderContext();
Font font = new Font("Arial", Font.BOLD, 250);
GlyphVector gv = font.createGlyphVector(frc, "Cat");
Rectangle2D box = gv.getVisualBounds();
int xOff = 25+(int)-box.getX();
int yOff = 80+(int)-box.getY();
Shape shape = gv.getOutline(xOff,yOff);
g.setColor(Color.WHITE);
g.setClip(shape);
g.drawImage(originalImage,0,0,null);
g.dispose();
ImageIO.write(textImage,"png",new File("cat-text.png"));
\end{lstlisting}
\subsection{Image Icons}
\emph{ Create a jlabel with icon from a scaled buffered image }
\begin{lstlisting}
BufferedImage img = ...;
JLable l = new JLabel(new ImageIcon(img.getScaledInstance(
img.getWidth(null)/2, img.getHeight(null)/2, Image.SCALE_SMOOTH)));
\end{lstlisting}
\emph{ Convert an ImageIcon to a BufferedImage }
\begin{lstlisting}
ImageIcon imageIcon =
new ImageIcon("http://pscode.org/media/stromlo2.jpg");
JLabel imageLabel = new JLabel(
"A Horse", imageIcon, SwingConstants.CENTER);
JOptionPane.showMessageDialog(null, imageLabel);
Icon icon = imageLabel.getIcon();
BufferedImage bi = new BufferedImage(
icon.getIconWidth(),
icon.getIconHeight(),
BufferedImage.TYPE_INT_RGB);
Graphics g = bi.createGraphics();
// paint the Icon to the BufferedImage.
icon.paintIcon(null, g, 0,0);
\end{lstlisting}
\subsection{Screen Shots}
A screen-shot is an image taken of what happens to be on the
computer screen at a given time.
\emph{ Capture a screen shot. }
\begin{lstlisting}
try
{
Robot robot = new Robot ();
// Capture a particular area on the screen
int x = 100; int y = 100; int width = 200; int height = 200;
Rectangle area = new Rectangle (x, y, width, height);
BufferedImage bufferedImage = robot.createScreenCapture (area);
// Capture the whole screen
area = new Rectangle (Toolkit.getDefaultToolkit ().getScreenSize ());
bufferedImage = robot.createScreenCapture (area);
}
catch (AWTException e) { }
\end{lstlisting}
\emph{ Get a buffered image of a jframe and write it to a png file }
\begin{lstlisting}
Component c = f.getContentPane();
BufferedImage i = getScreenShot(c);
try {
ImageIO.write(img, "png", new File("screenshot.png"));
} catch (Exception e) {
e.printStackTrace();
}
public static BufferedImage getScreenShot(Component component) {
BufferedImage image = new BufferedImage(
component.getWidth(),
component.getHeight(), BufferedImage.TYPE_INT_RGB
);
// call the Component's paint method, using
// the Graphics object of the image.
component.paint(image.getGraphics());
return image;
}
\end{lstlisting}
\subsection{Saving Images}
\emph{ Save a jpeg image with a specified quality (and file compression) }
\begin{lstlisting}
import javax.imageio.IIOImage;
import javax.imageio.ImageIO;
import javax.imageio.ImageWriteParam;
import javax.imageio.ImageWriter;
import javax.imageio.plugins.jpeg.JPEGImageWriteParam;
import javax.imageio.stream.ImageOutputStream;
...
float quality = 0.85f;
File outfile = new File( "MyImage.jpg" );
BufferedImage image = ...;
ImageWriter imgWriter = ImageIO.getImageWritersByFormatName("jpg").next();
ImageOutputStream ioStream = ImageIO.createImageOutputStream( outfile );
imgWriter.setOutput( ioStream );
JPEGImageWriteParam jpegParams = new JPEGImageWriteParam( Locale.getDefault() );
jpegParams.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
jpegParams.setCompressionQuality(quality);
imgWriter.write(null, new IIOImage(image, null, null), jpegParams );
ioStream.flush();
ioStream.close();
imgWriter.dispose();
,,,,
* similar code to save a compressed jpeg image
\begin{lstlisting}
private Image getJpegCompressedImage(BufferedImage image) throws IOException {
float qualityFloat = (float)quality.getValue()/100f;
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
ImageWriter imgWriter = ImageIO.getImageWritersByFormatName( "jpg" ).next();
ImageOutputStream ioStream = ImageIO.createImageOutputStream( outStream );
imgWriter.setOutput( ioStream );
JPEGImageWriteParam jpegParams = new JPEGImageWriteParam( Locale.getDefault() );
jpegParams.setCompressionMode( ImageWriteParam.MODE_EXPLICIT );
jpegParams.setCompressionQuality( qualityFloat );
imgWriter.write( null, new IIOImage( image, null, null ), jpegParams );
ioStream.flush();
ioStream.close();
imgWriter.dispose();
jpgSize = outStream.toByteArray().length;
BufferedImage compressedImage = ImageIO.read(new ByteArrayInputStream(outStream.toByteArray()));
return compressedImage;
}
\end{lstlisting}
\subsection{Converting Image Formats}
\emph{ Convert to a png compressed image without saving }
\begin{lstlisting}
BufferedImage image = ...;
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
ImageIO.write(image, "png", outStream);
pngSize = outStream.toByteArray().length;
BufferedImage compressedImage =
ImageIO.read(new ByteArrayInputStream(outStream.toByteArray()));
\end{lstlisting}
\section{Animation}
\emph{ Animation advice to reduce flicker }
In a JPanel, override paintComponent(Graphics) rather than
paint(Graphics) Instead of calling Thread.sleep(n) implement a Swing
Timer for repeating tasks or a SwingWorker for long running tasks.
See ``Concurrency in Swing'' for more details.
\emph{ An animation to create 'marching ants' rectangle }
\begin{lstlisting}
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
public class AnimatedStroke {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
BasicStroke dashedStroke;
final int width = 100;
final int height = 30;
final BufferedImage image = new BufferedImage(
width,height,BufferedImage.TYPE_INT_ARGB);
final JLabel label = new JLabel(new ImageIcon(image));
int pad = 5;
final Shape rectangle = new Rectangle2D.Double(
(double)pad,(double)pad,
(double)(width-2*pad),
(double)(height-2*pad));
ActionListener listener = new ActionListener() {
float dashPhase = 0f;
float dash[] = {5.0f,5.0f};
@Override
public void actionPerformed(ActionEvent ae) {
dashPhase += 9.0f;
BasicStroke dashedStroke = new BasicStroke(
1.5f,
BasicStroke.CAP_ROUND,
BasicStroke.JOIN_MITER,
1.5f, //miter limit
dash, dashPhase
);
Graphics2D g = image.createGraphics();
g.setColor(Color.WHITE);
g.fillRect(0,0,width,height);
g.setColor(Color.BLACK);
g.setStroke(dashedStroke);
g.draw(rectangle);
g.dispose();
label.repaint();
/*
if (dashPhase<100f) {
try { ImageIO.write(image, "PNG",
new File("img" + dashPhase + ".png"));
} catch(IOException ioe) {}
}*/
}
};
Timer timer = new Timer(40, listener);
timer.start();
JOptionPane.showMessageDialog(null, label);
}
});
}
}
\end{lstlisting}
The following animation doesnt flicker much on my pc.
\emph{ A waveform animation }
\begin{lstlisting}
import java.awt.*;
import javax.swing.*;
public class FlickerPanel extends JPanel implements Runnable {
private float[] pixelMap = new float[0];
// Cached graphics objects to reduce flicker
private Image screenBuffer;
private Graphics bufferGraphics;
public FlickerPanel () {
Thread t = new Thread(this);
t.start();
}
private float addNoise () {
return (float)((Math.random()*2)-1);
}
private synchronized void advance () {
if (pixelMap == null || pixelMap.length == 0) return;
float[] newPixelMap = new float[pixelMap.length];
for (int i=1; i<pixelMap.length; i++) {
newPixelMap[i-1] = pixelMap[i];
}
newPixelMap[newPixelMap.length-1] = addNoise();
pixelMap = newPixelMap;
}
public void run() {
while (true) {
advance();
repaint();
try {
Thread.sleep(25);
} catch (InterruptedException e) {}
}
}
private int getY (float height) {
double proportion = (1-height)/2;
return (int)(getHeight()*proportion);
}
public void paint (Graphics g) {
if (screenBuffer == null || screenBuffer.getWidth(this) != getWidth() || screenBuffer.getHeight(this) != getHeight()) {
screenBuffer = createImage(getWidth(), getHeight());
bufferGraphics = screenBuffer.getGraphics();
}
if (pixelMap == null || getWidth() != pixelMap.length) {
pixelMap = new float[getWidth()];
}
bufferGraphics.setColor(Color.BLACK);
bufferGraphics.fillRect(0, 0, getWidth(), getHeight());
bufferGraphics.setColor(Color.GREEN);
int lastX = 0;
int lastY = getHeight()/2;
for (int x=0; x<pixelMap.length; x++) {
int y = getY(pixelMap[x]);
bufferGraphics.drawLine(lastX, lastY, x, y);
lastX = x;
lastY = y;
}
g.drawImage(screenBuffer, 0, 0, this);
}
public void update (Graphics g) {
paint(g);
}
public static void main (String [] args) {
JFrame frame = new JFrame("Flicker test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(new FlickerPanel());
frame.setSize(500,300);
frame.setVisible(true);
}
}
\end{lstlisting}
\section{Charts}
one option is to use JFreeChart
\emph{ A simple example with jfreechart }
\begin{lstlisting}
HistogramDataset dataset = new HistogramDataset();
dataset.addSeries("series label",arrayOfValues,noOfBins);
//Create a chart object
JFreeChart chart = ChartFactory.
createHistogram( "plotTitle", "xaxis label", "yaxis label",
dataset, PlotOrientation.VERTICAL, false, false, false);
//If swing application use ChartPanel to render chart
ChartPanel chartPanel = new ChartPanel(chart)
chartPanel.setPreferredSize(new java.awt.Dimension JavaDoc(500, 270));
chartPanel.setMouseZoomable(true, false);
If need to write chart to a file/stream use ChartUtilities.saveChartAsPNG(...)
ChartUtilities.saveChartAsPNG(new File("histogram.PNG"), chart, width, height);
\end{lstlisting}
\section{Javamail}
Sending and receiving email can be done with the Javamail package
\subsection{Installing Javamail}
\subsection{Sending Email}
\emph{ Send email using a tls connection }
\begin{lstlisting}
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class SendMailTLS {
public static void main(String[] args) {
final String username = "[email protected]";
final String password = "password";
Properties props = new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.port", "587");
Session session = Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
try {
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("[email protected]"));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse("[email protected]"));
message.setSubject("Testing Subject");
message.setText("Dear Mail Crawler,"
+ "\n\n No spam to my email, please!");
Transport.send(message);
System.out.println("Done");
} catch (MessagingException e) {
throw new RuntimeException(e);
}
}
}
,,,,
* send an email via smtp and an ssl connection
\begin{lstlisting}
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class SendMailSSL {
public static void main(String[] args) {
Properties props = new Properties();
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
Session session = Session.getDefaultInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("username","password");
}
});
try {
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("[email protected]"));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse("[email protected]"));
message.setSubject("Testing Subject");
message.setText("Dear Mail Crawler," +
"\n\n No spam to my email, please!");
Transport.send(message);
System.out.println("Done");
} catch (MessagingException e) {
throw new RuntimeException(e);
}
}
}
\end{lstlisting}
\section{Html}
Java can parse html in using a number of packages
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ html tools }} \\
\hline
\texttt{ JSoup } & Easy to use \\
\texttt{ HtmlEditorKit } & A bit more tricky \\
\emph{ Parse html }
\begin{lstlisting}
JSoup (jsoup.org)
\end{lstlisting}
\emph{ Convert html to text }
\begin{lstlisting}
public static String html2text(String html) {
return Jsoup.parse(html).text();
} }
\end{lstlisting}
\section{Html Java Source Code Syntax Highlighting}
\emph{ Convert 'Test.java' to syntax highlighted HTML }
\begin{lstlisting}
webcpp Test.java Test.java.html -s
\end{lstlisting}
\emph{ Convert 'Test.java' to LaTeX and other formats }
\begin{lstlisting}
highlight -i Test.java -o Test.java.html -L
\end{lstlisting}
\begin{lstlisting}
source-highlight .... ~(the gnu source highlighter)
\end{lstlisting}
\section{Development Tools For Java}
\subsection{On Microsoft Windows}
I am assuming that the windows computer is borrowed and that you dont
really want to spend all your time developing in that environment.
My preferences:
install Vim, and GVim from www.vim.org - this is an somewhat annoying but
useful text editor.
install 'putty' and 'pscp' or 'pftp' so that you can upload your java files to
some server. If you like, just put the .exe files for these programs in
the directory where you are developing, otherwise add the location of the .exe
files to the microsoft 'path' environment variable.
Set up some useful mappings in the \_vimrc file. See the section 'Vim and Java'
for a long list of useful mappings.
Put your \_vimrc file somewhere like c:\textbackslash program files\textbackslash Vim
\section{Vim And Java}
Its possible, though possibly not advisable to use the vim
text editor as a java editor. By using mappings and commands we
can simplify the process of compiling and running java programs.
When using Microsoft windows the format of some of these commands are
slightly different owing to the use of the \textbackslash backslash in Windows file names
and the different command line syntax used by the Windows console
(for example \& and \&\& used to separated multiple commands on one line)
For a great deal of detailed information and recipes about how to use Vim
see bumble.sf.net/books/vim/vim-book.txt
\emph{ Save the current file to a sourceforge server }
\begin{lstlisting}
:!scp % user,[email protected]:folder/subfolder/ (## unix)
\end{lstlisting}
\begin{lstlisting}
:!pscp % user,[email protected]:folder/subfolder/ (## windows)
\end{lstlisting}
For the ms windows command, this requires that the pscp program has
been installed, available from the 'putty' website.
\emph{ Make a command 'Sav' (placed in vimrc) to save the current file to sourceforge }
\begin{lstlisting}
com Sav !scp % user,[email protected]:folder/subfolder/
\end{lstlisting}
\begin{lstlisting}
com Sav !pscp % user,[email protected]:folder/subfolder/ (## windows)
\end{lstlisting}
The user can upload the current file to the sourceforge server by typing ':Sav'
\emph{ Map the key sequence ';jr' to compile and run the current file with java }
\begin{lstlisting}
map ;jr :!javac % && java %:r<cr>
\end{lstlisting}
When the user types ';jr' in normal mode (not insert mode) the current file
will be compiled and run. If the compilation with javac fails, then the
mapping aborts
\emph{ Make an abbreviation to insert the main method in the file }
\begin{lstlisting}
ab public static void main(String[] args) {
\end{lstlisting}
\emph{ Java abbreviations }
\begin{lstlisting}
ab public static void main(String[] args) { public static void main(String[] args) {
\end{lstlisting}
ab public class Test $\{$
public static void main(String[] args) $\{$$\}$
$\}$ public class Test $\{$$<$cr$>$ public static void main(String[] args) $\{$$\}$$<$cr$>$ $\}$
,,,
\emph{ Make a mapping of ',jt' which inserts a simple skeleton program }
\begin{lstlisting}
map ,jt 0i public class Test {<cr> public static void main(String[] args) {}<cr>}
\end{lstlisting}
\emph{ Save a fragment (between '*' and ',,,') to a file }
\begin{lstlisting}
:?\*?+1,/,,,/-1w Test.java
\end{lstlisting}
\emph{ Save a fragment to a file even if it exists }
\begin{lstlisting}
:?\*?+1,/,,,/-1w! Test.java
\end{lstlisting}
\emph{ Save a fragment to a file and compile }
\begin{lstlisting}
:?^ *---?+1,/,,,/-1w! Test.java | !javac Test.java
\end{lstlisting}
\emph{ Compile and run a java program (between '---' and ',,,') }
\begin{lstlisting}
:?^ *---?+1,/,,,/-1w! Test.java | !javac Test.java; java Test
\end{lstlisting}
Note that the java program between the markers must be complete with a main method
\emph{ The same as above but also works on a Microsoft Windows computer }
\begin{lstlisting}
:?^ *---?+1,/,,,/-1w! Test.java | !javac Test.java && java Test
\end{lstlisting}
\emph{ Map ',jf' to compile and run a java program in the document on a unix system }
\begin{lstlisting}
:map ,jf :?^ *---?+1,/,,,/-1w! Test.java \| !javac Test.java; java Test<cr>
\end{lstlisting}
\emph{ And on Microsoft windows compile and run a java program }
\begin{lstlisting}
:map ,jf :?^ *---?+1,/,,,/-1w! Test.java \| !javac Test.java && java Test<cr>
\end{lstlisting}
Actually the Windows mapping will also work on Unix systems, since \&\& has the
same meaning in Unix (only execute the second command if the first was successful)
For example, if the document contains the following text containing
a simple java program.
\emph{ The simplest java program }
---
public class Test $\{$
public static void main(String[] args) $\{$
System.out.println(``hi'');
$\}$
$\}$
,,,
Then typing ',jf' in 'normal' or 'command' mode will extract
and compile and then run the java program contained within the
lines containing '---' and ',,,' The only problem is that
the code must use the class 'Test'
\emph{ Save and compile a java multiline fragment, inserting a class }
\begin{lstlisting}
:?^ *---?+1,/,,,/-1w ! (echo -e 'public class Test {\n public static void main(String[] args) {'; sed 's/a/a/'; echo -e ' }\n}') > Test.java; javac Test.java; java Test.java
\end{lstlisting}
\emph{ Create a mapping which compiles and runs a java fragment }
\begin{lstlisting}
map ,jfr :?^ *---?+1,/,,,/-1w ! (echo -e 'public class Test {\n public static void main(String[] args) {'; sed 's/a/a/'; echo -e ' }\n}') > Test.java; javac Test.java; java Test.java
\end{lstlisting}
The above will compile and run a fragment of java code in the
current document which is contained between '---' and ',,,,'
\subsection{Extracting The Java Class Name With Vim}
These recipes below are working towards a function which will extract
the java class name from a program within a text document.
\emph{ Put the text of the current line into a variable }
\begin{lstlisting}
:let t = getline('.') | echo t
\end{lstlisting}
\emph{ Set a vim variable to the text of the line just above the next empty one }
\begin{lstlisting}
:let line = search("^$") - 1
\end{lstlisting}
\begin{lstlisting}
:let text = getline(line)
\end{lstlisting}
\emph{ Set a vim variable to the text of the next line containing the word elephant }
\begin{lstlisting}
:let line = search("elephant")
\end{lstlisting}
\begin{lstlisting}
:let text = getline(line)
\end{lstlisting}
\emph{ Set the variable 't' to the next line containing the word 'public' }
\begin{lstlisting}
:let l = search("public") | let t = getline(l) | echo t
\end{lstlisting}
\emph{ Split the words of the current line into an array and display the second word }
\begin{lstlisting}
:let text = getline('.') | let words = split(text) | echo words[1]
\end{lstlisting}
Using a one character variable name for the array doesnt seem to work.
\emph{ Use a variable as part of a shell command. }
\begin{lstlisting}
:let n = '..' | exe "!dir " . n
\end{lstlisting}
In order to use the value of the variable in the shell command we need to
use the exe command which evaluates the concatenated string as a vim command
\emph{ Split the current line on each '(' character }
\begin{lstlisting}
:let t = getline(".") | let res = split(t, '(') | echo res[0]
\end{lstlisting}
\emph{ Go back to the first line above which contains split }
\begin{lstlisting}
:exe "?split?"
\end{lstlisting}
\emph{ Find the next java class name definition }
\begin{lstlisting}
exe "/^ *public class /" | let words = split(getline('.')) | echo words[2]
\end{lstlisting}
\emph{ Just a fragment to test the mapping below }
\begin{lstlisting}
public class Person {
private String first;
private String last;
public Person(String f, String l)
{ this.first = f; this.last = l; }
public void print()
{ System.out.println(this.first + " " + this.last); }
public static void main(String[] args) {
Person t = new Person("Bill", "King");
t.print();
}
}
\end{lstlisting}
\emph{ A mapping to extract the class name from a java program in a document }
\begin{lstlisting}
:map ;jj ?^ *---?<cr> \| :let l = search("^ *public class ") \| echo split(getline(l))[2] <cr>
\end{lstlisting}
The beginning of the java program in the document is marked by a line
which starts with '---'
\emph{ A mapping to extract the class name from a java program in a document }
\begin{lstlisting}
:map ;jj ?^ *---?<cr> \| :let l = search("^ *public class ") \| echo split(getline(l))[2] \| :?^ *---?+1,/,,,/-1w! Frag.java <cr>
\end{lstlisting}
\emph{ Extract the class name from a fragment and write to a file with that name }
\begin{lstlisting}
:map ,jr ?^ *---?<cr> \| :let l = search("^ *public class ") \| let class = split(getline(l))[2] \| exe ":?^ *---?+1,/,,,/-1w! " . class . ".java" <cr>
\end{lstlisting}
\emph{ Save, compile and run a fragment using the java class name }
\begin{lstlisting}
:map ,jr ?^ *---?<cr> \| :let l = search("^ *public class ") \| let class = split(getline(l))[2] \| exe ":?^ *---?+1,/,,,/-1w! " . class . ".java" \| exe "!javac " . class . ".java && java " . class <cr>
\end{lstlisting}
The mapping above is the culmination of the entire preceding section. It uses
several tricky aspects of Vims scripting language and variables. First is searches
backwards for the start of the java code (---), then it finds the line with
the java class name definition, then it assigned the class name to a variable
by calling 2 functions to create an list of words and getting the 3rd word.
Then it uses the ``exe'' function which is like an ``eval'' function in other
languages to construct a shell command using the value of the variable which
contains the Java class name. Finally it compiles and runs the java class
\begin{lstlisting}
:map ,jf :?^ *---?+1,/,,,/-1w! Test.java \| !javac Test.java && java Test<cr>
\end{lstlisting}
\subsection{Viewing Methods With Vim}
\emph{ A dubious but useful way to show public method declarations }
\begin{lstlisting}
:g/^ *public.*) *{*$/
\end{lstlisting}
\emph{ A command to show most public methods in a java file }
\begin{lstlisting}
:command! Me g/^ *public.*) *{*$/
\end{lstlisting}
\subsection{Indenting Within Vim}
\emph{ A mapping to indent a java fragment within a document using astyle }
\begin{lstlisting}
map ,ji :?^ *---?+1,/^ *,,,/-1! astyle -s2<cr>
\end{lstlisting}
\emph{ A mapping to indent a java fragment and indent the result 2 spaces }
\begin{lstlisting}
map ,ji :?^ *---?+1,/^ *,,,/-1! astyle -s2 <bar> sed 's/^/ /'<cr>
\end{lstlisting}
\emph{ Indent the whole java file }
\begin{lstlisting}
:%! astyle -s2 ~(2 space indent with open brace on the same line)
\end{lstlisting}
\begin{lstlisting}
:%! astyle -bs2 ~(the same but with open brace on the next line)
\end{lstlisting}
\emph{ Map ',jii' to indent the whole java file with a 2 space indent }
\begin{lstlisting}
:map ,jii %! astyle -s2<cr>
\end{lstlisting}
2 space indent with open brace on the same line
\subsection{Gvim}
If you are developing in java using vim on a microsoft computer, you
will almost certainly want to use gvim, since the fonts are much nicer.
In gvim select the font which you like, and then type
\begin{lstlisting}
:set guifont
\end{lstlisting}
If you have select 'courier new' size 20, you will see something like
\begin{lstlisting}
guifont=Courier_New:h20:cANSI
\end{lstlisting}
Now open the \_vimrc file (windows) or .vimrc file (unix) and put the
following line in the vimrc file
\begin{lstlisting}
set guifont=Courier_New:h20:cANSI
\end{lstlisting}
This will ensure that everytime that gvim starts it will use the specified
font. To do the same for the colorscheme, place the following in the vimrc file
\begin{lstlisting}
colorscheme elflord
\end{lstlisting}
where you replace 'elflord' with whatever colorscheme you like.
\section{Bash And Java}
The power and flexibility of the bash shell may help us
in the somewhat clumsy process of developing java applications.
\emph{ A bash function to show the methods and constructors of java class }
\begin{lstlisting}
function jcl
{
cat << xxx > JJJ.java
import java.lang.reflect.*;
public class JJJ {
public static void main(String args[]) throws Exception {
Class c = Class.forName("java.lang.$1");
Constructor cc[] = c.getDeclaredConstructors();
Method m[] = c.getMethods();
for (int i = 0; i < cc.length; i++) System.out.println(cc[i]);
for (int i = 0; i < m.length; i++) System.out.println(m[i]);
}
}
xxx
javac JJJ.java; java JJJ
}
\end{lstlisting}
\section{Indenting}
\emph{ Astyle }
\emph{ View a java file nicely indented with 2 spaces }
\begin{lstlisting}
cat test.java | astyle -s2 | less
\end{lstlisting}
The indent program was written for the c language but may be
used with java. astyle may be better.
\section{Java People}
\emph{ Bill Joy }
One time head of sun, programmer.
\emph{ Fred swartz: }
made some good notes, at leepoint.net
\subsection{Knowledgable Programmers}
\emph{ Vineet Reynolds @ stackoverflow - knows about stuff in java }
\emph{ Andrew Thompson @ stackoverflow - }
a contributor to the stack overflow site. Writes very complete code
examples on a range of java topics
\emph{ X4u @ stackoverflow - knows about images }
\section{Glossary}
Tooltip -
A little (usually yellow) that pops up when you move your mouse over
an element in a Java Gui Application. The box is supposed to contain
explanatory or helpful text relation to how to use the element highlighted.
Data hiding:
Garbage collection
Memory Management:
Decoupling
Patterns:
\section{Testing}
\emph{ Initialization }
\begin{lstlisting}
public class Test {
public int x;
public double d;
public static void main(String[] args) {
Test t = new Test();
System.out.println("x=" + t.d);
}
}
\end{lstlisting}
\emph{ Infinite recursion }
\begin{lstlisting}
public class Test {
public static void while()
{ Test.while(); }
public static void main(String[] args) {
Test.while();
System.out.println("=");
}
}
\end{lstlisting}
\emph{ Testing char casts }
\begin{lstlisting}
public class Test {
public static void main(String[] args) {
char c = 'e';
int i = (int)'A';
if ((c >= 'a') && (c <= 'z'))
{
System.out.println("c=" + (int)c);
System.out.println("i=" + i);
}
}
}
\end{lstlisting}
\emph{ Parseint }
\begin{lstlisting}
public class Test {
public static void main(String[] args) {
String s = "-123";
int i = Integer.parseInt(s);
System.out.println("i=" + i);
}
}
\end{lstlisting}
\emph{ Testing char casts }
\begin{lstlisting}
public class Test {
public static void main(String[] args) {
char c = 'e';
int i = (int)'A';
if ((c >= 'a') && (c <= 'z'))
{
System.out.println("c=" + (int)c);
System.out.println("i=" + i);
}
}
}
\end{lstlisting}
\emph{ Testing char casts }
\begin{lstlisting}
public class Test {
public static void main(String[] args) {
char c = 'a' + 4;
System.out.println("c=" + c);
}
}
\end{lstlisting}
\section{Notes}
This section contains notes which havent been placed in
their appropriate chapter or section yet.
\emph{ Load an application resource from a jar (not a user resource) }
\begin{lstlisting}
URL iconUrl = this.getClass().getResource("/icons/copy.jpg");
\end{lstlisting}
The code above has the disadvantage of downloading the images from
the internet each time they are used.
\emph{ Display a (buffered) image in a message box }
\begin{lstlisting}
JOptionPane.showMessageDialog(parent, new JLabel(new ImageIcon(theImage)));
\end{lstlisting}
\emph{ A logger which publishes to the console }
\begin{lstlisting}
import java.util.logging.*;
class LoggingLevels {
public static void main(String[] args) {
Logger logger = Logger.getAnonymousLogger();
// LOG this level to the log
logger.setLevel(Level.FINER);
ConsoleHandler handler = new ConsoleHandler();
// PUBLISH this level
handler.setLevel(Level.FINER);
logger.addHandler(handler);
System.out.println("Logging level is: " + logger.getLevel());
for (int ii=0; ii<3; ii++) {
logger.log(Level.FINE, ii + " " + (ii*ii));
logger.log(Level.INFO, ii + " " + (ii*ii));
}
}
}
\end{lstlisting}
\emph{ Produces output like }
Logging level is: FINER
Jun 11, 2011 9:39:23 PM LoggingLevels main
INFO: 0 0
Jun 11, 2011 9:39:24 PM LoggingLevels main
INFO: 1 1
Jun 11, 2011 9:39:24 PM LoggingLevels main
INFO: 2 4
,,,
\emph{ To investigate, writing log files with the logging package }
\begin{lstlisting}
import java.util.logging.*;
private Logger logger = Logger.getAnonymousLogger();
logger.log(Level.FINER, "Get column styles");
\end{lstlisting}
\emph{ Update look and feel after gui has been displayed }
\begin{lstlisting}
try {
UIManager.setLookAndFeel(plafInfos[index].getClassName() );
SwingUtilities.updateComponentTreeUI(frame);
// not necessary to pack but good
frame.pack();
frame.setMinimumSize(frame.getSize());
} catch(Exception e) {
e.printStackTrace();
}
\end{lstlisting}
\emph{ Get a screen shot of a jframe component (using BufferedImage) }
\begin{lstlisting}
http://stackoverflow.com/questions/5853879/java-swing-obtain-image-of-jframe/5853992#5853992
\end{lstlisting}
\emph{ Set a window location depending on os }
\begin{lstlisting}
jframe.setLocationByPlatform(true);
\end{lstlisting}
\section{Modern Loops}
String s = ``red yellow blue'';
String[] splitString = (s.split(``\\textbackslash s+''));
for (String ss: splitString) $\{$ System.out.println(ss); $\}$
\section{Todo}
http://www.daniweb.com/software-development/java/threads/94567/writing-string-to-a-file
a nice visual effect of highlighted words with shadows
StringBuilder since Java 1.5 not synchronized, more efficient, not to be used in threads
StringBuffer can be used in threads
Have the same methods
Use StringBuilder unless you really are trying to share a buffer between threads
\emph{ Insert integers at the beginning of a StringBuilder, this is very inefficient\ }
\begin{lstlisting}
StringBuilder sb = new StringBuilder();
for(int i=0;i<100;i++){
sb.insert(0, Integer.toString(i));
}
\end{lstlisting}
\emph{ Use the built in javascript engine in java 1.6 to evaluate a sum }
\begin{lstlisting}
import javax.script.ScriptEngineManager;
import javax.script.ScriptEngine;
public class Test {
public static void main(String[] args) throws Exception{
ScriptEngineManager mgr = new ScriptEngineManager();
ScriptEngine engine = mgr.getEngineByName("JavaScript");
String foo = "40+2";
System.out.println(engine.eval(foo));
}
}
\end{lstlisting}
\emph{ Use javap to generate bytecode or java assembly }
\begin{lstlisting}
3: dup
4: ldc #3; //String bu
6: invokespecial #4; //Method StringBuilder."<init>":(String;)V
9: astore_1
10: ldc #5; //String b
12: astore_2
13: ldc #6; //String u
\end{lstlisting}
By using javap it may be possible to see how the java compiler generates
bytecode.
\section{Reading And Writing Text Files}
FileReader and FileWriter can only use the default system encoding
\emph{ Read a file which is encoded in utf8 }
\begin{lstlisting}
FileInputStream fis = new FileInputStream("test.txt");
InputStreamReader in = new InputStreamReader(fis, "UTF-8");
\end{lstlisting}
\emph{ Write a text file encoded as utf8 }
\begin{lstlisting}
FileOutputStream fos = new FileOutputStream("test.txt");
OutputStreamWriter out = new OutputStreamWriter(fos, "UTF-8");
\end{lstlisting}
If the encoding is not specified then the default system encoding is used
\emph{ Read utf8 text data from a file }
\begin{lstlisting}
import java.io.*;
public class test {
public static void main(String[] args){
try {
File file = new File("c:\\temp\\test.txt");
BufferedReader in = new BufferedReader(
new InputStreamReader(new FileInputStream(file), "UTF8"));
String str;
while ((str = in.readLine()) != null) {
System.out.println(str);
}
in.close();
}
catch (UnsupportedEncodingException e)
{ System.out.println(e.getMessage()); }
catch (IOException e)
{ System.out.println(e.getMessage());}
catch (Exception e)
{ System.out.println(e.getMessage());}
}
}
\end{lstlisting}
\section{Regular Expressions}
Peter Boughton on Stackoverflow- knowledgable chap about regexes
\emph{ Replace all text between tree and leaf with ``new'' (this is non ``greedy''?) }
\begin{lstlisting}
String ResultString = subjectString.replaceAll("(tree).*?(leaf)", "$1new$2");
\end{lstlisting}
The \$1 and \$2 are back references. The .*? is non greedy matching
\emph{ Double all sequences of "a"s using a compiled regular expression }
\begin{lstlisting}
Pattern p = Pattern.compile("(a+)");
String ret = p.matcher(input).replaceAll("$1 $1");
\end{lstlisting}
Compiling the regular expression or pattern is supposed to be more efficient.
\emph{ Match any sequence of characters which are not word chars or \# or \$ }
\begin{lstlisting}
Pattern p = Pattern.compile("^[\\w#$]+$");
\end{lstlisting}
\emph{ Use a matcher to print each occurence of the 2nd subgroup found }
\begin{lstlisting}
String input = " ;1=2011-10-23T16:16:53+0530; 2=2011-10-23T16:17:53+0530;3=2011-10-23T16:18:53+0530;4=2011-10-23T16:19:53+0530;";
Pattern p = Pattern.compile("(;\\d+?)?=(.+?);");
Matcher m = p.matcher(input);
while(m.find()){
System.out.println(m.group(2));
}
\end{lstlisting}
\emph{ Match a string starting with a digit or a non-word char or a whitespace char }
\begin{lstlisting}
Pattern p = Pattern.compile("^\\d|^\\W|^\\s");
Matcher m = p.matcher("stack overflow"); // no matches with this input
\end{lstlisting}
\emph{ Parse a string into a date using a SimpleDateFormat }
\begin{lstlisting}
SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
try {
final Date date = parser.parse(dateString);
System.out.println(integer + " -> " + date);
} catch (final ParseException pe) {
System.err.println("bad date: " + dateString + ": " + pe);
}
\end{lstlisting}
\section{Writing Text}
\emph{ Write utf8 text data to a file }
\begin{lstlisting}
import java.io.*;
public class test {
public static void main(String[] args){
try {
File file = new File("c:\\temp\\test.txt");
Writer out = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(file), "UTF8"));
out.append("Website UTF-8").append("\r\n");
out.append("??????? UTF-8").append("\r\n");
out.flush();
out.close();
}
catch (UnsupportedEncodingException e)
{ System.out.println(e.getMessage()); }
catch (IOException e)
{ System.out.println(e.getMessage());}
catch (Exception e)
{ System.out.println(e.getMessage());}
}
}
\end{lstlisting}
The BufferedWriter class has a .newLine() method, but it uses the default
newline character(s) for the system.
\section{Exec}
\emph{ Run a system command with environment variable }
ProcessBuilder pb = new ProcessBuilder(``myCommand'', ``myArg1'', ``myArg2'');
Map$<$String, String$>$ env = pb.environment();
env.put(``VAR1'', ``myValue'');
env.remove(``OTHERVAR'');
env.put(``VAR2'', env.get(``VAR1'') + ``suffix'');
pb.directory(``myDir'');
Process p = pb.start();
,,,
\emph{ Run a system command and read the output }
import java.io.*;
public class JavaRunCommand $\{$
public static void main(String args[]) $\{$
String s = null;
try $\{$
Process p = Runtime.getRuntime().exec(``ps -ef'');
BufferedReader stdInput = new BufferedReader(new
InputStreamReader(p.getInputStream()));
BufferedReader stdError = new BufferedReader(new
InputStreamReader(p.getErrorStream()));
// read the output from the command
System.out.println("Here is the standard output of the command:\textbackslash n");
while ((s = stdInput.readLine()) != null) $\{$
System.out.println(s);
$\}$
// read any errors from the attempted command
System.out.println("Here is the standard error of the command (if any):\textbackslash n");
while ((s = stdError.readLine()) != null) $\{$
System.out.println(s);
$\}$
System.exit(0);
$\}$
catch (IOException e) $\{$
System.out.println("exception happened - here's what I know: ");
e.printStackTrace();
System.exit(-1);
$\}$
$\}$
$\}$
,,,
\emph{ Create a temporary file and delete it when the program exits }
File file = File.createTempFile(``realhowto'',``.vbs'');
file.deleteOnExit();
,,,
\section{File System Types}
\emph{ List file system labels or names }
import java.io.File;
import java.util.Arrays;
import java.util.List;
import javax.swing.filechooser.FileSystemView;
public class Test2 $\{$
public static void main(String args[])$\{$
List $<$File$>$files = Arrays.asList(File.listRoots());
for (File f : files) $\{$
String s = FileSystemView.getFileSystemView().getSystemDisplayName(f);
System.out.println("*" + s);
$\}$
/* output (French WinXP)
*
\emph{ REGA1 (C:) }
*
\emph{ My Book (F:) }
\emph{ / }
$\}$
$\}$
,,,
\emph{ Print the types of storage devices currently mounted as filesystems }
import java.io.File;
import java.util.Arrays;
import java.util.List;
import javax.swing.filechooser.FileSystemView;
public class Test $\{$
public static void main(String args[]) $\{$
List $<$File$>$files = Arrays.asList(File.listRoots());
for (File f : files) $\{$
String s = FileSystemView.getFileSystemView().getSystemTypeDescription(f);
System.out.println("*" + s);
$\}$
/* sample output (French WinXP)
\emph{ Disquette 3 1/2 pouces }
\emph{ Disque local }
\emph{ Lecteur CD }
\emph{ Disque local }
\emph{ / }
$\}$
$\}$
,,,
the above is from rgagnon.com
\emph{ Using printf style format strings, for those who live in the 80s }
\begin{lstlisting}
String.format("http://%s/manager/list", _host + ":8080"));
\end{lstlisting}
\section{Http Basic Authentication}
\emph{ A possible alternative for authenticating with ``basic'' auth on a url }
\begin{lstlisting}
Authenticator.setDefault (new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication ("username", "password".toCharArray());
}
});
\end{lstlisting}
\emph{ From a Java program, a FileNotFoundException is thrown when you try to read from an InputStream associated with the basic authenticated URL. }
\emph{ Upload a file to a server. The server has to know how to receive it }
public static void main(String[] args) throws IOException $\{$
File textFile = new File(``D:\\textbackslash file.zip'');
String boundary = Long.toHexString(System.currentTimeMillis());
// Just generate some unique value for the boundary.
HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:8080/upslet/upload").openConnection();
connection.setDoOutput(true);
connection.setRequestProperty(``Content-Type'', ``multipart/form-data; boundary='' + boundary);
OutputStream output = connection.getOutputStream();
PrintWriter writer = new PrintWriter(output, true);
// Send text file.
writer.println(``--'' + boundary);
writer.println("Content-Disposition: form-data; name=\textbackslash ``file1\textbackslash ''; filename=\textbackslash "`` + textFile.getName() + ''\textbackslash "");
writer.println("Content-Type: application/octet-stream");
FileInputStream fin = new FileInputStream(textFile);
writer.println();
IOUtils.copy(fin, output);
writer.println();
// End of multipart/form-data.
writer.println(``--'' + boundary + ``--'');
output.flush();
closeQuietly(fin, writer, output);
// Above request will never be sent if .getInputStream() or .getResponseCode() or .getResponseMessage() does not get called.
connection.getResponseCode();
$\}$
,,,
\emph{ Apache httpclient provides more advanced authentication }
The method below is said to work with java 1.1. see the method above
for a more modern technique (use an authenticator)
\emph{ Access a url which is protected by ``basic'' authentication, untested... }
\begin{lstlisting}
URL url = new URL(¿location address¿);
URLConnection uc = url.openConnection();
String authorizationString = ¿Basic ¿ + Base64.encode("username:password");
uc.setRequestProperty ("Authorization", authorizationString);
InputStream in = url.openStream();
\end{lstlisting}
but the Base64 encoding above is not part of standard java, try
\begin{lstlisting}
byte[] data = . . .;
String encoded = javax.xml.bind.DataTypeConverter.printBase64Binary(data);
byte[] decoded = javax.xml.bind.DatatypeConverter.parseBase64Binary(encoded);
\end{lstlisting}
\emph{ Read text from a url }
\begin{lstlisting}
try {
URL url = new URL("http://hostname:80/index.html");
BufferedReader in =
new BufferedReader(new InputStreamReader(url.openStream()));
String str;
while ((str = in.readLine()) != null) {
// str is one line of text;
// readLine() strips the newline character(s)
}
in.close();
} catch (MalformedURLException e) {
} catch (IOException e) { }
\end{lstlisting}
\emph{ Another almost identical way to read text from a webpage }
URLConnection urlConnection = url.openConnection();
InputStream is = urlConnection.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
int numCharsRead;
char[] charArray = new char[1024];
StringBuffer sb = new StringBuffer();
while ((numCharsRead = isr.read(charArray)) $>$ 0) $\{$
sb.append(charArray, 0, numCharsRead);
$\}$
String result = sb.toString();
,,,
I wonder if this is more efficient than readline///
\emph{ Post data using a url and read the reply from the webserver }
try $\{$
String data =
URLEncoder.encode(``key1'', ``UTF-8'') + "=" +
URLEncoder.encode(``value1'', ``UTF-8'') + ``\&'' +
URLEncoder.encode(``key2'', ``UTF-8'') + "=" +
URLEncoder.encode(``value2'', ``UTF-8'');
URL url = new URL(``http://hostname:80/cgi'');
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
// Get the response
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = rd.readLine()) != null) $\{$
// Process line...
$\}$
wr.close();
rd.close();
$\}$ catch (Exception e) $\{$$\}$
,,,
\section{Jtextpane}
\emph{ Get the default font for a text pane }
\begin{lstlisting}
System.out.println(UIManager.get("TextPane.font"));
\end{lstlisting}
\emph{ Get the pixel position of the cursor (caret) in jtextpane }
Rectangle caretCoords = textpane.modelToView(caretposition);
y = (int) caretCoords.getY();
,,,
\emph{ Loop through a textpanes different styles }
JTextPane jtp = new JTextPane();
...
HTMLDocument doc = (HTMLDocument) jtp.getDocument();
StyleSheet styles = doc.getStyleSheet();
Enumeration rules = styles.getStyleNames();
while (rules.hasMoreElements()) $\{$
String name = (String) rules.nextElement();
Style rule = styles.getStyle(name);
System.out.println(rule.toString());
$\}$
,,,
\section{Gridbag Layout}
using a grid bag, its not so hard, just like a table but with spans
\begin{lstlisting}
getContentPane().setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridwidth = 2;
c.gridheight = 1;
c.anchor = GridBagConstraints.CENTER;
c.fill = GridBagConstraints.BOTH;
c.weightx = 1.0;
c.weighty = 1.0;
c.gridx = 0;
c.gridy = 0;
c.insets = new Insets(2, 2, 2, 2);
getContentPane().add(new JScrollPane(pane), c);
\end{lstlisting}
\section{Text Components}
http://es.scribd.com/doc/89923641/31/JTextComponent-features
very good summary of JTextComponent features.
.createPosition in a text component is like creating a bookmark. The
bookmark doesnt change even when its offset from the start of the
document changes
JTextComponent is complex and is the ancestor of all java text
components. Documents can have a structure such as chapter paragraph
etc.
textArea.setCaretPosition(textArea.getDocument().getLength());
sets the cursor to the end of the ta
\emph{ Create a shape by subtracting one area from another }
Area area = new Area(new Rectangle2D.Double(...));
Area inner = new Area(new Rectangle2D.Double(...));
area.subtract(inner);
,,,
\section{Borders}
Java swing provides a great deal of flexibility with how
borders are painted around components.
\emph{ Create a new type of border by implementing the interface }
public static class GradientBorder implements Border
$\{$
private Insets margin;
public GradientBorder ( int top, int left, int bottom, int right )
$\{$
super ();
margin = new Insets ( top, left, bottom, right );
$\}$
public void paintBorder(
Component c, Graphics g, int x, int y, int width, int height )
$\{$
Graphics2D g2d = (Graphics2D) g;
g2d.setPaint (new GradientPaint(
x, y, Color.RED, x + width, y, Color.BLUE));
Area border = new Area ( new Rectangle ( x, y, width, height ) );
border.subtract ( new Area ( new Rectangle ( x + margin.left, y + margin.top, width - margin.left - margin.right, height - margin.top - margin.bottom ) ) );
g2d.fill ( border );
$\}$
public Insets getBorderInsets ( Component c )
$\{$ return margin; $\}$
public boolean isBorderOpaque ()
$\{$ return true; $\}$
$\}$
,,,
\emph{ A rounded corder border }
class OldRoundedBorderLine extends AbstractBorder $\{$
private final static int MARGIN = 5;
private static final long serialVersionUID = 1L;
private Color color;
OldRoundedBorderLine(Color clr) $\{$ color = clr; $\}$
public void setColor(Color clr) $\{$ color = clr; $\}$
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) $\{$
((Graphics2D) g).setRenderingHint(
RenderingHints.KEY\_ANTIALIASING, RenderingHints.VALUE\_ANTIALIAS\_ON);
g.setColor(color);
g.drawRoundRect(x, y, width, height, MARGIN, MARGIN);
$\}$
@Override
public Insets getBorderInsets(Component c) $\{$
return new Insets(MARGIN, MARGIN, MARGIN, MARGIN);
$\}$
@Override
public Insets getBorderInsets(Component c, Insets insets) $\{$
insets.left = MARGIN;
insets.top = MARGIN;
insets.right = MARGIN;
insets.bottom = MARGIN;
return insets;
$\}$
$\}$
,,,
http://stackoverflow.com/questions/4458982/repaint-swing-button-with-different-gradient/5845007\#5845007
set the colour gradient on abutton
\emph{ Create a hexagon button }
\begin{lstlisting}
You will have to extend JButton class not AbstractButton. Try the following things and you will get idea
The first move is to subclass JButton.
Then, in your subclass, start by redefining the paintComponent(Graphics) method. If you want any changes.
Then, override paintBorder(Graphics) to give it a shape of hexagon
\end{lstlisting}
\emph{ Create rounded corners on a border, but you cant control the radius }
\begin{lstlisting}
LineBorder(Color color, int thickness, boolean roundedCorners)
\end{lstlisting}
Creates a line border with the specified color, thickness, and corner
shape.
\emph{ Set text antialiasing with something like this }
\begin{lstlisting}
g2.setRenderingHint(RenderingHints.KEY_TEXTANTIALIASING, RenderingHints.VALUE_TEXTANTIALIAS_ON);
\end{lstlisting}
\emph{ (com.sun.awt.AWTUtilities) to make your JFrame really transparent. }
\begin{lstlisting}
import com.sun.awt.AWTUtilities;
/* "this" is the JFrame */
this.setUndecorated(true);
AWTUtilities.setWindowOpaque(this, true);
AWTUtilities.setWindowOpacity(this, 0.5f);
AWTUtilities.setWindowShape(this, new RoundRectangle2D.Float(0f, 0f, (float) getWidth(), (float) getHeight(), 15f, 15f));
\end{lstlisting}
\emph{ Another way to make a transparent top level window, w opaque component, but not on linux }
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT\_ON\_CLOSE);
f.setBackground(new Color(0f, 0f, 0f, 0.1f));
f.setUndecorated(true);
f.add(new JLabel("$<$html$>$Testing$<$br$>$1, 2, 3$<$/html$>$"));
f.pack();
,,,
http://oreilly.com/catalog/java2d/chapter/ch04.html
a chapter on painting from an oreilly book
idea: to create an angled stripy effect with two colours, use
a gradient paint in cycle mode with the gradient very small, or tight.
Then you could animate the gradient paint to create moving stripes.
This technique can fill a shape with lots of stripes.
\emph{ Make an italic font in the same family }
\begin{lstlisting}
Font f = g.deriveFont(Font.ITALIC);
\end{lstlisting}
\emph{ Make a text box with an image in it }
\begin{lstlisting}
use CompoundBorder and MatteBorder
\end{lstlisting}
\arrayrulecolor{gray}
\begin{center}
\begin{tabular}{ |rl| }
\multicolumn{2}{c}{\textbf{ =========================================== }} \\
\hline
\hline
\end{tabular}
\end{center}
\emph{ A borderlayout with gaps and a title }
JPanel p = new JPanel( new BorderLayout(5,5) );
p.setBorder( new TitledBorder(``Main GUI'') );
,,,
\emph{ Create a menu with control 0 shortcut key and an action listener }
\begin{lstlisting}
JMenuItem screenshot = new JMenuItem("Screenshot");
screenshot.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_0,
InputEvent.CTRL_DOWN_MASK));
screenshot.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
// do something here
}};
JMenu menu = new JMenu("Other");
menu.add(screenshot);
JMenuBar mb = new JMenuBar();
mb.add(menu);
jframe.setJMenuBar(mb);
\end{lstlisting}
\emph{ Get a buffered image of a jframe and write it to a png file }
Component c = f.getContentPane();
BufferedImage i = getScreenShot(c);
try $\{$
ImageIO.write(img, ``png'', new File(``screenshot.png''));
$\}$ catch (Exception e) $\{$ e.printStackTrace(); $\}$
public static BufferedImage getScreenShot(Component component) $\{$
BufferedImage image = new BufferedImage(
component.getWidth(), component.getHeight(),
BufferedImage.TYPE\_INT\_RGB
);
component.paint(image.getGraphics());
return image;
$\}$
,,,
\emph{ Create a jlabel with icon from a scaled buffered image }
\begin{lstlisting}
BufferedImage img = ...;
JLable l = new JLabel(
new ImageIcon(img.getScaledInstance(
img.getWidth(null)/2, img.getHeight(null)/2, Image.SCALE_SMOOTH)));
\end{lstlisting}
\emph{ Get a screen shot of a jframe component (using BufferedImage) }
\begin{lstlisting}
http://stackoverflow.com/questions/5853879/java-swing-obtain-image-of-jframe/5853992#5853992
\end{lstlisting}
\emph{ Set a window location depending on os }
\begin{lstlisting}
jframe.setLocationByPlatform(true);
\end{lstlisting}
\emph{ Set the native system look and feel. }
public static void main(String[] args) $\{$
SwingUtilities.invokeLater( new Runnable() $\{$
public void run() $\{$
try $\{$
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
$\}$ catch (Exception useDefault) $\{$$\}$
initGui();
$\}$
$\}$);
$\}$
,,,
\section{Modern Loops}
String s = ``red yellow blue'';
String[] splitString = (s.split(``\\textbackslash s+''));
for (String ss: splitString) $\{$ System.out.println(ss); $\}$
\section{Regular Expressions}
\emph{ Use the String built in pattern matching }
public class Test $\{$
public static final String S = "This is my small example string for testing";
public static void main(String[] args) $\{$
System.out.println(S.matches(``\\textbackslash w.*''));
String[] splitString = (S.split(``\\textbackslash s+''));
for (String string : splitString) $\{$
System.out.println(string);
$\}$
// Replace all whitespace with tabs
System.out.println(s.replaceAll(``\\textbackslash s+'', ``\textbackslash t''));
$\}$
$\}$
\emph{ Use compiled patterns and matching loops }
-------
Pattern pattern = Pattern.compile(``\\textbackslash w+'');
// or Pattern pattern = Pattern.compile(``\\textbackslash s+'', Pattern.CASE\_INSENSITIVE);
Matcher matcher = pattern.matcher(``some test string'');
// Check all occurance
while (matcher.find()) $\{$
System.out.print(``Start index: '' + matcher.start());
System.out.print(`` End index: '' + matcher.end() + " ");
System.out.println(matcher.group());
$\}$
,,,
\emph{ Replace all occurance of whitespace with tabs }
---
Pattern replace = Pattern.compile(``\\textbackslash s+'');
Matcher matcher2 = replace.matcher(``some example string'');
System.out.println(matcher2.replaceAll(``\textbackslash t''));
,,,
\section{Constructors}
\emph{ Make 2 object contructors, of which one uses a default value }
----
public FileSystemModel()
$\{$ this( System.getProperty( ``user.home'' ) ); $\}$
public FileSystemModel( String startPath ) $\{$
root = startPath;
$\}$
,,,
\emph{ Read a file into a string buffer }
----
BufferedReader br = new BufferedReader(fr);
String buffer;
StringBuffer result = new StringBuffer();
while ((buffer = br.readLine()) != null) $\{$
result.append(buffer);
$\}$
,,,
It would probably be faster to read into a larger buffer (8k ?) rather than
just one line.
\emph{ Jlist with a list model }
----
import java.awt.*;
import javax.swing.*;
public class List extends JFrame $\{$
public static void main(String[] args) $\{$
List t = new List();
ListModel bigData = new AbstractListModel() $\{$
public int getSize() $\{$ return Short.MAX\_VALUE; $\}$
public Object getElementAt(int index) $\{$ return ``Index '' +
index; $\}$
$\}$;
JList bigDataList = new JList(bigData);
//use the following method for performance reasons
bigDataList.setPrototypeCellValue(``Index 1234567890'');
JScrollPane js = new JScrollPane(bigDataList);
t.getContentPane().add(js);
t.setDefaultCloseOperation(JFrame.EXIT\_ON\_CLOSE);
t.setVisible(true);
$\}$
$\}$
,,,
\emph{ Displays a file list in the center of the screen }
------
import java.awt.*;
import javax.swing.*;
import java.io.*;
public class List extends JFrame $\{$
public static void main(String[] args) $\{$
List t = new List();
JList bigDataList = new JList((new File(".")).listFiles());
JScrollPane js = new JScrollPane(bigDataList);
JPanel pl = new JPanel(); pl.add(js);
t.getContentPane().add(pl);
t.setSize(new Dimension(300, 300));
t.setDefaultCloseOperation(JFrame.EXIT\_ON\_CLOSE);
t.setLocationRelativeTo(null);
t.setVisible(true);
$\}$
$\}$
,,,
\emph{ Display list of files in the current folder in a list box }
------
import java.awt.*;
import javax.swing.*;
import java.io.*;
public class List extends JFrame $\{$
public static void main(String[] args) $\{$
List t = new List();
File dir = new File(".");
File[] files = dir.listFiles();
JList bigDataList = new JList(files);
JScrollPane js = new JScrollPane(bigDataList);
JPanel pl = new JPanel(); pl.add(js);
t.getContentPane().add(pl);
t.setSize(new Dimension(300, 300));
t.setDefaultCloseOperation(JFrame.EXIT\_ON\_CLOSE);
t.setVisible(true);
$\}$
$\}$
,,,
\emph{ Do something when a jlist item is double clicked }
--------
final JList list = new JList(dataModel);
MouseListener mouseListener = new MouseAdapter() $\{$
public void mouseClicked(MouseEvent e) $\{$
if (e.getClickCount() == 2) $\{$
int index = list.locationToIndex(e.getPoint());
System.out.println(``Double clicked on Item '' + index);
$\}$
$\}$
$\}$;
list.addMouseListener(mouseListener);
,,,
\emph{ List with model and unicode characters }
------
import java.awt.*;
import javax.swing.*;
public class List extends JFrame $\{$
public static void main(String[] args) $\{$
List t = new List();
ListModel bigData = new AbstractListModel() $\{$
public int getSize() $\{$ return Short.MAX\_VALUE; $\}$
public Object getElementAt(int index)
$\{$ return ``unicode '' + index + "=" + (char)index; $\}$
$\}$;
JList bigDataList = new JList(bigData);
bigDataList.setPrototypeCellValue(``Index 1234567890'');
JScrollPane js = new JScrollPane(bigDataList);
JPanel pl = new JPanel(); pl.add(js);
t.getContentPane().add(pl);
t.setSize(new Dimension(300, 300));
t.setDefaultCloseOperation(JFrame.EXIT\_ON\_CLOSE);
t.setVisible(true);
$\}$
$\}$
,,,
\emph{ A simple file directory TreeModel for use with a JTree element }
---------
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.event.*;
import java.io.*;
public class FileSystemModel implements TreeModel $\{$
String root;
public FileSystemModel() $\{$
this( System.getProperty( ``user.home'' ) );
$\}$
public FileSystemModel( String startPath )
$\{$ root = startPath; $\}$
public Object getRoot()
$\{$ return new File( root ); $\}$
public Object getChild( Object parent, int index ) $\{$
File directory = (File)parent;
String[] children = directory.list();
return new File( directory, children[index] );
$\}$
public int getChildCount( Object parent ) $\{$
File fileSysEntity = (File)parent;
if ( fileSysEntity.isDirectory() ) $\{$
String[] children = fileSysEntity.list();
if (children == null) return 0;
return children.length;
$\}$
return 0;
$\}$
public boolean isLeaf( Object node )
$\{$ return ((File)node).isFile(); $\}$
public void valueForPathChanged( TreePath path, Object newValue ) $\{$$\}$
public void removeTreeModelListener(TreeModelListener l) $\{$$\}$
public void addTreeModelListener(TreeModelListener l) $\{$$\}$
public int getIndexOfChild( Object parent, Object child ) $\{$
File directory = (File)parent;
File fileSysEntity = (File)child;
String[] children = directory.list();
int result = -1;
for ( int i = 0; i $<$ children.length; ++i ) $\{$
if ( fileSysEntity.getName().equals( children[i] ) ) $\{$
result = i; break;
$\}$
$\}$
return result;
$\}$
public static void main(String[] args)
$\{$
JFrame f = new JFrame();
JTree t = new JTree(new FileSystemModel());
f.getContentPane().add(t);
f.setVisible(true);
$\}$
$\}$
,,,
\section{A Simple Frame Template With A Button}
public class Eg extends PPSFrame implements ActionListener
$\{$
private JButton b;
public Eg()
$\{$
b = new JButton(``click'');
b.addActionListener(this);
add(b);
$\}$
public void actionPerformed(ActionEvent e)
$\{$
if (e.getSource() == b) $\{$$\}$
if (e.getActionCommand().equals(``click'')) $\{$$\}$
repaint();
$\}$
public void paintComponent(Graphics g) $\{$$\}$
public static void main(String[] args) $\{$$\}$
$\}$
\section{The Filloval Method}
\emph{ Fill an oval }
\begin{lstlisting}
import java.awt.*;
import javax.swing.*;
public class Test extends JFrame
{
private boolean tracing;
public void paintComponent(Graphics g)
{
super.paintComponent(g);
this.setBackground(Color.YELLOW);
g.setColor(Color.WHITE);
g.fillOval(100,0,400,400);
}
public static void main(String[] args)
{
Test t = new Test();
}
}
\end{lstlisting}
The origin (0,0) is the top left
fillOval: public abstract void fillOval(int x, int y, int width, int height)
Fills an oval bounded by the specified rectangle with the current color.
\section{Print}
\begin{lstlisting}
System.out.println("hello " + i);
\end{lstlisting}
\begin{lstlisting}
System.out.print("hello " + i);
\end{lstlisting}
\section{Scan}
\begin{lstlisting}
import java.util.Scanner;
\end{lstlisting}
\begin{lstlisting}
Scanner s = new Scanner(System.in);
\end{lstlisting}
\begin{lstlisting}
int i = s.nextInt(); # get next integer
\end{lstlisting}
\begin{lstlisting}
String w = s.next(); # get the next word
\end{lstlisting}
\begin{lstlisting}
String w = s.nextLine(); # get whole line (but not '\n')
\end{lstlisting}
\section{Random}
A random number from 0-9
\begin{lstlisting}
java.util.Random g = new java.util.Random();
\end{lstlisting}
\begin{lstlisting}
int i = g.nextInt(10);
\end{lstlisting}
\begin{lstlisting}
System.out.println("i=" + i);
\end{lstlisting}
A random element of an array
\begin{lstlisting}
java.util.Random g = new java.util.Random();
\end{lstlisting}
\begin{lstlisting}
char[] cc = new char[20];
\end{lstlisting}
\begin{lstlisting}
int i = g.nextInt(cc.length);
\end{lstlisting}
\section{Constructor}
Constructors ARE methods.
\begin{lstlisting}
public Name(String f, int i) {}
\end{lstlisting}
\begin{lstlisting}
public Name() {}
\end{lstlisting}
\section{Final}
\begin{lstlisting}
final String WORD = new String("tree");
\end{lstlisting}
\begin{lstlisting}
private final String WORD = new String("tree");
\end{lstlisting}
\section{Methods}
!!! method names cant be reserved words ('do', 'while' etc)
\begin{lstlisting}
public void print() {}
\end{lstlisting}
\begin{lstlisting}
public boolean print() {}
\end{lstlisting}
\begin{lstlisting}
public String print(int i, double d) {}
\end{lstlisting}
\begin{lstlisting}
private static int[] doo() {}
\end{lstlisting}
\begin{lstlisting}
public static int doo(int i) {}
\end{lstlisting}
\begin{lstlisting}
public static void doo(char c) {}
\end{lstlisting}
\section{Recursion}
Infinite recursion gives stack overflow error (compiles)
\section{Declare}
compile errors !!! variable uninitialised
\begin{lstlisting}
int x; System.out.print("x=" + x);
\end{lstlisting}
\begin{lstlisting}
int x; x=x+1
\end{lstlisting}
but NO error if var is an instance variable
\begin{lstlisting}
private int x; !! initialised to zero
\end{lstlisting}
\section{Integer}
\begin{lstlisting}
int x = 2;
\end{lstlisting}
parseInt is FUSSY, below throws number format exception
\begin{lstlisting}
int i = Integer.parseInt("123 ")' !!! NO
\end{lstlisting}
\begin{lstlisting}
int i = Integer.parseInt(" 123")' !!! NO
\end{lstlisting}
\begin{lstlisting}
int i = Integer.parseInt("123\n")' !!! NO
\end{lstlisting}
Below is ok
\begin{lstlisting}
int i = Integer.parseInt("-123")'
\end{lstlisting}
\section{Operator Precedence}
In normal order, prints '2'
\begin{lstlisting}
System.out.println("\n result=" + 10*2%3);
\end{lstlisting}
\section{Double}
Convert a string to a double
\begin{lstlisting}
double d = Double.parseDouble("-0.223");
\end{lstlisting}
\begin{lstlisting}
java.lang.Math.pow(3,4)
\end{lstlisting}
\section{Char}
\begin{lstlisting}
char letter = 'a';
\end{lstlisting}
\begin{lstlisting}
char c = 'a' + 4; (c='e')
\end{lstlisting}
Implicit casts to integer are OK in statements
\begin{lstlisting}
char c = 'A'; int i = 4 + c;
\end{lstlisting}
Implicit casts to integer are NOT OK in methods
\begin{lstlisting}
Test.doo(25); !!! no if "doo(char c)"
\end{lstlisting}
Comparisons with characters ok
\begin{lstlisting}
char c = 'A'; if (c <= 'B') {}
\end{lstlisting}
\begin{lstlisting}
'a'=97, 'A'=65
\end{lstlisting}
\begin{lstlisting}
lower case letter: if ((c >= 'a') && (c <= 'z'))
\end{lstlisting}
Convert case
\begin{lstlisting}
char c = Character.toLowerCase('A');
\end{lstlisting}
\begin{lstlisting}
char c = Character.toUpperCase('a');
\end{lstlisting}
Convert a decimal digit to a character
\begin{lstlisting}
char c = Character.forDigit(4, 10);
\end{lstlisting}
\section{Strings}
\begin{lstlisting}
String r, s, t;
\end{lstlisting}
\begin{lstlisting}
String s = new String("cat");
\end{lstlisting}
\begin{lstlisting}
if (s.equals("tree") {}
\end{lstlisting}
\begin{lstlisting}
if (s.equalsIgnoreCase("trEE")) {}
\end{lstlisting}
\begin{lstlisting}
t = "TTR".toLowerCase();
\end{lstlisting}
\begin{lstlisting}
t = "TTR ".trim();
\end{lstlisting}
\begin{lstlisting}
t = "TTR".indexOf('R');
\end{lstlisting}
\begin{lstlisting}
t = "TTR".indexOf("TT");
\end{lstlisting}
Starts with and ends with
\begin{lstlisting}
if ("big".startsWith("bi"))
\end{lstlisting}
\begin{lstlisting}
if ("big".endsWith("ig"))
\end{lstlisting}
Matches
\begin{lstlisting}
if ("009".matches("\\d")) System.out.println("\n\nyes");
\end{lstlisting}
Split a string into words
\begin{lstlisting}
String[] ss = ("Some new words".split("\\s+")); System.out.println(ss[1]);
\end{lstlisting}
Substrings
\begin{lstlisting}
"big".substring(0,2) == "bi"
\end{lstlisting}
Comparing strings
\begin{lstlisting}
System.out.println("this".compareTo("this")); // prints 0
\end{lstlisting}
\begin{lstlisting}
System.out.println("zed".compareTo("this")); // prints 6
\end{lstlisting}
\begin{lstlisting}
System.out.println("us".compareTo("this")); // prints 1
\end{lstlisting}
\begin{lstlisting}
System.out.println("this".compareTo("us")); // prints -1
\end{lstlisting}
\begin{lstlisting}
System.out.println("this".compareTo("thks")); // prints -2
\end{lstlisting}
\section{Mod}
get the hundreds
\begin{lstlisting}
i = 1234; i=i/100%10;
\end{lstlisting}
\section{Loops}
\begin{lstlisting}
for (int i=0; i < 5; i++) {}
\end{lstlisting}
\begin{lstlisting}
for (int i=0; i < array.length; i++) {}
\end{lstlisting}
\section{Using The Graphics Object}
import java.awt.*;
import javax.swing.*;
public class Test extends JFrame
$\{$
private boolean tracing;
public void paintComponent(Graphics g)
$\{$
super.paintComponent(g);
this.setBackground(Color.YELLOW);
g.setColor(Color.WHITE);
g.fillOval(0,0,400,400);
g.setFont(new Font(``SansSerif'',Font.BOLD,32));
g.drawString(``Target Practice'', 130, 75);
$\}$
public static void main(String[] args)
$\{$ Test t = new Test(); $\}$
$\}$
\section{Watch Out For}
\begin{lstlisting}
array.length() !!! no array.length
\end{lstlisting}
\begin{lstlisting}
Class.make() !!! is 'make' static???
\end{lstlisting}
\begin{lstlisting}
method 'while()' !!! reserved word
\end{lstlisting}
\section{Investigate}
This section contains subjects and code snippets in java to
investigate
\emph{ What does this mean, a raster is a kind of pixel map }
\begin{lstlisting}
WritableRaster wr = screen.getRaster();
\end{lstlisting}
\emph{ Investigate Maps }
\begin{lstlisting}
Map<?, ?> properties = ((TAudioFileFormat) fileFormat).properties();
\end{lstlisting}
\emph{ Xml parsing code, zip extracting, logging code, by A. Thompson }
\begin{lstlisting}
http://stackoverflow.com/questions/8509302/is-this-ods-reader-functional
\end{lstlisting}
\emph{ Investigate using JWindows for pop up dialogs or tool tips }
\begin{lstlisting}
JWindow
\end{lstlisting}
\emph{ Initialize a boolean array (all element false) }
\begin{lstlisting}
boolean[] array = new boolean[size];
\end{lstlisting}
\emph{ Initialize a boolean array to true }
Boolean[] array = new Boolean[size];
Arrays.fill(array, Boolean.TRUE);
,,,
\emph{ Transfer a file via scp, Jsch has a reputation for being tricky to use }
\begin{lstlisting}
use JSch
\end{lstlisting}
\emph{ An alternative to jsch is sshj }
\begin{lstlisting}
https://github.com/shikhar/sshj
\end{lstlisting}
\end{document}
|
http://porocila.imfm.si/2009/mat/seminarji/kompleksna.tex
|
imfm.si
|
CC-MAIN-2020-29
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2020-29/segments/1593655924908.55/warc/CC-MAIN-20200711064158-20200711094158-00030.warc.gz
| 120,983,349
| 2,013
|
\seminar {Seminar za kompleksno analizo}
Seminar za kompleksno analizo vodita Josip Globevnik in Franc Forstnerič.
Rednih članov je bilo 15. Sestajal se je praviloma enkrat tedensko. V letu 2009
je imel 24 sestankov in povprečno 12 poslušalcev.
Spletno stran najdemo na naslovu: {\tt http://www2.arnes.si/{}$\sim$jtonej/}.
\begin{seznam}
\predavanje
{Dejan Kolarič}{Homotopski princip za holomorfne imerzije z aproksimacijo}
{}{6.~1.}{}
\predavanje
{Martin Vuk}{Posplošena Picardova grupa in izospektralni tok matričnih polinomov}
{}{13.~1.}{}
\predavanje
{Uroš Kuzman}{J - holomorfna okolica ravnega diska v $\mathbb{C}^2$}
{}{20.~1.}{}
\predavanje
{Michele Audin}{Lagrangian submanifolds}{}{24.~2.}{}
\predavanje
{Oliver Dragičević}{Nazarov-Treilova funkcija, toplotna jedra in bilinearne
ocene za razred Schroedingerjevih operatorjev}{1}{3.~3.}{}
\predavanje
{Oliver Dragičević}{Nazarov-Treilova funkcija, toplotna jedra in bilinearne ocene
za razred Schroedingerjevih operatorjev}{2}{10.~3.}{}
\predavanje
{Valery Romanovski}{Limitni cikli in centri v polinomskih sistemih navadnih
diferencialnih enačb}{}{24.~3.}{}
\predavanje
{Finnur Larusson}{The Oka principle: an overview of recent developments}{}{31.~3.}{}
\predavanje
{Nikolay Shcherbina}{Unbounded Wermer-type sets and CR-hulls}{}{7.~4.}{}
\predavanje
{Christoph Leuenberger}{Explicit bounds for the approximation error in
Benford's law}{1}{14.~4.}{}
\predavanje
{Sergey Ivashkovich}{Vanishing cycles in holomorphic foliations by Riemann
surfaces and foliated shells}{2}{21.~4.}{}
\predavanje
{Franc Forstnerič}{Lastnost konveksne aproksimacije implicira parametrično
lastnost Oka}{}{5.~5.}{}
\predavanje
{Alan Huckleberry}{On the pseudoconvexity and hyperbolicity of cycle spaces
of flag domains}{}{12.~5.}{}
\predavanje
{Marko Slapar}{Od Morseove teorije do SFT}{}{26.~5.}{}
\predavanje
{Andreea Nicoara}{The non-Noetherianity of the Denjoy-Carleman clas\-ses}{}{9.~ 6.}{}
\predavanje
{Andreea Nicoara}{Algebraic Geometry over non-Noetherian rings and subelliptic
estimates}{}{16.~ 6.}{}
\predavanje
{Franc Forstnerič}{Steinove okolice razslojenih množic}{}{13.~10.}{}
\predavanje
{Bjorn Ivarsson}{Factorization of holomorphic mappings into the special linear
group}{}{20.~10.}{}
\predavanje
{Oliver Dragičević}{Še o $L^p$ normah potenc Ahlfors-Beurlingovega operatorja}
{}{3.~11.}{}
\predavanje
{Irena Majcen}{Določene posplošitve Carlemanovega izreka}{}{17.~11.}{}
\predavanje
{Alexandre Sukhov}{Some remarks on almost complex geometry}{}{24.~11.}{}
\predavanje
{Josip Globevnik}{Majhne družine kompleksnih premic za preverjanje holomorfne
razširljivosti}{}{1.~12.}{}
\predavanje
{Uroš Kuzman}{Posplošene analitične funkcije v povezavi z okolico
psevdoholomorfnega diska}{}{8.~12.}{}
\predavanje
{Miran Černe}{Posplošitve Hartogsove leme}{}{15.~12}{}
\end{seznam}
|
https://journalofbusiness.org/index.php/GJMBR/article/download/102712/4-Hyperinflation-in-Venezuela_tex
|
journalofbusiness.org
|
CC-MAIN-2022-49
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2022-49/segments/1669446710941.43/warc/CC-MAIN-20221203212026-20221204002026-00560.warc.gz
| 372,079,429
| 18,223
|
\documentclass[11pt,twoside]{article}\makeatletter
\IfFileExists{xcolor.sty}%
{\RequirePackage{xcolor}}%
{\RequirePackage{color}}
\usepackage{colortbl}
\usepackage{wrapfig}
\usepackage{ifxetex}
\ifxetex
\usepackage{fontspec}
\usepackage{xunicode}
\catcode`⃥=\active \def⃥{\textbackslash}
\catcode`❴=\active \def❴{\{}
\catcode`❵=\active \def❵{\}}
\def\textJapanese{\fontspec{Noto Sans CJK JP}}
\def\textChinese{\fontspec{Noto Sans CJK SC}}
\def\textKorean{\fontspec{Noto Sans CJK KR}}
\setmonofont{DejaVu Sans Mono}
\else
\IfFileExists{utf8x.def}%
{\usepackage[utf8x]{inputenc}
\PrerenderUnicode{–}
}%
{\usepackage[utf8]{inputenc}}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{float}
\usepackage[]{ucs}
\uc@dclc{8421}{default}{\textbackslash }
\uc@dclc{10100}{default}{\{}
\uc@dclc{10101}{default}{\}}
\uc@dclc{8491}{default}{\AA{}}
\uc@dclc{8239}{default}{\,}
\uc@dclc{20154}{default}{ }
\uc@dclc{10148}{default}{>}
\def\textschwa{\rotatebox{-90}{e}}
\def\textJapanese{}
\def\textChinese{}
\IfFileExists{tipa.sty}{\usepackage{tipa}}{}
\fi
\def\exampleFont{\ttfamily\small}
\DeclareTextSymbol{\textpi}{OML}{25}
\usepackage{relsize}
\RequirePackage{array}
\def\@testpach{\@chclass
\ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
\ifnum \@lastchclass=7 5 \else
\ifnum \@lastchclass=8 \tw@ \else
\ifnum \@lastchclass=9 \thr@@
\else \z@
\ifnum \@lastchclass = 10 \else
\edef\@nextchar{\expandafter\string\@nextchar}%
\@chnum
\if \@nextchar c\z@ \else
\if \@nextchar l\@ne \else
\if \@nextchar r\tw@ \else
\z@ \@chclass
\if\@nextchar |\@ne \else
\if \@nextchar !6 \else
\if \@nextchar @7 \else
\if \@nextchar (8 \else
\if \@nextchar )9 \else
10
\@chnum
\if \@nextchar m\thr@@\else
\if \@nextchar p4 \else
\if \@nextchar b5 \else
\z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
\fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi}
\gdef\arraybackslash{\let\\=\@arraycr}
\def\@textsubscript#1{{\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
\def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}}
\def\abbr{}
\def\corr{}
\def\expan{}
\def\gap{}
\def\orig{}
\def\reg{}
\def\ref{}
\def\sic{}
\def\persName{}\def\name{}
\def\placeName{}
\def\orgName{}
\def\textcal#1{{\fontspec{Lucida Calligraphy}#1}}
\def\textgothic#1{{\fontspec{Lucida Blackletter}#1}}
\def\textlarge#1{{\large #1}}
\def\textoverbar#1{\ensuremath{\overline{#1}}}
\def\textquoted#1{‘#1’}
\def\textsmall#1{{\small #1}}
\def\textsubscript#1{\@textsubscript{\selectfont#1}}
\def\textxi{\ensuremath{\xi}}
\def\titlem{\itshape}
\newenvironment{biblfree}{}{\ifvmode\par\fi }
\newenvironment{bibl}{}{}
\newenvironment{byline}{\vskip6pt\itshape\fontsize{16pt}{18pt}\selectfont}{\par }
\newenvironment{citbibl}{}{\ifvmode\par\fi }
\newenvironment{docAuthor}{\ifvmode\vskip4pt\fontsize{16pt}{18pt}\selectfont\fi\itshape}{\ifvmode\par\fi }
\newenvironment{docDate}{}{\ifvmode\par\fi }
\newenvironment{docImprint}{\vskip 6pt}{\ifvmode\par\fi }
\newenvironment{docTitle}{\vskip6pt\bfseries\fontsize{22pt}{25pt}\selectfont}{\par }
\newenvironment{msHead}{\vskip 6pt}{\par}
\newenvironment{msItem}{\vskip 6pt}{\par}
\newenvironment{rubric}{}{}
\newenvironment{titlePart}{}{\par }
\newcolumntype{L}[1]{){\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{){\centering\arraybackslash}p{#1}}
\newcolumntype{R}[1]{){\raggedleft\arraybackslash}p{#1}}
\newcolumntype{P}[1]{){\arraybackslash}p{#1}}
\newcolumntype{B}[1]{){\arraybackslash}b{#1}}
\newcolumntype{M}[1]{){\arraybackslash}m{#1}}
\definecolor{label}{gray}{0.75}
\def\unusedattribute#1{\sout{\textcolor{label}{#1}}}
\DeclareRobustCommand*{\xref}{\hyper@normalise\xref@}
\def\xref@#1#2{\hyper@linkurl{#2}{#1}}
\begingroup
\catcode`\_=\active
\gdef_#1{\ensuremath{\sb{\mathrm{#1}}}}
\endgroup
\mathcode`\_=\string"8000
\catcode`\_=12\relax
\usepackage[a4paper,twoside,lmargin=1in,rmargin=1in,tmargin=1in,bmargin=1in,marginparwidth=0.75in]{geometry}
\usepackage{framed}
\definecolor{shadecolor}{gray}{0.95}
\usepackage{longtable}
\usepackage[normalem]{ulem}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{marginnote}
\renewcommand{\@cite}[1]{#1}
\renewcommand*{\marginfont}{\itshape\footnotesize}
\def\Gin@extensions{.pdf,.png,.jpg,.mps,.tif}
\pagestyle{fancy}
\usepackage[pdftitle={Hyperinflation in Venezuela, and its Financial Audit Effects},
pdfauthor={}]{hyperref}
\hyperbaseurl{}
\paperwidth210mm
\paperheight297mm
\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{3}
\clubpenalty=8000
\emergencystretch 3em
\hbadness=4000
\hyphenpenalty=400
\pretolerance=750
\tolerance=2000
\vbadness=4000
\widowpenalty=10000
\renewcommand\section{\@startsection {section}{1}{\z@}%
{-1.75ex \@plus -0.5ex \@minus -.2ex}%
{0.5ex \@plus .2ex}%
{\reset@font\Large\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-1.75ex\@plus -0.5ex \@minus- .2ex}%
{0.5ex \@plus .2ex}%
{\reset@font\Large}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-1.5ex\@plus -0.35ex \@minus -.2ex}%
{0.5ex \@plus .2ex}%
{\reset@font\large}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{-1ex \@plus-0.35ex \@minus -0.2ex}%
{0.5ex \@plus .2ex}%
{\reset@font\normalsize}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
{1.5ex \@plus1ex \@minus .2ex}%
{-1em}%
{\reset@font\normalsize\bfseries}}
\def\l@section#1#2{\addpenalty{\@secpenalty} \addvspace{1.0em plus 1pt}
\@tempdima 1.5em \begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\bfseries \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}\par
\endgroup}
\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
\def\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
\def\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
\@ifundefined{c@section}{\newcounter{section}}{}
\@ifundefined{c@chapter}{\newcounter{chapter}}{}
\newif\if@mainmatter
\@mainmattertrue
\def\chaptername{Chapter}
\def\frontmatter{%
\pagenumbering{roman}
\def\thechapter{\@roman\c@chapter}
\def\theHchapter{\roman{chapter}}
\def\thesection{\@roman\c@section}
\def\theHsection{\roman{section}}
\def\@chapapp{}%
}
\def\mainmatter{%
\cleardoublepage
\def\thechapter{\@arabic\c@chapter}
\setcounter{chapter}{0}
\setcounter{section}{0}
\pagenumbering{arabic}
\setcounter{secnumdepth}{6}
\def\@chapapp{\chaptername}%
\def\theHchapter{\arabic{chapter}}
\def\thesection{\@arabic\c@section}
\def\theHsection{\arabic{section}}
}
\def\backmatter{%
\cleardoublepage
\setcounter{chapter}{0}
\setcounter{section}{0}
\setcounter{secnumdepth}{2}
\def\@chapapp{\appendixname}%
\def\thechapter{\@Alph\c@chapter}
\def\theHchapter{\Alph{chapter}}
\appendix
}
\newenvironment{bibitemlist}[1]{%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}%
}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}%
{\def\@noitemerr
{\@latex@warning{Empty `bibitemlist' environment}}%
\endlist}
\def\tableofcontents{\section*{\contentsname}\@starttoc{toc}}
\parskip0pt
\parindent1em
\def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}}
\newenvironment{reflist}{%
\begin{raggedright}\begin{list}{}
{%
\setlength{\topsep}{0pt}%
\setlength{\rightmargin}{0.25in}%
\setlength{\itemsep}{0pt}%
\setlength{\itemindent}{0pt}%
\setlength{\parskip}{0pt}%
\setlength{\parsep}{2pt}%
\def\makelabel##1{\itshape ##1}}%
}
{\end{list}\end{raggedright}}
\newenvironment{sansreflist}{%
\begin{raggedright}\begin{list}{}
{%
\setlength{\topsep}{0pt}%
\setlength{\rightmargin}{0.25in}%
\setlength{\itemindent}{0pt}%
\setlength{\parskip}{0pt}%
\setlength{\itemsep}{0pt}%
\setlength{\parsep}{2pt}%
\def\makelabel##1{\upshape ##1}}%
}
{\end{list}\end{raggedright}}
\newenvironment{specHead}[2]%
{\vspace{20pt}\hrule\vspace{10pt}%
\phantomsection\label{#1}\markright{#2}%
\pdfbookmark[2]{#2}{#1}%
\hspace{-0.75in}{\bfseries\fontsize{16pt}{18pt}\selectfont#2}%
}{}
\def\TheFullDate{1970-01-01 (revised: 01 January 1970)}
\def\TheID{\makeatother }
\def\TheDate{1970-01-01}
\title{Hyperinflation in Venezuela, and its Financial Audit Effects}
\author{}\makeatletter
\makeatletter
\newcommand*{\cleartoleftpage}{%
\clearpage
\if@twoside
\ifodd\c@page
\hbox{}\newpage
\if@twocolumn
\hbox{}\newpage
\fi
\fi
\fi
}
\makeatother
\makeatletter
\thispagestyle{empty}
\markright{\@title}\markboth{\@title}{\@author}
\renewcommand\small{\@setfontsize\small{9pt}{11pt}\abovedisplayskip 8.5\p@ plus3\p@ minus4\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus2\p@
\belowdisplayshortskip 4\p@ plus2\p@ minus2\p@
\def\@listi{\leftmargin\leftmargini
\topsep 2\p@ plus1\p@ minus1\p@
\parsep 2\p@ plus\p@ minus\p@
\itemsep 1pt}
}
\makeatother
\fvset{frame=single,numberblanklines=false,xleftmargin=5mm,xrightmargin=5mm}
\fancyhf{}
\setlength{\headheight}{14pt}
\fancyhead[LE]{\bfseries\leftmark}
\fancyhead[RO]{\bfseries\rightmark}
\fancyfoot[RO]{}
\fancyfoot[CO]{\thepage}
\fancyfoot[LO]{\TheID}
\fancyfoot[LE]{}
\fancyfoot[CE]{\thepage}
\fancyfoot[RE]{\TheID}
\hypersetup{citebordercolor=0.75 0.75 0.75,linkbordercolor=0.75 0.75 0.75,urlbordercolor=0.75 0.75 0.75,bookmarksnumbered=true}
\fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}}
\date{}
\usepackage{authblk}
\providecommand{\keywords}[1]
{
\footnotesize
\textbf{\textit{Index terms---}} #1
}
\usepackage{graphicx,xcolor}
\definecolor{GJBlue}{HTML}{273B81}
\definecolor{GJLightBlue}{HTML}{0A9DD9}
\definecolor{GJMediumGrey}{HTML}{6D6E70}
\definecolor{GJLightGrey}{HTML}{929497}
\renewenvironment{abstract}{%
\setlength{\parindent}{0pt}\raggedright
\textcolor{GJMediumGrey}{\rule{\textwidth}{2pt}}
\vskip16pt
\textcolor{GJBlue}{\large\bfseries\abstractname\space}
}{%
\vskip8pt
\textcolor{GJMediumGrey}{\rule{\textwidth}{2pt}}
\vskip16pt
}
\usepackage[absolute,overlay]{textpos}
\makeatother
\usepackage{lineno}
\linenumbers
\begin{document}
\author[1]{Wladimir García C.}
\renewcommand\Authands{ and }
\date{\small \em Received: 1 January 1970 Accepted: 1 January 1970 Published: 1 January 1970}
\maketitle
\begin{abstract}
This documentary research, through activities carried out in Audit and Assurance II, aims to identify problems studied in terms of effects of hyperinflation in Venezuela on financial audit processes, analyzed by seventeen (17) Sixth semester students in the Public Accounting career at the Universidad Católica Andrés Bello, developed during the months of October to December 2019. Among the most outstanding conclusions, the fact that hyperinflation generates profound distortions in financial statements can be observed.
\end{abstract}
\keywords{hyperinflation, audit, financial, venezuela.}
\begin{textblock*}{18cm}(1cm,1cm) % {block width} (coords)
\textcolor{GJBlue}{\LARGE Global Journals \LaTeX\ JournalKaleidoscope\texttrademark}
\end{textblock*}
\begin{textblock*}{18cm}(1.4cm,1.5cm) % {block width} (coords)
\textcolor{GJBlue}{\footnotesize \\ Artificial Intelligence formulated this projection for compatibility purposes from the original article published at Global Journals. However, this technology is currently in beta. \emph{Therefore, kindly ignore odd layouts, missed formulae, text, tables, or figures.}}
\end{textblock*}
\begin{textblock*}{10cm}(1.05cm,3cm)
{{\textit{CrossRef DOI of original article:}} \underline{}}
\end{textblock*}\let\tabcellsep& \par
actividades efectuadas en la catedra de Auditoría y Aseguramiento II,tiene como objetivo identificar los problemas estudiados por los alumnos, en cuanto a los efectos de la hiperinflación en Venezuela en los procesos de auditoría financiera, analizados por diecisiete \hyperref[b14]{(17)} estudiantes de sexto semestre la carrera de Contaduría Pública de la Universidad Católica Andrés Bello, desarrollados durante los meses de octubrea diciembre 2019. Dentro de las conclusiones más resaltantes se puede observar el hecho de que la hiperinflación genera profundas distorsiones en los estados financieros, que no pueden ser solucionadas a partir del proceso de auditoría. Estas distorsiones han generado que la información contable, y por consiguiente la auditada, no sea fiable ni comparable en favor de los distintos usuarios; siendo así, dejan de ser útiles para todos los efectos. Los estudiantes consideraron que la información histórica no es comparable, y puntualizaron que los datos reexpresados deberían ser una mejor aproximación; no obstante, consideran que las cifras aportados por las autoridades gubernamentales podrían no ser fiables. Identifican al control cambiario, procesos de reconversión, así como otras medidas estadales, como detonantes de la hiperinflación.\par
Palabras claves: hiperinflación, auditoría, finanzas, venezuela.
\section[{I.}]{I.}
\section[{Introducción}]{Introducción}\par
La entidad debe previamente haber considerado si se encuentra como negocio en marcha o abiertamente en proceso de liquidación, donde se respete el principio del devengado/causado, registradas las transacciones con objetividad, prudencia, uniformidad, considerando la significación o importancia relativa y exponiendo todos los eventos tal como se presentaron.\par
Todos estos elementos son puertas adentro, y dependen fundamentalmente de la gerencia de la entidad que reporta la información; no obstante a ello, existen otros asuntos exógenos que no pueden ser manejados por las organizaciones y sus auditores. Estos son aspectos que dependen de la economía o de regulaciones gubernamentales que escapan del alcance de los particulares, pero que deben ser tomados en consideración o resueltas de forma inmediata. Dichas variables tienen incidencia en la información financiera, siendo punto de análisis por parte de los encargados y responsables de los datos contables, todo con el objetivo de proveer de información segura a los distintos usuarios interesados.\par
En este sentido, el objetivo de la presente investigación se centra en identificar los efectos de la hiperinflaciónen el proceso de auditoría de estados financieros, estudiadopor diecisiete \hyperref[b14]{(17)} estudiantes de Auditoría y Aseguramiento II de la carrera de Contaduría Pública, en cuanto a la presentación de datos contables Author: Licenciado en ciencias fiscales, mención rentas, Escuela Nacional de Administración y Hacienda Pública (ENAHP); maestría en ciencias gerencias, mención finanzas, Universidad Nororiental Privada Gran Mariscal de Ayacucho (UGMA); MBA, Formato Educativo y Universidad de Cádiz; diplomado en educación orientada al desarrollo de competencias, Universidad Católica Andrés Bello (UCAB); programa de estudios avanzados en gerencia de la tecnología y sistemas de información, UCAB; doctor en educación, UCAB. Profesor de la Universidad Católica Andrés Bello -Guayana. Socio de García Gómez Services \& Asociados, SC, firma miembro de IPG. e-mails: [email protected], [email protected]@wlagc e acuerdo con el Marco Conceptual para la Información Financiera (2018), para que la información financiera sea apropiada y útil para los usuarios,debe estar relacionada con una entidad definida a fecha de corte, cumpliendo con los principio de equidady partida doble en el reconocimiento contable. Además de ello, tiene que estar relacionada con bienes y/u obligaciones correctamente valuados, expresados en una moneda común.
\section[{D}]{D}\par
Hyperinflation in Venezuela, and its Financial Audit Effects y el proceso de auditoría de dichos valores. Dentro de los objetivos principales, se revisó la literatura contable asociada al proceso de auditoría y se analizaron los principales datos relacionados con la inflación en Venezuela, de acuerdo a fuentes gubernamentales. En ese sentido, la presente investigación describe lo previsto en la literatura contable y en el análisis documental de investigaciones escritas realizadas por los estudiantes durante los meses de octubre a diciembre de 2019, en la catedra antes referida.\par
Epistemológicamente, la hiperinflación ha generado serias distorsiones en la información contable, lo que impide que los datos históricos tengan validez para los usuarios, dado que son inexactos y dejan de ser comparables. Por otro lado, la información reexpresada tiende a generar dudas razonables por la opacidad gubernamental, o por la falta de certeza sobre la información extemporánea que ofrecen. Gnoseológicamente se pretende tener la perspectiva de la literatura especializada, aunada a la visión de profesionales del sexto semestre de la carrera de contaduría pública, quienes ya han transitado gran parte de la malla curricular a fin de licenciarse y cuentan con una importante base teórica de la profesión.\par
En lo axiológico, se identifica el impacto que pudiese tener la situación en las compañías y en los distintos usuarios, quienes demandan datos fiables, para efectos de la toma de decisiones. Para poder realizar la presente investigación de corte documental, se tomó información disponible en materia contable y en los análisis proporcionados por los estudiantes de forma escrita.
\section[{II.}]{II.}
\section[{Auditoría de Estados Financieros}]{Auditoría de Estados Financieros}\par
De acuerdo con Espino (2014, p. 4) "no concebimos un mundo financiero sin auditoría de estados financieros", considerando que ésta proporciona una confianza razonable sobre la información contable a una fecha de corte. Los usuarios (accionistas, inversionistas actuales o potenciales, entes regulatorios, deudores, acreedores, trabajadores y cualquier otro interesado) toman decisiones trascendentales entorno al dictamen, cifras y revelaciones contenidas en reportes emitidos por profesionales debidamente autorizados para tales fines y con ello se busca que los datos sean de igual comprensión, sin importar la jurisdicción donde los lectores se encuentren. Los distintos agentes económicos toman decisiones de toda índole, fundamentados principalmente en los datos reflejados en los estados financieros avalados por auditores externos independientes e idóneos.\par
Según Oviedo (2014), citado por Falconí, Altamirano y Avellán (2018, p. 77), "la auditoría financiera examina a los estados financieros y a través de ellos las operaciones financieras realizadas por el ente contable, con la finalidad de emitir una opinión técnica y profesional".\par
El entendimiento del cliente y del entorno donde desarrolla sus actividades es de suma importancia, dado que de dicho análisis se pueden determinar significativos elementos con incidencia en el proceso de auditoría y muy probablemente en el dictamen del auditor. Siendo así, el auditor no solamente debe conocer los asuntos estrictamente técnicos -contables; debe tener un profundo conocimiento del entorno donde se desarrollan los negocios. De acuerdo al Marco Conceptual para la Información Financiera (2018, p. 5), emitido por el IASB, la "(?) misión consiste en desarrollarNormas que aporten transparencia, rendición de cuentas y eficiencia a losmercados financieros de todo el mundo. El trabajo del Consejo sirve al interéspúblico fomentando la confianza, el crecimiento y la estabilidad financiera alargo plazo en la economía global".\par
En países como Venezuela, los contadores públicos son los únicos autorizados para emitir un dictamen sobre las cifras contables, esto de conformidad con lo previsto en la Ley de Ejercicio de la Contaduría Pública, publicada en Gaceta Oficial Nº 30. {\ref 273} Siendo así, la actividad de la auditoría legalmente está ligada a los licenciados en Contaduría Pública, o su equivalente, egresados de universidades venezolanas que ofertan dicha profesión o al proceso de reválida realizado por profesionales egresados en carreras análogas en otros países.\par
Siguiendo con Espino (2014, p. 13), "(?) la auditoría de los estados financieros se basa en el análisis y estudio de los estados financieros básicos de la empresa o entidad (?)", donde se debe visualizar no solo los resultados del período sujeto a estudio, sino también de las perspectivas futuras, en función al entorno donde se desarrollan las actividades. No hacerlo, proporciona una visión limitada y sesgada del proceso de auditoría y no da la visual que inversionistas actuales y potenciales esperan de un reporte con fe pública.\par
La auditoría de los estados financieros se ve afectada por los agentes económicos, siendo la inflación uno de los más importantes. Para Calderón (2015, p. 74) "Cuando un país está afectado por un proceso inflacionario, la información financiera basada en costos históricos no se próxima a la realidad. Este es uno de los requisitos que la información financiera debe cumplir", para con ello ser comparable y servir como base para la toma de decisiones. Siendo así, si la información carece de fiabilidad, el proceso de auditoría terminaría siendo insuficiente, más allá de la rigurosidad en su proceso de planificación y ejecución. Considerando esto, es importante destacar algunas de las consecuencias más importantes que se dan en la economía, producto de los procesos inflacionarios, detalladas en el Cuadro 1, donde se sintetizan los efectos de mayor importancia, desde diferentes perspectivas.
\section[{Consecuencias de la inflación}]{Consecuencias de la inflación}
\section[{Efecto Explicación}]{Efecto Explicación}\par
Efectos sobre los precios relativos Cuando existe inflación sube el nivel de precios de la economía, pero esto no significa que todos los precios suban al mismo ritmo, ni siquiera que todos suban. En una economía de mercado en la cual las decisiones de los agentes se basan en el sistema de precios, la inflación, sobre todo si es elevada, es una fuente de incertidumbre que hace que tanto empresarios como consumidores tengan dificultades para interpretar la información que dan los precios. La consecuencia será una deficiente asignación de los recursos y la consiguiente pérdida de bienestar de los agentes. Este hecho forma parte de un fenómeno denominado "ilusión monetaria", que afecta a muchos agentes económicos y que consiste en cometer errores sistemáticos cuando se valoran los cambios nominales frente a los reales.
\section[{Efectos en la redistribución de la renta}]{Efectos en la redistribución de la renta}\par
Este efecto está relacionado con el trasvase de poder adquisitivo entre acreedores y deudores cuyas obligaciones estén expresadas en términos monetarios. Algunos ejemplos: En los préstamos, el beneficiado es el deudor ya que cuando contrajo la deuda el valor nominal de ésta era superior en términos reales a lo que supondría esa cantidad de dinero en una economía con inflación. Además, los intereses que debe pagar en términos son también menores, en términos reales, ya que éstos se calculan en función del nominal y éste se ha visto devaluado. En el caso de los seguros el asegurado se ve perjudicado ya que ha ido pagando primas, que posteriormente serán valoradas con el consiguiente proceso inflacionista y, por tanto, estarán devaluadas. Por poner un ejemplo sencillo digamos que un asegurado de un plan de pensiones decide abonar anualmente una cuantía de
\section[{Global Journal of Management and Business Research}]{Global Journal of Management and Business Research}\par
Volume XXII Issue IV Version I Year 2022
\section[{( ) C}]{( ) C}\par
© 2022 Global Journals 5.000?, supongamos que durante 10 años, para recibir al final del periodo la cantidad invertida más los intereses. Si durante el periodo se ha producido un proceso inflacionario el poder adquisitivo de la cantidad recibida puede ser mucho menor que lo que esta persona esperaba recibir en un principio.\par
Efecto sobre el nivel de liquidez de los agentes económicos\par
En un proceso inflacionista como bien sabemos los precios suben y, en consecuencia, el poder adquisitivo del dinero baja. Por tanto, si la inflación es muy elevada, los agentes económicos al ser seres racionales, decidirán ajustar sus tenencias de saldos líquidos al mínimo (no interesa mantener el patrimonio en forma líquida ya que pierde valor). Este elevado coste de oportunidad del dinero obliga a los agentes económicos a frecuentes transacciones con los bancos para retirar los saldos líquidos con el objetivo de reducir ese coste de oportunidad. La velocidad de circulación del dinero aumenta y, en casos extremos, puede dispararse la demanda de bienes con el fin de conservar el patrimonio, lo cual agrava todavía más el proceso inflacionista.\par
Efecto sobre la estructura productiva Esta se ve afectada en dos aspectos: El primero tiene que ver con la producción: en un proceso inflacionista la demanda es superior a la oferta, toda la producción es absorbida y, en consecuencia, el "arte" de fijar un precio razonable deja de ser una ventaja para los productores. Esto tiene efectos sobre la asignación de los recursos y sobre la calidad de la producción de determinados bienes, ya que se ve reducida porque el consumidor no la valora tan positivamente. El segundo tiene que ver con la creación de nuevas empresas, que en muchas ocasiones sólo se justifica por la existencia de inflación. Esto significa que muchas inversiones no están económicamente bien planteadas, de manera que una vez terminado el proceso inflacionista muy posiblemente desaparecerán. Esto repercutirá negativamente no solo en ellas mismas sino también en toda la economía. En este contexto, puede destacarse también que en un escenario inflacionista la medición de costes es un problema muy importante, además de la valoración de inventarios y el tema del cálculo de amortizaciones. También hay que tener en cuenta unos costes que a priori no son importantes pero pueden llegar a serlo (sobre todo si la inflación es muy elevada): los denominados "costes de etiqueta", que son costes asociados a cambios de etiquetas de precios, cambios en los catálogos, reprogramaciones de las máquinas automáticas de recepción de monedas, etc.
\section[{Efectos sobre la tasa de desempleo}]{Efectos sobre la tasa de desempleo}\par
Es uno de los pocos efectos positivos. En los procesos inflacionistas la demanda suele superar ampliamente a la oferta y las empresas contratan más factores productivos para satisfacer esa demanda superior. El paro puede llegar a desaparecer e incluso trabajar la mano de obra por encima del horario laboral establecido, en forma de horas extras.
\section[{Efectos sobre el ahorro}]{Efectos sobre el ahorro}\par
Como ya se ha mencionado antes en los efectos sobre la redistribución de la renta, los prestamistas y ahorradores salen perjudicados ya que sus activos se ven devaluados. Por tanto, esto desincentiva y desmotiva a los ahorradores, en particular a los que son "adversos al riesgo". La demanda del público pasa a dirigirse hacia la renta variable, que además, como en este escenario las empresas obtienen beneficios, suelen dar dividendos elevados. La tenencia de renta fija se ve perjudicada, ya que tanto los intereses como el nominal se deprecian en términos reales como consecuencia de la inflación.
\section[{Efectos sobre la balanza de pagos}]{Efectos sobre la balanza de pagos}\par
Al tratarse un trabajo de macroeconomía no podía faltar una breve reseña sobre este apartado. El efecto sobre la balanza de pagos es claramente negativo: por un lado las exportaciones, al encarecerse los precios en la economía, pasan a ser relativamente más costosas respecto a otras economías. Por otro lado, el aumento del nivel de precios nacional incentiva la adquisición de productos extranjeros (importaciones). En este contexto, rápidamente la moneda nacional comienza a depreciarse respecto de las divisas extranjeras, tanto por las fuerzas del mercado como por intervenciones del gobierno, devaluando la moneda.
\section[{Efectos sobre el sistema impositivo}]{Efectos sobre el sistema impositivo}\par
Se pueden apreciar dos distorsiones; La primera es que existen ganancias ficticias provocadas por la inflación y que conllevan a un pago de impuestos mayor. La segunda es que se dan subidas impositivas injustas en los impuestos directos progresivos. Por último, existe un desajuste, ya mencionado, en las amortizaciones que se calculan sobre el precio de adquisición.\par
Fuente: {\ref Tabuenca (2016, p. 13-16)} Tal como se logra visualizar en el cuadro previo, la inflación no solo tiene consecuencias en el valor de los bienes y servicios, quienes aumentan de forma sostenida en el tiempo. Elementos como el empleo, la banca, los impuestos, entre otros, también se ven sensiblemente afectados.
\section[{III.}]{III.}
\section[{Hiperinflación}]{Hiperinflación}\par
Dentro del proceso de auditoría es fundamental tener conocimiento de la entidad sujeta a examen, y el entorno donde se desenvuelve. Para Espinoza y Naranjo (2012, p. 28), es necesario "contar con información suficiente, sobre las actividades, funcionarios y factores que puedan influir en el examen, para lograr evaluar el entorno, en el cual se va a desarrollar la Auditoría".\par
Para Reinhart y Savastano (2003, p. 20), "Un puñado de economías europeas sucumbió a la hiperinflación al término de la primera guerra mundial. En Alemania, Austria, Hungría, Polonia y Rusia hubo enormes aumentos de precios: en Alemania, llegaron a la astronómica cifra de 3,25 millones en un solo mes de 1923. A partir de los años cincuenta, sin embargo, la hiperinflación solo ha afectado a las economías en desarrollo y en transición. El fenómeno menos extremo de una inflación alta y crónica desapareció de las economías avanzadas en los años ochenta y de los países en desarrollo en los noventa (?)". Esto puntualiza el hecho de que la inflación se da en ambientes económica, política y socialmente hostiles.\par
Para el caso venezolano, uno de los elementos que ha generado mayor distorsión en el desenvolvimiento de la economía ha sido la inflación, la cual ha avanzado hasta el punto de convertirse en hiperinflación.\par
Para {\ref Guevara (2018, p. 6)}, la inflación es "un proceso económico caracterizado por alzas generalizadas y sostenidas de precios en el tiempo", lo que en términos prácticos se traduce en que los precios de los bienes y servicios aumentan en detrimento del poder adquisitivo de los usuarios o adquirientes, lo que no permite tener una visión clara real de los valores de la economía. Esta situación tiene un impacto significativo en la presentación de los estados financieros, dado que hace sumamente complejo poder mostrar resultados a una fecha de corte, de datos que han ido cambiando sostenidamente en el tiempo.\par
Siguiendo con Guevara, la hiperinflación se traduce en un problema aún mayor. En cuanto a esto, el investigador considera que:\par
Al momento de abordar el concepto de la hiperinflación se hace necesario tomar en consideración las coordenadas esenciales del proceso inflacionario, puesto que aunque son fenómenos distintos guardan una relación estrecha desde el punto de vista conceptual. En seguimiento a lo planteado por el profesor García Larralde, la noción clásica de "hiperinflación" se relaciona con lo expuesto por el economista Philip Cagan en 1956, quien sostiene que un episodio de hiperinflación comienza el mes en el que el aumento de los precios supera el 50\% y termina el mes anterior al cual ese aumento cae por debajo de esa tasa y permanece así por lo menos durante un año. Con posterioridad, Reinhart y Rogoff (2011) citados por Ortiz y Jaramillo (2016) sostienen que la hiperinflación existe cuando la tasa alcanza una variación anual superior a 500 por ciento.\par
Como bien apunta Ruiz (2015) las premisas iniciales expuestas por Cagan deben revisarse minuciosamente. Por una parte, pareciera que quienes se limitan al escenario de cincuenta por ciento (50\%) o más de inflación mensual señalado por Cagan lo hacen como si su premisa fuese una regla macroeconómica sin mayor profundidad. Adicionalmente, señala Ruiz que Cagan en TheMonetary Dynamics of Hyperinflation indica que su umbral es arbitrario y que tiene el cometido de servir a su estudio "satisfactoriamente" y desde el punto de vista técnico.\par
En el caso venezolano, el informe de CEDICE considera que las causas de hiperinflación en el país obedecen a:\par
1. crecimiento desorbitado de dinero sin respaldo para financiar sector público; 2. abultados y sostenidos déficits del sector público; 3. pérdida de confianza en el bolívar como depositario de valor; 4. colapso del sector externo y alza desmedida del dólar negro;e 5. indexación creciente de precios y remuneraciones.\par
Tal como se desprende de la Gráfica 1, Venezuela ha sufrido de inflación de manera sostenible en el tiempo; no obstante, desde el año 2015 y siguientes, se dio un significativo cambio cuantitativo, hasta llegar al clímax en el año 2018. La información formal fue emitida por el Banco Central de Venezuela de forma extemporánea, dándose un espacio significativo de tiempo donde los ciudadanos e interesados no estuvieron informados directamente de la variación de la inflación. Esto dio cabida a que entidades privadas hicieras sus propios cálculos estimados. Desafortunadamente, la metodología y alcance empleado por el ente gubernamental podría ser compleja de emular por terceros con recursos limitados para su determinación.
\section[{Global Journal of Management and Business Research}]{Global Journal of Management and Business Research}\par
Siguiendo con Reinhart y Savastano (2003, p. 23), existen siete \hyperref[b4]{(7)} lecciones claves que servirán de base para poder entender y eventualmente dar fin a procesos hiperinflaciones:\par
1. La hiperinflación normalmente precede a un prolongado periodo inflacionario, por lo que su llegada no es súbita, si no gradual. 2. La eliminación de la hiperinflación puede tomar años si la política fiscal no se ajusta. 3. El control del déficit es el elemento central de un programa antiinflacionario. 4. La unificación de los mercados cambiarios y la convertibilidad libre de la moneda son fundamentales. 5. Considerando que la actividad económica colapsa, es de suma importancia tomar medidas de estabilización, con el objetivo de buscar reactivación económica. 6. Es importante atender la intermediación financiera, considerando que la misma tiende a limitarse o restringirse en tiempos de hiperinflación. 7. El final de la hiperinflación no restablece la demanda de moneda local, por lo que las divisas será cada vez más pretendidas por los agentes económicos.\par
IV. Principales Situaciones Detectadas Producto del Proceso de Estudio Dentro de los análisis efectuados por diecisiete (17) estudiantes de Contaduría Pública, se aprecia la conexión que identifican entre los efectos de la inflación y la preparación de estados financieros sujetos a procesos de auditoria. Resaltan que la economía venezolana se ha visto seriamente afectada en los últimos años por la hiperinflación, dado que ha ocasionado un marcado deterioro de la moneda funcional, lo que obliga a las entidades a realizar cálculos que permitan llevar cifras históricas a nuevos valores reexpresados que permitan tener una mejor aproximación de una realidad que no es absoluta. Destacan que elementos tales como: la comparabilidad, la fiabilidad, la materialidad y la relevancia se ven afectadas por la hiperinflación. Su inaplicabilidad hace que la información financiera no sea útil para los usuarios, por lo que la toma de decisiones se ve seriamente afectada.\par
Los estudiantes destacaron el lapso de opacidad de la información relacionada por el Banco Central de Venezuela, lo que genera un alto nivel de incertidumbre en cuanto a la veracidad de la información publicada de forma extemporánea por el Estado. Para suplir la ausencia de información oficial, diversos entes privados se dieron a la tarea de hacer sus propias estimaciones, lo que de una u otra forma proporcionó a los usuarios de cierto nivel de información no confirmada. Es importante destacar que Por otro lado, destacaron los severos controles cambiarios y la existencia de distintos tipos de cambio. Esto ocasionó que los activos y pasivos en moneda extranjera se presentaran y revelaran en los estados financieros, utilizando tasas irreales y desfasadas, solo con el objetivo de cumplir con limitaciones gubernamentales, lo que indudablemente generó distorsiones en la información financiera imposibles de resolver a través de un proceso de auditoría. Esta situación ha generado distorsiones en la presentación de ingresos, costos y gastos y en la valuación apropiada de activos y pasivos valorados en moneda extranjera.\par
Es interesante cuando los estudiantes consideran que dichas distorsiones en los estados financieros coloca a las empresas venezolanas en desventaja frente a sus socios comerciales en el exterior, dado que no permite dar una visual clara de la situación económica puertas adentro, inhibiendo la posibilidad de hacer negocios de escala o incluso de recibir inversiones directas que tengan como objetivo apalancar las operaciones. En ese contexto, consideran que los datos contables (históricos y reexpresados) no cumplen su función de proveer de información de calidad para la toma de decisiones. El crecimiento de las organizaciones se fundamenta en su mercado natural local; sin embargo, está claro que en economías globalizadas, el éxito se asocia a la capacidad de poder extenderse a otros mercados. En ese sentido el punto aportado por los estudiantes es más que valido.\par
Otro aspecto resaltado es el hecho de para el caso venezolano, los estudiantes consideran que los análisis deben hacerse desde una perspectiva de corto plazo, dado que cualquier proyección de más de un (1) año pierde total validez para fines internos o externos. La inflación e hiperinflación dan una visión inmediata de los valores presentados. Esto está muy relacionado con el caso de los inventarios de bienes disponibles para la venta. El costo de los mismos se desconecta profundamente del precio de venta, por lo que termina existiendo una relación costo/precio de venta que puede hacer considerar que las entidades especulan, cuando realmente es un proceso natural en economías inflacionarias, relacionado principalmente con el costo de reposición.\par
Entre otros aspectos, consideraron que los eventos de reconversión, e incluso la creación de una criptomoneda también han servido para generar distorsiones en los estados financieros, dado que han protagonizado eventos inflacionarios.\par
V.
\section[{Conclusiones}]{Conclusiones}\par
Producto de la investigación llevada a cabo, de seguido se plantean las principales conclusiones con respecto a la problemática planteada:\par
1. La auditoría de estados financieros es clave en un contexto cada vez más globalizado, en el que los usuarios requieren de información debidamente validada por terceros independientes. 2. La hiperinflación genera fuertes distorsiones en cuanto al aumento de los precios de bienes y servicios de forma permanente en el tiempo. 3. Muchos países europeos sufrieron fuertes episodios de hiperinflación luego de la segunda guerra mundial. 4. Países de Suramérica también sufrieron serias distorsiones inflacionarias, producto de políticas económicas erradas. 5. Existe una fuerte relación entre la inflación y presentación de estados financieros, considerando que los valores históricos dejan de ser comparables. 6. La auditoría de estados financieros hace un examen a las cifras contables, con el objetivo de verificar el cumplimiento de los Principios de Contabilidad Generalmente Aceptados; no obstante, las distorsiones económicas no permiten que las cifras terminen siendo fiables y comparables. Siendo así, dejan de ser útiles para los usuarios de la información financiera. 7. Los estudiantes de contaduría pública consideraron los siguientes puntos, como claves al momento de evaluar la relación existente en los estados financieros, auditoría e hiperinflación: a. Se percibe una fuerte afectación de la moneda funcional de las entidades. b. Para el caso venezolano, el BCV no publicó información relacionada con la inflación de forma oportuna. En este contexto, consideran que los datos aportados pueden que no sean el reflejo de la realidad. c. Observan que los controles cambiarios y la multiplicidad de tipos cambiarios también afectó severamente la presentación de los estados financieros, haciéndolos poco fiables. Todo esto producto de obligaciones de carácter gubernamental. d. La hiperinflación y la opacidad de la información produce diferencias insalvables entre las empresas venezolanas y sus pares en el extranjero. Esto limita la posibilidad de escalar negocios e incluso de conseguir fuentes de inversión. e. La hiperinflación ocasiona la necesidad de hacer análisis de corto plazo. Es imposible llegar a conclusiones de largo plazo, con datos \begin{figure}[htbp]
\noindent\textbf{} \par
\begin{longtable}{P{0.07366666666666667\textwidth}P{0.0006296296296296296\textwidth}P{0.005037037037037037\textwidth}P{0.0012592592592592592\textwidth}P{0.005037037037037037\textwidth}P{0.0006296296296296296\textwidth}P{0.7637407407407407\textwidth}}
ganancias\tabcellsep y\tabcellsep pérdidas\tabcellsep de\tabcellsep empresas\tabcellsep y\\
\multicolumn{6}{l}{establecimientos públicos descentralizados, así}\tabcellsep de fecha 5 de Diciembre de 1973. Al respecto,\\
\multicolumn{6}{l}{como de fundaciones u otras instituciones de}\tabcellsep su Artículo 7 establece literalmente que:\\
\multicolumn{2}{l}{utilidad pública.}\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep Los servicios profesionales del Contador\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep Público serán requeridos en todos los casos en que las\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep Leyes lo exijan y muy especialmente en los siguientes:\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep 1. Para auditar o examinar libros o registros de\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep contabilidad, documentos conexos y estados\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep financieros de empresas legalmente establecidas\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep en el país, así como el dictamen sobre los mismos\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep cuando dichos documentos sirvan a fines judiciales\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep o administrativos. Asimismo será necesaria la\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep intervención de un contador público cuando los\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep mismos documentos sean requeridos a dichas\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep empresas por instituciones financieras, bancarias o\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep crediticias, en el cumplimiento de su objeto social;\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep 2. Para dictaminar sobre los balances de bancos,\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep compañías de seguros y almacenes generales de\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep depósito, así como los de cualquier sociedad,\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep cuyos títulos valores se negocien en el mercado\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep público de capital. Estos deberán ser publicados;\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep 3. Para auditar o examinar los estados financieros que\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep los institutos bancarios, compañías de seguros, así\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep como otras instituciones de créditos deben publicar\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep o presentar, de conformidad con las disposiciones\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep legales. Igualmente para dictaminar sobre dichos\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep estados financieros;\end{longtable} \par
{\small\itshape [Note: 4. Para actuar como peritos contables, en diligencias sobre exhibición de libros, juicios de rendición de cuentas o avalúo de intangibles patrimoniales; Global Journal of Management and Business Research Volume XXII Issue IV Version I Year 2022 ( ) 5.]}
\caption{\label{tab_0}}\end{figure}
\begin{figure}[htbp]
\noindent\textbf{} \par
\begin{longtable}{P{0.298828125\textwidth}P{0.265625\textwidth}P{0.285546875\textwidth}}
\tabcellsep \tabcellsep Inflación en Venezuela 2009-2019\\
\tabcellsep 140000.00\%\tabcellsep \\
\tabcellsep 120000.00\%\tabcellsep \\
\tabcellsep 100000.00\%\tabcellsep \\
\tabcellsep 80000.00\%\tabcellsep \\
Year 2022\tabcellsep 40000.00\% 60000.00\%\tabcellsep \\
\tabcellsep 20000.00\%\tabcellsep \\
Volume XXII Issue IV Version I\tabcellsep 0.00\%\tabcellsep 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019\\
(\tabcellsep \tabcellsep \\
Global Journal of Management and Business Research\tabcellsep \tabcellsep \end{longtable} \par
\caption{\label{tab_1})}\end{figure}
\footnote{© 2022 Global Journals} \footnote{( ) C © 2022 Global Journals} \backmatter \par
que pueden variar significativamente de un año a otro. f. Para el caso de los inventarios, la relación costo/precio de venta puede hacer creer que existe un alto nivel de especulación. Realmente, las entidades ajustan sus precios producto de los efectos de inflación, acercando los valores a lo que será su costo de reposición. g. Los procesos de reconversión e incorporación de criptoactivos, también son agentes hiperinflacionarios, que han perjudicado los resultados financieros de las entidades. \begin{bibitemlist}{1}
\bibitem[Espinoza and Naranjo ()]{b9}\label{b9} \textit{Auditoría financiera y guía de control financiero basada en NIIFS en la unidad académica Mario Rizzini Período comprendido enero a diciembre}, M Espinoza , N Naranjo . 2012. 2011. Universidad Politécnica Salesiana. Ecuador
\bibitem[Velásquez ()]{b25}\label{b25} \textit{Determinar la tasa de interés en activos fijos en temporada de hiperinflación}, A Velásquez . 2019. UCAB. Catedra de Auditoria y Aseguramiento II
\bibitem[Uzcátegui ()]{b23}\label{b23} \textit{Efectos de la hiperinflación en la comparabilidad de los estados financieros en Venezuela y su consideración en el dictamen de auditoría}, A Uzcátegui . 2019. UCAB. Catedra de Auditoria y Aseguramiento II
\bibitem[Peñalver ()]{b14}\label{b14} \textit{Efectos de la hiperinflación en los estados financieros de las empresas en Venezuela y su repercusión en la toma de decisiones de las entidades}, C Peñalver . 2019. UCAB. Catedra de Auditoria y Aseguramiento II
\bibitem[Pérez ()]{b15}\label{b15} \textit{Efectos de la Venezuela hiperinflacionaria en los estados financieros}, R Pérez . 2019. UCAB. Catedra de Auditoria y Aseguramiento II
\bibitem[Jaramillo ()]{b12}\label{b12} ‘Examinar la contabilidad hiperinflacionaria en Venezuela y las consecuencias por la ausencia del Índice Nacional de Precios al Consumidor’. L Jaramillo . \textit{Catedra de Auditoria y Aseguramiento II} 2019.
\bibitem[Puccini ()]{b16}\label{b16} \textit{Fijación del precio de venta en productos en temporada de hiperinflación}, M Puccini . 2019. UCAB. Catedra de Auditoria y Aseguramiento II
\bibitem[Espino (ed.) ()]{b8}\label{b8} \textit{Fundamentos de auditoría}, M Espino . Patria, S.A. de C.V. México (ed.) 2014.
\bibitem[Guevara ()]{b10}\label{b10} \textit{Hiperinflación: perspectiva histórica para Venezuela}, A Guevara . 2018.
\bibitem[Calderón ()]{b3}\label{b3} \textit{Inflación y su impacto en la lectura y análisis de estados financieros en la toma de decisiones}, K Calderón . 2015. Universidad Nacional de Córdoba. Argentina
\bibitem[Altamirano et al. ()]{b1}\label{b1} \textit{La contabilidad y auditoría: Ejes fundamentales para el control interno en las PYMES}, S Altamirano , N Avellán , M Falconí . 2018. Universidad de las Fuerzas Armadas ESPE. Ecuador
\bibitem[Rodríguez ()]{b19}\label{b19} ‘La hiperinflación en las empresas venezolanas’. J Rodríguez . \textit{Catedra de Auditoria y Aseguramiento II} 2019.
\bibitem[Marco Conceptual para la Información Financiera ()]{b11}\label{b11} \textit{Marco Conceptual para la Información Financiera}, 2018. Londres: IFRS.
\bibitem[Carrillo ()]{b5}\label{b5} \textit{Problemática de la contabilidad en la Venezuela hiperinflacionaria}, F Carrillo . 2019. Catedra de Auditoria y Aseguramiento II, UCAB
\bibitem[Rondón ()]{b20}\label{b20} \textit{Problemática de la contabilidad en la Venezuela hiperinflacionaria}, G Rondón . 2019. Catedra de Auditoria y Aseguramiento II, UCAB
\bibitem[Valderrama ()]{b24}\label{b24} \textit{Problemática de la contabilidad en la Venezuela hiperinflacionaria}, M Valderrama . 2019. Catedra de Auditoria y Aseguramiento II, UCAB
\bibitem[Aellos ()]{b0}\label{b0} \textit{Problemática de la contabilidad en la Venezuela hiperinflacionaria y su impacto en la auditoría}, M Aellos . 2019. UCAB. Catedra de Auditoria y Aseguramiento II
\bibitem[Carpio ()]{b4}\label{b4} \textit{Problemática de la contabilidad en la Venezuela hiperinflacionaria y su impacto en la auditoría}, V Carpio . 2019. UCAB. Catedra de Auditoria y Aseguramiento II
\bibitem[Berbin ()]{b2}\label{b2} \textit{Problemática de la contabilidad en la Venezuela hiperinflacionaria y su impacto en la auditoría de los estados financieros}, P Berbin . 2019. UCAB. Catedra de Auditoria y Aseguramiento II
\bibitem[España ()]{b7}\label{b7} \textit{Problemática de la contabilidad en la Venezuela hiperinflacionaria y su impacto en la auditoría de los estados financieros}, P España . 2019. UCAB. Catedra de Auditoria y Aseguramiento II
\bibitem[Sánchez ()]{b21}\label{b21} \textit{Problemática de la contabilidad en Venezuela hiperinflacionaria y su impacto en la auditoría de los estados financieros}, N Sánchez . 2019. UCAB. Catedra de Auditoria y Aseguramiento II
\bibitem[Ramírez ()]{b17}\label{b17} \textit{Problemática en la presentación del estado de resultados y sus efectos en la hiperinflación de Venezuela en la auditoría}, M Ramírez . 2019. UCAB. Catedra de Auditoria y Aseguramiento II
\bibitem[Díaz ()]{b6}\label{b6} ‘Problemática hiperinflación en Venezuela’. P Díaz . \textit{Catedra de Auditoria y Aseguramiento II} 2019.
\bibitem[Publicada en Gaceta Oficial Nº 30.273, de fecha 5 de Diciembre de ()]{b13}\label{b13} \textit{Publicada en Gaceta Oficial Nº 30.273, de fecha 5 de Diciembre de}, 1973. 1973. Ley de Ejercicio de la Contaduría Pública
\bibitem[Reinhart and Savastano ()]{b18}\label{b18} \textit{Realidades de las hiperinflaciones modernas". Finanzas y desarrollo}, C Reinhart , M Savastano . 2003. Estados Unidos.
\bibitem[Tabuenca ()]{b22}\label{b22} L Tabuenca . \textit{La hiperinflación: Análisis de casos históricos}, 2016. Universidad de Zaragoza. España
\end{bibitemlist}
\end{document}
|
https://theanarchistlibrary.org/library/anarchist-communist-group-euro-elections-an-aimless-mess.tex
|
theanarchistlibrary.org
|
CC-MAIN-2021-39
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-39/segments/1631780061350.42/warc/CC-MAIN-20210929004757-20210929034757-00097.warc.gz
| 587,927,905
| 4,335
|
\documentclass[DIV=12,%
BCOR=10mm,%
headinclude=false,%
footinclude=false,open=any,%
fontsize=11pt,%
twoside,%
paper=210mm:11in]%
{scrbook}
\usepackage[noautomatic]{imakeidx}
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{verbatim}
\usepackage[shortlabels]{enumitem}
\usepackage{tabularx}
\usepackage[normalem]{ulem}
\def\hsout{\bgroup \ULdepth=-.55ex \ULset}
% https://tex.stackexchange.com/questions/22410/strikethrough-in-section-title
% Unclear if \protect \hsout is needed. Doesn't looks so
\DeclareRobustCommand{\sout}[1]{\texorpdfstring{\hsout{#1}}{#1}}
\usepackage{wrapfig}
% avoid breakage on multiple <br><br> and avoid the next [] to be eaten
\newcommand*{\forcelinebreak}{\strut\\*{}}
\newcommand*{\hairline}{%
\bigskip%
\noindent \hrulefill%
\bigskip%
}
% reverse indentation for biblio and play
\newenvironment*{amusebiblio}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newenvironment*{amuseplay}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newcommand*{\Slash}{\slash\hspace{0pt}}
% http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\PassOptionsToPackage{hyphens}{url}\usepackage[hyperfootnotes=false,hidelinks,breaklinks=true]{hyperref}
\usepackage{bookmark}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setmainfont{LinLibertine_R.otf}[Script=Latin,%
Ligatures=TeX,%
Path=/usr/share/fonts/opentype/linux-libertine/,%
BoldFont=LinLibertine_RB.otf,%
BoldItalicFont=LinLibertine_RBI.otf,%
ItalicFont=LinLibertine_RI.otf]
\setmonofont{cmuntt.ttf}[Script=Latin,%
Ligatures=TeX,%
Scale=MatchLowercase,%
Path=/usr/share/fonts/truetype/cmu/,%
BoldFont=cmuntb.ttf,%
BoldItalicFont=cmuntx.ttf,%
ItalicFont=cmunit.ttf]
\setsansfont{cmunss.ttf}[Script=Latin,%
Ligatures=TeX,%
Scale=MatchLowercase,%
Path=/usr/share/fonts/truetype/cmu/,%
BoldFont=cmunsx.ttf,%
BoldItalicFont=cmunso.ttf,%
ItalicFont=cmunsi.ttf]
\newfontfamily\englishfont{LinLibertine_R.otf}[Script=Latin,%
Ligatures=TeX,%
Path=/usr/share/fonts/opentype/linux-libertine/,%
BoldFont=LinLibertine_RB.otf,%
BoldItalicFont=LinLibertine_RBI.otf,%
ItalicFont=LinLibertine_RI.otf]
\renewcommand*{\partpagestyle}{empty}
% global style
\pagestyle{plain}
\usepackage{indentfirst}
% remove the numbering
\setcounter{secnumdepth}{-2}
% remove labels from the captions
\renewcommand*{\captionformat}{}
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\KOMAoption{captions}{belowfigure,nooneline}
\addtokomafont{caption}{\centering}
\deffootnote[3em]{0em}{4em}{\textsuperscript{\thefootnotemark}~}
\addtokomafont{disposition}{\rmfamily}
\addtokomafont{descriptionlabel}{\rmfamily}
\frenchspacing
% avoid vertical glue
\raggedbottom
% this will generate overfull boxes, so we need to set a tolerance
% \pretolerance=1000
% pretolerance is what is accepted for a paragraph without
% hyphenation, so it makes sense to be strict here and let the user
% accept tweak the tolerance instead.
\tolerance=200
% Additional tolerance for bad paragraphs only
\setlength{\emergencystretch}{30pt}
% (try to) forbid widows/orphans
\clubpenalty=10000
\widowpenalty=10000
% given that we said footinclude=false, this should be safe
\setlength{\footskip}{2\baselineskip}
\title{Euro elections – an aimless mess}
\date{21st May 2019}
\author{Anarchist Communist Group}
\subtitle{}
% https://groups.google.com/d/topic/comp.text.tex/6fYmcVMbSbQ/discussion
\hypersetup{%
pdfencoding=auto,
pdftitle={Euro elections – an aimless mess},%
pdfauthor={Anarchist Communist Group},%
pdfsubject={},%
pdfkeywords={brexit; euro elections}%
}
\begin{document}
\begin{titlepage}
\strut\vskip 2em
\begin{center}
{\usekomafont{title}{\huge Euro elections – an aimless mess\par}}%
\vskip 1em
\vskip 2em
{\usekomafont{author}{Anarchist Communist Group\par}}%
\vskip 1.5em
\vfill
{\usekomafont{date}{21st May 2019\par}}%
\end{center}
\end{titlepage}
\cleardoublepage
\tableofcontents
% start a new right-handed page
\cleardoublepage
If you needed further convincing that our mainstream and even fringe political parties have only their own interests at heart, then join us as we take a look at the aimless mess that is the upcoming European Elections.
\section{The Big Two}
A divided Labour Party continues to struggle with internal battles between “democratic socialist” Corbynites and business friendly vaguely left leaning liberals. Both sides use Brexit, not as a way to try and help the voters they represent, but rather as a chance to weaken their internal opposition.
Local elections saw support for Labour fall as identity problems continue to confuse potential supporters of “a party with socialists in it”.
The Conservatives handling of Brexit has been seized upon by opportunists within the Party. Power struggles emerge between different strands of Toryism, from shiny polished neo-liberal politicians to those trying to play the populist card or “one nation” Tories. Needless to say that, by acting on remainers’ fears about the economic impact of Brexit, or adding fuel to the fire of those worried about immigration, Tory MP’s seek only to further their own careers and maybe get that bigger second home! Because whatever the degree of hatefulness they present to the public it will not affect them in the slightest, they will continue to live separate lives with big salaries, private health care and private education.
The divides in our biggest political parties highlight that those motivated by power can never truly represent us. They will always be lead by a desire to hold on to what they have or a chance to grab more.
What about an alternative then? From the hydra of hatred Nigel Farage and his newly spawned Brexit Party? Or UKIP, who have tried to plug the gap left by Farage’s resignation with members of the alt-right, rape apologists and islamophobes? The truth is that even with the degree of success these parties have had, (and look to achieve again with The Brexit Party presently polling highest) putting openly or more closeted racists into the European parliament to try and ensure a HARD Brexit will yield little success. After all, the European Parliament has been laughing at Farage since 2014 when he was first elected to Brussels.
But even if these problems could be resolved, elections cannot solve the problems our society faces. By handing over responsibility to power hungry politicians, we continue this real life Game of Thrones and only offer encouragement to those that feel like they deserve to rule over us. Our political system is doing exactly what it is meant to do; serve the interests of the powerful.
So what is the alternative?
The Anarchist Communist Group understands that many people vote in the hope of making a difference, with the word \emph{change} used like currency from all sides of the political debate. This desire to make a difference, were it channelled into organising in our workplaces and communities at a local and national level, could see the beginning of a society built not for profit and power but of solidarity and mutual aid. The Anarchist Communist Group calls on the working class not to strengthen the grip of the power hungry, bosses, land owners and aristocrats, but to find ways to make it harder for them, to build resistance and fight to defend what we little we have, while working to build the world that we want.
% begin final page
\clearpage
% if we are on an odd page, add another one, otherwise when imposing
% the page would be odd on an even one.
\ifthispageodd{\strut\thispagestyle{empty}\clearpage}{}
% new page for the colophon
\thispagestyle{empty}
\begin{center}
The Anarchist Library
\smallskip
Anti-Copyright
\bigskip
\includegraphics[width=0.25\textwidth]{logo-en}
\bigskip
\end{center}
\strut
\vfill
\begin{center}
Anarchist Communist Group
Euro elections – an aimless mess
21st May 2019
\bigskip
Retrieved on 2020-08-13 from https:\Slash{}\Slash{}www.anarchistcommunism.org\Slash{}2019\Slash{}05\Slash{}21\Slash{}euro-elections-an-aimless-mess\Slash{}
\bigskip
\textbf{theanarchistlibrary.org}
\end{center}
% end final page with colophon
\end{document}
% No format ID passed.
|
http://get-software.net/macros/latex209/contrib/xarticle/art8.sty
|
get-software.net
|
CC-MAIN-2015-40
|
text/x-tex
| null |
crawl-data/CC-MAIN-2015-40/segments/1443737942301.73/warc/CC-MAIN-20151001221902-00087-ip-10-137-6-227.ec2.internal.warc.gz
| 136,532,216
| 1,778
|
% art8.sty 22-Sept-90
%update by Mark Roth, 31 Dec 91 to match 15 Jun 91 art10.sty changes
%update by Mark Roth, 19 Feb 92 to match 12 Jan 92 art10.sty changes
\lineskip 1pt
\normallineskip 1pt
\def\baselinestretch{1}
\def\@normalsize{\@setsize\normalsize{9.5pt}\viiipt\@viiipt
\abovedisplayskip 6\p@ plus2\p@ minus4\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus\p@
\belowdisplayshortskip 3\p@ plus\p@ minus2\p@
\let\@listi\@listI}
\def\small{\@setsize\small{8pt}\viipt\@viipt
\abovedisplayskip 6\p@ plus2\p@ minus3\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus\p@
\belowdisplayshortskip 3\p@ plus\p@ minus2\p@
\def\@listi{\leftmargin\leftmargini
\topsep 4\p@ plus2\p@ minus2\p@\parsep 2\p@ plus\p@ minus\p@
\itemsep \parsep}}
\def\footnotesize{\@setsize\footnotesize{8pt}\vipt\@vipt
\abovedisplayskip 5\p@ plus2\p@ minus4\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus\p@
\belowdisplayshortskip 3\p@ plus\p@ minus2\p@
\def\@listi{\leftmargin\leftmargini
\topsep 2\p@ plus\p@ minus\p@\parsep 2\p@ plus\p@ minus\p@
\itemsep \parsep}}
\def\scriptsize{\@setsize\scriptsize{7pt}\vipt\@vipt}
\def\tiny{\@setsize\tiny{6pt}\vpt\@vpt}
\def\large{\@setsize\large{12pt}\xpt\@xpt}
\def\Large{\@setsize\Large{14pt}\xiipt\@xiipt}
\def\LARGE{\@setsize\LARGE{17pt}\xivpt\@xivpt}
\def\huge{\@setsize\huge{20pt}\xviipt\@xviipt}
\def\Huge{\@setsize\Huge{25pt}\xxpt\@xxpt}
\normalsize
\if@twoside
\oddsidemargin 44pt
\evensidemargin 82pt
\marginparwidth 107pt
\else
\oddsidemargin 63pt
\evensidemargin 63pt
\marginparwidth 90pt
\fi
\marginparsep 10pt
\topmargin 27pt
\headheight 12pt
\headsep 25pt
\topskip 8pt
\footskip 30pt
\textheight = 43\baselineskip
\advance\textheight by \topskip
\textwidth 345pt
\columnsep 10pt
\columnseprule 0pt
\footnotesep 6.65pt
\skip\footins 9pt plus 4pt minus 2pt
\floatsep 12pt plus 2pt minus 2pt
\textfloatsep 20pt plus 2pt minus 4pt
\intextsep 12pt plus 2pt minus 2pt
\@maxsep 20pt
\dblfloatsep 12pt plus 2pt minus 2pt
\dbltextfloatsep 20pt plus 2pt minus 4pt
\@dblmaxsep 20pt
\@fptop 0pt plus 1fil
\@fpsep 8pt plus 2fil
\@fpbot 0pt plus 1fil
\@dblfptop 0pt plus 1fil
\@dblfpsep 8pt plus 2fil
\@dblfpbot 0pt plus 1fil
\marginparpush 5pt
\parskip 0pt plus 1pt
\parindent 12pt
\partopsep 2pt plus 1pt minus 1pt
\@lowpenalty 51
\@medpenalty 151
\@highpenalty 301
\@beginparpenalty -\@lowpenalty
\@endparpenalty -\@lowpenalty
\@itempenalty -\@lowpenalty
\def\section{\@startsection {section}{1}{\z@}{-3.5ex plus-1ex minus
-.2ex}{2.3ex plus.2ex}{\reset@font\Large\bf}}
\def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus-1ex
minus-.2ex}{1.5ex plus.2ex}{\reset@font\large\bf}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus
-1ex minus-.2ex}{1.5ex plus.2ex}{\reset@font\normalsize\bf}}
\def\paragraph{\@startsection
{paragraph}{4}{\z@}{3.25ex plus1ex minus.2ex}{-1em}{\reset@font
\normalsize\bf}}
\def\subparagraph{\@startsection
{subparagraph}{4}{\parindent}{3.25ex plus1ex minus
.2ex}{-1em}{\reset@font\normalsize\bf}}
\setcounter{secnumdepth}{3}
\def\appendix{\par
\setcounter{section}{0}
\setcounter{subsection}{0}
\def\thesection{\Alph{section}}}
\leftmargini 2.5em
\leftmarginii 2.2em
\leftmarginiii 1.87em
\leftmarginiv 1.7em
\leftmarginv 1em
\leftmarginvi 1em
\leftmargin\leftmargini
\labelsep .5em
\labelwidth\leftmargini\advance\labelwidth-\labelsep
\def\@listI{\leftmargin\leftmargini \parsep 3\p@ plus2\p@ minus\p@
\topsep 7\p@ plus2\p@ minus4\p@
\itemsep 4\p@ plus2\p@ minus\p@}
\let\@listi\@listI
\@listi
\def\@listii{\leftmargin\leftmarginii
\labelwidth\leftmarginii\advance\labelwidth-\labelsep
\topsep 3.5\p@ plus2\p@ minus\p@
\parsep 2\p@ plus\p@ minus\p@
\itemsep \parsep}
\def\@listiii{\leftmargin\leftmarginiii
\labelwidth\leftmarginiii\advance\labelwidth-\labelsep
\topsep 2\p@ plus\p@ minus\p@
\parsep \z@ \partopsep \p@ plus\z@ minus\p@
\itemsep \topsep}
\def\@listiv{\leftmargin\leftmarginiv
\labelwidth\leftmarginiv\advance\labelwidth-\labelsep}
\def\@listv{\leftmargin\leftmarginv
\labelwidth\leftmarginv\advance\labelwidth-\labelsep}
\def\@listvi{\leftmargin\leftmarginvi
\labelwidth\leftmarginvi\advance\labelwidth-\labelsep}
\endinput
|
https://ctan.math.washington.edu/tex-archive/info/examples/LaTeX-Bib2/04-08-4.ltx
|
washington.edu
|
CC-MAIN-2022-27
|
text/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2022-27/segments/1656104054564.59/warc/CC-MAIN-20220702101738-20220702131738-00518.warc.gz
| 250,214,316
| 1,317
|
%%
%% Ein Beispiel der DANTE-Edition
%% Bibliografie mit LaTeX
%% 2. Auflage
%% Beispiel 04-08-4 auf Seite 171.
%% Copyright (C) 2016 Herbert Voss
%%
%% It may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% See http://www.latex-project.org/lppl.txt for details.
%%
%% ==command biber ++FILE++==
% Show page(s) 1
%%
%%
\documentclass[a5paper,ngerman,american]{exaarticle}
\pagestyle{empty}
\setlength\textwidth{352.81416pt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper,lmargin=3cm,rmargin=3cm,bmargin=10cm]{geometry}
\usepackage{babel}
\makeatletter
\providecommand\abx@macros@byothers{}
%\providecommand\lbx@bytypeeditor{}
\makeatother
\usepackage[autostyle]{csquotes}
%StartShownPreambleCommands
\usepackage[strict,babel=other,bibencoding=inputenc]{biblatex-chicago}
\bibliography{examplesA}
%StopShownPreambleCommands
\begin{document}
\ldots, die Verweise.~\parencite{shore} | \cite{averroes/bland} | F\footcite{brandt} |
\smartcite{ctan} | \cite{jaffe} | \cite{kant:kpv} | \cite{geer} | \cite{shore}
%@article: @book: @incollection: @online: @collection: @inbook: @thesis: @article:
\printbibliography
\end{document}
|
https://www.zentralblatt-math.org/matheduc/en/?id=47622&type=tex
|
zentralblatt-math.org
|
CC-MAIN-2019-30
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2019-30/segments/1563195526446.61/warc/CC-MAIN-20190720045157-20190720071157-00508.warc.gz
| 902,893,298
| 1,780
|
\input zb-basic
\input zb-matheduc
\iteman{ZMATH 2009a.00312}
\itemau{Heinrich, Frank}
\itemti{Sums of interior angles of complex star figures - courses for gifted students. (Innenwinkelsummen nicht einfacher Sternfiguren - ein Angebot zur F\"o{}rderung mathematischer Begabung.)}
\itemso{Mathematikinformation, No. 42, 40-58 (2005).}
\itemab
Zusammenfassung: Im vorliegenden Beitrag wird ein Themenkreis in der euklidischen Ebene vorgestellt, der in erster Linie Anregungen f\"ur die Arbeit mit mathematisch interessierten bzw. begabten Sch\"ulerinnen und Sch\"ulern der Jahrgangsstufen 7-10 des Gymnasiums oder ad\"aquater Schularten geben soll. Grunds\"atzlich kann F\"orderung mathematischer Begabung auf Erweiterung des mathematischen Sachwissens und/oder Vertiefung bzw. Fortentwicklung von T\"atigkeiten, die f\"ur mathematisches Arbeiten bestimmend sind, ausgerichtet werden. Mit dieser Abhandlung werden beide Richtungen verfolgt. Ankn\"upfend an traditionelle Inhalte aus der Mittelstufengeometrie wird eine den Lernenden (vermutlich) neue und unter \"asthetischen Aspekten interessante Figurenklasse in der euklidischen Ebene erschlossen. Dabei ist es zugleich Ziel, wesentliche mathematische T\"atigkeiten wie vermuten, beweisen, verallgemeinern, konkretisieren, formalisieren, klassifizieren, systematisieren und sich kreativ verhalten anzuregen. Auf die besonderen Potenzen des Themas f\"ur heuristisches Arbeiten, f\"ur eigene mathematische Entdeckungen und f\"ur das Erkennen von Beziehungen zwischen unteschiedlichen mathematischen Objekten bzw. Sachbereichen sei besonders hingewiesen. Die erfolgreiche Behandlung der Thematik setzt grundlegende Kenntnisse der Sch\"ulerinnen und Sch\"uler \"uber Vielecke, \"uber Winkelsummens\"atze im Dreieck, im Viereck und in Vielecken, \"uber Winkelbeziehungen an geschnittenen Parallelen, \"uber kongruente Figuren und \"uber Symmetrie- und Symmetrieformen in der euklidischen Ebene voraus.
\itemrv{~}
\itemcc{G43 C93 C43}
\itemut{Euclidean geometry; polygons; angles; gifted}
\itemli{}
\end
|
https://buczo.web.elte.hu/tj812d.tex
|
elte.hu
|
CC-MAIN-2023-14
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2023-14/segments/1679296948976.45/warc/CC-MAIN-20230329120545-20230329150545-00537.warc.gz
| 200,774,637
| 1,424
|
\magnification1200
\nopagenumbers
\tolerance9000
1998-99/I\par
\centerline{\bf DOKTORI ISKOLA}
\centerline{Fejezetek a Dinamikus Rendszerek Elm\'elet\'eb\H ol}
\centerline{Vizsga T\'etelek} \bigskip
1. Ism\'etl\'es: Hausdorff dimenzi\'o. $s$-halmazok, p\'elda
\"onhasonl\'o
$s$-
halmazok Hausdorff-dimenzi\'oj\'ara. Pakol\'asi dimenzi\'o. Doboz
(Box) dimenzi\'o. Pakol\'asi \'es fels\H o doboz dimenzi\'o
\"osszehasonl\' \i t\'asa.
2. T\"omeg sz\'etoszt\'asi elv. Iter\'alt f\"uggv\'enyrendszerek.
Az attraktor l\'etez\'es\'ere vonatkoz\'o t\'etel kimond\'asa.
3. IFS-ek attraktorainak k\'odol\'asa. OSC. \"Onhasonl\'o
halmazok Hausdorff dimenzi\'oj\'ara vonatkoz\'o dimenzi\'oformula
(csak kimondani).
4. Invari\'ans m\'ert\'ekek PIFS-ek attraktorain.
5. Implicit m\'odszerek I. Als\'o becsl\'es.
6. Implicit m\'odszerek II. Fels\H o becsl\'es. Alkalmaz\'as IFS-
ekre.
\def\uli{\underline{i}}
7. S\"uti v\'ag\'ok. Alapvet\H o defin\' \i ci\'ok, k\'odol\'as.
Ellenp\'elda a $c_{min}|X_{\uli}|\leq |X_{\uli,i}|$-re.
8. Korl\'atos vari\'aci\'os elv.
9. Korl\'atos torz\' \i t\'asi elv.
10. A korl\'atos torz\' \i t\'asi elv k\"ovetkezm\'enyei:
$X_{\uli}$-k k\"oz\"otti t\'avols\'aggal kapcsolatos becsl\'esek.
Kv\'azi \"onhasonl\'os\'ag. Implicit t\'etelek
alkalmazhat\'os\'aga.
11. Szubaddit\' \i v \'es szubmultiplikat\' \i v sorozatok.
12. M\'ert\'ekek gyenge konvergenci\'aja, gyenge kompakts\'ag.
13. A topologikus nyom\'as \'es a Gibbs m\'ert\'ek
l\'etez\'es\'ere vonatkoz\'o t\'etel.
14. A dimenzi\'oformula.
15. A dimenzi\'oformula k\"ovetkezm\'enyei. Invari\'ans
m\'ert\'ekek (ebb\H ol annyi amennyi az utols\'o alkalommal
lemegy): Sinai-Bowen-Ruelle oper\'ator, Invari\'ans m\'ert\'ek
l\'etez\'es\'ere vonatkoz\'o t\'etel.
\bigskip
\bigskip
A vizsg\'an k\'et t\'etelt kell
kidolgozni.
\bye
|
http://dlmf.nist.gov/36.9.E4.tex
|
nist.gov
|
CC-MAIN-2017-22
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2017-22/segments/1495463609061.61/warc/CC-MAIN-20170527210417-20170527230417-00017.warc.gz
| 129,712,234
| 701
|
\[|\mathop{\Psi_{2}\/}\nolimits\!\left(x,y\right)|^{2}=\int_{0}^{\infty}\left(%
\mathop{\Psi_{1}\/}\nolimits\!\left(\frac{4u^{3}+2uy+x}{u^{1/3}}\right)+%
\mathop{\Psi_{1}\/}\nolimits\!\left(\frac{4u^{3}+2uy-x}{u^{1/3}}\right)\right)%
\frac{\mathrm{d}u}{u^{1/3}}.\]
|
http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/hepparticles/hepparticles.tex
|
utah.edu
|
CC-MAIN-2014-49
|
application/x-tex
| null |
crawl-data/CC-MAIN-2014-49/segments/1416405325961.18/warc/CC-MAIN-20141119135525-00143-ip-10-235-23-156.ec2.internal.warc.gz
| 71,058,878
| 4,397
|
\documentclass[12pt]{article}
\usepackage{setspace}
\usepackage{a4wide}
\usepackage{xspace, amsmath}
\usepackage[maybess]{hepparticles}
\onehalfspacing
\newcommand{\hepparticles}{\texttt{hepparticles}\xspace}
\author{Andy Buckley, \texttt{[email protected]}}
\title{The \hepparticles package for \LaTeX\footnote{This document describes \hepparticles as of version 1.4}}
\begin{document}
\maketitle
\begin{abstract}
This package provides macros for typesetting high energy physics particle names
in a consistent, semantic and aesthetically pleasing manner, as well as fixing
problems with math-mode boldness problems in section titles. You may also be
interested in the \texttt{heppennames} and \texttt{hepnicenames} packages, which
use this one to provide a large set of pre-existing particle names.
\end{abstract}
\section{Motivation}
Typesetting the names of high-energy fundamental particles (and their elementary
composites) is well-defined by a set of rules:
\begin{itemize}
\item The basic particle name consists of a large Roman or Greek symbol with
optional following sub- and super-scripts.
\item Depending on convention, the symbols for particles are either italic or
upright. Using the latter convention, the symbols should be upright when
describing a specific particle; if describing a generic class of particles
they should be italicised (where possible). In italic and bold contexts the
symbols should adapt by becoming bold and italic themselves where possible.
\item Anti-particles are written with a bar on top of the main symbol (but for
aesthetic reasons the bar does not extend above the sub- and super-scripts.
\item Supersymmetric partners of Standard Model particles are written as for
anti-particles but with a tilde in place of the bar. SUSY anti-particles
(though the use of symbols to represent them is currently uncommon) may be
written with a bar above the tilde.
\item Resonant states may sport an extra resonance specifier consisting of a
value in parentheses and optinal following sub- and super-scripts. This
follows the main particle name.
\end{itemize}
Several issues arise when typesetting these particle names in standard \LaTeX{}:
for starters the requirement of sub- and super-scripts and the need to use Greek
symbols forces us into math mode. But math mode does not usually follow the
surrounding text context for boldness and italicism: this has been fixed in this
specific case by use of the \texttt{maybemath} package. Secondly, the positions
of super-scripts with overlines and tildes are affected: this is also corrected
by this package. By request, the particle typesetting conventions may be
specified as a package option.
\section{Commands}
The commands available are divided into two groups: those which provide
appropriate typeset output for a given semantic description and those which are
purely designed to implement that typesetting, several of which are exposed to
public use for convenience.
\subsection{Semantic commands}
\begin{itemize}
\item For generic particle names e.g. all positively charged leptons:\\
\texttt{$\backslash{}$HepGenParticle\{\textit{main}\}\{\textit{subscript}\}\{\textit{superscript}\}}\\
\texttt{$\backslash{}$HepGenAntiParticle\{\textit{main}\}\{\textit{subscript}\}\{\textit{superscript}\}}
\item For concrete particle names:\\
\texttt{$\backslash{}$HepParticle\{\textit{main}\}\{\textit{subscript}\}\{\textit{superscript}\}}\\
\texttt{$\backslash{}$HepAntiParticle\{\textit{main}\}\{\textit{subscript}\}\{\textit{superscript}\}}
\item For supersymmetric ``sparticles'':\\
\texttt{$\backslash{}$HepGenSusyParticle\{\textit{main}\}\{\textit{subscript}\}\{\textit{superscript}\}}\\
\texttt{$\backslash{}$HepSusyParticle\{\textit{main}\}\{\textit{subscript}\}\{\textit{superscript}\}}\\
\texttt{$\backslash{}$HepGenSusyAntiParticle\{\textit{main}\}\{\textit{subscript}\}\{\textit{superscript}\}}\\
\texttt{$\backslash{}$HepSusyAntiParticle\{\textit{main}\}\{\textit{subscript}\}\{\textit{superscript}\}}
\item For resonance specifiers (just the extra terms):\\
\texttt{$\backslash{}$HepResonanceMassTerm\{\textit{mainterm}\}\{\textit{subscript}\}\{\textit{superscript}\}}\\
\texttt{$\backslash{}$HepResonanceSpecTerm\{\textit{mainterm}\}\{\textit{subscript}\}\{\textit{superscript}\}}
\item For a full particle name and resonance specification:\\
\texttt{$\backslash{}$HepParticleResonance\{\textit{name}\}\{\textit{mass}\}\{\textit{massSub}\}\{\textit{massSup}\}}\\
\texttt{$\backslash{}$HepParticleResonanceFull\{\textit{main}\}\{\textit{sub}\}\{\textit{sup}\}\{\textit{mass}\}\{\textit{massSub}\}\{\textit{massSup}\}}\\
\texttt{$\backslash{}$HepParticleResonanceFormal\{\textit{name}\}$\backslash{}$\\\{\textit{mass}\}\{\textit{massSub}\}\{\textit{massSup}\}\{\textit{spec}\}\{\textit{specSub}\}\{\textit{specSup}\}}\\
\texttt{$\backslash{}$HepParticleResonanceFormalFull\{\textit{main}\}\{\textit{sub}\}\{\textit{sup}\}$\backslash{}$\\\{\textit{mass}\}\{\textit{massSub}\}\{\textit{massSup}\}\{\textit{spec}\}\{\textit{specSub}\}\{\textit{specSup}\}}\\
(hurrah, we hit the \TeX{} 9-argument limit!)
\item And finally, for containing processes describing particle evolution;\\
\texttt{$\backslash{}$HepProcess\{\textit{iParticles} $\backslash$HepTo \textit{fParticles}\}}\\
where \texttt{$\backslash$HepTo} is a normal \texttt{$\backslash$to} arrow
with a bit of extra space.\footnote{In fact, this space will only be added
when not compiling via PDF\TeX{}. This is due to a conflict not yet understood *sigh*.}
\end{itemize}
\noindent giving typeset particle names as follows:
\begin{itemize}
\item Normal particles: \HepParticle{B}{d}{0}, \HepAntiParticle{B}{d}{0}
\item Generic particles: \HepGenParticle{q}{d}{}, \HepGenAntiParticle{\ell}{\mu}{}
\item SUSY particles: \HepSusyParticle{\chi}{1}{}, \HepGenSusyParticle{q}{2}{}
\item Resonances: \HepParticleResonance{J\!/\psi}{1S}{}{\star}
\item Process: \HepProcess{\HepParticle{B}{d}{0} \HepTo \HepParticle{K}{}{-} \HepParticle{\pi}{}{+}}.
\end{itemize}
\subsection{Primitive commands}
A primitive command, \texttt{$\backslash{}$HepParticleStruct}, is provided for
typesetting particle-like structures with a main term and super and sub-scripts
with appropriate automatic changing of the text style into bold, italic and
upright fonts. It also accounts for most vertical spacing problems in the sub-
and super-scripts, largely due to empty script boxes. In addition, three
``styles'': the wrapper macros that apply appropriate text stylings are
available publically. The implementation of the semantic commands is built round
conditionally using these styles within the structure macro.
These macros can be used for implementing particle-like structures with custom
requirements and it's advised that you take a look at the internals of
\texttt{hepparticles.sty} if you're planning on using them.
\begin{itemize}
\item Style which only applies conditional boldness:\\
\texttt{$\backslash{}$HepNormStyle\{\textit{text}\}}
\item Style appropriate for generic particle names:\\
\texttt{$\backslash{}$HepGenStyle\{\textit{text}\}}
\item Style appropriate for concrete particle names:\\
\texttt{$\backslash{}$HepConStyle\{\textit{text}\}}
\item Particle structure:\\
\texttt{$\backslash{}$HepParticleStruct\{\textit{main}\}\{\textit{sub}\}\{\textit{sup}\}}
\end{itemize}
\section{Package options}
By request, the package now typesets particles in italic as well as upright
convention. The choice of convention can be made when the package is loaded with
the \texttt{italic} and \texttt{notitalic} options, e.g.\\
\texttt{$\backslash{}$usepackage[italic]\{hepparticles\}}.
The default mode is upright (i.e. \texttt{notitalic}).
In addition, the \texttt{forceit} option will force \emph{everything} in particle names
to be italic, even if they aren't normally italic in math mode (such as Arabic
numerals). Note that the italic font that will appear here is that used by
\texttt{$\backslash{}$mathit} and so will appear more script-like than normal
math mode. I can't say that I recommend using this option, but it's there for
flexibility's sake.
Finally, a pair of options, \texttt{maybess} and \texttt{noss}, are available:
using \texttt{maybess} will allow particle names to be typeset in sans-serif if
the surrounding context is sans-serif and \texttt{noss} has the converse effect.
Note that since there is no italic sans-serif math font in LaTeX, generic
particle names will not be typeset in italic sans font. Maybe this behaviour
will change in future if there's lots of enthusiasm for a fix. However, it looks
pretty good at the moment and I suspect most people will want sans-serif
particle names in sans documents, so \texttt{maybess} is set by default.
\section{Known problems}
Since this package messes around quite a bit with the sub- and super-scripts,
not everything you might want to do can be done. Sorry\dots
\begin{itemize}
\item To make the macros a bit ``safer'', the output is wrapped in a pair of
braces --- i.e. it's intended as a packaged unit. Hence you can't add new
indices using math mode scripting\dots this example hopefully illustrates what
I mean in that it doesn't accomplish the intended effect of placing the $i$
subscript directly underneath the \HepParticle{B}{}{} meson superscript.\\
\texttt{\$$\backslash{}$HepParticle\{B\}\{\}\{+\}\_i\$} $\quad \Rightarrow
\quad \HepParticle{B}{}{+}_i$ \\
I don't consider this a problem --- the package structures already manoeuver
the vertical positioning if the scripts so much that compliance with
externally applied indices is pretty much guaranteed not to happen. If you
want this sort of effect then you should use the
\texttt{$\backslash{}$HepParticleStruct} macro.
\item When putting particle names in sub or superscripts it's a good idea to
wrap them in braces. I'd like to be able to avoid this requirement but
wrapping everything in braces, despite removing compile errors, hasn't done
the trick of actually making the sub/sup-script work as intended. Please let
me know how to do it, should the answer spring to mind\dots
\end{itemize}
\section{Installation}
\textbf{Requirements:} You will need to be using a \LaTeXe{} system to use
\hepparticles. Hopefully this isn't a problem --- I wasn't feeling up to writing
a Plain \TeX{} version! In addition, you'll need the \texttt{maybemath} package
(get a recent version: the first release has bugs which were only discovered
when writing the 1.4 version of this package).
To install, simply copy the \texttt{hepparticles.sty} file into a location in
your \texttt{LATEXINPUTS} path. Tada!
\vspace{2cm}
\centering
\noindent Any feedback is appreciated! Email to \texttt{[email protected]}, please.
\end{document}
|
https://git.proxmox.com/?p=pve-docs.git;a=blob_plain;f=asciidoc-dblatex-custom.sty;hb=34ef065aac63f0e372510319ef4843b443c16a14
|
proxmox.com
|
CC-MAIN-2022-05
|
text/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2022-05/segments/1642320301737.47/warc/CC-MAIN-20220120100127-20220120130127-00273.warc.gz
| 328,727,433
| 1,517
|
%%
%% This style is derived from the docbook one.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{asciidoc-proxmox}[2016/10/30 AsciiDoc DocBook Style]
% this will set letterpaper, because docbook.sty honors page layout
% made by geometry package
%\usepackage[letterpaper,total={7.25in,9.25in}, top=1in]{geometry}
%\usepackage[a4paper]{geometry}
\usepackage[a4paper, left=2cm, right=1cm, top=2.5cm, bottom=2cm ]{geometry}
%% Just use the original package and pass the options.
\RequirePackageWithOptions{docbook}
% Sidebar is a boxed minipage that can contain verbatim.
% Changed shadow box to double box.
\renewenvironment{sidebar}[1][0.95\textwidth]{
\hspace{0mm}\newline%
\noindent\begin{Sbox}\begin{minipage}{#1}%
\setlength\parskip{\medskipamount}%
}{
\end{minipage}\end{Sbox}\doublebox{\TheSbox}%
}
% For DocBook literallayout elements, see `./dblatex/dblatex-readme.txt`.
\usepackage{alltt}
\definecolor{proxmoxred}{RGB}{229, 112, 0}
\definecolor{proxmoxgrey1}{RGB}{229, 229, 229}
\def\greyribbon{
\AddToShipoutPicture*{
\put(0,\LenToUnit{2.5cm}){%
{\color{proxmoxgrey1}\rule{\paperwidth}{22cm}}}
}
}
% custom cover page
\def\DBKcover{
\thispagestyle{empty}
\begin{flushright}
\includegraphics[width=0.5\textwidth]{proxmox-logo} \\
\end{flushright}
\vspace*{2.5cm}
\sffamily
\begin{center}
{\Huge \bfseries \scshape \color{proxmoxred} \DBKtitle \\[1ex]\large ~~~ \\}
{\Large \bfseries \scshape \DBKsubtitle \\[1ex]\large ~~~ \\}
{\includegraphics[width=132mm]{proxmox-ci-header} \\}
\end{center}
\vfill
\begin{flushright}
{\Large \DBKdate \\}
{\Large \bfseries \sffamily Proxmox Server Solutions Gmbh \\ \color{proxmoxred} www.proxmox.com}
\end{flushright}
\vspace*{1cm}
\greyribbon
\pagebreak[4]
}
|
https://ctan.space-pro.be/tex-archive/macros/plain/contrib/varisize/11point.tex
|
space-pro.be
|
CC-MAIN-2023-14
|
text/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2023-14/segments/1679296950247.65/warc/CC-MAIN-20230401191131-20230401221131-00297.warc.gz
| 223,067,201
| 1,383
|
%%% This file is public domain.
%%% Originally written 1992, Don Hosek.
%%% This declaration added by Clea F. Rees 2008/11/16 with the permission of Dan Hosek.
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This file sets up an eleven point environment for TeX. It can be initialized
% with the '\elevenpoint' macro.
% It also sets up a '\tenpoint' macro in case you want to go back down.
% By Don Hosek
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifx\tenpoint\undefined\let\loadedfrommacro=Y
\input 10point
\let\loadedfrommacro=N\fi
%%%
%%% Load in the fonts
%%%
\font\elevenrm=cmr10 scaled \magstephalf
\font\eleveni=cmmi10 scaled \magstephalf
\font\elevensy=cmsy10 scaled \magstephalf
\font\elevenex=cmex10 scaled \magstephalf
\font\elevenbf=cmbx10 scaled \magstephalf
\font\elevensl=cmsl10 scaled \magstephalf
\font\eleventt=cmtt10 scaled \magstephalf
\font\elevenit=cmti10 scaled \magstephalf
\font\elevencsc=cmcsc10 scaled \magstephalf
\font\eightrm=cmr8 \font\sixrm=cmr6
\font\eighti=cmmi8 \font\sixi=cmmi6
\font\eightsy=cmsy8 \font\sixsy=cmsy6
\font\eightbf=cmbx8 \font\sixbf=cmbx6
%%%
%%% Set up the elevenpoint macros
%%%
\ifx\elevenpoint\undefined
\def\elevenpoint{\def\rm{\fam0\elevenrm}% switch to 11-point type
\textfont0=\elevenrm \scriptfont0=\eightrm \scriptscriptfont0=\sixrm
\textfont1=\eleveni \scriptfont1=\eighti \scriptscriptfont1=\sixi
\textfont2=\elevensy \scriptfont2=\eightsy \scriptscriptfont2=\sixsy
\textfont3=\elevenex \scriptfont3=\elevenex\scriptscriptfont3=\elevenex
\textfont\itfam=\elevenit \def\it{\fam\itfam\elevenit}%
\textfont\slfam=\elevensl \def\sl{\fam\slfam\elevensl}%
\textfont\ttfam=\eleventt \def\tt{\fam\ttfam\eleventt}%
\textfont\bffam=\elevenbf \scriptfont\bffam=\eightbf
\scriptscriptfont\bffam=\sixbf \def\bf{\fam\bffam\elevenbf}%
\textfont\scfam=\elevencsc \def\sc{\fam\scfam\elevencsc}%
\normalbaselineskip=14pt
\setbox\strutbox=\hbox{\vrule height9pt depth4pt width0pt}%
\normalbaselines\rm}
\fi
|
https://www.zentralblatt-math.org/matheduc/en/?id=60&type=tex
|
zentralblatt-math.org
|
CC-MAIN-2019-43
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2019-43/segments/1570986648481.7/warc/CC-MAIN-20191014003258-20191014030258-00539.warc.gz
| 1,259,921,614
| 1,573
|
\input zb-basic
\input zb-matheduc
\iteman{ZMATH 06675921}
\itemau{Turgut, Melih}
\itemti{A spatial-semiotic framework in the context of information and communication technologies (ICTs).}
\itemso{Khine, Myint Swe (ed.), Visual-spatial ability in STEM education. Transforming research into practice. Cham: Springer (ISBN 978-3-319-44384-3/hbk; 978-3-319-44385-0/ebook). 173-194 (2017).}
\itemab
Summary: This chapter is devoted to the spatial thinking process in ICTs from a semiotic perspective. Initially, I review particular research (limited to geometry and mathematics education) in order to analyze and elaborate subjects' ways of spatial thinking, while they are using 3D modeling software. Thereafter, certain analyses are conducted through the perspective of learning (2D and 3D) geometry, visualization and spatial thinking frameworks, semiotics and multimodal paradigm perspectives in order to provide underpinning for a spatial-semiotic framework in the context of 3D modeling software. Thereafter, I look at two case studies on the use of 3D modeling software (in particular, SketchUp$^{\circledR}$) to evaluate the proposed framework. The data is analyzed through a semiotic lens, including different kinds of resources, not only for words, but also extra-linguistic modes of expressions and inscriptions (drawings or sketches) to relate attached signs in the use of software for the process of spatial thinking. Finally, I discuss the results to ameliorate the proposed framework.
\itemrv{~}
\itemcc{C40 U70 U50}
\itemut{spatial thinking; ICT; visualization; learning geometry; multimodal paradigm}
\itemli{doi:10.1007/978-3-319-44385-0\_9}
\end
|
https://repo.iut.ac.ir/tex-archive/fonts/plex/doc/plex-samples.tex
|
iut.ac.ir
|
CC-MAIN-2023-06
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2023-06/segments/1674764500339.37/warc/CC-MAIN-20230206113934-20230206143934-00129.warc.gz
| 520,165,286
| 1,016
|
\documentclass{article}
\usepackage[LGR,T1]{fontenc}
\usepackage[sb]{plex-sans}
\usepackage[m]{plex-serif}
\usepackage{plex-mono}
\usepackage{lipsum}
\begin{document}
\section*{Plex Serif}
\subsection*{Regular}
\lipsum[1]
\subsection*{Italic}
\textit{\lipsum[2]}
\subsection*{Bold}
\textbf{\lipsum[3]}
\subsection*{Bold Italic}
\textbf{\textit{\lipsum[4]}}
\subsection*{Numbers}
1234567890
\clearpage
\section*{Plex Sans}
\plexsans
\subsection*{Regular}
\lipsum[1]
\subsection*{Italic}
\textit{\lipsum[2]}
\subsection*{Bold}
\textbf{\lipsum[3]}
\subsection*{Bold Italic}
\textbf{\textit{\lipsum[4]}}
\subsection*{Numbers}
1234567890
\subsection*{LGR}
{\plexsanslgr\noindent
a b g d e z h j i k l m n x o p r s t u f q y w\\
A B G D E Z H J I K L M N X O P R S T U F Q Y W\\
}
\clearpage
\section*{Plex Sans Condensed}
\plexsanscondensed
\subsection*{Regular}
\lipsum[1]
\subsection*{Italic}
\textit{\lipsum[2]}
\subsection*{Bold}
\textbf{\lipsum[3]}
\subsection*{Bold Italic}
\textbf{\textit{\lipsum[4]}}
\subsection*{Numbers}
1234567890
\clearpage
\section*{Plex Mono}
\ttfamily
\subsection*{Regular}
\lipsum[1]
\subsection*{Italic}
\textit{\lipsum[2]}
\subsection*{Bold}
\textbf{\lipsum[3]}
\subsection*{Bold Italic}
\textbf{\textit{\lipsum[4]}}
\subsection*{Numbers}
1234567890
\subsection*{Mono Non-Ligatures}
Officially broken off. Often offline, find me flowerless.
\end{document}
|
http://kleine.mat.uniroma3.it/e/02-116.latex.mime
|
uniroma3.it
|
CC-MAIN-2019-18
|
application/x-latex
|
message/rfc822
|
crawl-data/CC-MAIN-2019-18/segments/1555578760477.95/warc/CC-MAIN-20190426053538-20190426075538-00194.warc.gz
| 102,499,863
| 14,941
|
Content-Type: multipart/mixed; boundary="-------------0203111140301"
This is a multi-part message in MIME format.
---------------0203111140301
Content-Type: text/plain; name="02-116.keywords"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="02-116.keywords"
Schr\"odinger operators, quasiperiodic potentials, quantum dynamics
---------------0203111140301
Content-Type: application/x-tex; name="usturmdyn.TEX"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="usturmdyn.TEX"
\documentclass{amsart}
\usepackage{amssymb}
\usepackage{latexsym}
% Standard sets
\newcommand{\Z}{{\mathbb Z}}
\newcommand{\R}{{\mathbb R}}
\newcommand{\C}{{\mathbb C}}
\newcommand{\N}{{\mathbb N}}
\newcommand{\T}{{\mathbb T}}
% Theorem environments
\newtheorem{theorem}{Theorem}
\newtheorem{remark}{Remark}
\newtheorem{lemma}{Lemma}[section]
\newtheorem{prop}[lemma]{Proposition}
\newtheorem{coro}[lemma]{Corollary}
\newtheorem{definition}[lemma]{Definition}
\sloppy
% QED Symbol
\renewcommand\qedsymbol{$\Box$}
% Standard Functions
\renewcommand{\Im}{{\rm Im}}
\renewcommand{\Re}{{\rm Re}}
\newcommand{\tr}{{\mathrm{tr}}}
% Simple list
\newcounter{smalllist}
\newenvironment{SmallList}{%
\begin{list}{\roman{smalllist})}%
{\setlength{\topsep}{0mm}\setlength{\parsep}{0mm}\setlength{\itemsep}{0mm}%
\setlength{\labelwidth}{10mm}\usecounter{smalllist}}%
}{\end{list}}
% Case Hierachy
\newenvironment{CaseHier}[1]{%
\begin{list}{}%
{\setlength{\topsep}{#1}\setlength{\parsep}{0mm}\setlength{\itemsep}{#1}%
\setlength{\labelwidth}{0mm}\setlength{\labelsep}{0mm}\setlength{\itemindent}{0mm}\setlength{\leftmargin}{0mm}}%
}{\end{list}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\title[Dynamical Upper Bounds for One-Dimensional Quasicrystals]{Dynamical Upper Bounds for One-Dimensional Quasicrystals}
\author{David Damanik}
\thanks{Research partially supported by NSF Grant DMS--0010101}
\maketitle
\vspace{0.3cm}
\noindent
Department of Mathematics 253--37, California Institute of Technology,
Pasadena, CA 91125, U.S.A.\\[2mm]
E-mail: \mbox{[email protected]}\\[3mm]
2000 AMS Subject Classification: 81Q10, 47B80, 68R15\\
Key words: Schr\"odinger operators, quasiperiodic potentials, quantum dynamics
\begin{abstract}
Following the Killip-Kiselev-Last method, we prove quantum dynamical upper bounds for discrete one-dimensional Schr\"odinger operators with Sturmian potentials. These bounds hold for sufficiently large coupling, almost every rotation number, and every phase.
\end{abstract}
\section{Introduction}
In this paper we study quantum dynamical properties of one-dimensional quasicrystals. That is, we will be concerned with the family of operators $H_{\lambda,\alpha,\theta}$ on $\ell^2(\Z)$, acting on $u \in \ell^2(\Z)$ by
\begin{equation}\label{oper}
H_{\lambda,\alpha, \theta} u(n) = u(n+1) + u(n-1) + \lambda v_{\alpha, \theta}(n) u(n).
\end{equation}
Here, $\lambda > 0$, $\alpha \in (0,1)$ is irrational, $\theta$ belongs to $ [0,1)$, and $v_{\alpha,\theta}(n)$ is given by
\begin{equation}\label{potform}
v_{\alpha,\theta}(n) = \chi_{[1-\alpha,1)}(n \alpha + \theta \mod 1).
\end{equation}
Operators of the form \eqref{oper} have been extensively studied since the early eighties. We refer the reader to \cite{d2,s2} for history and known results (``last-millennium results''). The spectral type has been found to always be purely singular continuous \cite{bist,dkl}. Moreover, in some cases the spectral measures were even found to be absolutely continuous with respect to certain Hausdorff measures \cite{d1,dkl,dl,jl2,kkl} from which one may deduce quantitative quantum dynamical lower bounds (using a general theory initiated by Guarneri \cite{g}, Combes \cite{c}, and Last \cite{l}).
We will be concerned with quantum dynamical upper bounds in the spirit of Killip, Kiselev, and Last \cite{kkl}. While there is no general method known to this date which bounds the ``fast'' part of the wavepacket time evolution from above, the authors of \cite{kkl} propose a method to at least bound the spreading of the ``slow'' part from above. They apply their method to the operator of the form \eqref{oper}, where $\lambda > 8$, $\alpha = (\sqrt{5} - 1)/2$, and $\theta = 0$. In this paper we consider the case of general $\alpha$ and $\theta$.
Before stating our main theorem, we fix some notation. Let $\delta_n$ be the element of $\ell^2(\Z)$ which is supported at $n \in \Z$ and obeys $\delta_n(n) = 1$. Given a function $\psi : \Z \rightarrow \C$ and $L > 0$, we define
\begin{equation}\label{psilnorm}
\| \psi \|_L^2 = \sum_{n = - \lfloor L \rfloor}^{\lfloor L \rfloor} | \psi (n) |^2 + (L - \lfloor L \rfloor ) \left( | \psi ( -\lfloor L \rfloor -1 ) |^2 + | \psi ( \lfloor L \rfloor + 1 ) |^2 \right).
\end{equation}
For a function $A : [0, \infty ) \rightarrow \R$, we define
$$
\langle A(t) \rangle_T = \frac{2}{T} \int_0^\infty e^{-2t/T} A(t) \, dt.
$$
Finally, for $\alpha \in (0,1)$ irrational, we consider its continued fraction expansion
\begin{equation}\label{contfrac}
\alpha = \cfrac{1}{a_1+ \cfrac{1}{a_2+ \cfrac{1}{a_3 + \cdots}}}
\end{equation}
with uniquely determined $a_k \in \N$. Let us define the associated rational approximants $p_k/q_k$ of $\alpha$ by
\begin{alignat}{3}
\label{pkdef}
p_0 &= 0, &\quad p_1 &= 1, &\quad p_k &= a_k p_{k-1} + p_{k-2},\\
\label{qkdef}
q_0 &= 1, & q_1 &= a_1, & q_k &= a_k q_{k-1} + q_{k-2}.
\end{alignat}
The rational numbers $p_k/q_k$ are known to be best approximants to $\alpha$ and, in particular, $p_k$ and $q_k$ are relatively prime. See Khinchin \cite{khin} for background on continued fraction expansions.
We let
\begin{equation}\label{edef}
\mathcal{E} = \{ \alpha \in (0,1) \mbox{ irrational} : \exists B \mbox{ such that } q_k + 1 \le B^k \, \forall k \in \N \}.
\end{equation}
It is known that $\mathcal{E}$ has full Lebesgue measure \cite{khin}.
Our main result reads as follows:
\begin{theorem}\label{main}
There are constants $C_1, C_2 > 0$ such that for every $\lambda > 20$, every $\alpha \in \mathcal{E}$, and every $\theta \in [0,1)$, we have
\begin{equation}\label{dynbound}
\left\langle \| e^{-itH_{\lambda, \alpha, \theta}} \delta_1 \|^2_{C_1 T^{p(\lambda,\alpha)}} \right\rangle_T \ge C_2
\end{equation}
for $T$ large enough {\rm (}i.e., for $T \ge T_0(\alpha,\theta)${\rm )}, where
$$
p(\lambda,\alpha) = \frac{6 \log B}{\log \left( \frac{\lambda - 8}{3} \right) }
$$
and $B$ is associated to $\alpha$ via \eqref{edef}.
\end{theorem}
\noindent\textit{Remarks.} (a) The physical interpretation of \eqref{dynbound} is the following. At any time $T \ge T_0(\theta)$, the averaged probability to find the particle in a ball of radius $C_1 T^{p(\lambda,\alpha)}$ is uniformly bounded away from zero. This gives an upper bound on the \textit{slow} part of the wavepacket time evolution.\\[1mm]
(b) Since for fixed $\alpha \in \mathcal{E}$, $p(\lambda,\alpha) \rightarrow 0$ as $\lambda \rightarrow \infty$, we see that the slow part of the wavepacket moves arbitrarily slowly if we choose large enough coupling.\\[1mm]
(c) This theorem was shown by Killip et al.\ in \cite{kkl} for the particular case $\alpha = (\sqrt{5} - 1)/2$ and $\theta = 0$. They only require $\lambda > 8$. For this particular rotation number $\alpha$, our extension to arbitrary phase $\theta$ works for the same range of $\lambda$-values.\\[1mm]
(d) Our extension to arbitrary phase $\theta$ is based on a fine analysis of the local combinatorial structure of the sequences $v_{\alpha,\theta}$ which might be of independent interest.\\[1mm]
(e) The key ingredient in our extension to almost every rotation number $\alpha$ is a recent result of Liu and Wen \cite{lw} which generalizes a paper of Raymond \cite{r} (which in turn is at the heart of the proof in \cite{kkl}) to arbitrary rotation number.\\[1mm]
(f) As in \cite{kkl}, the theorem, while stated for initial vector $\delta_1$, can be recast for other initial vectors from $\ell^2(\Z)$.\\[1mm]
(g) Alternatively, the bound \eqref{dynbound} holds for every $T$ if one allows for $\theta$-dependent $C_1$ and adjusted $p(\lambda,\alpha) = p(\lambda,\alpha,\theta)$.
\medskip
The organization of the article is as follows. In the next section, we recall important properties of the operators $H_{\lambda,\alpha,\theta}$ and in particular describe the results of Liu and Wen. In Section~3 we establish all the necessary ingredients for an application of the general method of Killip, Kiselev, and Last. Finally, in Section~4, we put everything together and prove Theorem~\ref{main}.
\section{Spectra of Periodic Approximants and a Result of Liu and Wen}
In this section we discuss the structure of the spectra of the standard periodic approximants to a given $H_{\lambda,\alpha,\theta}$ and describe recent results of Liu and Wen.
Fix $\lambda > 0$ and some irrational $\alpha \in (0,1)$. Let $(a_k)_{k \in \N}$ be the continued fraction expansion coefficents associated with $\alpha$ via \eqref{contfrac}, and let $p_k/q_k$ be the rational approximants to $\alpha$. Following \cite{bist,lw,r,s1}, we define the matrices $M_k(E) = M_k(E; \lambda,\alpha)$, for $k \ge 1$, by
\begin{equation}\label{mkdef}
M_k(E) = M(E,q_k,\lambda,\alpha,0),
\end{equation}
where, for $n \in \Z$,
\begin{equation}\label{transfer}
M(E,n,\lambda,\alpha,\theta) = \left\{ \begin{array}{cl} T(E,n,\lambda,\alpha,\theta) \times \cdots \times T(E,1,\lambda,\alpha,\theta) & \mbox{ if } n \ge 1 \\
\left( \begin{array}{cr} 1 & 0 \\ 0 & 1 \end{array} \right) & \mbox{ if } n = 0\\
T(E,n+1,\lambda,\alpha,\theta)^{-1} \times \cdots \times T(E,0,\lambda,\alpha,\theta)^{-1} & \mbox{ if } n \le -1
\end{array} \right.
\end{equation}
and, for $m \in \Z$,
\begin{equation}\label{tmdef}
T(E,m,\lambda,\alpha,\theta) = \left( \begin{array}{cr} E - \lambda v_{\alpha,\theta}(m) & -1 \\ 1 & 0 \end{array} \right).
\end{equation}
Thus, $M_k(E)$ is the standard transfer matrix associated with the operator $H_{\lambda,\alpha,\theta = 0}$ and the interval $[1,q_k]$.
For $k = -1$ and $k = 0$, we define
\begin{equation}\label{m-1def}
M_{-1}(E) = \left( \begin{array}{cr} 1 & -\lambda \\ 0 & 1 \end{array} \right) \; \mbox{ and } \; M_0(E) = \left( \begin{array}{cr} E & -1 \\ 1 & 0 \end{array} \right).
\end{equation}
Furthermore, we let
\begin{equation}\label{tkpdef}
t_{(k,p)}(E) = \tr \left( M_{k-1}(E) M_k(E)^p \right)
\end{equation}
and
\begin{equation}\label{skpdef}
\sigma_{(k,p)} = \{ E \in \R : |t_{(k,p)}(E)| \le 2 \}.
\end{equation}
The set $\sigma_{(k,p)}$ is the spectrum of a periodic Schr\"odinger operator whose transfer matrix over one period is given by $M_{k-1}(E) M_k(E)^p$. Consequently, it consists of a finite number ($= p q_k + q_{k-1}$, to be precise) of closed intervals (``bands''). In particular, the set $\sigma_{(k+1,0)}$ is the spectrum of the periodic Schr\"odinger operator $H_{\lambda, p_k/q_k,0}$ (i.e., its potential results from $\lambda v_{\alpha,0}$ by replacing $\alpha$ by the rational approximant $p_k/q_k$); compare \cite{bist}.
We recall two key results \cite{bist,r}:
\begin{equation}\label{mkrec}
M_{k+1}(E) = M_{k-1}(E) M_k(E)^{a_{k+1}},
\end{equation}
which implies $t_{(k+2,0)} = t_{(k,a_{k+1})}$, and
\begin{equation}\label{invariant}
t_{(k+1,0)}^2 + t_{(k,p)}^2 + t_{(k,p+1)}^2 - t_{(k+1,0)} t_{(k,p)} t_{(k,p+1)} = 4 + \lambda^2.
\end{equation}
We first discuss how the spectrum of $H_{\lambda,\alpha,\theta}$ is approximated by the sets $\sigma_{(k,p)}$. It is easy to see (and was noted in \cite{bist}) that the set $\sigma(H_{\lambda,\alpha,\theta})$ is independent of $\theta$, that is, there exists a compact set $\Sigma_{\lambda,\alpha} \subset \R$ such that
$$
\sigma(H_{\lambda,\alpha,\theta}) = \Sigma_{\lambda,\alpha} \; \mbox{ for every } \theta \in [0,1).
$$
Let us define the following three types of bands:
\begin{center}
\begin{tabular}{rcl}
$(k,I)$-type band & : & a band of $\sigma_{(k,1)}$ which is contained in a band of $\sigma_{(k,0)}$,\\
$(k,II)$-type band & : & a band of $\sigma_{(k+1,0)}$ which is contained in a band of $\sigma_{(k,-1)}$,\\
$(k,III)$-type band & : & a band of $\sigma_{(k+1,0)}$ which is contained in a band of $\sigma_{(k,0)}$.
\end{tabular}
\end{center}
These bands are mutually disjoint and they are called \textit{spectral generating bands of order k} by Liu and Wen. Their union is denoted by $\mathcal{G}_k$. The following was shown in \cite{lw}:
\begin{lemma}
{\rm (a)} $\Sigma_{\lambda,\alpha} = \cap_k \mathcal{G}_k$.\\
{\rm (b)} For $k > 0$, every spectral generating band of order $k+1$ is contained in some spectral generating band of order $k$.
\end{lemma}
From this lemma, we see that for every $k$, every energy in the spectrum lies in some spectral generating band of order $k$. Thus, we can assign to it a one-sided infinite sequence over the alphabet $\mathcal{A} = \{ I, II, III \}$.
Define the matrices $T_m$ by
$$
T_m = (t_m(i,j))_{i,j = 1,2,3} = \left( \begin{array}{ccc} 0 & 1 & 0 \\ a_m + 1 & 0 & a_m \\ a_m & 0 & a_m -1 \end{array} \right).
$$
An $(m-1,i)$-type band generates $t_m (i,j)$ bands of $(m,j)$ type. Moreover, every spectral generating band of order $k$ is associated with a unique word $i_0 i_1 \ldots i_k \in \mathcal{A}^{k+1}$, called its \textit{type index}.
A central result of \cite{lw}, whose proof makes critical use of \eqref{mkrec} and \eqref{invariant}, establishes lower bounds for the derivative with respect to the energy of the trace function $t_{(k,p)}$ for energies from spectral generating bands. To formulate this result, we need the following sequence of matrices:
\begin{equation}\label{pkmatdef}
P_m = (p_m(i,j))_{i,j = 1,2,3} = \left( \begin{array}{ccc} 0 & t_\lambda^{-(a_m - 1)} & 0 \\ a_m/t_\lambda & 0 & a_m/t_\lambda \\ a_m/t_\lambda & 0 & a_m/t_\lambda \end{array} \right),
\end{equation}
where
$$
t_\lambda = \frac{3}{\lambda - 8}.
$$
Then, Liu and Wen prove the following result (essentially Proposition~5 of \cite{lw}; the explicit estimate appears in the proof of this proposition).
\begin{prop}\label{lwthm}
Let $\lambda > 20$. For every spectral generating band $B$ with type index $i_0 i_1 \ldots i_k$, we have for every $E \in B$,
$$
|T'(E)| \ge p_1(i_0,i_1) p_2(i_1,i_2) \cdots p_k(i_{k-1},i_k),
$$
where $T$ is the appropriate trace function {\rm (}i.e., $t_{(k,p)}$ if $B$ is a band of $\sigma_{(k,p)}${\rm )}.
\end{prop}
We now put the above result in a form suitable for our purpose. Denote, for $k \in \N$,
\begin{equation}\label{agtone}
A_k = \Pi_{i=1}^k a_i \ge 1
\end{equation}
and
$$
x_k(E) = t_{(k+1,0)}(E) \; \mbox{ and } \; \sigma_k = \sigma_{(k+1,0)}.
$$
Then we have (cf.\ \cite{bist})
\begin{equation}\label{spectrumrep}
\Sigma_{\lambda,\alpha} = \bigcap_{k \in \N} (\sigma_k \cup \sigma_{k+1})
\end{equation}
and the following result for $x'(E)$:
\begin{prop}\label{lwcor}
Let $\lambda > 20$. Then for every $k \in \N$ and every $E \in \sigma_k$, we have
$$
|x_k'(E)| \ge A_k \xi(\lambda)^{k-1},
$$
where
$$
\xi(\lambda) = \left( \frac{\lambda - 8}{3} \right)^{1/2}.
$$
\end{prop}
\begin{proof}
This is an immediate consequence of the results above. We note that every band of $\sigma_k$ is either a $(k,II)$-type band or a $(k,III)$-type band and hence generating. Moreover, we see from the specific form of the matrices $P_m$ in \eqref{pkmatdef} that we pick up a factor $(\lambda - 8)/3$ in at least every other step. Finally, for $\lambda > 20$, we have
$$
t_{\lambda}^{-(a_m - 1)} \ge a_m
$$
and we therefore pick up a factor $a_m$ in every step.
\end{proof}
\section{Bounds on Transfer Matrices and Variation of the Phase}
In this section we establish the input to KKL theory, which will then be used to prove Theorem~\ref{main} in the next section. Namely, we will study derivatives of traces of transfer matrices with respect to the energy, and we will then prove lower bounds for averaged transfer matrix norms. Our approach is combinatorial in nature. Namely, we will use the partition approach to Sturmian sequences, as developed in \cite{dl1}, to study the local structure of the sequences $v_{\alpha,\theta}$ for general $\alpha,\theta$. In particular, we will exhibit plenty of occurrences of words conjugate to words whose associated trace derivatives we can control, thanks to Propositions~\ref{lwthm} and \ref{lwcor}, which is crucial since the trace is invariant with respect to cyclic permutation. This will then allow us to use the results of Section~2 to study the issues at hand.
Let $M(E,n,\lambda,\alpha,\theta)$ be the transfer matrix as defined in \eqref{transfer}. We denote, for $L \ge 1$,
$$
\|M(E,\lambda,\alpha,\theta)\|_L^2 = \sum_{n=1}^{\lfloor L \rfloor - 1} \|M(E,n,\lambda,\alpha,\theta)\|^2 + ( L - \lfloor L \rfloor ) \|M(E, \lfloor L \rfloor,\lambda,\alpha,\theta)\|^2,
$$
where $\|M(E,n,\lambda,\alpha,\theta)\|$ is the usual operator norm of the matrix $M(E,n,\lambda,\alpha,\theta)$. While this notation conflicts somewhat with the definition in \eqref{psilnorm}, it is standard (and was used in \cite{kkl} and previous works). We hope that this does not lead to any real confusion.
As shown in \cite{kkl} (using a formula from \cite{toda}), we have the following estimate of this quantity in terms of the derivative of the trace:
\begin{equation}\label{keyestimate}
\frac{\partial}{\partial E} ( \tr M(E,L,\lambda,\alpha,\theta) ) \le 4 \|M(E,\lambda,\alpha,\theta)\|^3_{L+1}.
\end{equation}
Thus, combining this estimate with the result given in Proposition~\ref{lwthm} (resp., Proposition~\ref{lwcor}), we obtain lower bounds on $\|M(E,\lambda,\alpha,\theta)\|_L$ for energies in spectral generating bands (for suitable $L$ and, at this point, $\theta = 0$).
The quantity $\|M(E,\lambda,\alpha,\theta)\|_L$ for $L \le 0$ is defined analogously. Clearly, an estimate similar to \eqref{keyestimate} holds.
Our immediate goal is to study the trace of $M(E,n,\lambda,\alpha,\theta)$ for general $\theta$. To this end, we analyze the local structure of the sequences $v_{\alpha,\theta}$. We show in particular that the traces of the transfer matrices over intervals of length $q_k$ exhibit a rather strong invariance property with respect to a variation of the phase.
Let us first recall some combinatorial notions. As general references, we want to mention \cite{loth1,loth2}. Let $A$ be a finite set, called the alphabet, and denote by $A^*,A^\N,A^\Z$ the set of finite, one-sided infinite, and two-sided infinite words over $A$, respectively. A word $v$ is called a subword (or factor) of some word $u$ if there are words $w_1,w_2$ (possibly empty) such that $u = w_1 v w_2$. If $w = w_1 \ldots w_m$ with $w_i \in A$, then the word $w^R = w_m \ldots w_1$ is called the reversal of $w$. A word $w$ with $w = w^R$ is called a palindrome. If a word $w$ can be written as $w = uv$ with words $u,v$, we call $u$ a prefix of $w$ and $v$ a suffix of $w$. Two words $w_1,w_2$ are said to be conjugate if there are words $u,v$ such that $w_1 = uv$ and $w_2 = vu$. This is equivalent to $w_2$ being equal to a cyclic permutation of $w_1$. Given any word $w$, we denote by $P_w$ the set of its finite subwords, and by $P_w(n)$ the set of its finite subwords of length $n$, $n \in \N$. Write $p_w(n)$ for the cardinality of $P_w(n)$; the function $p_w : \N \rightarrow \N$ is called the complexity function associated with $w$. If the word $w$ is infinite and uniformly recurrent (i.e., each of its finite subwords occurs infinitely often and with bounded gaps), we define the hull associated with $w$ by $\Omega_w = \{ s \in A^\Z : P_s = P_w \}$.
In our concrete setting, the alphabet will be given by $A = \{0,1\}$ and the word $w$ will be given by the restriction of $v_{\alpha,0}$ to $\N$, that is,
$$
w = v_{\alpha,0} (1) v_{\alpha,0} (2) v_{\alpha,0} (3) \ldots \in \{0,1\}^\N.
$$
The word $w$ is called a characteristic Sturmian sequence and its combinatorial properties have been studied extensively. For example, it is well known that its complexity function is given by
\begin{equation}\label{complex}
p_w (n) = n+1 \mbox{ for every } n.
\end{equation}
This implies that for every $n$, $P_w(n)$ contains exactly one word which has two extensions to the right to form a word in $P_w(n+1)$; every other word extends uniquely to the right. This special word, let us denote it by $r_n$, is called the right-special factor of $w$ of length $n$ and, for later use, we note the following (Proposition~2.1.23 of \cite{loth2}):
\begin{equation}\label{rightspecial}
r_n = v_{\alpha,0} (n) \ldots v_{\alpha,0} (1).
\end{equation}
That is, the set of right-special factors of $w$ coincides with the set of reversals of its prefixes. Also for later use, we note that it follows from Proposition~4.5 of \cite{b2} that
\begin{equation}\label{palindrome}
\mbox{For every } k \in \N, \; v_{\alpha,0} (1) \ldots v_{\alpha,0} (q_k - 2) \mbox{ is a palindrome.}
\end{equation}
Moreover, it is also well known that $w$ is uniformly recurrent and that for every $\theta$, we have $v_{\alpha,\theta} \in \Omega_w$. In particular, we have
\begin{equation}\label{samewords}
P_{v_{\alpha,\theta}} = P_w \mbox{ for every } \theta.
\end{equation}
Our goal is to study the sets $P_w(q_k)$, $k \in \N$. One element of $P_w(q_k)$ is certainly given by the prefix $s_k$ of $w$ of length $q_k$. As is well known, the words $s_k$, $k \in \N$ obey recursive relations. Since this fact is crucial to our proof, we recall this result briefly:
\begin{equation}\label{skrec}
s_0 = 0, \; s_1 = 0^{a_1 - 1} 1, \; s_k = s_{k-1}^{a_k} s_{k-2} \mbox{ for } k \ge 2.
\end{equation}
Note that this is where \eqref{mkrec} comes from.
Our first observation is very simple:
\begin{lemma}\label{lastsymb}
For $k \ge 2$, the word $s_k$ has suffix $10$ if $k$ is even and it has suffix $01$ if $k$ is odd.
\end{lemma}
\begin{proof}
This follows immediately from the recursion \eqref{skrec}.
\end{proof}
Define $\overline{\cdot} : A \rightarrow A$ by $\overline{0} = 1$, $\overline{1} = 0$. Our next goal is to list all elements of $P_w(q_k)$ explicitly. Write $s_k = s_k^{(1)} \ldots s_k^{(q_k)}$ with $s_k^{(i)} \in A$, $1 \le i \le q_k$.
\begin{lemma}\label{list}
For every $k \ge 0$, the $q_k + 1$ elements of $P_w(F_k)$ are given by
\begin{itemize}
\item The $q_k$ cyclic permutations of $s_k$ which are mutually distinct, and
\item the word $\overline{s_k^{(q_k)}} s_k^{(1)} \ldots s_k^{(q_k - 1)}$.
\end{itemize}
\end{lemma}
\begin{proof}
As a preliminary remark, we note that it follows from \eqref{skrec} that $w$ contains the factor $s_{k-1} s_k s_k$, for every $k \ge 1$. Namely, for $k \ge 1$, $w$ has the prefix
\begin{eqnarray*}
s_{k+3} & = & s_{k+2}^{a_{k+3}} s_{k+1}\\
& = & \left( s_{k+1}^{a_{k+2}} s_k \right)^{a_{k+3}} s_k^{a_{k+1}} s_{k-1}\\
& = & \left( \left( s_k^{a_{k+1}} s_{k-1} \right)^{a_{k+2}} s_k \right)^{a_{k+3}} s_k^{a_{k+1}} s_{k-1},
\end{eqnarray*}
which contains the factor $s_{k-1} s_k s_k$.
First of all, the claim of the proposition can be verified easily for $k = 0$ and $k = 1$. We therefore consider the case $k \ge 2$ and write $a$ for the rightmost symbol of $s_k$. Then, using Lemma~\ref{lastsymb}, we have the following structure somewhere in $w$:
$$
\begin{array}{ccc}
s_{k-1} & s_k & s_k \\
\fbox{\hspace{1cm} $| \, \overline{a}$} & \fbox{\hspace{1.6cm} $| \, a$} &\fbox{\hspace{1.6cm} $| \, a$}
\end{array}
$$
In particular, all the words listed in the assertion of the lemma belong to $P_w(q_k)$. Finally, to conclude the proof all we have to show is that the $q_k$ cyclic permutations of $s_k$ are mutually distinct because by \eqref{complex} there are only $q_k + 1$ words in $P_w(q_k)$ and the list contains $q_k + 1$ words which are mutually distinct. Define, for $k \ge 0$, the height $h(s_k)$ of $s_k$ by $h(s_k) = $ number of $1$'s in $s_k$. It follows from the definition, \eqref{pkdef}, and \eqref{skrec} that $h(s_k) = p_k$. Since $p_k$ and $q_k$ are relatively prime for every $k \ge 0$, we get that for $k \ge 0$, $h(s_k)$ and $|s_k|$ are relatively prime. This implies that the cyclic permutations of $s_k$ are mutually distinct, for otherwise $s_k$ could be written as a power of some shorter word, contradicting the above observation.
\end{proof}
We see that there is only one word $b_k$ in $P_w(q_k)$ which is not a cyclic permutation of $s_k$ and it can be described explicitly. In particular, it follows from Lemma~\ref{lastsymb} and Lemma~\ref{list} that the following holds:
\begin{equation}\label{firstsym}
\mbox{The leftmost symbol of $b_k$ is } \left\{ \begin{array}{ll} 1 & \mbox{if $k$ is even,} \\ 0 & \mbox{if $k$ is odd,} \end{array} \right.
\end{equation}
and
\begin{equation}\label{lastsym}
\mbox{The rightmost symbol of $b_k$ is } \left\{ \begin{array}{ll} 1 & \mbox{if $k$ is even,} \\ 0 & \mbox{if $k$ is odd.} \end{array} \right.
\end{equation}
Denote by $s_k^\theta$ the word $v_{\alpha,\theta} (1) v_{\alpha,\theta} (2) \ldots v_{\alpha,\theta} (q_k)$ and by $t_k^\theta$ the word $v_{\alpha,\theta} (-q_k + 1) v_{\alpha,\theta} (-q_k + 2) \ldots v_{\alpha,\theta} (0)$. We can now state the following combinatorial result:
\begin{prop}\label{cyclic}
For every $\theta$, we have that $s_k^\theta$ is a cyclic permutation of $s_k$ for all $k$ odd or for all $k$ even. The same statement is true for $t_k^\theta$.
\end{prop}
\begin{proof}
Fix $\theta$. If $v_{\alpha,\theta} (1) = 0$, then by \eqref{firstsym}, $s_k^\theta$ is conjugate to $s_k$ for all $k$ odd. Similarly, if $v_{\alpha,\theta} (1) = 1$, then by \eqref{firstsym}, $s_k^\theta$ is conjugate to $s_k$ for all $k$ even. A completely analogous argument, using \eqref{lastsym}, yields the claim for $t_k^\theta$.
\end{proof}
This has the following immediate consequence for the traces of the transfer matrices. Let
$$
x_k(E,\lambda,\alpha,\theta) = \tr M(E,q_k,\lambda,\alpha,\theta).
$$
\begin{prop}\label{traceequalities}
For every $\lambda,\theta$, we have that
\begin{equation}\label{traceeq}
x_k(E,\lambda,\alpha,\theta) = x_k(E,\lambda,\alpha,0) \mbox{ for every } E \in \R
\end{equation}
holds for all $k$ odd or for all $k$ even. In particular,
\begin{equation}\label{deriveq}
\frac{\partial}{\partial E} x_k(E,\lambda,\alpha,\theta) = \frac{\partial}{\partial E} x_k(E,\lambda,\alpha,0) \mbox{ for every } E \in \R
\end{equation}
holds for all $k$ odd or for all $k$ even.
\end{prop}
\begin{proof}
This follows from Proposition~\ref{cyclic} and the invariance of the trace of a product with respect to a cyclic permutation of the factors.
\end{proof}
Similarly, we have the following result on the left half-line. Let
$$
y_k (E,\lambda,\alpha,\theta) = \tr M(E,-q_k,\lambda,\alpha,\theta).
$$
\begin{prop}\label{traceequalities2}
For every $\lambda,\alpha,\theta$, we have that
\begin{equation}\label{traceeq2}
y_k(E,\lambda,\alpha,\theta) = x_k(E,\lambda,\alpha,0) \mbox{ for every } E \in \R
\end{equation}
holds for all $k$ odd or for all $k$ even. In particular,
\begin{equation}\label{deriveq2}
\frac{\partial}{\partial E} y_k(E,\lambda,\alpha,\theta) = \frac{\partial}{\partial E} x_k(E,\lambda,\alpha,0) \mbox{ for every } E \in \R
\end{equation}
holds for all $k$ odd or for all $k$ even.
\end{prop}
\begin{proof}
We have
\begin{eqnarray*}
y_k (E,\lambda,\alpha,\theta) & = & \tr M(-q_k,E,\lambda,\alpha,\theta)\\
& = & \tr \left( T(-q_k + 1,E,\lambda,\alpha,\theta)^{-1} \times \cdots \times T(0,E,\lambda,\alpha,\theta)^{-1} \right)\\
& = & \tr \left( T(0,E,\lambda,\alpha,\theta) \times \cdots \times T(-q_k+1,E,\lambda,\alpha, \theta) \right),
\end{eqnarray*}
where in the last step we have used that the determinant is one and hence the trace is invariant with respect to inverting the matrix. By Proposition~\ref{cyclic} and invariance of the trace with respect to cyclic permutations, for all even $k$ or for all odd $k$, the right-hand side is equal to $x_k(E,\lambda,\alpha,0)$ for all $E$.
\end{proof}
For some fixed $\theta$, these results determine the traces $x_k(\theta)$ and $y_k(\theta)$ in terms of $x_k$ for one-half of the possible values of $k$, which leaves us with the question of how to investigate the other half. While it is certainly not true that for every $\theta$ and every $k$, $x_k(\theta)$ and $x_k$ are equal as functions of $E$, we will show that this is true at least for $k$ large enough and all but one $\theta$.
To this end, we will employ another combinatorial consideration which is based on the partitions of the sequences $v_{\alpha,\theta}$ introduced by D.~Lenz and the author in \cite{dl1}.
\begin{definition}
\rm
Let $k \in \N_0$ be given. A $(k,\alpha)$-partition of a function $f:\Z \rightarrow \{0,1\}$ is a sequence of pairs $(I_j, z_j)$, $j\in\Z$ such that:
\begin{itemize}
\item the sets $I_j \subset \Z$ partition $\Z$;
\item $1 \in I_0$;
\item each block $z_j$ belongs to $\{s_k,s_{k-1}\}$; and
\item the restriction of $f$ to $I_j$ is $z_j$. That is, $f_{d_j} f_{d_j +1} \ldots f_{d_{j+1}-1} = z_j$.
\end{itemize}
Notice that $d_j$ is defined implicitly to be the left-hand endpoint of the interval $I_j$.
\end{definition}
We will suppress the dependence on $\alpha$ if it is understood to which $\alpha$ we refer. In particular, we will write $k$-partition instead of $(k,\alpha)$-partition. The sequences $v_{\alpha,\theta}$ have a unique decomposition property which is given in the following lemma (Lemma~3.2.(b) of \cite{dl1}).
\begin{lemma}\label{partition-lemma}
For every $k \in \N_0$, every irrational $\alpha \in (0,1)$, and every $\theta \in [0,1)$, there exists a unique $k$-partition $(I_j,z_j)$ of $v_{\alpha,\theta}$.
\end{lemma}
Using this partition lemma, we can now continue our study of the local structure of a given $v_{\alpha,\theta}$. Recall that $b_k$ denotes the unique word in $P_w(q_k)$ which is not conjugate to $s_k$. As a preliminary result, we show in the following lemma that $b_k$ can occur in $v_{\alpha,\theta}$ only at canonical positions relative to the $k$-partition of $v_{\alpha,\theta}$. Namely, whenever the $k$-partition yields the occurrence of some $s_{k-1}$ block followed by some $s_k$ block, we saw above that we get an occurrence of $b_k$. The following lemma says that these are the \textit{only} occurrences of $b_k$ in $v_{\alpha,\theta}$.
\begin{lemma}\label{synchron}
Let $\alpha \in (0,1)$ be irrational and let $\theta \in [0,1)$. If
$$
v_{\alpha,\theta}(m) \ldots v_{\alpha,\theta}(m + q_k - 1) = b_k
$$
for some $m \in \Z$, then $[m+1,m+q_k]$ is an interval $I_j$ belonging to the $k$-partition of $v_{\alpha,\theta}$. In particular, for every occurrence of $b_k$ in $v_{\alpha,\theta}$, we have the following local structure:
\begin{eqnarray*}
& \fbox{\rule{0cm}{2.1mm}\hspace{5mm}$s_{k-1}$\hspace{5mm}} \; \fbox{\rule[-0.9mm]{0cm}{3mm}\hspace{2cm}$s_{k}$\hspace{2cm}} & \; \; \mbox{ {\rm (}blocks of $k$-partition{\rm )}}\\
& \hspace{15mm} \fbox{\hspace{21mm}$b_k$\hspace{20mm}} & \; \; \mbox{ {\rm (}relative position of $b_k${\rm )}}
\end{eqnarray*}
\end{lemma}
\begin{proof}
Recall that it follows from \eqref{complex} that there is exactly one factor of length $q_k - 1$ which does not have a unique extension to the right to a factor of length $q_k$, and it follows from \eqref{rightspecial} and \eqref{palindrome} that this factor is different from $v_{\alpha,\theta}(m+1) \ldots v_{\alpha,\theta}(m + q_k - 1)$. Thus this factor extends uniquely to the right, and we necessarily have $v_{\alpha,\theta}(m) \ldots v_{\alpha,\theta}(m + q_k) = s_k$. Now we can apply Lemma~3.3 of \cite{dl2} which says that this occurrence of $s_k$ must correspond to one from the $k$-partition. That this $s_k$ block must be preceded by an $s_{k-1}$ block in the $k$-partition is forced by $v_{\alpha,\theta} (m)$ being equal to the first letter of $b_k$.
\end{proof}
\begin{prop}
Let $\alpha \in (0,1)$ be irrational and let $\theta \in [0,1)$. If $\theta \not= 1 - \alpha$, we have
\begin{equation}\label{traceeqglob}
x_k(E,\lambda,\alpha,\theta) = x_k(E,\lambda,\alpha,0) \mbox{ for every } E \in \R, \, k \ge k_0(\theta)
\end{equation}
and
\begin{equation}\label{traceeqglob2}
y_k(E,\lambda,\alpha,\theta) = x_k(E,\lambda,\alpha,0) \mbox{ for every } E \in \R, \, k \ge k_1(\theta).
\end{equation}
As before, this gives \eqref{deriveq} and \eqref{deriveq2} for the respective $k$-ranges.
\end{prop}
\begin{proof}
Assume first that \eqref{traceeqglob} fails. Our goal is to show
\begin{equation}\label{badphase}
\theta = 1 - \alpha.
\end{equation}
Fix some $k$ and consider the $k$-partition of $v_{\alpha,\theta}$. If $s_k^{\theta}$ is conjugate to $s_k$, we have $x_k(E,\lambda,\alpha,\theta) = x_k(E,\lambda,\alpha,0)$ for every $E \in \R$. Conversely, if $s_k^{\theta}$ is not conjugate to $s_k$, then it follows from Lemma~\ref{synchron} that we must have the following situation:
\begin{equation}\label{badpic}
\begin{array}{rl}
\fbox{\rule{0cm}{2.1mm}\hspace{5mm}$s_{k-1}$\hspace{5mm}} & \fbox{\rule[-0.9mm]{0cm}{3mm}\hspace{2cm}$s_k$\hspace{2cm}} \\
\ldots 1 & 2 \ldots
\end{array}
\end{equation}
That is, the site $1$ is the right endpoint of $I_0$. If \eqref{traceeqglob} fails, then we have the situation depicted in \eqref{badpic} for infinitely many values of $k$. In other words, $v_{\alpha,\theta}$ restricted to $[2,\infty)$ coincides with $v_{\alpha,0}$ restricted to $[1,\infty)$ because as a one-sided infinite word, it has infinitely many $s_k$'s as prefixes. Since the phase $\theta$ can be recovered uniquely from $v_{\alpha,\theta}$ restricted to a half-line (and $v_{\alpha,1 - \alpha}$ restricted to $[2,\infty)$ coincides with $v_{\alpha,0}$ restricted to $[1,\infty)$), we obtain \eqref{badphase}.\\[1mm]
Assume now that \eqref{traceeqglob2} fails. By Lemma~\ref{synchron}, we have the following situation for infinitely many values of $k$:
\begin{equation}\label{badpic2}
\begin{array}{rrl}
\fbox{\rule{0cm}{2.1mm}\hspace{4mm}$s_{k-1}$\hspace{4mm}} & \fbox{\rule[-0.9mm]{0cm}{3mm}\hspace{17mm}$s_k$\hspace{17mm}} & \fbox{\rule{0cm}{2.1mm}\hspace{12mm}$s_{k-1}$ or $s_k$\hspace{12mm}} \\
\ldots -q_k + 1 & \ldots 0 1 & 2 \ldots
\end{array}
\end{equation}
Again, the site $1$ is the right endpoint of $I_0$ and we conclude as above that \eqref{badphase} holds.
\end{proof}
Next, we provide power-law lower bounds for $\|M(E,\lambda,\alpha,\theta)\|_L$ for $\lambda > 20$ and $\alpha \in \mathcal{E}$. This will be achieved using \eqref{keyestimate} and the results from the preceding section.
\begin{prop}
Let $\lambda > 20$ and $\alpha \in \mathcal{E}$. Then there exist constants $C , \zeta > 0$ such that for every $\theta \in [0,1)$ and every $E \in \Sigma_{\lambda,\alpha}$, we have
\begin{equation}\label{tmlowerb}
\|M(E,\lambda,\alpha,\theta)\|_L \ge C |L|^\zeta \; \mbox{ for } |L| \ge L_0(\theta).
\end{equation}
\end{prop}
\begin{proof}
For each $\alpha \in \mathcal{E}$, there is a constant $B$ such that the associated sequence $(q_k)_{k \in \N}$ obeys
\begin{equation}\label{expobound}
q_k + 1 \le B^k \; \mbox{ for every } k \in \N.
\end{equation}
Now let $\lambda > 20$, $\theta \in [0,1) \setminus \{ 1 - \alpha \}$, and $k \in \N$ such that
\begin{equation}\label{klarge}
k \ge \max \{ k_0(\theta), k_1(\theta) \},
\end{equation}
with $k_0(\theta)$ and $k_1(\theta)$ from \eqref{traceeqglob} and \eqref{traceeqglob2}. Let $E \in \Sigma_{\lambda,\alpha}$. Then, by \eqref{spectrumrep}, $E \in \sigma_k \cup \sigma_{k+1}$. Hence, by Proposition~\ref{lwcor}, we have either
$$
\frac{\partial}{\partial E} x_k(E,\lambda,\alpha,0) \ge A_k \xi(\lambda)^{k-1}
$$
or
$$
\frac{\partial}{\partial E} x_{k+1}(E,\lambda,\alpha,0) \ge A_{k+1} \xi(\lambda)^{k}.
$$
In either case, by \eqref{agtone}, \eqref{keyestimate}, and \eqref{traceeqglob} (yielding \eqref{deriveq}), we obtain
$$
4 \|M(E,\lambda,\alpha,\theta)\|_{q_{k+1}+1}^3 \ge \xi(\lambda)^{k-1}.
$$
Thus, if we consider $q_{k+1} + 1 \le L \le q_{k+2} + 1$ for $k$ obeying \eqref{klarge}, we get
\begin{eqnarray*}
\|M(E,\lambda,\alpha,\theta)\|_L & \ge & \|M(E,\lambda,\alpha,\theta)\|_{q_{k+1} + 1}\\
& \ge & \left( \frac{1}{4} \xi(\lambda)^{k-1} \right)^{1/3}\\
& \ge & C B^{\zeta (k+2)} \\
& \ge & C (q_{k+2} + 1)^\zeta\\
& \ge & C L^\zeta,
\end{eqnarray*}
with $B$ from \eqref{expobound} and, essentially,
$$
C = \frac{1}{4^{1/3}} \; \mbox{ and } \; \zeta = \frac{\log \xi(\lambda)}{3 \log B}
$$
(more precisely, $\zeta = \frac{\tilde{k} - 1}{\tilde{k} + 2} \cdot \frac{\log \xi(\lambda)}{3 \log B}$ with $\tilde{k} = \max \{ k_0(\theta), k_1(\theta) \}$, and we obtain an exponent $\zeta$ which is arbitrarily close to $\frac{\log \xi(\lambda)}{3 \log B}$ if we increase $\tilde{k}$ suitably).
A completely analogous proof, using \eqref{traceeqglob2} (yielding \eqref{deriveq2}), proves the claimed bound for negative $L$.
We are left with the exceptional case $\theta = 1 - \alpha$. Since $v_{\alpha,1-\alpha}$ is obtained from the sequence $v_{\alpha,0}$ by a unit shift to the right, there is a constant $C$, depending only on $\lambda$, such that for every $n \ge 1$, every $E \in \Sigma_{\lambda,\alpha}$, we have
\begin{align*}
\|M(&E,n,\lambda,\alpha,1-\alpha)\| = \\
& = \| T(E,n,\lambda,\alpha,1 - \alpha) \times \cdots \times T(E,1,\lambda,\alpha,1 - \alpha) \| \\
& = \| T(E,n-1,\lambda,\alpha,0) \times \cdots \times T(E,0,\lambda,\alpha,0) \| \\
& = \left\| T(E,n,\lambda,\alpha,0)^{-1} ( T(E,n,\lambda,\alpha,0) \times \cdots \times T(E,1,\lambda,\alpha,1) ) T(E,0,\lambda,\alpha,0) \right\| \\
& \ge \| T(E,n,\lambda,\alpha,0) \|^{-1} \cdot \| M(E,n,\lambda,\alpha,0) \| \cdot \| T(E,1,\lambda,\alpha,0)^{-1} \|^{-1} \\
& \ge C \|M(E,n,\lambda,\alpha,0)\|,
\end{align*}
and a similar inequality for $n \le 0$. This permits us to deduce \eqref{tmlowerb} for $\theta = 1 - \alpha$ from \eqref{tmlowerb} for $\theta = 0$ with the constant adjusted accordingly.
\end{proof}
\section{Application of KKL Theory}
In this section we prove Theorem~\ref{main} by combining \eqref{tmlowerb} with the general theory of \cite{kkl}. To this end, we first recall a result from \cite{kkl} and we then show how it applies in our concrete situation.
Consider a discrete, one-dimensional Schr\"odinger operator
$$
Hu(n) = u(n+1) + u(n-1) + V(n) u(n)
$$
in $\ell^2(\Z)$, define the transfer matrices $M(n,E)$ as usually, and define for $\varepsilon > 0$, the characteristic length scales $\tilde{L}^{\pm}_\varepsilon (E)$ (where $\pm \tilde{L}^{\pm}_\varepsilon (E) > 0$) by
$$
\|M(E)\|_{\tilde{L}^{\pm}_\varepsilon (E)} = 2 \| M(1,E)^{-1}\| \varepsilon^{-1}.
$$
Denote the spectral measure of the pair $(H,\delta_1)$ by $\mu$. Then, the following was shown in \cite{kkl} (essentially, Theorem~1.5 of that paper):
\begin{theorem}[Killip, Kiselev, Last]\label{kkltheo}
For any $T > 0$, $L > 2$, we have
$$
\langle \| e^{-itH} \delta_1 \|_L^2 \rangle_T > C \mu ( \{ E : \tilde{L}^{\pm}_{T^{-1}}(E) \le L \}),
$$
where $C$ is a universal positive constant.
\end{theorem}
We are now in a position to give the
\begin{proof}[Proof of Theorem~\ref{main}.]
Consider the case of $\tilde{L}^{+}_{T^{-1}} (E)$ (the other one is analogous). The length scale $\tilde{L}^{+}_{T^{-1}} (E)$ is determined by
$$
\|M(E,\lambda,\alpha,\theta)\|_{\tilde{L}^{+}_{T^{-1}} (E)} = 2 \| M(E,1,\lambda,\alpha,\theta)^{-1}\| T.
$$
Under the assumptions of the theorem on $\lambda,\alpha$, we get from \eqref{tmlowerb} that for $T$ large enough, and every $E \in \Sigma_{\lambda,\alpha}$,
$$
\tilde{L}^{+}_{T^{-1}} (E)^{\frac{\log \xi(\lambda)}{3 \log B}} \le \tilde{C} T
$$
and hence
$$
\tilde{L}^{+}_{T^{-1}} (E) \le C T^{\frac{3 \log B}{\log \xi(\lambda)}}.
$$
This, together with Theorem~\ref{kkltheo}, implies the statement of Theorem~\ref{main} and concludes the proof.
\end{proof}
Let us comment on some of the remarks that are listed after the statement of Theorem~\ref{main}. First of all, if the rotation number $\alpha$ is equal to $(\sqrt{5}-1)/2$, then an analog of Proposition~\ref{lwthm}, sufficient for our purpose, was shown in \cite{kkl,r} for $\lambda > 8$. Since this result is the only place in our proof where we have to put a restriction on $\lambda$, our extension to every phase for this particular value of $\alpha$ works for every $\lambda > 8$, rather than every $\lambda > 20$.
Secondly, if one wants to establish the bound \eqref{dynbound} for every $T$, one needs \eqref{tmlowerb} for every $L$ which can easily be achieved for every \textit{fixed} $\theta$ by adjusting the constants $C$ and $\zeta$ suitably.
\begin{thebibliography}{10}
%\bibitem{b} M.\ Baake, A guide to mathematical quasicrystals, in \textit{Quasicrystals}, Eds.~J.-B.~Suck, M.~Schreiber, and P.~H\"au{\ss}ler, Springer, Berlin (1999), in press; preprint (math-ph/9901014)
\bibitem{bist} J.\ Bellissard, B.\ Iochum, E.\ Scoppola, and D.\ Testard, Spectral properties of one-dimensional quasi-crystals, \textit{Commun.\ Math.\ Phys.} {\bf 125} (1989), 527--543
\bibitem{b2} J.\ Berstel, Recent results in Sturmian words, in {\it Developments in Language Theory}, Eds.~J.~Dassow and A.~Salomaa, World Scientific, Singapore (1996), 13--24
\bibitem{c} J.\ M.\ Combes, Connections between quantum dynamics and spectral properties of time-evolution operators, in \textit{Differential Equations with Applications to Mathematical Physics}, Eds.~W.~F.~Ames, E.~M.~Harrell, and J.~V.~Herod, Academic Press, Boston (1993), 59--68
\bibitem{d1} D. Damanik, $\alpha$-continuity properties of one-dimensional quasicrystals, \textit{Commun.\ Math.\ Phys.} {\bf 192} (1998), 169--182
\bibitem{d2} D.\ Damanik, Gordon-type arguments in the spectral theory of one-dimensional quasicrystals, in \textit{Directions in Mathematical Quasicrystals}, Eds.~M.~Baake and R.~V.~Moody, CRM Monograph Series {\bf 13}, AMS, Providence, RI (2000), 277--305
%\bibitem{d3} D.\ Damanik, Uniform dynamical bounds for the Fibonacci Hamiltonian, preprint (2001)
\bibitem{dkl} D.\ Damanik, R.\ Killip, and D.\ Lenz, Uniform spectral properties of one-dimensional quasicrystals, III. $\alpha$-continuity, \textit{Commun.\ Math.\ Phys.} {\bf 212} (2000), 191--204
\bibitem{dl} D.\ Damanik and M.\ Landrigan, Log-dimensional spectral properties of one-dimensional quasicrystals, to appear in \textit{Proc.\ Amer.\ Math.\ Soc.}
\bibitem{dl1} D.\ Damanik and D.\ Lenz, Uniform spectral properties of one-dimensional quasicrystals, I. Absence of eigenvalues, \textit{Commun.\ Math.\ Phys.} {\bf 207} (1999), 687--696
\bibitem{dl2} D.\ Damanik and D.\ Lenz, The index of Sturmian sequences, \textit{European J.\ Combin.} {\bf 23} (2002), 23--29
%\bibitem{djls} R.\ del Rio, S.\ Jitomirskaya, Y.\ Last, and B.\ Simon, Operators with singular continuous spectrum. IV. Hausdorff dimensions, rank one perturbations, and localization, \textit{J.\ Anal.\ Math.} {\bf 69} (1996), 153--200
%\bibitem{gp} D.\ J.\ Gilbert and D.\ B.\ Pearson, On subordinacy and analysis of the spectrum of one-dimensional Schr\"odinger operators, \textit{J.\ Math.\ Anal.\ Appl.} {\bf 128} (1987), 30--56
\bibitem{g} I.\ Guarneri, Spectral properties of quantum diffusion on discrete lattices, \textit{Europhys.\ Lett.} {\bf 10} (1989), 95--100
%\bibitem{jl1} S.\ Jitomirskaya and Y.\ Last, Power-law subordinacy and singular spectra. I. Half-line operators, \textit{Acta Math.} {\bf 183} (1999), 171--189
\bibitem{jl2} S.\ Jitomirskaya and Y.\ Last, Power-law subordinacy and singular spectra. II. Line operators, \textit{Commun.\ Math.\ Phys.} {\bf 211} (2000), 643--658
\bibitem{khin} A.\ Ya.\ Khinchin, \textit{Continued Fractions}, Dover Publications, Mineola (1997)
\bibitem{kkl} R.\ Killip, A.\ Kiselev, and Y.\ Last, Dynamical upper bounds on wavepacket spreading, preprint (2001), available from mp-arc (01--460)
%\bibitem{kl} A.\ Kiselev and Y.\ Last, Solutions, spectrum, and dynamics for Schr\"odinger operators on infinite domains, \textit{Duke Math.\ J.} {\bf 102} (2000), 125--150
%\bibitem{l2} M.\ Landrigan, Log--dimensional properties of spectral measures, Ph.~D.~thesis, UC~Irvine (2001)
\bibitem{l} Y. Last, Quantum dynamics and decompositions of singular continuous spectra, \textit{J.\ Funct.\ Anal.} {\bf 142} (1996), 406--445
\bibitem{lw} Q.-H.\ Liu and Z.-Y.\ Wen, Hausdorff dimension of spectrum of one-dimensional Schr\"odinger operator with Sturmian potentials, preprint (2002)
\bibitem{loth1} M.\ Lothaire, \textit{Combinatorics on Words}, Cambridge University Press, Cambridge (1997)
\bibitem{loth2} M.\ Lothaire, \textit{Algebraic Combinatorics on Words}, Cambridge University Press, Cambridge (2002)
\bibitem{r} L.\ Raymond, A constructive gap labelling for the discrete Schr\"odinger operator on a quasiperiodic chain, preprint (1997)
\bibitem{s1} A.\ S\"ut\H{o}, The spectrum of a quasiperiodic Schr\"odinger operator, \textit{Commun.\ Math.\ Phys.} {\bf 111} (1987), 409--415
\bibitem{s2} A.\ S\"ut\H{o}, Schr\"odinger difference equation with deterministic ergodic potentials, in \textit{Beyond Quasicrystals} (Les Houches, 1994), Eds.~F.~Axel and D.~Gratias, Springer, Berlin (1995), 481--549
\bibitem{toda} M.\ Toda, \textit{Theory of Nonlinear Lattices}, Springer, Berlin (1989)
\end{thebibliography}
\end{document}
---------------0203111140301--
|
http://abmh.de/fhs/GEL-L/Z72/pdfheader
|
abmh.de
|
CC-MAIN-2019-51
|
unk
|
application/x-tex
|
crawl-data/CC-MAIN-2019-51/segments/1575540551267.14/warc/CC-MAIN-20191213071155-20191213095155-00456.warc.gz
| 5,417,468
| 990
|
\documentclass[11pt]{article}
\usepackage[final]{ps4pdf}
\usepackage{a4,german}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{ngerman}
%\usepackage[dvips]{graphics}
\ifpdf
% Pdf-Latex:
\usepackage[pdftex]{graphics}
\usepackage{ae}
\usepackage{graphicx}
\usepackage[
pdftex,
a4paper,
bookmarks,
bookmarksopen=true,
bookmarksnumbered=true,
pdfauthor={Andreas Hofmeier -- an-h.de},
pdftitle={GEL Versuch: Reihenschwingkreis},
% colorlinks=true,
% linkcolor=black,
% filecolor=black,
% urlcolor=black
]{hyperref}
\else
\usepackage[dvips]{graphics}
\fi
\usepackage{latexsym}
\usepackage{exscale}
\usepackage{amssymb,amsmath}
%\documentclass[11pt]{report}
%\usepackage{isolatin1}
%\usepackage{german}
\usepackage{epsf}
\usepackage[dvips]{rotating}
\usepackage{longtable}
\usepackage{dcolumn}
\usepackage{listings}
%\usepackage{eurosym}
%\EUR{300}
\usepackage{multicol}
%\usepackage[dvips]{rotating}
|
http://tutorial.jp/prog/ruby/rubyman.tex
|
tutorial.jp
|
CC-MAIN-2019-09
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2019-09/segments/1550247481624.10/warc/CC-MAIN-20190217051250-20190217073250-00271.warc.gz
| 272,621,990
| 106,077
|
% ========================
% 用紙サイズに依存する宣言
% ========================
% 文書クラス
\documentclass[10pt,a4paper,fleqn]{jbook}
% 本文領域と余白の大きさ(A4判(210mm x 297mm)の場合)
% 横方向
\textwidth 144mm
\oddsidemargin\paperwidth
\advance\oddsidemargin by-\textwidth
\oddsidemargin0.5\oddsidemargin
\advance\oddsidemargin by-1in
\evensidemargin\oddsidemargin
% 縦方向
\textheight 240mm
\topmargin -5mm
\headsep 5mm
% 長さコマンドの値の設定
\newlength{\honbunlineskip}
\setlength{\honbunlineskip}{1.348zh}
\newlength{\contentslineskip}
\setlength{\contentslineskip}{1.40zh}
\newlength{\indexlineskip}
\setlength{\indexlineskip}{1.42zh}
\newlength{\programlineskip}
\setlength{\programlineskip}{1.12zh}
\newlength{\syntaxlineskip}
\setlength{\syntaxlineskip}{1.8zh}
\newlength{\listitemsep}
\setlength{\listitemsep}{0.2zh}
% 文字サイズ変更コマンドの再定義
% \def\normalsize{\small} % B5判の場合のみ使用。
% 表の伸縮比率の再定義
% \def\arraystretch{1.2} % B5判の場合のみ使用。
% ==========================
% 用紙サイズに依存しない宣言
% ==========================
% パッケージの読み込み
\usepackage{makeidx} % 索引の出力
% \usepackage[dvips]{graphicx} % EPS形式の図の挿入
% ノンブルと柱のスタイル
\pagestyle{headings}
% 長さコマンドの値の設定
\setlength{\fboxsep}{0.5ex}
\setlength{\unitlength}{1zw}
\setlength{\topsep}{0.5zh}
\newlength{\horizontallinethickness}
\setlength{\horizontallinethickness}{0.2pt}
% displaymath環境のパラメーター
\setlength{\mathindent}{2zw}
% 索引の作成
\makeindex
% リスト環境の再定義
\renewenvironment{itemize}{\begin{list}{$\bullet$}{
\setlength{\topsep}{0.5zh}
\setlength{\partopsep}{0zh}
\setlength{\parsep}{0zh}
\setlength{\itemsep}{\listitemsep}
\setlength{\labelwidth}{1zw}
\setlength{\labelsep}{1.2zw}
\setlength{\leftmargin}{2zw}
\setlength{\listparindent}{1zw}
}}{\end{list}}
\newcounter{enumeratecounter}
\renewenvironment{enumerate}{\begin{list}
{(\arabic{enumeratecounter})}{
\setlength{\topsep}{0.5zh}
\setlength{\partopsep}{0zh}
\setlength{\parsep}{0zh}
\setlength{\itemsep}{\listitemsep}
\settowidth{\labelwidth}{(\arabic{enumeratecounter})}
\setlength{\labelsep}{0.7zw}
\settowidth{\leftmargin}{(\arabic{enumeratecounter})}
\addtolength{\leftmargin}{0.8zw}
\setlength{\listparindent}{1zw}
\usecounter{enumeratecounter}
}}{\end{list}}
% \begin{description}{長さ最大の項目名}
% \item[項目名] 項目
% \end{description}
\def\descriptionlabel#1{#1\hfill}
\renewenvironment{description}[1]{\begin{list}{}{
\setlength{\topsep}{0.5zh}
\setlength{\partopsep}{0zh}
\setlength{\parsep}{0zh}
\setlength{\itemsep}{\listitemsep}
\settowidth{\labelwidth}{#1}
\addtolength{\labelwidth}{1.2zw}
\setlength{\labelsep}{0zw}
\setlength{\leftmargin}{0zw}
\addtolength{\leftmargin}{\labelwidth}
\setlength{\listparindent}{1zw}
\let\makelabel\descriptionlabel
}}{
\end{list}
}
\renewenvironment{quote}{\begin{list}{}{
\setlength{\topsep}{0.5zh}
\setlength{\partopsep}{0zh}
\setlength{\parsep}{0zh}
\setlength{\itemsep}{0zh}
\setlength{\labelwidth}{0zw}
\setlength{\labelsep}{0zw}
\setlength{\leftmargin}{2zw}
\setlength{\listparindent}{0zw}
}
\vspace{0.1zh}
\setlength{\baselineskip}{\programlineskip}
\item
\begin{ttfamily}
}{
\end{ttfamily}
\end{list}
}
\renewenvironment{verse}{\begin{list}{}{
\setlength{\topsep}{0.5zh}
\setlength{\partopsep}{0zh}
\setlength{\parsep}{0zh}
\setlength{\itemsep}{0zh}
\setlength{\labelwidth}{0zw}
\setlength{\labelsep}{0zw}
\setlength{\leftmargin}{2zw}
\setlength{\listparindent}{0zw}
}
\vspace{0.2zh}
\item
}{\end{list}}
% リスト環境の定義
\newenvironment{syntaxquote}{\begin{list}{}{
\setlength{\topsep}{0.5zh}
\setlength{\partopsep}{0zh}
\setlength{\parsep}{0zh}
\setlength{\itemsep}{0zh}
\setlength{\labelwidth}{0zh}
\setlength{\labelsep}{0zw}
\setlength{\leftmargin}{2zw}
\setlength{\listparindent}{0zw}
}
\vspace{-0.4zh}
\setlength{\baselineskip}{\syntaxlineskip}
\item
\begin{ttfamily}
}{
\end{ttfamily}
\end{list}
}
%\begin{quotetabular}{列の形式}
% 項目 & 項目 & ... & 項目 \\
% ... \\
% 項目 & 項目 & ... & 項目
%\end{quotetabular}
\newenvironment{quotetabular}[1]{\begin{list}{}{
\setlength{\topsep}{0.5zh}
\setlength{\partopsep}{0zh}
\setlength{\parsep}{0zh}
\setlength{\itemsep}{0zh}
\setlength{\labelwidth}{0zh}
\setlength{\labelsep}{0zw}
\setlength{\leftmargin}{0zw}
\setlength{\listparindent}{0zw}
}
\setlength{\baselineskip}{\honbunlineskip}
\item
\begin{tabular}{#1}
}{
\end{tabular}
\end{list}
}
% \begin{tablelist}{長さ最大の項目名}
% \item[項目名] 項目
% \end{tablelist}
\def\tablelistlabel#1{#1\hfill}
\newenvironment{tablelist}[1]{\begin{list}{}{
\setlength{\topsep}{0.5zh}
\setlength{\partopsep}{0zh}
\setlength{\parsep}{0zh}
\setlength{\itemsep}{\listitemsep}
\settowidth{\labelwidth}{#1}
\addtolength{\labelwidth}{1.2zw}
\setlength{\labelsep}{0zw}
\setlength{\leftmargin}{0zw}
\addtolength{\leftmargin}{\labelwidth}
\setlength{\listparindent}{1zw}
\let\makelabel\tablelistlabel
}}{
\end{list}
}
% \begin{tttablelist}{長さ最大の項目名}
% \item[項目名] 項目
% \end{tttablelist}
\def\tttablelistlabel#1{#1\hfill}
\newenvironment{tttablelist}[1]{
\begin{ttfamily}
\begin{list}{}{
\setlength{\topsep}{0.5zh}
\setlength{\partopsep}{0zh}
\setlength{\parsep}{0zh}
\setlength{\itemsep}{\listitemsep}
\settowidth{\labelwidth}{#1}
\addtolength{\labelwidth}{1.2zw}
\setlength{\labelsep}{0zw}
\setlength{\leftmargin}{0.2zw}
\addtolength{\leftmargin}{\labelwidth}
\setlength{\listparindent}{1zw}
\let\makelabel\tttablelistlabel
}}{
\end{list}
\end{ttfamily}
}
% \begin{ttdescription}{長さ最大の項目名}
% \item[項目名] 項目
% \end{ttdescription}
\def\ttdescriptionlabel#1{#1\hfill}
\newenvironment{ttdescription}[1]{
\begin{ttfamily}
\begin{list}{}{
\setlength{\topsep}{0.5zh}
\setlength{\partopsep}{0zh}
\setlength{\parsep}{0zh}
\setlength{\itemsep}{\listitemsep}
\settowidth{\labelwidth}{#1}
\addtolength{\labelwidth}{1.2zw}
\setlength{\labelsep}{0zw}
\setlength{\leftmargin}{0.2zw}
\addtolength{\leftmargin}{\labelwidth}
\setlength{\listparindent}{1zw}
\let\makelabel\ttdescriptionlabel
}}{
\end{list}
\end{ttfamily}
}
% \begin{example}{タイトル}{ファイル名}
% プログラムなどの例
% \end{example}
\newenvironment{example}[2]{\begin{list}{}{
\setlength{\topsep}{0.5zh}
\setlength{\partopsep}{0zh}
\setlength{\parsep}{0zh}
\setlength{\itemsep}{0.3zh}
\setlength{\labelwidth}{0zw}
\setlength{\labelsep}{0zw}
\setlength{\leftmargin}{0zw}
\setlength{\listparindent}{0zw}
}
\vspace{0.2zh}
\item
\makebox[0zw][l]{\textrm{#1}\zenkuu \texttt{#2}}%
\rule[-0.3zh]{\textwidth}{\horizontallinethickness}
\setlength{\baselineskip}{\programlineskip}
\begin{ttfamily}
\item
}{
\end{ttfamily}
\par
\rule[0.6zh]{\textwidth}{\horizontallinethickness}
\par
\vspace{-0.6zh}
\end{list}
}
\def\bibliolabel#1{[#1]}
\newenvironment{biblio}{\begin{list}{}{
\setlength{\topsep}{0zh}
\setlength{\partopsep}{0zh}
\setlength{\parsep}{0zh}
\setlength{\itemsep}{0.5zh}
\setlength{\labelwidth}{0.5zh}
\setlength{\labelsep}{0.6em}
\setlength{\leftmargin}{1.2zw}
\setlength{\listparindent}{0zw}
\let\makelabel\bibliolabel
}}{\end{list}}
% コマンドの定義
\def\expbox#1{\,\rule[-1.8ex]{0ex}{0ex}\fbox{#1}\,}
\def\syntax#1{\textrm{\expbox{#1}}}
\def\booktitle#1{\textit{#1}}
\def\url#1{\texttt{#1}}
\def\address#1{\texttt{#1}}
\def\code#1{\,\texttt{#1}\,\linebreak[0]}
\def\website#1#2{\textrm{#1}\hspace{1.5zw}#2}
\def\bibliourl#1{\par\texttt{#1}}
\def\zenkuu{\hspace{1zh}} % 全角空白
\def\baikuu{\hspace{2zh}} % 倍角空白
\def\inkuu{\hspace{1.0em}} % インデント用空白
\def\yen{Y\llap=} % 円マーク
% 評価の矢印
\def\evaluate{\hspace{1.2zw}$\longrightarrow$\hspace{1.2zw}}
\def\bs{\texttt{\symbol{'134}}} % バックスラッシュ
\def\cf{\texttt{\symbol{'136}}} % サーカムフレックス
\def\us{\texttt{\symbol{'137}}} % アンダースコア
\def\lb{\texttt{\symbol{'173}}} % 左中括弧
\def\vl{\texttt{\symbol{'174}}} % 縦棒
\def\rb{\texttt{\symbol{'175}}} % 右中括弧
\def\ti{\texttt{\symbol{'176}}} % チルダ
% 倍角ダッシュ
\def\baidash{\makebox[2zw]{\rule[0.37zh]{1.9zw}{0.03zh}}}
% quote環境とその次の本文とのあいだを広げるための支柱
\def\quotestrut{\rule[-0.4zh]{0zw}{0zh}}
\def\tatetenten{%
\begin{picture}(1,2)
% \put(0,0){\framebox(1,2){}}
\multiput(0.5,1.5)(0,-0.8){3}{\makebox(0,0){$\bullet$}}
\end{picture}%
}
\def\tenten{%
\begin{picture}(1.9,1)
% \put(0,0){\framebox(1.9,1){}}
\multiput(0.4,0.4)(0.6,0){3}
{\makebox(0,0){{\Large\texttt{.}}}}
\end{picture}%
}
\def\cursor{\rule[-0.7ex]{1.2ex}{2.3ex}}
\def\plus{%
\hspace{0.05ex}\rule[0.75ex]{1.2ex}{0.1ex}%
\hspace{-0.65ex}\rule[0.2ex]{0.1ex}{1.2ex}%
\hspace{0.7ex}%
}
\def\cpp{\mbox{C\plus\plus\hspace{0.2ex}}}
\def\subscript#1#2{\mbox{#1$_{#2}$}}
\def\displaygraphics#1{
\begin{quote}
\includegraphics{#1}
\end{quote}
}
% セクションコマンドの再定義
\makeatletter
% 章
\def\chapter{
\global\@topnum\z@
\@afterindenttrue
\secdef\@chapter\@schapter
}
\def\@chapter[#1]#2{ % #1: optional heading, #2: heading
\refstepcounter{chapter}
\addcontentsline{toc}{chapter}
{\protect\numberline{\@chapapp\thechapter\@chappos}#1}
\chaptermark{#1}
\@makechapterhead{#2}
\@afterheading
}
\def\@makechapterhead#1{ % #1: heading
\par
\vspace{2zh}
\begin{bfseries}
\Large
\noindent\@chapapp\thechapter\@chappos\zenkuu#1
\end{bfseries}
\vspace{0.8zh}
\par
}
\def\@schapter#1{ % #1: heading
\@makeschapterhead{#1}
\@afterheading
}
\def\@makeschapterhead#1{ % #1: heading
\par
\vspace{2zh}
\begin{bfseries}
\Large
\noindent#1
\end{bfseries}
\vspace{0.8zh}
\par
}
% 節
\def\section{
\@startsection{section}{1}{0zw}{1.4zh}{1zh}
{\large\bfseries}
}
\def\subsection{
\@startsection{subsection}{2}{0zw}{1zh}{0.1zh}
{\normalsize\bfseries}
}
% 目次出力コマンドの再定義
\def\tableofcontents{
\chapter*{\contentsname}
\@mkboth{\contentsname}{\contentsname}
\@starttoc{toc}
}
% 見出し用文字列の再定義
\def\contentsname{目次}
\def\indexname{索引}
\def\appendixname{付録}
\makeatother
% ==================================
% 「Ruby実習マニュアル」のための宣言
% ==================================
\newenvironment{program}[1]{ % #1: filename
\begin{example}{プログラムの例}{#1}
}{
\end{example}
}
\newenvironment{jikkourei}{
\begin{example}{実行例}{}
}{
\end{example}
}
% タイトルと版次の定義
\def\daimei{Ruby実習マニュアル}
\def\edition{第五版}
% 改訂履歴を出力するコマンドの定義
\newlength{\twodigits}
\settowidth{\twodigits}{99}
\def\history#1#2#3#4#5{ % #1:年 #2:月 #3:日 #4:曜日 #5:版次
#1年
\ \makebox[\twodigits][r]{#2}月
\ \makebox[\twodigits][r]{#3}日%
(#4)%
\hspace{1zw}#5発行
\par
}
%===============
% 文書環境の開始
%===============
\begin{document}
\pagestyle{empty} % 扉とその次のページは柱を出力しない。
\setlength{\parindent}{0zw} % インデントはゼロ。
% 扉
\setlength{\baselineskip}{1.4zh}
\vspace*{3zh}
{\Large \daimei} \par
\vspace{2zh}
{\large \edition} \par
\vfill
大黒学
\clearpage
% 扉の次のページ
\setlength{\baselineskip}{1.5zh}
\vspace*{\fill}
\daimei ・\edition \par
著者\baidash 大黒学 \par
\vspace{0.8zh}
\history{2001}{11}{12}{月}{第零版}
\history{2004}{1}{5}{月}{第一版}
\history{2004}{3}{8}{月}{第二版}
\history{2005}{3}{6}{日}{第三版}
\history{2006}{3}{2}{木}{第四版}
\history{2007}{8}{19}{日}{第五版}
\vspace{0.8zh}
Copyright \copyright\ 2001--2007 Daikoku Manabu \par
This tutorial is licensed under a Creative Commons
Attribution 2.1 Japan License.
% 改訂履歴
% 第零版 2001年11月12日(月)
% 第一版 2004年1月5日(月)
% 第二版 2004年3月8日(月)
% 第三版 2005年3月6日(日)
% 第四版 2006年3月2日(木)
% 第五版 2007年8月19日(日)
\clearpage
% 目次
\pagestyle{headings} % ここから先は柱を出力する。
\setlength{\baselineskip}{\contentslineskip}
\tableofcontents
\clearpage
% ====
% 本文
% ====
\setlength{\parindent}{1zw}
\setlength{\baselineskip}{\honbunlineskip}
\chapter{オブジェクト指向プログラミングの基礎}
\label{chap:ooprogramming}
\section{プログラム}\label{sec:program}
\subsection{文書と言語}
文字を並べることによって何かを記述したもののことを、
「文書\index{ふんしょ@文書}」(document)と呼びます。
文書を作るためには、記述したいことを意味として持つように、
文字を並べていく必要があります。そして、そのためには、文字を
どのように並べればどういう意味になるかということを定めた規則が
必要になります。そのような規則は、「言語\index{けんこ@言語}」
(language)と呼ばれます。
人間に読んでもらうことを第一の目的とする文書を書く場合は、
日本語や中国語やアラビア語のような、
「自然言語\index{しせんけんこ@自然言語}」(natural language)と
呼ばれる言語が使われます。自然言語というのは、人間の社会の中で
自然発生的に形成された言語のことです。
言語には、自然言語のほかに、人間が意図的に設計することによって
作られた、「人工言語\index{しんこうけんこ@人工言語}」
(artificial language)と呼ばれるものもあります。人間ではなく
コンピュータに読んでもらうことを第一の目的とする文書を書く
場合は、普通、自然言語ではなく人工言語が使われます。
\subsection{プログラムとプログラミング}
コンピュータに何らかの動作を実行させるためには、
実行してほしいことがどんな動作なのかということを記述した文書を
コンピュータに与える必要があります。そのような文書は、
「プログラム\index{ふろくらむ@プログラム}」(program)と
呼ばれます。
プログラムを作成するためには、ただ単にそれを書くという
作業だけではなく、その構造を設計したり、その動作を
テストしたり、その不具合を修正したりするというような、
さまざまな作業が必要になります。そのような、プログラムを
作成するために必要となるさまざまな作業の全体は、
「プログラミング\index{ふろくらみんく@プログラミング}」
(programming)と呼ばれます。
\subsection{プログラミング言語}
プログラムというのも文書の一種ですから、それを書くためには
何らかの言語が必要になります。プログラムを書く場合には、
プログラムを書くことだけを目的として作られた人工言語を使うのが
普通です。そのような、プログラムを書くための専用の言語は、
「プログラミング言語
\index{ふろくらみんくけんこ@プログラミング言語}」
(programming language)と呼ばれます。
プログラミング言語には、たくさんのものがあります。たとえば、
Pascal\index{Pascal}、C\index{C}、Lisp\index{Lisp}、
ML\index{ML}、Prolog\index{Prolog}、
Smalltalk\index{Smalltalk}、Eiffel\index{Eiffel}、
……というように、枚挙にいとまがないほどです。
それぞれのプログラミング言語は、自分にとって得意なことと
不得意なことを持っていて、万能のプログラミング言語というものは
存在しません。ですから、プログラムを書くときは、その目的に
応じて適切なプログラミング言語を選択することが重要です。
\subsection{スクリプト言語}
プログラミング言語を設計するときには、どのようなことを
得意とする言語を作るのかという方針を立てる必要があります。
複数の方針を立ててプログラミング言語を設計することも可能です。
しかし、プログラムがコンピュータによって実行されるときの効率を
向上させるという方針と、プログラムが人間にとって書きやすくて
読みやすいものになるようにするという方針とは、トレードオフの
関係にあります。つまり、それらの二つの方針を両立させることは、
とても困難なことなのです。
プログラミング言語の中には、書きやすさや読みやすさよりも
実行の効率を優先させて設計されたものもあれば、それとは逆に、
効率よりも書きやすさや読みやすさを優先させて
設計されたものもあります。後者の方針で設計された言語は、
「スクリプト言語\index{すくりふとけんこ@スクリプト言語}」
(scripting language)と呼ばれます。スクリプト言語としては、
sed\index{sed}、awk\index{awk}、Perl\index{Perl}、
Tcl\index{Tcl}、Python\index{Python}、
Ruby\index{Ruby}などがよく使われています。
プログラミング言語で書かれた文書は「プログラム」と
呼ばれるわけですが、スクリプト言語で書かれた文書は、
「スクリプト\index{すくりふと@スクリプト}」(script)と
呼ばれることが多いようです。
\subsection{言語処理系}
コンピュータというものは異質な二つの要素から構成されていて、
それぞれの要素は、
「ハードウェア\index{はあとうぇあ@ハードウェア}」(hardware)と
「ソフトウェア\index{そふとうぇあ@ソフトウェア}」(software)と
呼ばれます。ハードウェアというのは物理的な装置のことで、
ソフトウェアというのはプログラムなどのデータのことです。
コンピュータは、さまざまなプログラミング言語で書かれた
プログラムを理解して実行することができます。しかし、
コンピュータのハードウェアが、ソフトウェアの助力を得ないで
単独で理解することのできるプログラミング言語は、
ハードウェアの種類によって決まっているひとつの言語だけです。
ハードウェアが理解することのできるプログラミング言語は、
そのハードウェアの
「機械語\index{きかいこ@機械語}」(machine language)と
呼ばれます。機械語というのは、人間にとっては書くことも
読むことも困難な言語ですので、人間が機械語でプログラムを
書くということはめったにありません。
人間にとって書いたり読んだりすることが容易な
プログラミング言語で書かれたプログラムをコンピュータに
理解させるためには、そのためのプログラムが必要になります。
そのような、人間が書いたプログラムをコンピュータに
理解させるためのプログラムのことを、
「言語処理系\index{けんこしょりけい@言語処理系}」
(language processor)と呼びます(「言語」を省略して、単に
「処理系\index{しょりけい@処理系}」と呼ぶこともあります)。
言語処理系には、「コンパイラ\index{こんはいら@コンパイラ}」
(compiler)と「インタプリタ\index{いんたふりた@インタプリタ}」
(interpreter)と呼ばれる二つの種類があります。
コンパイラというのは、人間が書いたプログラムを機械語に翻訳する
プログラムのことで、インタプリタというのは、人間が書いた
プログラムがあらわしている動作をコンピュータに実行させる
プログラムのことです。
\section{オブジェクト}\label{sec:object}
\subsection{プログラミングパラダイム}
人間がプログラムを書くためには、そのプログラムによって
実現したいことを何らかのプログラミング言語を使って具体的に
記述する必要があります。しかし、「実現したいこと」と
「具体的な記述」とのあいだには、大きな距離があります。
プログラムを書く人間は、思考することによって、その距離を埋める
必要があります。
どのように考えれば、「実現したいこと」と
「具体的な記述」とのあいだにある距離を埋めることができるか、
という考え方のことを、「プログラミングパラダイム
\index{ふろくらみんくはらたいむ@プログラミングパラダイム}」
(programming paradigm)と呼びます。
プログラミングパラダイムは、厳密に言えば、
プログラミング言語ごとに異なるわけですが、それらは、
いくつかの類型に大きく分類することが可能です。
プログラミングパラダイムの類型としては、
「オブジェクト指向プログラミング
\index{おふしぇくとしこうふろくらみんく@
オブジェクト指向プログラミング}」
(object-oriented programming)、
「関数プログラミング
\index{かんすうふろくらみんく@関数プログラミング}」
(functional programming)、「論理プログラミング
\index{ろんりふろくらみんく@論理プログラミング}」
(logic programming)、「手続き型プログラミング
\index{てつつきかたふろくらみんく@手続き型プログラミング}」
(procedural programming)などがあります。
ところで、この「Ruby実習マニュアル」という文章は、
Ruby\index{Ruby}というプログラミング言語を使ってプログラムを
書く方法について解説することを目的として書かれたものです。
Rubyを使ってプログラムを書く場合に使用される
プログラミングパラダイムは、
オブジェクト指向プログラミングです。そこで、この節では、
オブジェクト指向プログラミングにおいて中心的な役割を果たす、
「オブジェクト」と呼ばれるものについて説明したいと思います。
\subsection{オブジェクトとは何か}
「オブジェクト\index{おふしぇくと@オブジェクト}」
(object)というのは、箱のようなものだと考えることができます。
オブジェクト指向プログラミングにおいては、
いくつかのオブジェクトに対する操作という形で、プログラムを
記述していきます。
オブジェクトという箱の中には、2種類のものが
詰め込まれています。ひとつの種類はデータで、
もうひとつの種類は、「メソッド\index{めそっと@メソッド}」
(method)と呼ばれるものです。
メソッドというのは、何らかの仕事をするもののことです。
メソッドの仕事というのは、基本的には、自分が所属している
オブジェクトの中にあるデータの操作です。
ひとつのオブジェクトはいくつかのメソッドを持っていて、
それぞれのメソッドは、自分に固有の仕事を実行します。
ですから、オブジェクトというのは、自分の中にあるデータを
操作するためのさまざまな機能を持っている箱のことだと
考えることができます。
オブジェクトにはさまざまな種類があります。たとえば文字列の
オブジェクトや数値のオブジェクトなどです。オブジェクトがどんな
メソッドを持っているかというのは、そのオブジェクトの
種類によって決まっています。たとえば、文字列のオブジェクトは、
文字列から文字を取り出すメソッドや、文字の個数を数える
メソッドや、大文字を小文字に変換するメソッドなどを
持っています。
\subsection{メッセージ}
メソッドに仕事をさせることができるのは、そのメソッドを
持っているオブジェクトだけです。
オブジェクトに対してメソッドに仕事をさせる
依頼をするためには、「メッセージ」と呼ばれるものを
そのオブジェクトに送る
必要があります\footnote{オブジェクトにメッセージを送る
方法については、第\ref{sec:message}節で説明します。}。
「メッセージ\index{めっせえし@メッセージ}」
(message)というのは、「このメソッドに
こんな仕事をさせてください」という意味を持つ記述のことです。
オブジェクトは、メッセージを受け取ると、その記述にしたがって、
自分の中にある適切なメソッドに仕事をさせます。
オブジェクトにメッセージを送ることによってメソッドに
仕事をさせることを、メソッドを
「呼び出す\index{よひたす@呼び出す}」(call)と言います。
また、メッセージを受け取ったオブジェクトは、
そのメッセージの「レシーバー\index{れしいはあ@レシーバー}」
(receiver)と呼ばれます。
オブジェクト指向プログラミングというのは、「オブジェクトに
メッセージを送る」ということを基本とする
プログラミングパラダイムのことです。
\subsection{引数と戻り値}
メソッドは、自分が呼び出されたとき、自分の仕事を
開始するのに先立って、自分を呼び出したものから
何個かのオブジェクトを受け取ることができます。メソッドが
受け取るオブジェクトのそれぞれは、
「引数\index{ひきすう@引数}」(argument)と呼ばれます。
また、メソッドは、自分の動作が終了したのち、かならず、
自分を呼び出したものに対して1個のオブジェクトを返します。
メソッドが返すオブジェクトは、
「戻り値\index{もとりち@戻り値}」(returned value)と
呼ばれます。
\section{Rubyの概要}\label{sec:ruby}
\subsection{Rubyとは何か}
前の節にも書きましたが、この「Ruby実習マニュアル」という
文章は、Ruby\index{Ruby}というプログラミング言語を使って
プログラムを書く方法について解説することを目的として
書かれたものです。そこで、Rubyという
プログラミング言語についての本格的な説明に入る前に、この節で、
それについて概略的な紹介をしておきたいと思います。
Rubyというのは、
まつもとゆきひろ\index{まつもとゆきひろ}さんという人によって
設計されたプログラミング言語です。この言語が持っている特徴は
いくつもあるのですが、それらのうちでとりわけ重要なのは、
\begin{itemize}
\item スクリプト言語である。
\item オブジェクト指向プログラミングに基づいて設計されている。
\end{itemize}
という二つの特徴です。
\subsection{式と評価と値}
Rubyのプログラムは、「式\index{しき@式}」(expression)と
呼ばれるものから構成されます。式というのは、
何らかの動作を記述した文字の列のことです。式が記述している
動作を実行することを、その式を
「評価する\index{ひょうかする@評価する}」(evaluate)と
言います。式を評価すると、その結果として1個のオブジェクトが
得られます。式を評価することによって得られた
オブジェクトのことを、その式の
「値\index{あたい@値!しきの@式の\baidash}」(value)と言います。
\subsection{リテラル}
特定のオブジェクトを生成するという動作を記述した式は、
「リテラル\index{りてらる@リテラル}」(literal)と呼ばれます。
リテラルを評価すると、それによって生成されたオブジェクトが、
そのリテラルの値になります。
リテラルにはさまざまな種類があるのですが、ここでは、整数と
文字列のオブジェクトを生成するリテラルについて、ごく簡単に
説明しておきたいと思います\footnote{リテラルについては、
第\ref{sec:literal}節で、さらに詳細に説明します。}。
\index{せいすう@整数!0のりてらる@\baidash のリテラル}
\index{りてらる@リテラル!せいすうの@整数の\baidash}
\code{0}から\code{9}までの数字を並べてできる列は、整数の
オブジェクトを生成するリテラルです。たとえば、
\code{2800}というのは、整数のオブジェクトを生成するリテラルの
一例です。このリテラルを評価すると、2800という整数の
オブジェクトが生成されて、そのオブジェクトが値として
得られます。
\index{もしれつ@文字列!0のりてらる@\baidash のリテラル}
\index{りてらる@リテラル!もしれつの@文字列の\baidash}
文字列のオブジェクトを生成するリテラルは、その文字列を
二重引用符\index{にしゅういんようふ@二重引用符}%
(\code{"}\index{""@\code{""}})で囲んだものです。たとえば、
\code{"namako"}というのは、文字列のオブジェクトを生成する
リテラルの一例です。このリテラルを評価すると、
\code{namako}という文字列のオブジェクトが生成されて、
そのオブジェクトが値として得られます。
\subsection{Rubyの処理系}
Rubyの処理系としては、現在のところ、ruby\index{ruby}という
名前\footnote{先頭の文字が大文字になっているRubyは言語の
名前で、小文字になっているrubyはインタプリタの名前です。}の
インタプリタが、もっとも普及しています。このインタプリタは、
Linuxディストリビューションの大多数とMacOSには最初から
組み込まれていますので、それらのOSを使っている場合、
インストールは不要です。
Rubyのプログラムを実行したいけれども、使っているOSにRubyの
処理系が組み込まれていない、という場合は、処理系を
インストールする必要があります。rubyは、無料で配布されていて、
インターネット上のサイトからダウンロードすることができます。
rubyをダウンロードしたりインストールしたりする方法について
知りたい方は、
\begin{quote}
\website{Ruby公式サイト}{http://www.ruby-lang.org/ja/}
\end{quote}
を参照してください。
\subsection{対話型のインタプリタ}
人間が入力したものを読み込んでそれを処理する、という動作を
延々と繰り返すように作られているプログラムは、
「対話型である\index{たいわかたてある@対話型である}」
(interactive)と言われます。
インタプリタには、対話型のものとそうでないものとがあります。
rubyというのは対話型のインタプリタではないのですが、
irb\index{irb}というプログラムを使うことによって、rubyを
対話型のインタプリタとして使うことができるようになります。
それでは、実際にirbを起動してみましょう。まず、
シェル(Linuxならばbashなど、Windowsならばcmd.exeなど)を
起動して、そのシェルに対して\code{irb}というコマンドを
入力してみてください。すると、irbが起動して、
\begin{quote}
irb(main):001:0>
\end{quote}
というプロンプトが表示されるはずです。
irbは、
\begin{enumerate}
\item プロンプトを出力する。
\item 式を読み込む。
\item 読み込んだ式を評価する。
\item 評価によって得られた値を出力する。
\end{enumerate}
ということを延々と繰り返すように作られています。
それでは、整数のオブジェクトを生成するリテラルをirbに
入力してみましょう。たとえば、
\begin{quote}
irb(main):001:0> 2800
\end{quote}
というように、整数のリテラルを入力して、そののちエンターキーを
押してみてください。すると、
\begin{quote}
=> 2800
\end{quote}
と出力されます。\code{=>}というのは、その右側に
出力されているものが式の値だということを示している矢印です。
リテラルを評価すると、それによって生成されたオブジェクトが
値として得られますので、\code{2800}というリテラルを評価した
結果が、矢印の右側に\code{2800}と出力されたわけです。
次に、文字列のオブジェクトを生成するリテラルをirbに
入力してみましょう。そうすると、
\begin{quote}
\begin{verbatim}
irb(main):002:0> "namako"
=> "namako"
\end{verbatim}
\end{quote}
というように、文字列のリテラルを評価することによって得られた
文字列のオブジェクトが、矢印の右側に出力されます。
それでは次に、irbを終了させてみましょう。irbは、
\code{exit}\index{exit@\code{exit}}という式を
入力することによって終了させることができます。それでは、実際に
\code{exit}を入力して、irbを終了させてみてください。
\section{メッセージ}\label{sec:message}
\subsection{メッセージについての復習}
この節では、メッセージについて説明したいと思います。
メッセージとは何か、ということについては、すでに
第\ref{sec:object}節で説明していますので、まず、そこで
説明したことを復習しておくことにしましょう。
「メッセージ\index{めっせえし@メッセージ}」
(message)というのは、オブジェクトに対して送られる、
「このメソッドにこんな仕事をさせてください」という意味を持つ
記述のことです。オブジェクトは、メッセージを受け取ると、
その記述にしたがって、自分の中にある適切なメソッドに
仕事をさせます。
オブジェクトにメッセージを送ることによってメソッドに
仕事をさせることを、メソッドを
「呼び出す\index{よひたす@呼び出す}」(call)と言います。
また、メッセージを受け取ったオブジェクトのことを、
そのメッセージの「レシーバー\index{れしいはあ@レシーバー}」
(receiver)と呼びます。
\subsection{メッセージ式}
第\ref{sec:object}節では、オブジェクトにメッセージを
送るためにはどうすればいいかということについては、まったく
説明していませんでした。それではさっそく、その方法について
説明しましょう。
オブジェクトにメッセージを送りたいときは、
「メッセージ式\index{めっせえししき@メッセージ式}」
(message expression)と呼ばれる式を書きます。
メッセージ式というのは、
\begin{quote}
\syntax{式}\,{\Large .}\,\syntax{メッセージ}
\end{quote}
という形の式のことです。メッセージ式の中にあるドット
\index{とっと@ドット!めっせえししきの@メッセージ式の\baidash}%
(\code{.}%
\index{.@\code{.}!めっせえししきの@メッセージ式の\baidash})%
は、「左側の式の値に右側のメッセージを送る」という意味を
持っています。
メッセージ式を評価すると、まず、ドットの左側に書かれた式が
評価されます。そして、その値として得られた
オブジェクトに対して、ドットの右側の部分がメッセージとして
送られます。つまり、ドットの左側に書かれた式の値を
レシーバーにして、メッセージが送られるわけです。
メッセージ式を評価することによって得られる値は、それによって
呼び出されたメソッドが返した戻り値です。
\subsection{引数を渡さないメッセージ}
次に、メッセージの書き方について説明しましょう。ただし、引数を
受け取るメソッドを呼び出すためのメッセージの書き方はちょ{}っと
複雑なので、それは後回しにして、まずは、引数を受け取らない
メソッドを呼び出すためのメッセージの書き方について説明します。
実は、引数を受け取らないメソッドを呼び出すための
メッセージというのは、そのメソッドの名前をそのまま
書くだけです。
それでは、具体的な例を使って説明しましょう。文字列の
オブジェクトは、
\code{downcase}\index{downcase@\code{downcase}}という
メソッドを持っています。これは、レシーバーに含まれている
すべての英大文字を英小文字に変換することによってできる
文字列のオブジェクトを戻り値として返す、という動作をする
メソッドです。たとえば、\code{hItODe}という文字列の
オブジェクトが持っている\code{downcase}を呼び出すと、
その戻り値として、\code{hitode}という文字列のオブジェクトが
得られます。
\code{downcase}は引数を受け取らないメソッドですから、
\code{downcase}という名前が、そのまま、そのメソッドを
呼び出すためのメッセージになります。つまり、文字列の
オブジェクトに\code{downcase}というメッセージを送ると、
そのオブジェクトは、自分の中にある\code{downcase}という
メソッドに仕事をさせることになる、ということです。
オブジェクトにメッセージを送りたいときは、
\begin{quote}
\syntax{式}\,{\Large .}\,\syntax{メッセージ}
\end{quote}
というメッセージ式を書けばいいわけですから、たとえば、
\begin{quote}
"hItODe".downcase
\end{quote}
というメッセージ式を書くことによって、\code{hItODe}という
文字列に対して\code{downcase}というメッセージを
送ることができます。
メッセージ式を評価することによって得られる値は、それによって
呼び出されたメソッドが返した戻り値ですので、
\begin{quote}
"hItODe".downcase
\end{quote}
というメッセージ式を評価すると、それによって呼び出された
\code{downcase}が返した戻り値、つまり\code{hitode}という
文字列のオブジェクトが、そのメッセージ式の値になります。
それでは、irbを使って、文字列のオブジェクトに
\code{downcase}というメッセージを送ってみましょう。
そうすると、次のようになります。
\begin{quote}
\begin{verbatim}
irb(main):001:0> "hItODe".downcase
=> "hitode"
\end{verbatim}
\end{quote}
\subsection{引数を渡すメッセージ}
次に、引数を受け取るメソッドを呼び出すためのメッセージの
書き方について説明しましょう。
まず、説明のために使うメソッドの実例として、
\code{gsub}\index{gsub@\code{gsub}}というメソッドを
紹介します。これは、文字列のオブジェクトが持っている
メソッドで、部分文字列の置き換え(substitution)という動作を
実行します。
「部分文字列\index{ふふんもしれつ@部分文字列}」(substring)と
いうのは、文字列の中に含まれている文字列のことです。たとえば、
\code{namako}という文字列は、\code{nama}、\code{ama}、
\code{am}、\code{m}などの部分文字列を含んでいます。
\code{gsub}は、2個の引数を受け取ります。1個目は探索する
文字列のオブジェクトで、2個目は、発見された部分文字列を
置き換える文字列のオブジェクトです。\code{gsub}は、
レシーバーの中で、1個目の引数と一致する部分文字列を探索して、
発見されたすべての部分文字列を2個目の引数に
置き換えることによってできる文字列のオブジェクトを戻り値として
返す、という動作をします。たとえば、レシーバーが、
\begin{quote}
ccxyzcccxyzcxyzcccxyzc
\end{quote}
という文字列のオブジェクトで、1個目の引数が\code{xyz}で、
2個目の引数が\code{789}だとすると、\code{gsub}は、
\begin{quote}
cc789ccc789c789ccc789c
\end{quote}
という文字列のオブジェクトを戻り値として返します。
\code{gsub}のような、引数を受け取るメソッドを
呼び出すためには、どのような引数をメソッドに
渡すのかということを記述したメッセージをオブジェクトに送る
必要があります。そのようなメッセージは、
\begin{quote}
\syntax{メソッド名}\,{\Large (}\,\syntax{式}{\Large ,}
\tenten\ {\Large )}
\end{quote}
と書きます。この形のメッセージをオブジェクトに送ると、
丸括弧の中に書かれた式の値が、書かれた順番のとおりに、
引数としてメソッドに渡されることになります。ですから、
\code{gsub}を呼び出したいときは、
\begin{quote}
gsub(\syntax{\subscript{式}{1}}, \syntax{\subscript{式}{2}})
\end{quote}
という形のメッセージを文字列のオブジェクトに
送ればいいわけです。そうすると、\subscript{式}{1}の値が
1個目の引数として\code{gsub}に渡されて、\subscript{式}{2}の
値が2個目の引数として\code{gsub}に渡されます。
それでは、irbを使って、実際に試してみましょう。
\begin{quote}
\begin{verbatim}
irb(main):001:0> "ccxyzcccxyzcxyzcccxyzc".gsub("xyz", "789")
=> "cc789ccc789c789ccc789c"
\end{verbatim}
\end{quote}
ちなみに、\code{gsub}というメソッドの名前は、
globally substitute(大域的に置き換える)という言葉を縮めて
作られたものです。「大域的に」というのは、「文字列全体に
渡って」という意味です。\code{gsub}とは別に、大域的ではない
置き換えを実行する\code{sub}\index{sub@\code{sub}}という
メソッドもあります。\code{sub}は、レシーバーの先頭から
末尾に向かって部分文字列を探索して、最初に発見された
部分文字列だけを置き換えます。irbを使って試してみると、
次のようになります。
\begin{quote}
\begin{verbatim}
irb(main):001:0> "ccxyzcccxyzcxyzcccxyzc".sub("xyz", "789")
=> "cc789cccxyzcxyzcccxyzc"
\end{verbatim}
\end{quote}
\subsection{メソッドの戻り値にメッセージを送る式}
メソッドの戻り値に対して、さらにメッセージを送りたい、
ということがしばしばあります。
そんなときは、メッセージ式のうしろに、さらにドットと
メッセージを書きます。つまり、
\begin{quote}\rmfamily
\syntax{式}\,{\Large .}\,\syntax{\subscript{メッセージ}{1}}%
\,{\Large .}\,\syntax{\subscript{メッセージ}{2}}
\end{quote}
という形の式を書けばいいわけです。この形の式は、まず左端にある
式の値に対して\subscript{メッセージ}{1}を送って、
その結果として得られたオブジェクトに対してさらに
\subscript{メッセージ}{2}を送る、という意味だと解釈されます。
たとえば、
\begin{quote}
"kITSutSUki".downcase.gsub("tsu", "mo")
\end{quote}
という式を評価すると、まず\code{kITSutSUki}という文字列の
オブジェクトに\code{downcase}というメッセージが送られます。
すると、その結果として、\code{kitsutsuki}という文字列の
オブジェクトが得られます。そしてそののち、
\begin{quote}
gsub("tsu", "mo")
\end{quote}
というメッセージが、\code{kitsutsuki}という文字列の
オブジェクトに送られます。ですから、式全体の値として、
\code{kimomoki}という文字列のオブジェクトが
得られることになります。
\subsection{トップレベル}
メッセージ式は、普通、レシーバーを求める式とドットを書いて、
その右側にメッセージを書くわけですが、場合によっては、
レシーバーを求める式とドットを省略することが可能です。
レシーバーを省略した場合、メッセージは、文脈によって決定される
オブジェクトに送られます。
irbに入力した式は、「トップレベル
\index{とっふれへる@トップレベル!ふんみゃくの@
文脈の\baidash}」
(toplevel)と呼ばれる文脈で評価されます。レシーバーを省略した
メッセージ式をトップレベルで評価すると、そのメッセージは、
「トップレベルオブジェクト
\index{とっふれへるおふしぇくと@トップレベルオブジェクト}」
(toplevel object)と呼ばれるオブジェクトに送られます。
irbを終了させたいときに入力する
\code{exit}\index{exit@\code{exit}}という式は、レシーバーが
省略されたメッセージ式です。ですから、irbに\code{exit}という
式を入力すると、トップレベルオブジェクトに対して
\code{exit}というメッセージが送られるわけです。その結果、
トップレベルオブジェクトの中にある\code{exit}というメソッドが
呼び出されて、そのメソッドがirbを終了させます。
\subsection{関数的メソッド}
メソッドというのは、基本的にはレシーバーに対して何らかの処理を
実行するわけですが、例外的に、レシーバーとは無関係な動作をする
メソッドもあります。そのような、レシーバーに対する処理を
何もしないメソッドは、
「関数的メソッド\index{かんすうてきめそっと@関数的メソッド}」
(functional method)あるいは単に「関数\index{かんすう@関数}」
(function)と呼ばれます。たとえば、
\code{exit}\index{exit@\code{exit}}というメソッドは、
関数的メソッドのひとつです。関数的メソッドは、たいていの
場合、レシーバーを省略したメッセージ式を書くことによって
呼び出すことができます。
Rubyの処理系にはさまざまな関数的メソッドが
組み込まれているのですが、ここでは、その例として
\code{system}というメソッドを紹介しておきたいと思います。
\code{system}\index{system@\code{system}}というのは、
引数として文字列を受け取って、それをシェルのコマンドとして
実行する、という動作をする関数的メソッドです。
もしも、使っているOSがLinuxならば、
\begin{quote}
system("cal 8 1997")
\end{quote}
という式をirbに入力してみてください。そうすると、1997年8月の
カレンダーが出力されるはずです。LinuxではなくてWindowsを
使っているならば、
\begin{quote}
system("date /t")
\end{quote}
という式をirbに入力してみましょう。そうすると、今日の日付が
出力されるはずです。
\code{system}は、\code{true}\index{true@\code{true}}または
\code{false}\index{false@\code{false}}というオブジェクトを
戻り値として返します。コマンドの実行に成功した場合は
\code{true}で、失敗した場合は\code{false}です。
\section{クラス}\label{sec:class}
\subsection{クラスとは何か}
オブジェクトは、「クラス\index{くらす@クラス}」(class)と
呼ばれるものから生成されます。
クラスというのは、鋳型\index{いかた@鋳型}のようなものだと
考えるといいでしょう。つまり、何らかの形を持っている
容器だということです。液体をその容器に入れて、そののち
何らかの方法でその液体を個体に変えて、そして中身を取り出すと、
容器の中の空間と同じ形を持つ物体が出てきます。鋳型を使わずに
物体を作ることも可能ですが、鋳型を使うことによって、同じ形を
持つ物体を何個も作るということが簡単にできるようになります。
オブジェクトというのは、クラスという鋳型から作られた
物体のことだと考えることができます。ですから、
ひとつのクラスから生成されたすべてのオブジェクトは、
同じメソッドを持つことになります。
オブジェクトには、整数や文字列など、さまざまな種類があります。
そして、オブジェクトを生成するクラスも、オブジェクトの
種類ごとに別々になっています。つまり、整数は整数のクラスから
生成され、文字列は文字列のクラスから生成される、
ということです。
それぞれのクラスは、それを識別するための名前を持っています。
たとえば、整数のオブジェクトを生成するクラスは、
\code{Fixnum}\index{Fixnum@\code{Fixnum}}という名前を
持っています。同じように、文字列のオブジェクトは
\code{String}\index{String@\code{String}}という名前の
クラスから生成されます。
\subsection{インスタンス}
「インスタンス\index{いんすたんす@インスタンス}」
(instance)という言葉が、
オブジェクト指向プログラミングに関連する文章や会話の中で、
しばしば使われることがあります。
実は、「インスタンス」という言葉の意味は、基本的には
「オブジェクト」とほとんど同じです。相違点は、
「オブジェクト」よりも「インスタンス」のほうが、
何らかのクラスから生成されたものだという観点が
強調されるというところにあります。ですから、「これは
\code{String}クラスのオブジェクトだ」という言い方は、決して
間違いではありませんが、この場合は、「これは
\code{String}クラスのインスタンスだ」という言い方のほうが、
意味が鮮明です。
オブジェクトが何というクラスのインスタンスなのかということを
調べたいときは、\code{class}\index{class@\code{class}}という
メソッドを使います。\code{class}は、すべてのオブジェクトが
持っているメソッドで、レシーバーを生成したクラスを戻り値として
返す、という動作をします。たとえば、
\begin{quote}
38.class
\end{quote}
というように、整数のオブジェクトに\code{class}という
メッセージを送る式をirbに入力すると、\code{Fixnum}という
クラス名が出力されます(\code{class}メソッドはクラスそのものを
返しているのですが、irbが出力するのはその名前だけです)。
それでは、文字列のオブジェクトについても、\code{class}を
使って、それを生成したクラスの名前を確かめてみましょう。
たとえば、
\begin{quote}
"hitode".class
\end{quote}
という式をirbに入力すると、\code{String}というクラス名が
出力されるはずです。
\subsection{クラスを生成するクラス}
実は、クラスというのもオブジェクトの一種です。ということは、
クラスに対して\code{class}というメッセージを送れば、それを
生成したクラスがわかるはずです。たとえば、irbに、
\begin{quote}
Fixnum.class
\end{quote}
という式を入力してみてください。そうすると、
\code{Fixnum}というクラスは
\code{Class}\index{Class@\code{Class}}というクラスの
インスタンスだということがわかります。
\code{Fixnum}だけではなくて、すべてのクラスは、
\code{Class}というクラスのインスタンスです。ちなみに、
\code{Class}クラス自身も、やはり\code{Class}クラスの
インスタンスです。つまり、\code{Class}クラスは、自分自身から
生成されるわけです。
\subsection{スーパークラスとサブクラス}
すでに説明したように、クラスというのはオブジェクトを生成する
鋳型のようなものですが、それはクラスというものの
側面のひとつにすぎません。クラスには、もうひとつの別の
側面があるのです。それは、「分類体系の部品」という側面です。
さまざまなクラスの全体は、生物などの分類体系と同じように、木の
形をした構造を持っています。この木は、本物の木とは上と下とが
逆になっていて、いちばん上に根があって、下に向かって枝が
伸びています。木を構成するそれぞれのクラスは、
上にあるものほど一般的で、下にあるものほど特殊です。
Bというクラスが、Aというクラスを特殊化することによって
作られたものだとするとき、Aのことを、Bの
「スーパークラス\index{すうはあくらす@スーパークラス}」
(superclass)と言い、Bのことを、Aの
「サブクラス\index{さふくらす@サブクラス}」(subclass)と
言います。
クラスのスーパークラスが何なのかということを調べたいときは、
\code{superclass}\index{superclass@\code{superclass}}という
メソッドを使います。\code{superclass}は、すべてのクラスが
持っているメソッドで、レシーバーのスーパークラスを戻り値として
返します。
それでは、\code{Fixnum}クラスのスーパークラスが
何なのかということを調べてみましょう。irbに、
\begin{quote}
Fixnum.superclass
\end{quote}
という式を入力してみてください。すると、
\code{Integer}\index{Integer@\code{Integer}}という名前が
出力されるはずです。つまり、\code{Fixnum}のスーパークラスは
\code{Integer}というクラスだということです。
\code{Integer}のスーパークラスは、
\code{Numeric}\index{Numeric@\code{Numeric}}というクラスです。
そして、\code{Numeric}と\code{String}のスーパークラスは、
ともに\code{Object}\index{Object@\code{Object}}という
クラスです。
\subsection{クラスの木の根}
Rubyでは、クラスの木を上へ上へとたどっていくと、かならず
\code{Object}というクラスに到達します。つまり、
\code{Object}というのが、クラスの木の根に相当するわけです。
クラスの木の根ということは、もっとも一般的な
クラスということです。
ほとんどすべてのクラスは、自分のスーパークラスというものを
持っているわけですが、\code{Object}だけはその例外です。
しかし、\code{Object}も、クラスである以上、
\code{superclass}メソッドを持っているという点は、
ほかのクラスと同じです。
それでは、irbを使って、\code{superclass}というメッセージを
\code{Object}に送ってみましょう。そうすると、
\code{Object}クラスが持っている\code{superclass}メソッドは、
戻り値として\code{nil}というオブジェクトを返す、ということが
分かります。ちなみに、
\code{nil}\index{nil@\code{nil}}というのは、
「存在しない」ということなどをあらわすために使われる
オブジェクトで、この場合は、「スーパークラスは
存在しない」ということを意味しています。
\subsection{組み込みクラス}
Rubyの処理系の中には、さまざまなクラスが最初から
組み込まれています。そのような、処理系の中に最初から
組み込まれているクラスは、
「組み込みクラス\index{くみこみくらす@組み込みクラス}」
(built-in class)と呼ばれます。これまでの説明の中で登場した、
\code{Fixnum}、\code{String}、\code{Class}、\code{Integer}、
\code{Object}などは、すべて組み込みクラスです。
プログラムが扱うことのできるクラスは、
組み込みクラスだけではありません。プログラムを書く人は、
クラスを作る記述\footnote{クラスを作る記述の書き方については、
第\ref{chap:class}章で説明します。}をプログラムの中に
書くことによって、自分が必要とするクラスを自由に
作り出すことができます。
\section{主要なメソッド}\label{sec:basicmethods}
\subsection{すべてのオブジェクトが持っているメソッド}
この節では、組み込みクラスのオブジェクトが持っている
メソッドのうちの主要なものをいくつか紹介したいと思います。
まず最初は、すべてのオブジェクトが持っているメソッドです。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{メッセージ式} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
$o$.to\us s & $o$をあらわす文字列を返します。 \\ \hline
$o$.display & $o$をあらわす文字列を出力します。 \\ \hline
$o$.class & $o$を生成したクラスを返します。
\\ \hline
\end{tabular}
\end{ttfamily}
\caption{すべてのオブジェクトが持っている主要なメソッド}
\label{tab:allobjectmethods}
\index{to_s@\code{to\us s}}
\index{display@\code{display}}
\index{class@\code{class}}
\end{table}
表\ref{tab:allobjectmethods}は、すべてのオブジェクトが
持っているメソッドのうちの主要なものを示しています。
何らかのクラスのオブジェクトを文字列のオブジェクトに
変換したいときは、
\code{to\us s}\index{to_s@\code{to\us s}}というメソッドを
使います。たとえば、
\begin{quote}
\verb|7803.to_s|
\end{quote}
という式を評価すると、レシーバーを文字列のオブジェクトに
変換した結果、つまり\code{7803}という文字列のオブジェクトが
得られます。
オブジェクトをあらわす文字列を出力したいときは、
\code{display}\index{display@\code{display}}というメソッドを
使います。たとえば、
\begin{quote}
8703.display
\end{quote}
という式をirbに入力したとすると、
\begin{quote}
8703=> nil
\end{quote}
という文字列が出力されます。ただし、\code{display}によって
出力された文字列は、この文字列の中の\code{8703}という
部分だけです。その右側の部分は、入力された式の値を示すために
irbによって出力されたものです。ちなみに、\code{display}の
戻り値は、常に\code{nil}です。
どんなメソッドも、かならず何らかのオブジェクトを戻り値として
返します。しかし、\code{display}のように、戻り値を返すことを
目的としないメソッドもあります。そのようなメソッドは、普通、
意味のない戻り値として\code{nil}\index{nil@\code{nil}}という
オブジェクトを返すように作られています。
次に、\code{display}というメッセージを文字列のオブジェクトに
送ってみましょう。たとえば、
\begin{quote}
"namako".display
\end{quote}
という式を評価すると、\code{namako}という文字列が
出力されます。
改行\index{かいきょう@改行}という文字を含んでいる文字列の
オブジェクトを生成したいときは、改行を意味する文字列を
リテラルの中に書きます。改行を意味する文字列は、まず
バックスラッシュ
\index{はっくすらっしゅ@バックスラッシュ}%
(\code{\bs}\index{\@\code{\bs}})という
文字\footnote{バックスラッシュは、日本語の環境では
円マーク\index{えんまあく@円マーク}(\code{\yen})で
表示されることがあります。}を書いて、その右側に\code{n}という
文字を書いたものです。たとえば、
\begin{quote}
\verb|"umiushi\nhitode"|
\end{quote}
というリテラルを評価すると、改行を含んでいる文字列の
オブジェクトが値として得られます。そのような文字列に
\code{display}というメッセージを送ると、
\begin{quote}
\begin{verbatim}
irb(main):001:0> "umiushi\nhitode".display
umiushi
hitode=> nil
\end{verbatim}
\end{quote}
というように、改行が出力されます。
\subsection{文字列のメソッド}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{メッセージ式} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
$s$.size & $s$の長さ(文字数)を返します。 \\ \hline
$s$.length & $s$.sizeと同じ意味です。$s$の長さを返します。
\\ \hline
$s$.chomp & $s$の末尾にある改行を削除した結果を返します。
\\ \hline
$s$.downcase & $s$に含まれる英大文字を英小文字に変換した
結果を返します。 \\ \hline
$s$.upcase & $s$に含まれる英小文字を英大文字に変換した
結果を返します。 \\ \hline
$s$.ljust($n$) & $s$の右側を空白で埋めた、長さが$n$の
文字列を返します。 \\ \hline
$s$.rjust($n$) & $s$の左側を空白で埋めた、長さが$n$の
文字列を返します。 \\ \hline
$s$.center($n$) & $s$の左右を空白で埋めた、長さが$n$の
文字列を返します。 \\ \hline
$s$.delete($t$) & $t$に含まれる文字を$s$から削除した結果を
返します。 \\ \hline
$s$.sub($t$, $u$) & $s$に含まれる最初の$t$を$u$に
置き換えた結果を返します。 \\ \hline
$s$.gsub($t$, $u$) & $s$に含まれるすべての$t$を$u$に
置き換えた結果を返します。 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{文字列の主要なメソッド}
\label{tab:stringbasicmethods}
\index{size@\code{size}!もしれつの@文字列の\baidash}
\index{length@\code{length}}
\index{chomp@\code{chomp}}
\index{downcase@\code{downcase}}
\index{upcase@\code{upcase}}
\index{ljust@\code{ljust}}
\index{rjust@\code{rjust}}
\index{center@\code{center}}
\index{delete@\code{delete}!もしれつの@文字列の\baidash}
\index{sub@\code{sub}}
\index{gsub@\code{gsub}}
\end{table}
表\ref{tab:stringbasicmethods}は、文字列のオブジェクトが
持っているメソッドのうちの主要なものを示しています。
文字列の長さ、
\index{もしれつ@文字列!0のなかさ@\baidash の長さ}%
\index{なかさ@長さ!もしれつの@文字列の\baidash}%
つまりそれを構成している文字の個数を求めたいときは、
文字列のオブジェクトが持っている\code{size}%
\index{size@\code{size}!もしれつの@文字列の\baidash}という
メソッドを使います。たとえば、
\begin{quote}
"umiushi".size
\end{quote}
という式を評価すると、その値として7という整数のオブジェクトが
得られます。
文字列の末尾にある改行を削除したいときは、
\code{chomp}\index{chomp@\code{chomp}}というメソッドを
使います。たとえば、
\begin{quote}
\verb|"kurage\n".chomp|
\end{quote}
という式を評価すると、レシーバーの末尾にある改行を
削除することによってできる\code{kurage}という文字列の
オブジェクトが値として得られます。
文字列から特定の文字を削除したいときは、\code{delete}%
\index{delete@\code{delete}!もしれつの@文字列の\baidash}という
メソッドを使います。たとえば、
\begin{quote}
"amefurashi".delete("aiueo")
\end{quote}
という式を評価すると、レシーバーから母音の文字を
削除することによってできる\code{mfrsh}という文字列の
オブジェクトが値として得られます。
\subsection{文字列を数値に変換するメソッド}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{メッセージ式} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
$s$.to\us i & $s$を整数に変換した結果を返します。
\\ \hline
$s$.to\us f & $s$を浮動小数点数に変換した結果を返します。
\\ \hline
$s$.hex & $s$を\textrm{16}進数とみなして整数に変換した
結果を返します。 \\ \hline
$s$.oct & $s$を\textrm{8}進数とみなして整数に変換した
結果を返します。 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{文字列を数値に変換するメソッド}
\label{tab:stringtonumeric}
\index{to_i@\code{to\us i}}
\index{to_f@\code{to\us f}}
\index{hex@\code{hex}}
\index{oct@\code{oct}}
\end{table}
表\ref{tab:stringtonumeric}に示したメソッドを
使うことによって、数値を表現している文字列のオブジェクトを
数値のオブジェクトに変換することができます。
10進数で整数をあらわしている文字列のオブジェクトを整数の
オブジェクトに変換したいときは、文字列のオブジェクトが
持っている\code{to\us i}\index{to_i@\code{to\us i}}という
メソッドを使います。たとえば、
\begin{quote}
\verb|"7803".to_i|
\end{quote}
という式を評価すると、7803という整数のオブジェクトが値として
得られます。
文字列のオブジェクトを整数のオブジェクトに変換する
メソッドとしては、\code{to\us i}だけではなくて、
\code{hex}\index{hex@\code{hex}}と
\code{oct}\index{oct@\code{oct}}というメソッドもあります。
\code{to\us i}がレシーバーを10進数とみなすのに対して、
\code{hex}はレシーバーを16進数とみなします。たとえば、
\begin{quote}
"ff".hex
\end{quote}
という式を評価すると、255という整数のオブジェクトが値として
得られます。
\code{oct}は、レシーバーを8進数とみなして、それを整数の
オブジェクトに変換します。ただし、レシーバーが\code{0b}で
始まっている場合はそれを2進数とみなし、レシーバーが\code{0x}で
始まっている場合はそれを16進数とみなします。たとえば、
\begin{quote}
"0b10000001".oct
\end{quote}
という式を評価した場合、レシーバーが\code{0b}で
始まっていますので、\code{oct}はそれを2進数とみなして整数の
オブジェクトに変換します。ですから、戻り値は129になります。
\section{Rubyのプログラム}\label{sec:programofruby}
\subsection{プログラムの実行}
Rubyでは、
「プログラム\index{ふろくらむ@プログラム}」(program)という
言葉は、「式\index{しき@式}」(expression)という言葉と
ほとんど同じ意味だと
考えることができます\footnote{Rubyで書かれたプログラムは、
「スクリプト\index{すくりふと@スクリプト}」(script)と
呼ばれることもあります。}。
Rubyのプログラムは、irbに入力することによって
実行することができるわけですが、ファイルの中にプログラムを
格納しておいて、それを処理系(irbまたはruby)に
実行させるということも可能です。
それでは実際に、ファイルの中に格納されているプログラムを
処理系に実行させてみましょう。まず、エディターを使って、
\code{hello.rb}という名前のファイルに次のプログラムを
保存してください。
\begin{program}{hello.rb}
\begin{verbatim}
"みなさん、こんにちは。\n".display
\end{verbatim}
\end{program}
なお、Rubyのプログラムを格納するファイルの名前には、
このように\code{.rb}という拡張子を付けることになっています。
irb\index{irb}を使ってプログラムを実行したいときは、
\code{load}\index{load@\code{load}}という関数的メソッドを
使います。\code{load}は、引数として1個の文字列を受け取って、
その文字列を、プログラムが格納されているファイルのパス名と
みなして、そのプログラムを読み込んで実行します。
それでは、先ほど入力したプログラムを、irbを使って
実行してみましょう。
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("hello.rb")
みなさん、こんにちは。
=> true
\end{verbatim}
\end{jikkourei}
ちなみに、\code{load}は、戻り値として常に\code{true}を
返します。
ruby\index{ruby}を使ってプログラムを実行したいときは、
シェルに対して、
\begin{quote}
ruby \syntax{パス名}
\end{quote}
というコマンドを入力します。そうすると、rubyが起動して、
パス名で指定されたファイルの中に格納されているプログラムを
実行します。
それでは、先ほど入力したプログラムを、rubyを使って
実行してみましょう。
\begin{jikkourei}
\begin{verbatim}
$ ruby hello.rb
みなさん、こんにちは。
\end{verbatim}
\end{jikkourei}
\subsection{注釈}
人間によって書かれたプログラムというのは、処理系という
プログラムによって処理される文書です。プログラムによって
処理される文書を書くときには、プログラムがそれを
処理できるように書かないといけないのはもちろんですが、
それだけではなくて、人間にとって理解しやすいように
書くということも重要です。
人間にとって理解しやすい文書を書く上で大きな役割を
果たすもののひとつに、「注釈」と呼ばれるものがあります。
「注釈\index{ちゅうしゃく@注釈}」(comment)というのは、
文書の中に含まれる、人間がその文書を理解するための
手助けとなる記述のことです。
プログラムによって処理される文書の中に注釈を書くためには、
この部分は注釈だから処理しなくてもいい、ということが
プログラムにわかるような書き方をする必要があります。ですから、
プログラムによって処理される文書を書くための言語の中には、
たいてい、注釈を書くための規則が含まれています。
Rubyでは、「この部分は注釈です」ということを処理系に
知らせるために、シャープ(\code{\#})という文字を使います。
プログラムの中にシャープを書くと、Rubyの処理系は、
その直後から改行までの部分を注釈とみなして無視します。
それでは、次のプログラムを入力して、rubyに
実行させてみてください。
\begin{program}{comment.rb}
\begin{verbatim}
"Congratulations!\n".display # 日本語では「おめでとう」
\end{verbatim}
\end{program}
このプログラムの中にある
「日本語では「おめでとう」」という部分は、シャープと改行の
あいだに書かれていますので、rubyはその部分を注釈とみなして
無視します。さて、それでは、このプログラムからシャープを
取り除いて実行すると、いったいどうなるでしょうか。
試してみてください。
\chapter{式}\label{chap:expression}
\section{基本的な式}\label{sec:basicexpression}
\subsection{式についての復習}
この章では、式というものについて説明していきたいと思います。
そこで、この章を始めるに当たって、まず、
第\ref{chap:ooprogramming}章で式について説明したことを
復習しておくことにしましょう。
何らかの動作を記述した文字の列のことを
「式\index{しき@式}」(expression)と呼びます。式が記述している
動作を実行することを、式を
「評価する\index{ひょうかする@評価する}」(evaluate)と
言います。式を評価すると、その結果として1個のオブジェクトが
得られます。式を評価した結果として得られる
オブジェクトのことを、その式の
「値\index{あたい@値!しきの@式の\baidash}」(value)と呼びます。
特定のオブジェクトを生成するという動作を記述した式のことを
「リテラル\index{りてらる@リテラル}」(literal)と呼びます。
たとえば、\code{7038}というのは、7038という整数の
オブジェクトを生成するリテラルで、\code{"namako"}というのは、
\code{namako}という文字列のオブジェクトを生成する
リテラルです。
リテラルを評価すると、それによって生成されたオブジェクトが
値として得られます。たとえば、\code{7038}というリテラルを
評価すると、その値として、7038という整数のオブジェクトが
得られます。
オブジェクトにメッセージを送る、という動作をあらわしている
式のことを
「メッセージ式\index{めっせえししき@メッセージ式}」
(message expression)と呼びます。メッセージ式は、基本的には、
\begin{quote}
\syntax{式}\,{\Large .}\,\syntax{メソッド名}\,{\Large (}\,%
\syntax{式}{\Large ,} \tenten\ {\Large )}
\end{quote}
と書きます。メッセージ式を評価すると、ドット(\code{.})の左側の
式を評価することによって得られたオブジェクトに対して、ドットの
右側がメッセージとして送られます。すると、メッセージを
受け取ったオブジェクト(つまりレシーバー)は、メッセージの中の
メソッド名で指定されたメソッドを呼び出して、その右側の式の値を
引数としてそのメソッドに渡します。そして、呼び出された
メソッドが戻り値として返したオブジェクトが、メッセージ式全体の
値になります。たとえば、
\begin{quote}
"shimauma".gsub("ma", "be")
\end{quote}
というメッセージ式を評価すると、\code{"shimauma"}という
文字列のオブジェクトの中の\code{gsub}というメソッドが
呼び出されて、\code{"ma"}と\code{"be"}が引数として
そのメソッドに渡されます。\code{gsub}は、レシーバーの中の
\code{"ma"}を\code{"be"}に置き換えた結果を戻り値として
返しますので、\code{"shibeube"}という文字列が、
そのメッセージ式の値として得られることになります。
\subsection{式列}
式を並べることによってできる列のことを
「式列\index{しきれつ@式列}」(expression sequence)と
呼びます。ただし、式列を構成するそれぞれの式は、
セミコロン(\code{;})または改行で区切られていないといけません。
つまり、式列というのは、
\begin{quote}
\framebox[4zw]{式}{\Large ;} \framebox[4zw]{式}{\Large ;}%
\ \tenten
\end{quote}
という形で式を並べたもの、または、
\begin{syntaxquote}
\framebox[12zw]{式} \\*[0.1zh]
\framebox[12zw]{式} \\
\makebox[12zw]{\tatetenten}
\end{syntaxquote}
という形で式を並べたもの、ということになります。
式列は、その全体がひとつの式になります。式列を評価すると、
それを構成するそれぞれの式が、先頭から末尾に向かって順番に
評価されていきます。たとえば、
\begin{quote}
\verb|"mike".display; "neko".display; "\n".display|
\end{quote}
という式列を評価すると、まず\code{mike}という文字列が
出力されて、次に\code{neko}という文字列が出力されて、そののち
改行が出力されます。irbで試してみると、次のようになります。
\begin{quote}
\begin{verbatim}
irb(main):001:0> "mike".display; "neko".display; "\n".display
mikeneko
=> nil
\end{verbatim}
\end{quote}
それでは、次のプログラムをファイルに保存してください。
\begin{program}{expsequ.rb}
\begin{verbatim}
"リテラル\n".display
"メッセージ式\n".display
"式列\n".display
\end{verbatim}
\end{program}
プログラムの保存ができたら、そのプログラムを
実行してみてください。そうすると、式列の中の式が順番に
評価されて、次のように出力されるはずです。
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("expsequ.rb")
リテラル
メッセージ式
式列
=> true
\end{verbatim}
\end{jikkourei}
式列を評価すると、その末尾の式の値が、式列全体の値として
得られます。つまり、
\begin{quote}
\syntax{\subscript{式}{1}}{\Large ;}
\syntax{\subscript{式}{2}}{\Large ;}
\tenten {\Large ;}
\syntax{\subscript{式}{n}}
\end{quote}
という式列を評価すると、その末尾にある、
\subscript{式}{n}という式の値が、式列全体の値になります。
ですから、末尾以外の式は、その値が失われることになります。
irbで試してみると、次のようになります。
\begin{quote}
\begin{verbatim}
irb(main):001:0> "kitsune"; 604; "tanuki"; 532
=> 532
\end{verbatim}
\end{quote}
\section{リテラル}\label{sec:literal}
\subsection{リテラルについての復習など}
すでに第\ref{sec:ruby}節で説明したように、特定のオブジェクトを
生成するという動作を記述した式は、
「リテラル\index{りてらる@リテラル}」(literal)と呼ばれます。
たとえば、\code{"suzume"}のような、文字列を二重引用符で
囲んだものは、リテラルの一種です。
リテラルを評価すると、それによって生成されたオブジェクトが、
その値として得られます。たとえば、\code{"suzume"}という
リテラルを評価すると、それによって生成された
\code{suzume}という文字列のオブジェクトが、その値として
得られます。
第\ref{sec:ruby}節でのリテラルについての説明は、きわめて
不十分なものでしたので、この節では、リテラルについて、
もう少し詳細な説明を加えたいと思います。
ところで、この文章の中では、これまでのところ、文字列を
取り扱うさまざまなメソッドを持っているオブジェクトのことを
「文字列のオブジェクト」と呼んできました。しかし、
これから先は、文字列のオブジェクトを指していることが文脈から
明らかに分かる場合には、「文字列のオブジェクト」のことを単に
「文字列」と呼ぶことにします。
同じように、文字列以外のオブジェクトについても、誤解の
おそれがなければ、「○○のオブジェクト」のことを単に「○○」と
呼ぶことにします。
\subsection{整数のリテラル}
\index{せいすう@整数!0のりてらる@\baidash のリテラル}
\index{りてらる@リテラル!せいすうの@整数の\baidash}
\code{481}とか\code{3007}というような、数字だけから構成される
列は、プラスの整数のオブジェクトを生成するリテラルになります。
たとえば、\code{481}というリテラルを評価すると、481という
プラスの整数のオブジェクトが値として得られます。
整数のオブジェクトは、
\code{Fixnum}\index{Fixnum@\code{Fixnum}}というクラスの
インスタンスです。ただし、巨大な整数のオブジェクトは、
\code{Fixnum}ではなくて
\code{Bignum}\index{Bignum@\code{Bignum}}というクラスの
インスタンスです。
それでは、irbで、整数のオブジェクトを生成したクラスを
調べてみましょう。
\begin{quote}
\begin{verbatim}
irb(main):001:0> 10.class
=> Fixnum
irb(main):002:0> 1000000000000000000000000000000.class
=> Bignum
\end{verbatim}
\end{quote}
ちなみに、\code{Fixnum}と\code{Bignum}の境目は、Rubyの
仕様ではなくて、環境に依存して決定されます。
数字の列の左端にマイナス(\code{-})という文字を書くと、
その全体は、マイナスの整数を生成するリテラルになります。
たとえば、\code{-56}というリテラルは、マイナスの56という整数を
生成します。
10進数ではなくて、8進数や16進数や2進数で整数を生成することも
可能です。10進数以外の基数で整数を生成したいときは、そのための
接頭辞をリテラルの先頭に書きます。接頭辞は、8進数は\code{0}、
16進数は\code{0x}、2進数は\code{0b}です。
たとえば、\code{0377}、\code{0xff}、\code{0b11111111}は、
いずれも、255という整数を生成します。
\subsection{浮動小数点数のリテラル}
\index{ふとうしょうすうてんすう@浮動小数点数!0のりてらる@
\baidash のリテラル}
\index{りてらる@リテラル!ふとうしょうすうてんすうの@
浮動小数点数の\baidash}
ひとつの数値を、数字の列と小数点の位置という二つの要素で
表現しているデータは、
「浮動小数点数\index{ふとうしょうすうてんすう@浮動小数点数}」
(floating point number)と呼ばれます。浮動小数点数の
オブジェクトは、\code{Float}\index{Float@\code{Float}}という
クラスのインスタンスです。
\code{0.003}とか\code{41.56}とか\code{723.0}というような、
数字の列の途中に、
ドット\index{とっと@ドット!ふとうしょうすうてんすうの@
浮動小数点数の\baidash}(\code{.}%
\index{.@\code{.}!ふとうしょうすうてんすうの@
浮動小数点数の\baidash})という文字を1個だけ書いたものは、
プラスの浮動小数点数のオブジェクトを生成する
リテラルになります。この場合、ドットは小数点の位置を示します。
整数のリテラルの場合と同じように、浮動小数点数のリテラルの
場合も、左端にマイナス(\code{-})という文字を書くと、
その全体は、マイナスの浮動小数点数を生成する
リテラルになります。たとえば、\code{-8.317}というリテラルは、
マイナスの8.317という浮動小数点数を生成します。
浮動小数点数のリテラル($a$)の右側に\code{e}という文字を
書いて、そのさらに右側に整数のリテラル($b$)を書いた、
\begin{quote}
$a$\code{e}$b$
\end{quote}
という形のリテラルを書くことも可能です。この形のリテラルを
評価すると、
\begin{displaymath}
a \times 10^{b}
\end{displaymath}
という浮動小数点数が生成されます。たとえば、
\begin{quote}
-3.71e-24
\end{quote}
というリテラルは、
\begin{displaymath}
-3.71 \times 10^{-24}
\end{displaymath}
という浮動小数点数を生成します。
\subsection{文字列のリテラル}
\index{もしれつ@文字列!0のりてらる@\baidash のリテラル}
\index{りてらる@リテラル!もしれつの@文字列の\baidash}
第\ref{sec:ruby}節で説明したように、文字列を
二重引用符\index{にしゅういんようふ@二重引用符}%
(\code{"}\index{""@\code{""}})で囲んだものは、その文字列の
オブジェクトを生成するリテラルになります。たとえば、
\code{"namako"}というのは、\code{namako}という文字列の
オブジェクトを生成するリテラルです。
\subsection{バックスラッシュ記法}
改行のような、出力装置を制御するための特殊な文字は、文字列の
リテラルの中では、「バックスラッシュ記法
\index{はっくすらっしゅきほう@バックスラッシュ記法}」
(backslash notation)と呼ばれる表記法によって記述されます。
バックスラッシュ記法というのは、バックスラッシュ
\index{はっくすらっしゅ@バックスラッシュ}%
(\code{\bs}\index{\@\code{\bs}})という文字で始まる
文字列によって1個の文字を記述する表記法のことです。たとえば、
バックスラッシュ記法を使うことによって、
タブ\index{たふ@タブ}は
\code{\bs t}\index{\t@\code{\bs t}}、
改行\index{かいきょう@改行}は
\code{\bs n}\index{\n@\code{\bs n}}、
改ページ\index{かいへえし@改ページ}は
\code{\bs f}\index{\f@\code{\bs f}}と記述することができます。
ですから、
\begin{quote}
isoginchaku \\
fujitsubo
\end{quote}
というような、改行を含んでいる文字列は、
\begin{quote}
\verb|"isoginchaku\nfujitsubo"|
\end{quote}
というリテラルを書くことによって生成することができます。
バックスラッシュ記法は、出力装置を制御する文字を
記述するときだけではなくて、文字列のリテラルの中で特殊な意味を
持つ文字を記述するときにも使われます。たとえば、
二重引用符\index{にしゅういんようふ@二重引用符}%
(\code{"}\index{""@\code{""}})という文字は、文字列のリテラルを
囲むために使われる文字ですので、文字列のリテラルの中で
二重引用符を記述したいときは、
\code{\bs "}\index{"\""@\code{\bs ""}}と書く必要があります。
そして、バックスラッシュという文字も特殊な意味を
持っていますので、文字列のリテラルの中でバックスラッシュを
記述したいときは、
\code{\bs \bs}\index{\\@\code{\bs \bs}}と書く必要があります。
\subsection{式展開}
文字列のリテラルの中に式を書いておいて、文字列のリテラルが
評価された時点で、その式を評価して、その値を文字列の中に
埋め込む、ということが可能です。
しかし、式の値を文字列に埋め込みたいからと言って、ただ単に
文字列のリテラルの中に式を書いただけでは、その意図が処理系には
伝わりません。式の値を文字列に埋め込みたいという意図を処理系に
伝えるためには、単なる式ではなくて、
「式展開\index{しきてんかい@式展開}」(expression unfolding)と
呼ばれる文字列を書く必要があります。
式展開は、
\begin{quote}
\#\lb \syntax{式}\rb
\end{quote}
という構文を持つ文字列です。たとえば、
\begin{quote}
\verb|"\"subject\" consists of #{"subject".size} characters."|
\end{quote}
というリテラルを評価すると、その中に書かれた式がその時点で
評価されて、
\begin{quote}
"subject" consists of 7 characters.
\end{quote}
という文字列が生成されます。
\subsection{文字のリテラル}
\index{もし@文字!0のりてらる@\baidash のリテラル}
\index{りてらる@リテラル!もしの@文字の\baidash}
文字のオブジェクトは、\code{Fixnum}クラスのインスタンスです。
つまり、文字は整数によってあらわされるわけです。たとえば、
大文字の\code{A}は65という整数であらわされ、
スラッシュ(\code{/})は47という整数であらわされます。文字を
あらわしている整数は、その文字の
「文字コード\index{もしこおと@文字コード}」(character code)と
呼ばれます\footnote{「文字コード」という言葉は、文字と整数とを
対応させる規則、という意味で使われることもあります。}。
ですから、特定の文字のオブジェクトを生成したいときは整数の
リテラルを書けばいい、ということになるわけですが、その方法は
少し不便です。実は、整数を生成するリテラルには、
まだ説明していないもうひとつの書き方があって、特定の文字の
オブジェクトを生成したいときは、その書き方を使うと便利です。
整数を生成するリテラルのもうひとつの書き方というのは、
まずクエスチョンマーク
\index{くえすちょんまあく@クエスチョンマーク!もしのりてらるの@
文字のリテラルの\baidash}%
(\code{?}\index{?@\code{?}!もしのりてらるの@
文字のリテラルの\baidash})を書いて、その右側に1個の文字を
書く、というものです。そのようなリテラルを評価すると、
クエスチョンマークの右側に書かれた文字に対応する文字コードの
オブジェクトが生成されます。たとえば、\code{?M}という
リテラルは、大文字の\code{M}の文字コード(77)を生成します。
クエスチョンマークの右側に、バックスラッシュ記法で文字を
記述することも可能です。たとえば、\code{?\bs n}という
リテラルは、改行という文字の文字コード(10)を生成します。
\section{演算子}\label{sec:operator}
\subsection{演算}
メッセージ式とは異なる形の式を書くことによって
呼び出すことのできる動作のことを「演算\index{えんさん@演算}」
(operation)と呼びます。演算というのは、基本的にはメソッドの
一種だと考えていいのですが、メソッドではない演算というのも
いくつか存在します。
演算に与えられた名前のことを
「演算子\index{えんさんし@演算子}」(operator)と呼びます。
そして、演算を呼び出すために書かれる、メッセージ式とは異なる
形の式は、「演算子式\index{えんさんししき@演算子式}」
(operator expression)と呼ばれます。演算子式にはいくつかの
形があって、どの形の演算子式を書けばいいのかというのは、
呼び出したい演算の種類によって決まります。
二つのオブジェクトを処理の対象とする演算は
「二項演算\index{にこうえんさん@二項演算}」
(binary operation)と呼ばれ、それに与えられた名前は
「二項演算子\index{にこうえんさんし@二項演算子}」
(binary operator)と呼ばれます。二項演算を呼び出したい場合は、
\begin{quote}
\syntax{式} \syntax{二項演算子} \syntax{式}
\end{quote}
という形の演算子式を書きます。
ひとつのオブジェクトを処理の対象とする演算は
「単項演算\index{たんこうえんさん@単項演算}」
(unary operation)と呼ばれ、それに与えられた名前は
「単項演算子\index{たんこうえんさんし@単項演算子}」
(unary operator)と呼ばれます。単項演算を呼び出したい場合は、
\begin{quote}
\syntax{単項演算子} \syntax{式}
\end{quote}
という形の演算子式を書きます。
\subsection{算術演算}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{演算子式} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
$a$ + $b$ & $a$と$b$とを加算した結果を返します。 \\ \hline
$a$ - $b$ & $a$から$b$を減算した結果を返します。 \\ \hline
$a$ * $b$ & $a$と$b$とを乗算した結果を返します。 \\ \hline
$a$ ** $b$ & $a$の$b$乗を返します。 \\ \hline
$a$ / $b$ &
$a$を$b$で除算したときの商を返します。 \\ \hline
$a$ \% $b$ &
$a$を$b$で除算したときのあまりを返します。 \\ \hline
+ $a$ & $a$をそのまま返します。 \\ \hline
- $a$ & $a$の符号(プラスかマイナスか)を反転させた結果を
返します。 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{算術演算}
\label{tab:arithmeticoperation}
\index{+@\code{+}!すうちの@数値の\baidash}
\index{-@\code{-}!すうちの@数値の\baidash}
\index{*@\code{*}!すうちの@数値の\baidash}
\index{**@\code{**}}
\index{/@\code{/}}
\index{%@\code{\%}}
\end{table}
数値(整数または浮動小数点数)のオブジェクトは、
加算、減算、乗算、除算などを実行する演算のメソッドを
持っています。それらの演算は、総称して
「算術演算\index{さんしゅつえんさん@算術演算}」
(arithmetic operation)と呼ばれ、それらの演算の名前は
「算術演算子\index{さんしゅつえんさんし@算術演算子}」
(arithmetic operator)と呼ばれます。算術演算には、
表\ref{tab:arithmeticoperation}のようなものがあります。
それでは、実際に算術演算を呼び出してみましょう。まず、
\begin{quote}
7.+(8)
\end{quote}
というメッセージ式をirbに入力してみてください。すると、
15という値が得られるはずです。
\code{+}というのは演算子ですから、メッセージ式ではなくて
演算子式を書くことによって呼び出すことも可能です。そこで次に、
\begin{quote}
7+8
\end{quote}
という演算子式を入力してみてください。すると、先ほどと同じ
結果になるはずです。
\subsection{範囲演算}
始端と終端を意味する二つのオブジェクトによって指定される
オブジェクトの列は、
「範囲\index{はんい@範囲}」(range)と呼ばれます。範囲の
オブジェクトは、\code{Range}というクラスのインスタンスです。
範囲のオブジェクトは、
「範囲演算\index{はんいえんさん@範囲演算}」(range operation)と
呼ばれる二項演算を呼び出すことによって生成することができます。
範囲演算には、\code{..}\index{..@\code{..}}と
\code{...}\index{...@\code{...}}の2種類があります。
\code{..}は、始端と終端の両方を含む範囲のオブジェクトを生成する
演算で、\code{...}は、始端は含むけれども終端は含まない範囲の
オブジェクトを生成する演算です。たとえば、
\begin{quote}
30..80
\end{quote}
という式を評価すると、30から80までの範囲が生成され、
\begin{quote}
30...80
\end{quote}
という式を評価すると、30から79までの範囲が生成されます。
整数だけではなくて、文字列の範囲を生成することも可能です。
たとえば、
\begin{quote}
"ax".."bc"
\end{quote}
という式を評価すると、
\begin{quote}
"ax" "ay" "az" "ba" "bb" "bc"
\end{quote}
という範囲が生成されます。
\subsection{文字列演算}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{演算子式} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
$s$ + $t$ & $s$の右側に$t$を連結した結果を返します。
\\ \hline
$s$ * $n$ & $s$を$n$回繰り返して連結した結果を返します。
\\ \hline
$s$[$i$] & $s$の$i$番目の文字の文字コードを返します。
\\ \hline
$s$[$i$..$j$] &
$s$の$i$番目から$j$番目までの部分文字列を返します。
\\ \hline
$s$[$i$, $n$] &
$s$の$i$番目から始まる長さが$n$の部分文字列を返します。
\\ \hline
\end{tabular}
\end{ttfamily}
\caption{文字列演算}
\label{tab:stringoperation}
\end{table}
文字列のオブジェクトも、
「文字列演算\index{もしれつえんさん@文字列演算}」
(string operation)と呼ばれるいくつかの演算を持っています。
表\ref{tab:stringoperation}は、文字列演算のうちの主要なものを
示しています。
文字列の
\code{+}\index{+@\code{+}!もしれつの@文字列の\baidash}は、
文字列と文字列とを連結します。たとえば、
\begin{quote}
"kitsune" + "udon"
\end{quote}
という式を評価すると、\code{kitsuneudon}という文字列が値として
得られます。
文字列の
\code{*}\index{*@\code{*}!もしれつの@文字列の\baidash}は、
ひとつの文字列を指定された回数だけ繰り返して連結します。
たとえば、
\begin{quote}
"----+" * 12
\end{quote}
という式を評価すると、
\begin{quote}
----+----+----+----+----+----+----+----+----+----+----+----+
\end{quote}
という文字列が値として得られます。
角括弧(\code{[\,]})という演算を呼び出すための式は、これまでに
出てきた演算子式とは少し形が違いますが、これもまた演算子式の
一種です。角括弧の左側の式の値がレシーバーになって、角括弧で
囲まれた場所に書かれた式の値が引数になります。
文字列を構成するそれぞれの文字には、先頭が0番、次の文字が1番、
というように番号が与えられています。\code{[\,]}%
\index{[]@\code{[\,]}!もしれつの@文字列の\baidash}に引数として
整数を渡すと、\code{[\,]}は、その整数を番号とする文字を
レシーバーの中から取り出して、その文字を戻り値として返します。
それでは、実際に\code{[\,]}を呼び出してみましょう。たとえば、
\begin{quote}
"namako"[4]
\end{quote}
という式を評価すると、107という整数が値として得られます。
この107という整数は、\code{k}という文字の文字コードです。
\code{[\,]}に対して、引数として範囲を渡すと、\code{[\,]}は、
受け取った範囲によって指定される
部分文字列\index{ふふんもしれつ@部分文字列}を戻り値として
返します。たとえば、
\begin{quote}
"isoginchaku"[3..8]
\end{quote}
という式を評価すると、3番目から8番目までの部分文字列、つまり
\code{gincha}という文字列が値として得られます。
\code{$s$[$i$, $n$]}という形の式で\code{[\,]}を呼び出すと、
\code{[\,]}は、$i$番目から始まる長さが$n$の
部分文字列\index{ふふんもしれつ@部分文字列}を戻り値として
返します。たとえば、
\begin{quote}
"tatsunootoshigo"[7, 6]
\end{quote}
という式を評価すると、7番目から始まる長さが6の部分文字列、
つまり\code{otoshi}という文字列が値として得られます。
\subsection{優先順位と結合規則}
ところで、$\circ$と$\bullet$のそれぞれが二項演算子で、$a$と
$b$と$c$のそれぞれが式だとするとき、
\begin{quote}
$a$ $\circ$ $b$ $\bullet$ $c$
\end{quote}
という式は、
\begin{quote}
\expbox{$a$ $\circ$ $b$} $\bullet$ $c$
\end{quote}
と解釈されるのでしょうか、それとも、
\begin{quote}
$a$ $\circ$ \expbox{$b$ $\bullet$ $c$}
\end{quote}
と解釈されるのでしょうか。
そのような、演算子が何個も含まれている式は、それぞれの演算子が
持っている、「優先順位」(precedence)という属性か、または
「結合規則」(associativity)という属性にしたがって
解釈されます。
\begin{table}[tb]\centering
\begin{tabular}{|l|} \hline
\texttt{[\,]\ \ [\,]=} \\ \hline
\verb|**| \\ \hline
\texttt{単項の\,+\ \ 単項の\,-\ \ !\ \ \~} \\ \hline
\verb|* / %| \\ \hline
\texttt{二項の\,+\ \ 二項の\,-} \\ \hline
\verb|<< >>| \\ \hline
\verb|&| \\ \hline
\verb/| ^/ \\ \hline
\verb|> < >= <=| \\ \hline
\verb|<=> == === != =~ !~| \\ \hline
\verb|&&| \\ \hline
\verb/||/ \\ \hline
\verb|.. ...| \\ \hline
\verb|? :| \\ \hline
\verb|= 自己代入演算子| \\ \hline
\verb|defined?| \\ \hline
\verb|not| \\ \hline
\verb|and or| \\ \hline
\verb|if unless while until| \\ \hline
\verb|begin/end| \\ \hline
\end{tabular}
\caption{演算子の優先順位}\label{tab:precedence}
\end{table}
優先順位\index{ゆうせんしゅんい@優先順位}というのは、演算子が
左右の式と結合する強さの順位だと考えることができます。
優先順位の高い演算子は、低い演算子に比べて、より強く左右の式と
結合します。
表\ref{tab:precedence}は、演算子の優先順位を
示したものです(まだ説明していない演算子がたくさん
含まれていますが、その点は気にしないでください)。この表は、
上のほうに書かれている演算子ほど高い優先順位を持っていて、横に
並べて書かれている演算子は同一の優先順位を
持っているということを意味しています。
たとえば、乗算と除算の演算子は、加算と減算の演算子よりも高い
優先順位を持っていますので、
\begin{quote}
$a$ + $b$ * $c$
\end{quote}
という式は、
\begin{quote}
$a$ + \expbox{$b$ * $c$}
\end{quote}
と解釈されます。
さて、それでは、同一の優先順位を持つ演算子がいくつも
含まれている、
\begin{quote}
$a$ - $b$ + $c$
\end{quote}
というような式は、どのように解釈されるのでしょうか。
そのような式は、演算子の優先順位では解釈できませんので、
演算子が持っている結合規則という属性によって
解釈されることになります。
結合規則\index{けつこうきそく@結合規則}は、同一の優先順位を
持つ演算子が共有している性質です。それらの演算子が
ひとつの式の中に何個も含まれているとき、それぞれの演算子が
左右の式と結合する強さは、それらの演算子が共有している
結合規則によって決定されます。左にあるものほど強くなるという
結合規則は「左結合\index{ひたりけつこう@左結合}」
(left-associativity)と呼ばれ、右にあるものほど強くなるという
結合規則は「右結合\index{みきけつこう@右結合}」
(right-associativity)と呼ばれます。
これまでに登場した二項演算子の結合規則は、すべて左結合です。
したがって、
\begin{quote}
$a$ - $b$ + $c$
\end{quote}
という式は、
\begin{quote}
\expbox{$a$ - $b$} + $c$
\end{quote}
と解釈されることになります。
\subsection{丸括弧式}
丸括弧
\index{まるかっこ@丸括弧!まるかっこしきの@丸括弧式の\baidash}%
\index{()@\code{(\,)}!まるかっこしきの@丸括弧式の\baidash}%
で式を囲んだもの、つまり、
\begin{quote}
{\Large (}\,\framebox[8zw]{式}\,{\Large )}
\end{quote}
という形のものは、
「丸括弧式\index{まるかっこしき@丸括弧式}」
(parenthesis expression)と呼ばれる式になります。丸括弧式を
評価すると、丸括弧の中の式が評価されて、その値が丸括弧式全体の
値になります。
丸括弧式は、優先順位や結合規則とは無関係に、式を書く人間の
意図のとおりに式を解釈してほしい、という場合に使われます。
たとえば、
\begin{quote}
\expbox{$a$ + $b$} * $c$
\end{quote}
と解釈されるような式を書きたい、というときは、
\begin{quote}
($a$ + $b$) * $c$
\end{quote}
というように丸括弧式を使えばいいわけです。
メッセージ式を書くときに使われるドット(\code{.})というのは、
厳密には演算子ではありませんが、式の解釈という観点から見た
場合、優先順位のきわめて高い演算子だと考えることができます。
ですから、$\circ$が二項演算子だとするとき、
\begin{quote}
$a$ $\circ$ $b$ .\ \textrm{message}
\end{quote}
という式は、
\begin{quote}
$a$ $\circ$ \expbox{$b$ .\ \textrm{message}}
\end{quote}
と解釈されることになります。このような、ドットを含んでいる
式に関しても、丸括弧式を使うことによって、
どう解釈してほしいのかということを指定することができます。
たとえば、
\begin{quote}
\expbox{$a$ $\circ$ $b$} .\ \textrm{message}
\end{quote}
と解釈されるような式を書きたい、というときは、
\begin{quote}
($a$ $\circ$ $b$) .\ \textrm{message}
\end{quote}
というように丸括弧式を使えばいいわけです。
\section{変数}\label{sec:variable}
\subsection{変数の基礎}
プログラミング言語の多くは、「変数\index{へんすう@変数}」
(variable)と呼ばれるものを取り扱います。この「変数」という
言葉の意味は、プログラミング言語ごとに微妙に異なります。
Rubyでも「変数」と呼ばれるものを取り扱うのですが、Rubyの
「変数」は、オブジェクトに付ける名札のようなもの、という
意味です。
プログラムの多くは、リテラルで記述されるような特定の
オブジェクトだけではなくて、特定できない
オブジェクトというものも扱います。そのような不特定の
オブジェクトを扱うためには、それに名札を付けることが
必要になります。オブジェクトに対して変数という名札を
付けておくと、それの実体が何であるかにかかわらず、それを
プログラムの中で取り扱うことができるようになります。
オブジェクトに変数という名札が付けられているとき、その変数は
そのオブジェクトを「指し示す\index{さししめす@指し示す}」
(point)と言われます。
変数には、ローカル変数
\index{ろおかるへんすう@ローカル変数}(local variable)、
グローバル変数
\index{くろおはるへんすう@グローバル変数}(global variable)、
インスタンス変数\index{いんすたんすへんすう@インスタンス変数}%
(instance variable)、
クラス変数\index{くらすへんすう@クラス変数}%
(class variable)という4種類のものがあります。
ローカル変数というのがごく普通の変数のことで、グローバル変数、
インスタンス変数、クラス変数というのは、やや特殊な変数です。
なお、この節では、ローカル変数のことをただ単に「変数」と
呼ぶことにします。
\subsection{変数名}
変数という名札には、ひとつの名前が書かれています。変数に
書かれている名前のことを、
「変数名\index{へんすうめい@変数名}」(variable name)と
呼びます。変数名は、英字、数字、アンダースコア(\code{\us})を
並べることによって作ります。ただし、変数名の先頭の文字は
英字の小文字でないといけません。
たとえば、\code{a}、\code{namako}、\code{uni83}、
\code{ika\us tako}、\code{ikaTako}、などは、変数名として
使うことのできる名前です。
変数名は、式として評価することができます。変数名を
評価することによって得られる値は、その変数が指し示している
オブジェクトです。たとえば、\code{namako}という名前の変数が、
684というオブジェクトに名札として与えられているとするとき、
\code{namako}という変数名を評価すると、684というオブジェクトが
値として得られます。
\subsection{代入}
オブジェクトに変数という名札を付けることを、変数に
オブジェクトを
「代入する\index{たいにゅうする@代入する}」(assign)と
言います。
変数にオブジェクトを代入したいときは、
「代入演算子\index{たいにゅうえんさんし@代入演算子}」
(assignment operator)と呼ばれるいくつかの演算子のうちの
いずれかを使います。代入演算子は、変数にオブジェクトを
代入するという動作をあらわしていて、その動作は
「代入演算\index{たいにゅうえんさん@代入演算}」
(assignment operation)と呼ばれます(代入演算は
メソッドではありません)。
代入演算子のうちで、もっとも単純な演算をあらわしているのは、
\code{=}\index{=@\code{=}}という演算子です。この演算子は、
左辺で指定された変数に右辺の値を代入する、という演算を
あらわしています。たとえば、
\begin{quote}
namako = 4004
\end{quote}
という式を評価することによって、\code{namako}という変数に
4004という整数のオブジェクトを
代入することができます(\code{namako}という変数が
存在していない場合は、この時点で新しく作られます)。
変数が指し示すオブジェクトは、何度でも変更することが可能です。
変数が指し示すオブジェクトを変更したいときは、ただ単に、別の
オブジェクトを代入すればいいだけです。たとえば、今、
4004というオブジェクトを指し示している\code{namako}という
変数があるとしましょう。このとき、
\begin{quote}
namako = 3773
\end{quote}
という式で\code{namako}に3773を代入したとすると、
\code{namako}が指し示すオブジェクトは、4004から3773へ
変更されます。
それでは、irbを使って、実際に変数にオブジェクトを
代入してみましょう。
\begin{quote}
\begin{verbatim}
irb(main):001:0> namako = 4004
=> 4004
irb(main):002:0> namako
=> 4004
irb(main):003:0> namako = 3773
=> 3773
irb(main):004:0> namako
=> 3773
\end{verbatim}
\end{quote}
\subsection{複数の変数への同一オブジェクトの代入}
Rubyでは、二項演算子の大多数は結合規則が左結合ですが、
代入演算子の結合規則は右結合\index{みきけつこう@右結合}です。
つまり、
\begin{quote}
$a$ = $b$ = $c$
\end{quote}
という式は、
\begin{quote}
$a$ = \expbox{$b$ = $c$}
\end{quote}
と解釈されることになります。
代入演算子を使って変数にオブジェクトを代入する式を評価すると、
その値として、代入ののちに変数が指し示すことになった
オブジェクトが得られます。
ところで、変数にオブジェクトを代入する式は、代入という動作が
第一の目的ですので、式の値を利用するということは
めったにありません。しかし、利用すれば便利だという場面が、
まったくないわけではありません。
そのような場面のひとつとして、複数の変数に同一のオブジェクトを
代入したい、というときがあります。変数にオブジェクトを代入する
式の値を利用すると、複数の変数に同一のオブジェクトを
代入するという動作をひとつの式で書くことが可能になります。
たとえば、
\begin{quote}
a = b = c = d = 3579
\end{quote}
という式を書くことによって、4個の変数のそれぞれに3579という
同一の整数のオブジェクトを代入することができます。
\subsection{自己代入演算子}
\code{=}以外のすべての代入演算子は、「自己代入演算子
\index{しこたいにゅうえんさんし@自己代入演算子}」
(self assignment operator)と呼ばれるものです。
自己代入演算子というのは、変数が指し示している
オブジェクトに対して演算を実行することによって得られた
オブジェクトを、元の変数に代入する、という動作をあらわしている
演算子のことです。
自己代入演算子は、すべて、\textit{op}\texttt{=}\,という
形になっています。この中の\textit{op}のところには、\code{+}、
\code{-}、\code{*}、\code{/}などの二項演算子が入ります。
二項演算子とイコールとのあいだに空白を入れることはできません。
自己代入演算子を使って、
\begin{quote}
\syntax{変数名} \textrm{\textit{op}}\texttt{=} \syntax{式}
\end{quote}
という式を書いたとすると、それは、
\begin{quote}
\syntax{変数名} \texttt{=} \syntax{変数名}
\ \textrm{\textit{op}} \syntax{式}
\end{quote}
という意味だと解釈されます。たとえば、
\begin{quote}
a += 3
\end{quote}
という式は、
\begin{quote}
a = a + 3
\end{quote}
という式と同じ意味になります。つまり、\code{a}という変数が
指し示しているオブジェクトを、それを3だけ大きくした
オブジェクトに変更するわけです。
\section{メソッドの定義}\label{sec:definitionofmethod}
\subsection{メソッドの定義の基礎}
新しいメソッドを作ることを、メソッドを「定義する」
\index{めそっと@メソッド!0をていきする@\baidash を定義する}%
\index{ていぎする@定義する!めそっとを@メソッドを\baidash}%
(define)と言います。
メソッドを定義するためには、その新しいメソッドに何らかの
名前を付ける必要があります。メソッドの名前は、変数の名前と
同じように、英字、数字、アンダースコア(\code{\us})を
並べることによって作ります。そして、先頭の文字は、英字の
小文字でないといけません。たとえば、\code{namako}、
\code{uni587}、\code{ika\us tako}、\code{ikaTako}などは、
メソッドに与えることのできる名前です。
メソッドを定義したいときは、
「メソッド定義\index{めそっとていき@メソッド定義}」
(method definition)と呼ばれる式を書きます。
引数を受け取らないメソッドは、
\begin{syntaxquote}
def \framebox[6zw]{メソッド名} \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
という形のメソッド定義によって定義することができます。この形の
式を評価すると、新しいメソッドが作られて、
そのメソッドに対して、「メソッド名」のところに書かれた名前が
与えられます。そのとき、メソッド定義の中に書かれている式は、
評価されません。
メソッドは、そのメソッドを定義したメソッド定義の中に
書かれている式を評価する、という動作をします。つまり、
メソッドを呼び出すと、そのたびに、そのメソッドを定義した
メソッド定義の中に書かれている式が評価されることになります。
\subsection{irbへのメソッド定義の入力}
第\ref{sec:message}節で説明したように、irbに入力した式は、
「トップレベル
\index{とっふれへる@トップレベル!ふんみゃくの@
文脈の\baidash}」
(toplevel)と呼ばれる文脈で評価されます。レシーバーを省略した
メッセージ式をトップレベルで評価すると、そのメッセージは、
「トップレベルオブジェクト
\index{とっふれへるおふしぇくと@トップレベルオブジェクト}」
(toplevel object)と呼ばれるオブジェクトに送られます。
ところで、メソッドというのは、かならず何らかの
オブジェクトの中に存在するものです。それでは、メソッド定義を
トップレベルで評価した場合、新しいメソッドはどこに
作られるのでしょうか。その答は、
「トップレベルオブジェクトの中」です。
それでは、irbにメソッド定義を入力して、新しいメソッドを
トップレベルオブジェクトの中に作ってみましょう。まず、
\begin{quote}
\begin{verbatim}
def kujira
"kujira\n".display
end
\end{verbatim}
\end{quote}
という式をirbに入力してください。irbは、式の入力の途中で改行が
入力された場合は、
\begin{quote}
irb(main):001:0> def kujira \\
irb(main):002:1> \cursor
\end{quote}
というように、式の続きの入力を促すプロンプトを出力します。
そして、式を最後まで入力すると、
\begin{quote}
\begin{verbatim}
irb(main):001:0> def kujira
irb(main):002:1> "kujira\n".display
irb(main):003:1> end
=> nil
\end{verbatim}
\end{quote}
というように、その式の値を出力します。ちなみに、メソッド定義の
値は、常に\code{nil}です。
さて、これで、\code{"kujira\bs n"}という文字列を出力する、
\code{kujira}というメソッドがトップレベルオブジェクトの中に
作られたはずですので、次に、それを呼び出してみましょう。
トップレベルでは、レシーバーが書かれていないメッセージ式は、
トップレベルオブジェクトにメッセージを送る式だと解釈されます。
ということは、トップレベルオブジェクトの中にあるメソッドを
トップレベルで呼び出したいときは、レシーバーを書かずに、
ただ単にメッセージだけを書けばいい、ということになります。
試してみましょう。irbに対して、
\begin{quote}
kujira
\end{quote}
というメッセージ式を入力してください。そうすると、
\code{kujira}が呼び出されて、\code{"kujira\bs n"}という
文字列が出力されるはずです。
\subsection{ファイルに保存されたメソッド定義}
今度は、メソッド定義をファイルに保存して、それをirbに
実行させてみましょう。まず、次のプログラムを入力して、
ファイルに保存してください。
\begin{program}{fortune.rb}
\begin{verbatim}
def fortune
"あなたの今日の運勢は大吉です。\n".display
end
\end{verbatim}
\end{program}
次に、irbに対して、
\begin{quote}
load("fortune.rb")
\end{quote}
という式を入力してください。すると、プログラムが
実行されるわけですが、その中で定義されている
\code{fortune}というメソッドは、いったいどこに
作られるのでしょうか。
プログラムの地肌に相当する場所(つまり、そこを囲んでいる
枠組みが何もない場所)に書かれた式が評価される文脈は、
やはりトップレベルです。したがって、\code{fortune}は、
トップレベルオブジェクトの中に作られることになります。
ですから、そのメソッドは、レシーバーを省略したメッセージ式を
irbに入力することによって呼び出すことができます。それでは
実際に、
\begin{quote}
fortune
\end{quote}
というメッセージ式をirbに入力してみましょう。そうすると、
「あなたの今日の運勢は大吉です。」という託宣が
出力されるはずです。
\subsection{インデント}
メソッド定義という式は、枠組みの中に式を書く、という
構造になっています。このような構造の式を書くときは、普通、
枠組みの中の式を少しだけ右にずらして書きます。その理由は、
そのほうがプログラムを読む人間にとって式の構造が
理解しやすくなるからです。
行の先頭に空白を入れることによって式を右にずらすことを、式を
「インデントする\index{いんてんとする@インデントする}」
(indent)と言います。Rubyでは、2個の空白を使って式を
インデントするというのが慣習になっています。
\subsection{クラス定義}
トップレベルオブジェクトの中にメソッドを作るのではなくて、
整数や文字列などのオブジェクトの中にメソッドを作りたいときは、
「クラス定義\index{くらすていき@クラス定義}」
(class definition)と呼ばれる式の中にメソッド定義を書く
必要があります。
クラス定義というのは、
\begin{syntaxquote}
class \framebox[5zw]{クラス名} \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
という形の式です。クラス定義の中にはどんな式を
書いてもかまわないのですが、普通はそこにメソッド定義を
書きます。
クラス定義を評価すると、その過程で、その中に書かれている式も
評価されます。クラス定義の中に書かれている式は、クラス定義の
文脈で評価されます。
クラス定義の文脈でメソッド定義を評価すると、
そのメソッド定義によって定義されるメソッドを作るための
鋳型が、クラス定義の冒頭で指定されたクラスに追加されます。
クラスという鋳型は、さまざまなメソッドの鋳型から
構成されています。クラスから生成されたインスタンスは、
そのクラスが持っているメソッドの鋳型から作られたメソッドを
持つことになります。ですから、新しいメソッドの鋳型をクラスに
追加するということは、そのクラスのインスタンスに新しい
メソッドを追加するということを意味します。
それでは、実際に試してみましょう。まず、次のプログラムを
入力して、ファイルに保存してください。
\begin{program}{strwhat.rb}
\begin{verbatim}
class String
def what
"I am a string.\n".display
end
end
\end{verbatim}
\end{program}
次に、irbに対して、
\begin{quote}
load("strwhat.rb")
\end{quote}
という式を入力してください。すると、\code{what}という
メソッドを作るための鋳型が\code{String}クラスの中に
作られます。ということは、\code{String}クラスのインスタンスは
\code{what}というメソッドを持つということですから、
\begin{quote}
"namako".what
\end{quote}
というように、文字列に\code{what}というメッセージを送ると、
\begin{quote}
I am a string.
\end{quote}
という文字列が出力されることになります。
ちなみに、存在しないクラスの名前を指定したクラス定義を評価した
場合は、その名前を持つ新しいクラスが作られて、その新しい
クラスにメソッドの鋳型が追加されます。クラスを作ることを、
クラスを「定義する」(define)と言います。
\index{くらす@クラス!0をていきする@\baidash を定義する}%
\index{ていぎする@定義する!くらすを@クラスを\baidash}%
クラスの定義については、第\ref{sec:definitionofclass}節で
説明することにしたいと思います。
\subsection{継承}
第\ref{sec:class}節で、スーパークラスと
サブクラスというものについて説明しました。それは、次のような
クラス間の関係のことでした。
Aというクラスがあって、それを特殊化することによってBという
クラスを作ったとするとき、Aのことを、Bの
「スーパークラス\index{すうはあくらす@スーパークラス}」
(superclass)と言い、Bのことを、Aの
「サブクラス\index{さふくらす@サブクラス}」(subclass)と
言います。たとえば、\code{Fixnum}というクラスは
\code{Integer}というクラスを特殊化することによって
作られたものですので、\code{Integer}は\code{Fixnum}の
スーパークラスで、\code{Fixnum}は\code{Integer}の
サブクラスだということになります。
スーパークラスとサブクラスについては、第\ref{sec:class}節で
説明したことに加えて、さらに、「継承\index{けいしょう@継承}」
(inheritance)と呼ばれるものについて理解しておく
必要があります。
クラスを定義するというのは、常に、何らかのクラスを
スーパークラスとするサブクラスとして新しいクラスを
作るということです。そのとき、新しく作られたクラスは、
そのスーパークラスから、それが持っている性質をそのまま
受け継ぎます。「継承」というのは、サブクラスがスーパークラスの
性質を受け継ぐことです。
スーパークラスからサブクラスへ継承される性質というのは、
どんなメソッドの鋳型を持っているかということだと
考えることができます。つまり、スーパークラスが持っている
メソッドの鋳型は、すべてサブクラスへ
継承されることになるわけです。
クラスの階層を上へ上へとたどっていくと、かならず
\code{Object}\index{Object@\code{Object}}というクラスに
たどりついて、そこで行き止まりになります。つまり、
\code{Object}というクラスは、クラスの木の根の
位置にあるわけです。ですから、\code{Object}クラスにメソッドの
鋳型を追加すると、その鋳型はすべてのクラスへ継承されます。
つまり、すべてのオブジェクトがそのメソッドを
持つことになるということです。
それでは、次のプログラムをファイルに保存して、irbに
実行させてください。
\begin{program}{objwhat.rb}
\begin{verbatim}
class Object
def what
"I am an object.\n".display
end
end
\end{verbatim}
\end{program}
そうすると、\code{Object}クラスに\code{what}というメソッドの
鋳型が追加され、その鋳型はすべてのクラスへ継承されます。
つまり、すべてのオブジェクトが\code{what}というメソッドを
持つことになるわけです。ですから、
\begin{quote}
7614.what
\end{quote}
というように整数のオブジェクトに\code{what}という
メッセージを送ると、
\begin{quote}
I am an object.
\end{quote}
という文字列が出力されるはずです。
\subsection{レシーバーの文脈}
メソッド定義の中に書かれている式は、レシーバーの文脈で
評価されます。レシーバーの文脈というのは、「レシーバーを
省略したメッセージ式は、レシーバー自身にメッセージを
送るものだと解釈される」という文脈のことです。ここで
「レシーバー自身\index{れしいはあししん@レシーバー自身}」と
呼ばれているのは、実行中のメソッドを含んでいる
オブジェクトのことです。
第\ref{sec:message}節で説明したように、オブジェクトが
メッセージを受け取ると、そのオブジェクトは、受け取った
メッセージにしたがって自分の中にあるメソッドに仕事をさせます。
そのとき、そのメソッドは、自分の仕事を遂行するために、
自分と同じオブジェクトの中にある別のメソッドを呼び出すことが
しばしば必要になります。
メソッド定義の中では、「自分と同じオブジェクトの中にある
別のメソッドを呼び出す」という動作は、レシーバーを省略した
メッセージ式によって記述することができます。なぜなら、
そのメッセージ式はレシーバーの文脈で評価されるからです。
それでは、次のプログラムをファイルに保存して、irbで
実行してください。
\begin{program}{twice.rb}
\begin{verbatim}
class String
def twice
display
display
"\n".display
end
end
\end{verbatim}
\end{program}
\code{twice}というメソッドを定義する式の中には、
\code{display}というメッセージが3個書かれていますが、上の
二つはレシーバーが指定されていませんので、\code{twice}という
メッセージを受け取ったレシーバー自身に送られます。ですから、
\begin{quote}
"Manami".twice
\end{quote}
という式で、\code{"Manami"}という文字列に\code{twice}という
メッセージを送ったとすると、
\begin{quote}
ManamiManami
\end{quote}
というように、レシーバーの出力が
2回繰り返されることになります。
\subsection{レシーバー自身を求める式}
メソッド定義の中では、しばしば、レシーバー自身を求める必要が
生じます。レシーバー自身を求めたいときは、
\code{self}\index{self@\code{self}}という式を書きます。
\code{self}を評価すると、その値としてレシーバー自身が
得られます。
次のプログラムは、2のレシーバー乗を出力する、
\code{powerOfTwo}というメソッドを定義しています。
\begin{program}{powtwo.rb}
\begin{verbatim}
class Numeric
def powerOfTwo
(2 ** self).display
"\n".display
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("powtwo.rb")
=> true
irb(main):002:0> 8.powerOfTwo
256
=> nil
irb(main):003:0> 0.5.powerOfTwo
1.414213562
=> nil
\end{verbatim}
\end{jikkourei}
ちなみに、このプログラムに登場している
\code{Numeric}\index{Numeric@\code{Numeric}}というのは、
\code{Integer}と\code{Float}のスーパークラスです。
\code{Numeric}にメソッドの鋳型を追加すると、その鋳型は、
\code{Integer}と\code{Float}の両方へ継承されます。ですから、
整数と浮動小数点数の両方に同じメソッドを追加したいときは、
クラスとして\code{Numeric}を指定すればいいわけです。
\subsection{引数}
引数\index{ひきすう@引数}を受け取るメソッドを
定義したいときは、
\begin{syntaxquote}
def \framebox[6zw]{メソッド名}\,(\syntax{仮引数名},
\tenten\ ) \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
という形のメソッド定義を書きます。
「仮引数名」というところには、英字の小文字で始まる名前を
書きます。
「仮引数名」のところに書かれた名前は、
「仮引数\index{かりひきすう@仮引数}」(formal argument)と
呼ばれるものに与えられます。仮引数というのは、引数を
受け取るための変数のことです。
どの仮引数がどの引数を受け取ることになるかというのは、
それらが書かれている順番で決まります。たとえば、
\begin{syntaxquote}
def namako(a, b, c) \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
と定義されたメソッドを、
\begin{quote}
namako(24, 33, 81)
\end{quote}
というメッセージで呼び出したとすると、\code{a}が24を、
\code{b}が33を、\code{c}が81を受け取ることになります。
次のプログラムの中で定義されている\code{rect}という
メソッドは、縦の個数と横の個数を引数として受け取って、
文字列のレシーバーを長方形の形に並べて出力します。
\begin{program}{rect.rb}
\begin{verbatim}
class String
def rect(tate, yoko)
((self * yoko + "\n") * tate).display
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("rect.rb")
=> true
irb(main):002:0> "Mikako".rect(4, 6)
MikakoMikakoMikakoMikakoMikakoMikako
MikakoMikakoMikakoMikakoMikakoMikako
MikakoMikakoMikakoMikakoMikakoMikako
MikakoMikakoMikakoMikakoMikakoMikako
=> nil
\end{verbatim}
\end{jikkourei}
\subsection{戻り値}
メソッドは、自分を定義したメソッド定義の中に書かれている式の
値を、戻り値\index{もとりち@戻り値}として返します。たとえば、
\code{iruka}というメソッドが、
\begin{quote}
\begin{verbatim}
def iruka
2222
end
\end{verbatim}
\end{quote}
と定義されているとすると、\code{iruka}は、常に2222を
戻り値として返すことになります。
次のプログラムは、数値のレシーバーを2乗した結果を戻り値として
返す、\code{square}というメソッドを定義します。
\begin{program}{square.rb}
\begin{verbatim}
class Numeric
def square
self * self
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("square.rb")
=> true
irb(main):002:0> 7.square
=> 49
\end{verbatim}
\end{jikkourei}
次のプログラムは、1からレシーバーまでの整数の和を戻り値として
返す、\code{sumOfNumbers}というメソッドを定義します。
\begin{program}{sumnum.rb}
\begin{verbatim}
class Integer
def sumOfNumbers
self * (self + 1) / 2
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("sumnum.rb")
=> true
irb(main):002:0> 10.sumOfNumbers
=> 55
irb(main):003:0> 100.sumOfNumbers
=> 5050
\end{verbatim}
\end{jikkourei}
\subsection{メソッドを定義する必要性}
プログラムというものは、コンピュータに理解できれば
それでいいというものではなくて、人間にとっても
理解しやすいように書く必要があります。しかし、
プログラムによって記述されている動作が複雑になればなるほど、
そのプログラムは、それを読む人間にとって理解することが
困難なものになっていきます。ですから、複雑な動作をする
プログラムを書く場合は、それを少しでも人間にとって
理解しやすいものにするための工夫が必要です。
複雑な動作をわかりやすく記述するための工夫としてもっとも
効果があるのは、いきなり全体を記述するのではなくて、全体を
いくつかの部分に分割して、それぞれの部分を、その内部の構造を
知らなくても使うことのできる部品として記述して、それらの部品の
組み合わせとして全体を記述する、という方法です。
部品の内部が複雑になる場合は、その部品をさらにいくつかの部分に
分割して、それぞれの部分を部品にします。つまり、部品を階層的に
組み合わせていくことによって全体を構成するということです。
そのように階層的に動作を記述したプログラムは、そうでない
プログラムよりも、人間にとって理解しやすいものになります。
部品というのは、その内部の構造を知らなくても
使うことができるようなものでないといけません。Rubyの場合は、
メソッドというのが動作の部品になると考えることができます。
つまり、Rubyでは、メソッドを階層的に組み合わせたものとして
動作を記述することによって、人間にとって理解しやすい
プログラムを書くことができるということです。
\section{条件}\label{sec:condition}
\subsection{真偽値}
成り立っているか成り立っていないかを判断することのできる
対象のことを、「条件\index{しょうけん@条件}」(condition)と
言います。プログラムを書くときには、しばしば、「この数値は
100よりも大きい」とか、「この文字列は\code{"wasabi"}と
等しい」というような条件が成り立っているかどうかを判断する、
という動作を記述することが必要になります。
条件が成り立っているということを「真\index{しん@真}」(true)と
言い、成り立っていないということを「偽\index{き@偽}」(false)と
言います。たとえば、「この数値は100よりも大きい」という
条件は、「この数値」が107のときは真で、94のときは偽です。
真と偽は、総称して
「真偽値\index{しんきち@真偽値}」(Boolean value)と呼ばれます。
Rubyでは、すべてのオブジェクトについて、真偽値のどちらかを
あらわしていると解釈することができます。偽を
あらわしているのは、\code{nil}\index{nil@\code{nil}}という
名前であらわされるオブジェクトと、
\code{false}\index{false@\code{false}}という名前であらわされる
オブジェクトの二つだけです。そして、その二つ以外のすべての
オブジェクトは、真をあらわしていると解釈されます。
ちなみに、\code{nil}は
\code{NilClass}\index{NilClass@\code{NilClass}}というクラスの
インスタンスで、\code{false}は
\code{FalseClass}\index{FalseClass@\code{FalseClass}}という
クラスのインスタンスです。
条件が成り立っているかどうかを調べたいときは、
「述語\index{しゅつこ@述語}」(predicate)と呼ばれるものを
使います。述語というのは、何らかの条件が
成り立っているかどうかを調べて、その結果の真偽値をあらわす
オブジェクトを返す、という動作をするもののことです(大多数の
述語はメソッドですが、メソッドではない述語もあります)。
述語は、普通、真偽値をあらわすオブジェクトとして、
\code{true}または\code{false}というオブジェクトを返します。
\code{true}\index{true@\code{true}}という名前で
あらわされるのは、真をあらわすための専用のオブジェクトで、
\code{TrueClass}\index{TrueClass@\code{TrueClass}}という
クラスのインスタンスです。
\subsection{等値演算}
さて、それでは、Rubyの処理系の中に組み込まれている
述語のうちで重要なものを紹介していくことにしましょう。
まず最初は、\code{==}という述語です。
\code{==}\index{==@\code{==}}は、すべてのオブジェクトが
持っているメソッドです。このメソッドは、レシーバーと引数とが
等しいかどうかを調べて、等しいならば\code{true}、
そうでなければ\code{false}を返します(\code{==}という名前は、
二項演算子になっています)。たとえば、
\begin{quote}
"karashi" == "karashi"
\end{quote}
という式を評価すると、\code{true}という値が得られ、
\begin{quote}
80 == 27
\end{quote}
という式を評価すると、\code{false}という値が得られます。
二つのオブジェクトのあいだに、等しくないという関係が
成り立っているかどうかを調べたいときは、
\code{!=}\index{"!=@\code{!=}}という二項演算を
使います。たとえば、
\begin{quote}
"karashi" != "karasu"
\end{quote}
という式を評価すると、\code{true}という値が得られ、
\begin{quote}
80 != 80
\end{quote}
という式を評価すると、\code{false}という値が得られます。
なお、\code{==}と\code{!=}は、総称して
「等値演算\index{とうちえんさん@等値演算}」
(equality operation)と呼ばれます。
ちなみに、\code{!=}は、独立したメソッドではなくて、
\code{==}とは逆の動作をするように、\code{==}の定義から自動的に
作成される演算です。
\subsection{比較演算}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{演算子式} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
$a$ > $b$ & $a$のほうが$b$よりも大きい。
\\ \hline
$a$ < $b$ & $a$のほうが$b$よりも小さい。
\\ \hline
$a$ >= $b$ &
$a$のほうが$b$よりも大きいか、または$a$と$b$とは等しい。
\\ \hline
$a$ <= $b$ &
$a$のほうが$b$よりも小さいか、または$a$と$b$とは等しい。
\\ \hline
\end{tabular}
\end{ttfamily}
\caption{比較演算}\label{tab:comparisonoperation}
\index{>@\code{>}}
\index{<@\code{<}}
\index{>=@\code{>=}}
\index{<=@\code{<=}}
\end{table}
数値と文字列のオブジェクトは、大きいとか小さいという関係が
成り立っているかどうかを調べる、
「比較演算\index{ひかくえんさん@比較演算}」
(comparison operation)と呼ばれる述語を持っています。
比較演算というのは、表\ref{tab:comparisonoperation}に示した
4個の演算のことです(比較演算はすべてメソッドです)。
たとえば、
\begin{quote}
107 > 100
\end{quote}
という式を評価すると、値として\code{true}が得られ、
\begin{quote}
94 > 100
\end{quote}
という式を評価すると、値として\code{false}が得られます。
文字列のオブジェクトが持っている比較演算は、
「辞書式順序\index{ししょしきしゅんしょ@辞書式順序}」
(lexicographical order)と呼ばれる順序にもとづいて文字列を
比較します。辞書式順序というのは、辞書の見出しを並べるときに
使われる順序のことです。文字列の比較演算は、辞書式順序で
文字列を並べたときに、前にあるものほど小さく、
後ろにあるものほど大きいと判断します。たとえば、
\begin{quote}
"karashi" < "karasu"
\end{quote}
という式を評価すると、値として\code{true}が得られます。
なお、等値演算と比較演算は、総称して
「関係演算\index{かんけいえんさん@関係演算}」
(relational operation)と呼ばれます。
\subsection{論理演算}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{演算子式} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
$a$ \&\& $b$ & $a$かつ$b$である。 \\ \hline
$a$ || $b$ & $a$または$b$である。 \\ \hline
!\ $a$ & $a$ではない。 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{論理演算}\label{tab:logicaloperation}
\index{&&@\code{\&\&}}
\index{"|"|@\code{||}}
\index{"!@\code{!}}
\index{かつ}
\index{または}
\index{ではない}
\end{table}
二つの条件の組み合わせになっているような条件について
判断したり、真偽値を反転させたりしたいときは、
「論理演算\index{ろんりえんさん@論理演算}」
(logical operation)と呼ばれる述語を使います。
論理演算というのは、表\ref{tab:logicaloperation}に示した3個の
演算のことで、これらはすべて、真偽値を処理して真偽値を
求めるという動作をします(論理演算はメソッドではありません)。
\code{\&\&}\index{&&@\code{\&\&}}という論理演算は、左右の式の
値が両方とも真のときだけ真を返し、それ以外の場合は偽を
返します。つまり、
\begin{quote}
\begin{tabular}{lllll}
true & \&\& & true & \evaluate & true \\
true & \&\& & false & \evaluate & false \\
false & \&\& & true & \evaluate & false \\
false & \&\& & false & \evaluate & false \\
\end{tabular}
\end{quote}
という動作をするわけです。
\code{||}\index{"|"|@\code{||}}は、左右の式の値が両方とも
偽のときだけ偽を返し、それ以外の場合は真を返す論理演算です。
したがって、
\begin{quote}
\begin{tabular}{lllll}
true & || & true & \evaluate & true \\
true & || & false & \evaluate & true \\
false & || & true & \evaluate & true \\
false & || & false & \evaluate & false \\
\end{tabular}
\end{quote}
という動作をすることになります。
普通、二項演算を呼び出す式を評価すると、二項演算子の左右に
書かれた式は、かならず両方とも評価されます。しかし、
\code{\&\&}または\code{||}を呼び出す式は、かならずしも
両方の式が評価されるとは限りません。左側の式はかならず
評価されるのですが、その値だけで結論が出せるならば、右側の式は
評価されないのです。\code{\&\&}の左側に書かれた式の値が
偽だったとすると、それだけで偽という結論を
出すことができますので、右側の式は評価されません。同じように、
\code{||}の左側に書かれた式が真だった場合も、右側の式は
評価されません。
\code{!}\index{"!@\code{!}}というのは単項演算で、その右側に
書かれた式の値が真ならば偽を返し、偽ならば真を返します。
つまり、
\begin{quote}
\begin{tabular}{lll}
!\ true & \evaluate & false \\
!\ false & \evaluate & true \\
\end{tabular}
\end{quote}
というように、真偽値を反転させるという動作をするわけです。
\subsection{述語の定義}
これまでに紹介したように、処理系の中にはさまざまな述語が
組み込まれているわけですが、それらの述語は、きわめて単純な
条件についての判断しかできません。しかし、述語というのは、
プログラムを書く人が自分で定義することも可能ですので、複雑な
条件の判断を記述したいときは、その判断をする述語を自分で
定義するといいでしょう。
述語を定義するというのは、言い換えれば、戻り値として真偽値を
返すメソッドを定義するということです。たとえば、次の
プログラムは、レシーバーが偶数であるという条件が
成り立っているかどうかを調べる、\code{even}という述語を
定義します。
\begin{program}{even.rb}
\begin{verbatim}
class Integer
def even
self % 2 == 0
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("even.rb")
=> true
irb(main):002:0> 6.even
=> true
irb(main):003:0> 7.even
=> false
\end{verbatim}
\end{jikkourei}
\section{選択}\label{sec:selection}
\subsection{選択とは何か}
「選択\index{せんたく@選択}」(selection)という言葉は、
日常的に使われるときは、「いくつかのものの中からどれかを
選び出すこと」という意味ですが、プログラミングの文脈では、
もう少し特殊な意味で使われます。プログラミングの用語としての
「選択」は、「いくつかの動作の中からどれかひとつを選び出して
実行するという動作」という意味です。
この節では、プログラムの中で選択という動作を記述するためには
どのようなものを書けばいいのか、ということについて
説明していきたいと思います。
\subsection{\texttt{if}式}
まず最初に、真偽値によって動作を選択するという動作を記述する
方法について説明することにしましょう。真偽値による動作の
選択というのは、条件が成り立っている場合はこの動作を実行して、
成り立っていない場合はこの動作を実行する、というような
選択のことです。
Rubyでは、真偽値による動作の選択を記述したいときは、
「\code{if}式\index{ifしき@\code{if}式}」
(\code{if} expression)と呼ばれる式を書きます。
\code{if}式というのは、
\begin{syntaxquote}
if \framebox[5zw]{条件式} \\
\inkuu \framebox[12zw]{式$_{1}$} \\
else \\
\inkuu \framebox[12zw]{式$_{2}$} \\
end
\end{syntaxquote}
という形の式のことです。「条件式」のところには、動作を
選択するための真偽値を求める式を書きます。そして、条件式の値が
真だった場合に評価したい式を「式$_{1}$」のところに書いて、
条件式の値が偽だった場合に評価したい式を「式$_{2}$」のところに
書きます。
それでは、\code{if}式をirbに入力してみましょう。まず、条件式の
値が真になるような\code{if}式を入力すると、
\begin{quote}
\begin{verbatim}
irb(main):001:0> if 5 > 3
irb(main):002:1> "namako\n".display
irb(main):003:1> else
irb(main):004:1* "hitode\n".display
irb(main):005:1> end
namako
=> nil
\end{verbatim}
\end{quote}
というように、\code{else}の上に書かれた式が評価されて、
\code{namako\bs n}という文字列が出力されます。それに対して、
条件式の値が偽になるような\code{if}式を入力すると、
\begin{quote}
\begin{verbatim}
irb(main):001:0> if 3 > 5
irb(main):002:1> "namako\n".display
irb(main):003:1> else
irb(main):004:1* "hitode\n".display
irb(main):005:1> end
hitode
=> nil
\end{verbatim}
\end{quote}
というように、\code{else}の下に書かれた式が評価されて、
\code{hitode\bs n}という文字列が出力されます。
ところで、\code{if}式というのは式の一種ですから、それを
評価すると、その値が得られます。\code{if}式全体の値は、
選択された式の値です。
\code{if}式全体の値についても、irbを使って試してみましょう。
そうすると、
\begin{quote}
\begin{verbatim}
irb(main):001:0> if 5 == 5
irb(main):002:1> 6006
irb(main):003:1> else
irb(main):004:1* 7117
irb(main):005:1> end
=> 6006
irb(main):006:0> if 5 == 3
irb(main):007:1> 6006
irb(main):008:1> else
irb(main):009:1* 7117
irb(main):010:1> end
=> 7117
\end{verbatim}
\end{quote}
というように、選択された式の値が\code{if}式全体の
値になっている、ということが分かります。
\begin{program}{zero.rb}
\begin{verbatim}
class Numeric
def zero
if self == 0
"zero"
else
"not zero"
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("zero.rb")
=> true
irb(main):002:0> 0.zero
=> "zero"
irb(main):003:0> 5.zero
=> "not zero"
\end{verbatim}
\end{jikkourei}
\begin{program}{evenodd.rb}
\begin{verbatim}
class Integer
def even
self % 2 == 0
end
def evenodd
if even
"even"
else
"odd"
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("evenodd.rb")
=> true
irb(main):002:0> 6.evenodd
=> "even"
irb(main):003:0> 7.evenodd
=> "odd"
\end{verbatim}
\end{jikkourei}
\subsection{\texttt{else}を省略した\texttt{if}式}
真偽値による動作の選択には、条件が真のときは何らかの動作を
実行するけれども、条件が偽のときは何もしない、という
タイプのものもあります。そのようなタイプの選択を
記述したいときは、
\begin{syntaxquote}
if \framebox[5zw]{条件式} \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
というような、\code{else}\index{else@\code{else}}とそれに続く
式を省略した形の\code{if}式を書きます。この形の
\code{if}式の中に書かれた式は、「条件式」のところに書かれた
式の値が真だった場合だけ評価されます。
irbを使って試してみると、次のようになります。
\begin{quote}
\begin{verbatim}
irb(main):001:0> if true
irb(main):002:1> "namako\n".display
irb(main):003:1> end
namako
=> nil
irb(main):004:0> if false
irb(main):005:1> "namako\n".display
irb(main):006:1> end
=> nil
\end{verbatim}
\end{quote}
\begin{program}{distime.rb}
\begin{verbatim}
class Integer
def displayTime
if self >= 60
((self / 60).to_s + "時間").display
end
if (self % 60 != 0) || (self == 0)
((self % 60).to_s + "分").display
end
"\n".display
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("distime.rb")
=> true
irb(main):002:0> 150.displayTime
2時間30分
=> nil
irb(main):003:0> 180.displayTime
3時間
=> nil
irb(main):004:0> 40.displayTime
40分
=> nil
\end{verbatim}
\end{jikkourei}
\code{else}を省略した形の\code{if}式の値は、その中の式が
評価された場合はその値で、評価されなかった場合は
\code{nil}です。irbを使って試してみると、次のようになります。
\begin{quote}
\begin{verbatim}
irb(main):001:0> if true
irb(main):002:1> 1771
irb(main):003:1> end
=> 1771
irb(main):004:0> if false
irb(main):005:1> 1771
irb(main):006:1> end
=> nil
\end{verbatim}
\end{quote}
\subsection{\texttt{elsif}を付加した\texttt{if}式}
選択の対象となる動作が3個以上あるような選択のことを、
「多肢選択\index{たしせんたく@多肢選択}」
(multibranch selection)と言います。多肢選択には、いくつかの
条件のうちのどれが真になるかということによって動作を選択する
タイプのものと、ひとつの式の値が何なのかということによって
動作を選択するタイプのものがあります。
いくつかの条件のうちのどれが真になるかということによって動作を
選択するというタイプの多肢選択は、
\begin{syntaxquote}
if \framebox[5zw]{条件式$_{1}$} \\
\inkuu \framebox[12zw]{式$_{1}$} \\
elsif \framebox[5zw]{条件式$_{2}$} \\
\inkuu \framebox[12zw]{式$_{2}$} \\
\tatetenten \\
elsif \framebox[5zw]{条件式$_{n}$} \\
\inkuu \framebox[12zw]{式$_{n}$} \\
else \\
\inkuu \framebox[12zw]{式$_{n+1}$} \\
end
\end{syntaxquote}
というような、\code{if}と\code{else}のあいだに
\code{elsif}\index{elsif@\code{elsif}}を付加した形の
\code{if}式を使うことによって記述することができます。
この形の\code{if}式を評価すると、その中の条件式が、値が
真になるものが見つかるまで、上から順番に
評価されていきます。値が真になる条件式が見つかった場合は、
その条件式の下に書かれた式が評価されて、その式の値が
\code{if}式全体の値になります。もしも、すべての条件式の値が
偽だった場合は、\code{else}の下に書かれた式が評価されて、
その式の値が\code{if}式全体の値になります。
irbを使って試してみると、次のようになります。
\begin{quote}
\begin{verbatim}
irb(main):001:0> if false
irb(main):002:1> 8888
irb(main):003:1> elsif true
irb(main):004:1> 5000
irb(main):005:1> else
irb(main):006:1* 1441
irb(main):007:1> end
=> 5000
\end{verbatim}
\end{quote}
\begin{program}{sign.rb}
\begin{verbatim}
class Numeric
def sign
if self > 0
"plus"
elsif self < 0
"minus"
else
"zero"
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("sign.rb")
=> true
irb(main):002:0> 5.sign
=> "plus"
irb(main):003:0> -5.sign
=> "minus"
irb(main):004:0> 0.sign
=> "zero"
\end{verbatim}
\end{jikkourei}
\subsection{\texttt{case}式}
いくつかの条件のうちのどれが真になるかということではなくて、
ひとつの式の値が何なのかということによって動作を選択するという
タイプの多肢選択は、\code{if}式を使って
記述することもできますが、
「\code{case}式\index{caseしき@\code{case}式}」
(\code{case} expression)と呼ばれる式を使えば、\code{if}式を
使うよりもすっきりと記述することができます。
\code{case}式は、
\begin{syntaxquote}
case \framebox[5zw]{判定式} \\
when \framebox[5zw]{場合式$_{1}$} \\
\inkuu \framebox[12zw]{式$_{1}$} \\
when \framebox[5zw]{場合式$_{2}$} \\
\inkuu \framebox[12zw]{式$_{2}$} \\
\tatetenten \\
when \framebox[5zw]{場合式$_{n}$} \\
\inkuu \framebox[12zw]{式$_{n}$} \\
else \\
\inkuu \framebox[12zw]{式$_{n+1}$} \\
end
\end{syntaxquote}
というように書きます。\code{case}式を評価すると、まず最初に、
「判定式」というところに書かれた式が評価されます。そして、
判定式の値と一致する値を持つ式が見つかるまで、
「場合式」というところに書かれた式が、上から順番に
評価されていきます。判定式の値と一致する場合式が見つかった
場合は、その下に書かれた式が評価されて、その式の値が
\code{case}式全体の値になります。判定式の値と一致する場合式が
見つからなかった場合は、\code{else}の下に書かれた式が
評価されて、その式の値が\code{case}式全体の値になります。
irbを使って試してみると、次のようになります。
\begin{quote}
\begin{verbatim}
irb(main):001:0> case 2
irb(main):002:1> when 1
irb(main):003:1> "one"
irb(main):004:1> when 2
irb(main):005:1> "two"
irb(main):006:1> else
irb(main):007:1* "many"
irb(main):008:1> end
=> "two"
\end{verbatim}
\end{quote}
\begin{program}{operate.rb}
\begin{verbatim}
class Numeric
def operate(ope, a)
case ope
when "add"
self + a
when "subtract"
self - a
when "multiply"
self * a
when "divide"
self / a
else
self
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("operate.rb")
=> true
irb(main):002:0> 23.operate("add", 34)
=> 57
irb(main):003:0> 100.operate("divide", 4)
=> 25
\end{verbatim}
\end{jikkourei}
なお、\code{case}式の\code{when}\index{when@\code{when}}の
右側には、
\begin{quote}
when \syntax{場合式}, \syntax{場合式}, \tenten
\end{quote}
というように、2個以上の場合式をコンマで区切って
並べることもできます。その場合、\code{when}の右側に書かれた
場合式の列は、左から順番に評価されていって、判定式の値と
一致するものが見つかったならば、\code{when}の下に書かれた式が
評価されます。
\section{ブロック}\label{sec:block}
\subsection{ブロックとは何か}
メソッドは、引数としていくつかのオブジェクトを
受け取ることができるわけですが、メソッドが
受け取ることのできるものはオブジェクトだけではありません。
メソッドは、「ブロック\index{ふろっく@ブロック}」(block)と
呼ばれるものを受け取ることもできます。
ブロックというのは、包装紙のようなもので式を
包み込んだもののことです。この包装紙は、その中に包まれている
式を、現在の場所で評価するのではなくて、式という形を保ったまま
メソッドに送り届ける、という機能を持っています。
ブロックを受け取ったメソッドは、そのブロックの中の式を
評価することができます。ブロックの中の式を評価することを、
ブロックを「実行する」
\index{ふろっく@ブロック!0をしっこうする@\baidash を実行する}%
\index{しっこうする@実行する!ふろっくを@ブロックを\baidash}%
(execute)と言います。
メソッドがブロックを受け取ることができるということは、
メソッドは、オブジェクトだけではなくて、何らかの動作をも処理の
対象にすることができる、ということを意味しています。
\subsection{ブロックの書き方}
ブロックの書き方は、二通りあります。ひとつは、\code{do}と
\code{end}という二つの単語を使う書き方です。
それらの単語のあいだに式を書くと、その全体がひとつの
ブロックになります。つまり、
\begin{syntaxquote}
do \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
という形のものを書けば、それがブロックになるということです。
ブロックのもうひとつの書き方は、中括弧
\index{ちゅうかっこ@中括弧!ふろっくの@ブロックの\baidash}%
(\code{\lb\,\rb}%
\index{"{"}@\code{\lb\,\rb}!ふろっくの@ブロックの\baidash})を
使うというものです。式を中括弧(\code{\lb\,\rb})で囲むと、
その全体がひとつのブロックになります。ですから、
\begin{syntaxquote}
\lb \\
\inkuu \framebox[12zw]{式} \\
\rb
\end{syntaxquote}
という形のものも、やはりブロックです。
ブロックは、1行にまとめて書いてもかまいません。つまり、
ブロックは、
\begin{quote}
do \framebox[12zw]{式} end
\end{quote}
という形で書くこともできるし、
\begin{quote}
\lb\ \framebox[12zw]{式} \rb
\end{quote}
という形で書くこともできる、ということです。
ブロックは、\code{do}と\code{end}を使って
書いてもかまいませんし、中括弧を使って書いてもかまいません。
慣習としては、ブロックを複数行に分けて書くときは\code{do}と
\code{end}、ブロック全体を1行で書くときは中括弧、という
使い分けが定着しているようです。
\subsection{ブロックを渡すメッセージ}
メソッドにブロックを渡したいときは、オブジェクトに送る
メッセージの中に、そのブロックを書きます。
メソッドにブロックを渡すメッセージは、
\begin{quote}
\syntax{メソッド名}\,{\Large (}\,\syntax{式}{\Large ,}
\tenten\ {\Large )} \syntax{ブロック}
\end{quote}
と書きます。たとえば、
\begin{quote}
\verb|hibari { tsubame }|
\end{quote}
というメッセージをオブジェクトに送ると、\code{hibari}という
メソッドが呼び出されて、そのメソッドに対して、
\begin{quote}
\verb|{ tsubame }|
\end{quote}
というブロックが渡されます。
\subsection{ブロックの実行}
受け取ったブロックを実行したいときは、
「\code{yield}式\index{yieldしき@\code{yield}式}」
(\code{yield} expression)と呼ばれる式を書きます。
\code{yield}式は、基本的には、
\begin{quote}
yield
\end{quote}
と書くだけです。\code{yield}式を評価すると、受け取った
ブロックが実行されます。
次のプログラムは、受け取ったブロックを実行するだけ、という
きわめて単純な動作をする、\code{exblock}というメソッドを
定義します。
\begin{program}{exblock.rb}
\begin{verbatim}
def exblock
yield
end
\end{verbatim}
\end{program}
それでは、このメソッドを呼び出して、それに対してブロックを
渡してみましょう。
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("exblock.rb")
=> true
irb(main):002:0> exblock { "hototogisu\n".display }
hototogisu
=> nil
\end{verbatim}
\end{jikkourei}
この\code{exblock}のような、受け取ったブロックを
実行するように作られているメソッドは、
「イテレーター\index{いてれえたあ@イテレーター}」(iterator)と
呼ばれます。iteratorという単語は「繰り返すもの」という
意味ですが、すべてのイテレーターが何らかの動作を
繰り返すとは限りません。
\subsection{ブロックが受け取る引数}
\index{ふろっく@ブロック!0のひきすう@\baidash の引数}
\index{ひきすう@引数!ふろっくの@ブロックの\baidash}
ブロックは、メソッドと同じように、自分が動作を開始する直前に、
いくつかのオブジェクトを引数として受け取ることができます。
ただし、引数を受け取るためには、あらかじめ、\code{do}または
左中括弧の直後に、
\begin{quote}
|\syntax{仮引数名}, \tenten\ |
\end{quote}
という形のもの、つまり、コンマで区切られた仮引数名の列を縦棒
(\code{|}\index{"|@\code{|}!ふろっくの@ブロックの\baidash})で
囲んだものを書いておく必要があります。そうすると、ブロックに
渡された引数が、それらの名前を持つ仮引数に代入されます。
たとえば、
\begin{quote}
\verb/{ |a, b| a.display; b.display }/
\end{quote}
というブロックは、2個のオブジェクトを引数として受け取って、
それらを出力する、という動作をします。
ブロックに引数を渡して、そのブロックを実行したいときは、
\begin{quote}
yield(\syntax{式}, \tenten\ )
\end{quote}
という形の\code{yield}式を書きます。この形の\code{yield}式を
評価すると、丸括弧の中に書かれた式の値が引数としてブロックに
渡されて、ブロックが実行されます。
次のプログラムは、2個の引数とブロックを受け取って、それらの
引数を渡してブロックを実行する、\code{exblock2}という
メソッドを定義します。
\begin{program}{exblock2.rb}
\begin{verbatim}
def exblock2(a, b)
yield(a, b)
end
\end{verbatim}
\end{program}
それでは、このメソッドを呼び出して、それに対して引数と
ブロックを渡してみましょう。
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("exblock2.rb")
=> true
irb(main):002:0> exblock2(100, 24) { |a, b| (a-b).display }
76=> nil
\end{verbatim}
\end{jikkourei}
\subsection{ブロックが返す戻り値}
\index{ふろっく@ブロック!0のもとりち@\baidash の戻り値}
\index{もとりち@戻り値!ふろっくの@ブロックの\baidash}
ブロックは、メソッドと同じように、自分の実行が終了したのち、
自分を実行したメソッドに対して戻り値を返します。ブロックが
返す戻り値というのは、ブロックの中に書かれた式の値です。
そして、ブロックが返した戻り値は、そのブロックを実行した
\code{yield}式の値になります。
それでは、先ほど定義した、\code{exblock2}というメソッドを
使って、ブロックが本当に戻り値を返すかどうか、
試してみましょう。
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("exblock2.rb")
=> true
irb(main):002:0> exblock2(100, 24) { |a, b| a-b }
=> 76
\end{verbatim}
\end{jikkourei}
\section{イテレーター}\label{sec:iteratior}
\subsection{イテレーターと繰り返し}
「繰り返し\index{くりかえし@繰り返し}」(iteration)という
動作、つまり、ひとつの動作を何回も実行するという動作は、
基本的には、イテレーターを使うことによって
記述することができます。
イテレーターというのは、前の節で説明したように、受け取った
ブロックを実行するメソッドのことですから、すべての
イテレーターが何らかの繰り返しを実行するとは限りません。
しかし、大多数のイテレーターは、何らかの繰り返しを
実行するように作られています。
この節では、組み込みクラスのオブジェクトが持っている
イテレーターのうちの主要なものを紹介したいと思います。
\index{くみこみくらす@組み込みクラス!0のいてれえたあ@
\baidash のイテレーター}
\index{いてれえたあ@イテレーター!くみこみくらすの@
組み込みクラスの\baidash}
\subsection{整数のイテレーター}
\index{せいすう@整数!0のいてれえたあ@
\baidash のイテレーター}
\index{いてれえたあ@イテレーター!せいすうの@整数の\baidash}
整数のオブジェクトは、\code{times}、\code{upto}、
\code{downto}というイテレーターを持っています。
\code{times}\index{times@\code{times}}は、レシーバーを
回数としてブロックの実行を繰り返すイテレーターです。
このイテレーターは、レシーバーをそのまま戻り値として返します。
\begin{quote}
\begin{verbatim}
irb(main):001:0> 7.times { "Namako".display }
NamakoNamakoNamakoNamakoNamakoNamakoNamako=> 7
\end{verbatim}
\end{quote}
\code{times}は、ブロックを実行するたびに、それが何回目の
実行なのかということをあらわす整数のオブジェクトを、引数として
ブロックに渡します(ただし、最初の実行を0回目と数えます)。
\begin{quote}
\begin{verbatim}
irb(main):001:0> 18.times { |i| i.display; " ".display }
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 => 18
\end{verbatim}
\end{quote}
次のプログラムの中で定義されている\code{power}という
メソッドは、整数$n$を引数として受け取って、レシーバーの0乗から
$n-1$乗までを出力します。
\begin{program}{power.rb}
\begin{verbatim}
class Numeric
def power(n)
n.times do |i|
(to_s + "の" + i.to_s + "乗: " +
(self**i).to_s + "\n").display
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("power.rb")
=> true
irb(main):002:0> 7.power(10)
7の0乗: 1
7の1乗: 7
7の2乗: 49
7の3乗: 343
7の4乗: 2401
7の5乗: 16807
7の6乗: 117649
7の7乗: 823543
7の8乗: 5764801
7の9乗: 40353607
=> 10
\end{verbatim}
\end{jikkourei}
\code{upto}\index{upto@\code{upto}}も、
\code{times}と同じように、ブロックに整数を渡してブロックの
実行を繰り返すイテレーターです。ブロックに渡す引数は、
レシーバーから出発して、1ずつ増やしていきます。
$n$と$m$が整数だとするとき、
\begin{quote}
$n$.upto($m$) \syntax{ブロック}
\end{quote}
という式で\code{upto}を呼び出すと、\code{upto}は、
\begin{quote}
$n$、$n+1$、$n+2$、\tenten 、$m$
\end{quote}
という整数のそれぞれをブロックに渡して、ブロックの実行を
繰り返します。そして、レシーバーをそのまま戻り値として
返します。
\begin{quote}
\begin{verbatim}
irb(main):001:0> 20.upto(30) { |i| i.display; " ".display }
20 21 22 23 24 25 26 27 28 29 30 => 20
\end{verbatim}
\end{quote}
次のプログラムの中で定義されている\code{divisor}という
メソッドは、レシーバーのすべての
約数\index{やくすう@約数}(divisor)を出力します。
\begin{program}{divisor.rb}
\begin{verbatim}
class Integer
def divisor
(to_s + "の約数: ").display
1.upto(self) do |i|
if self % i == 0
(i.to_s + " ").display
end
end
"\n".display
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("divisor.rb")
=> true
irb(main):002:0> 36.divisor
36の約数: 1 2 3 4 6 9 12 18 36
=> nil
\end{verbatim}
\end{jikkourei}
次のプログラムの中で定義されている\code{eachDivisor}という
イテレーターは、レシーバーの約数のそれぞれをブロックに渡して
ブロックを実行する、ということを繰り返します。そして、
\code{sumOfDivisor}というメソッドは、\code{eachDivisor}を
使ってレシーバーのすべての約数の和を求めて、その結果を
戻り値として返します。
\index{やくすう@約数!0のわ@\baidash の和}
\index{わ@和!やくすうの@約数の\baidash}
\begin{program}{sumdiv.rb}
\begin{verbatim}
class Integer
def eachDivisor
1.upto(self) do |i|
if self % i == 0
yield(i)
end
end
self
end
def sumOfDivisor
sum = 0
eachDivisor do |i|
sum += i
end
sum
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("sumdiv.rb")
=> true
irb(main):002:0> 54.sumOfDivisor
=> 120
\end{verbatim}
\end{jikkourei}
\code{downto}\index{downto@\code{downto}}は、\code{upto}とは
逆の動作をするイテレーターです。レシーバーから出発するという
点は\code{upto}と同じですが、増やすのではなくて、1ずつ
減らしながらブロックの実行を繰り返します。
$n$と$m$が整数だとするとき、
\begin{quote}
$n$.downto($m$) \syntax{ブロック}
\end{quote}
という式で\code{downto}を呼び出すと、\code{downto}は、
\begin{quote}
$n$、$n-1$、$n-2$、\tenten 、$m$
\end{quote}
という整数のそれぞれをブロックに渡して、ブロックの実行を
繰り返します。そして、レシーバーをそのまま戻り値として
返します。
\begin{quote}
\begin{verbatim}
irb(main):001:0> 30.downto(20) { |i| i.display; " ".display }
30 29 28 27 26 25 24 23 22 21 20 => 30
\end{verbatim}
\end{quote}
\subsection{数値のイテレーター}
\index{すうち@数値!0のいてれえたあ@\baidash のイテレーター}
\index{いてれえたあ@イテレーター!すうちの@数値の\baidash}
整数と浮動小数点数の総称として、それらを
「数値\index{すうち@数値}」と呼ぶことにしましょう。
数値のオブジェクトは、\code{step}というイテレーターを
持っています。
\code{step}\index{step@\code{step}}は、数値をブロックに
渡してブロックの実行を繰り返すイテレーターです。ブロックに
渡す数値は、レシーバーから出発して、一定の歩幅で増加または
減少していきます。
$b$と$e$と$s$が数値だとするとき、
\begin{quote}
$b$.step($e$, $s$) \syntax{ブロック}
\end{quote}
という式で\code{step}を呼び出すと、\code{step}は、
\begin{quote}
$b$、$b+s$、$b+2s$、$b+3s$、\tenten
\end{quote}
という数値のそれぞれをブロックに渡して、ブロックの実行を
繰り返します($s$がプラスの場合は増加していって、マイナスの
場合は減少していくことになります)。そして、$e$を
通り過ぎたならば繰り返しを終了します。戻り値はレシーバーです。
\begin{quote}
\begin{verbatim}
irb(main):001:0> 0.step(80, 7) { |i| i.display; " ".display }
0 7 14 21 28 35 42 49 56 63 70 77 => 0
irb(main):002:0> 80.step(0, -7) { |i| i.display; " ".display }
80 73 66 59 52 45 38 31 24 17 10 3 => 80
\end{verbatim}
\end{quote}
\subsection{範囲のイテレーター}
\index{はんい@範囲!0のいてれえたあ@\baidash のイテレーター}
\index{いてれえたあ@イテレーター!はんいの@範囲の\baidash}
範囲のオブジェクトは、\code{each}というイテレーターを
持っています。
\code{each}\index{each@\code{each}!はんいの@範囲の\baidash}%
は、レシーバーに含まれているそれぞれのオブジェクトをブロックに
渡して、ブロックの実行を繰り返すイテレーターです。
このイテレーターは、レシーバーをそのまま戻り値として返します。
\begin{quote}
\begin{verbatim}
irb(main):001:0> ("a".."z").each { |s| s.display }
abcdefghijklmnopqrstuvwxyz=> "a".."z"
\end{verbatim}
\end{quote}
\subsection{文字列のイテレーター}
\index{もしれつ@文字列!0のいてれえたあ@
\baidash のイテレーター}
\index{いてれえたあ@イテレーター!もしれつの@文字列の\baidash}
文字列のオブジェクトは、\code{each\us byte}という
イテレーターを持っています。
\code{each\us byte}%
\index{each_byte@\code{each\us byte}!もしれつの@
文字列の\baidash}は、
レシーバーを構成しているそれぞれの文字(文字コード)を
ブロックに渡して、ブロックの実行を繰り返すイテレーターです。
このイテレーターは、レシーバーをそのまま戻り値として返します。
たとえば、
\begin{quote}
\verb/"Umberto Eco".each_byte { |c| c.display; " ".display }/
\end{quote}
というメッセージ式を評価すると、
\begin{quote}
85 109 98 101 114 116 111 32 69 99 111
\end{quote}
というように、レシーバーを構成するそれぞれの文字の文字コードが
出力されます。
文字コードを文字列に変換したいときは、
\index{もしこおと@文字コード!0からもしれつへのへんかん@
\baidash から文字列への変換}%
整数が持っている\code{chr}\index{chr@\code{chr}}という
メソッドを使います。\code{chr}は、レシーバーを文字コードとする
文字から構成される、長さが1の文字列を返すメソッドです。
たとえば、スラッシュ(\code{/})という文字の文字コードは
47ですから、
\begin{quote}
47.chr
\end{quote}
という式を評価すると、\code{"/"}という文字列が値として
得られます。
次のプログラムの中で定義されている\code{abbreviate}という
メソッドは、レシーバーの中に含まれている英字の大文字だけを
取り出して並べた文字列を戻り値として返します。
\begin{program}{abbrevi.rb}
\begin{verbatim}
class Fixnum
def isUppercase
self >= ?A && self <= ?Z
end
end
class String
def abbreviate
abbr = ""
each_byte do |c|
if c.isUppercase
abbr += c.chr
end
end
abbr
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("abbrevi.rb")
=> true
irb(main):002:0> "Unidentified Flying Object".abbreviate
=> "UFO"
\end{verbatim}
\end{jikkourei}
次のプログラムの中で定義されている\code{eachChar}という
イテレーターは、レシーバーを構成しているそれぞれの文字の
文字コードをブロックに渡してブロックを実行する、ということを
繰り返します。そして、ブロックが返した戻り値を
連結することによってできる文字列を戻り値として返します。
そして、\code{enclose}というメソッドは、\code{eachChar}を
使って、レシーバーを構成するそれぞれの文字を角括弧で
囲むことによってできる文字列を戻り値として返します。
\begin{program}{enclose.rb}
\begin{verbatim}
class String
def eachChar
s = ""
each_byte do |c|
s += yield(c)
end
s
end
def enclose
eachChar do |c|
"[" + c.chr + "]"
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("enclose.rb")
=> true
irb(main):002:0> "Italo Calvino".enclose
=> "[I][t][a][l][o][ ][C][a][l][v][i][n][o]"
\end{verbatim}
\end{jikkourei}
第\ref{sec:message}節で紹介した
\code{gsub}\index{gsub@\code{gsub}}というメソッドを、ここで
再び紹介したいと思います。
\code{gsub}は、文字列のオブジェクトが持っているメソッドです。
このメソッドは、引数として2個の文字列を受け取って、1個目の
引数で指定された部分文字列をレシーバーの中で探索して、
発見したすべての部分文字列を2個目の引数に
置き換えることによってできる文字列を戻り値として返します。
実は、この\code{gsub}というメソッドは、イテレーターです。
つまり、受け取ったブロックを実行するメソッドなのです。
イテレーターとしての\code{gsub}は、発見した部分文字列を、
ブロックを使って別の文字列に変換します。
$s$と$t$が文字列だとするとき、
\begin{quote}
$s$.gsub($t$) \syntax{ブロック}
\end{quote}
という式で\code{gsub}を呼び出すと、\code{gsub}は、
$s$の先頭から末尾に向かって、$t$を部分文字列として探索します。
そして、部分文字列を発見するたびに、その部分文字列をブロックに
渡して、ブロックを実行します。そして、$s$の中で発見された
すべての部分文字列をブロックの戻り値で
置き換えることによってできる文字列を戻り値として返します。
次のプログラムの中で定義されている\code{gsubnum}という
メソッドは、1個の文字列を引数として受け取って、それが
レシーバーの中に部分文字列として含まれている部分に番号を
挿入して、その番号と部分文字列とを角括弧で
囲むことによってできた文字列を戻り値として返します。
\begin{program}{gsubnum.rb}
\begin{verbatim}
class String
def gsubnum(s)
num = 0
gsub(s) do |ss|
num += 1
"[" + num.to_s + ss + "]"
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("gsubnum.rb")
=> true
irb(main):002:0> "namamuginamagomenamatamago".gsubnum("ma")
=> "na[1ma]mugina[2ma]gomena[3ma]ta[4ma]go"
\end{verbatim}
\end{jikkourei}
\section{条件による繰り返し}\label{sec:while}
\index{しょうけん@条件!0によるくりかえし@
\baidash による繰り返し}
\index{くりかえし@繰り返し!しょうけんによる@
条件による\baidash}
\subsection{条件による繰り返しとは何か}
繰り返しを記述したいときは、基本的にはイテレーターを
使えばいいわけですが、どのような繰り返しの場合でも、
イテレーターを使うことが最善の選択肢だとは限りません。
イテレーター以外の方法で記述するほうが自然な繰り返し、
というものも存在します。それは、条件による繰り返しです。
条件による繰り返しというのは、動作を実行するたびに、
その繰り返しを続行するか、それとも繰り返しを終了するか、
ということを、何らかの条件が成り立っているかどうかを
判断することによって決定する、というタイプの
繰り返しのことです。このようなタイプの繰り返しは、
イテレーターではなく、繰り返しのための式を使って記述するほうが
自然です。
\subsection{\texttt{while}式}
繰り返しのための式にはいくつかの種類があるのですが、
それらの中でもっとも基本的なのは、
「\code{while}式\index{whileしき@\code{while}式}」
(\code{while} expression)と呼ばれる式です。
\code{while}式は、
\begin{syntaxquote}
while \framebox[5zw]{条件式} \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
という構文を持つ式です。繰り返しを続行するための条件をあらわす
式を「条件式」のところに書いて、繰り返しの対象となる動作を
あらわす式をその下に書きます。
\code{while}式を評価すると、条件式の評価と、繰り返しの
対象となる式の評価とが繰り返されていきます。そして、条件式を
評価したときにその値が偽だった場合、\code{while}式の
評価はそこで終了します。
\code{while}式では、条件式が評価されたのちに繰り返しの
対象となる式が評価されますので、条件式の値が最初から偽だった
場合は、繰り返しの対象となる式は1回も実行されないで
終了することになります。
\subsection{条件による繰り返しの例}
条件による繰り返しの例として、二つの整数の
最大公約数\index{さいたいこうやくすう@最大公約数}%
(greatest common measure)を求めるという処理について
考えてみることにしましょう。
二つの整数の最大公約数は、「ユークリッドの互除法
\index{ゆうくりっとのこしょほう@ユークリッドの互除法}」
(Euclidean algorithm)と呼ばれる方法を使えば、きわめて簡単に
求めることができます。ユークリッドの互除法というのは、
\begin{itemize}
\item[ステップ1] 与えられた二つの整数のそれぞれを、$n$と
$m$という変数に代入する。
\item[ステップ2] $m$が0ならば計算を終了する。
\item[ステップ3] $n$を$m$で除算して、そのあまりを$r$という
変数に代入する。
\item[ステップ4] $m$を$n$に代入する。
\item[ステップ5] $r$を$m$に代入する。
\item[ステップ6] ステップ2に戻る。
\end{itemize}
という計算を実行していけば、計算が終了したときの$n$が、
最初に与えられた二つの整数の最大公約数になっている、
というものです。ステップ2からステップ6までは、
\begin{quote}\rmfamily
$m$が0ではないあいだ、ステップ3からステップ5までを繰り返す。
\end{quote}
ということだと考えることができますので、その部分は、
\code{while}式を書くことによって素直に
記述することができます。
さて、それでは、レシーバーと引数との最大公約数を求めて、
その結果を戻り値として返す、\code{gcm}というメソッドの
定義を書いてみましょう。
\begin{program}{gcm.rb}
\begin{verbatim}
class Integer
def gcm(m)
n = self
while m != 0
r = n % m
n = m
m = r
end
n
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("gcm.rb")
=> true
irb(main):002:0> 54.gcm(36)
=> 18
\end{verbatim}
\end{jikkourei}
\section{再帰}\label{sec:recursion}
\subsection{再帰的な構造}
全体と同じ構造のものが一部分として含まれている構造のことを、
「再帰的な\index{さいきてきな@再帰的な}」(recursive)構造と
言います。
雑誌の表紙に、ときおり、同じ雑誌の同じ号を手に持った人物が
登場することがあります。その人物が持っている雑誌の表紙には、
同じ人物がいて、同じ雑誌を持っています。すると、表紙の中に
同じ表紙がある、という構造が無限に続くことになります。
このような構造は、再帰的な構造の一例です。
抽象的な概念のうちにも、再帰的な構造を
持つものがけっこうあります。たとえば、これから説明する
「括弧列」というのもそのひとつです。
$n$が0またはプラスの整数だとするとき、$n$個の左丸括弧の列の
右側に$n$個の右丸括弧の列を並べることによってできる
文字列のことを、$n$重の「括弧列\index{かっこれつ@括弧列}」と
呼ぶことにします。たとえば、
\begin{quote}
((((((()))))))
\end{quote}
という文字列は、7重の括弧列です。
括弧列が持っている再帰的な構造というのは、丸括弧で囲まれた
内側にさらに括弧列があるという構造のことです。つまり、$n$が
1以上のとき、$n$重の括弧列は、
\begin{quote}
( \syntax{$(n-1)$重の括弧列} )
\end{quote}
という文字列だと考えることができる、ということです。
このように、括弧列は、その一部分として全体と同じ構造のものを
含んでいるわけです。
\subsection{再帰的なメソッド}
メソッドは、再帰的に定義することが可能です。メソッドを
再帰的に定義するというのは、自分自身というメソッドを使って
メソッドを定義するということです。再帰的な構造を持った概念を
取り扱うメソッドは、再帰的に定義するほうが、再帰的ではない
方法で定義するよりもすっきりした記述になります。
それでは、先ほど説明した括弧列という再帰的な概念を使って、
メソッドの再帰的な定義について考えてみることにしましょう。
レシーバーを$n$とする括弧列を作る\code{paren}というメソッドを
再帰的に定義するためにはどうすればいいでしょうか。
メソッドを再帰的に定義するためには、まず、「基底」と
呼ばれるものについて考える必要があります。
「基底\index{きてい@基底}」(basis)というのは、再帰的な構造の
中心にあって、それ以上の内部を持っていないもののことです。
たとえば、括弧列では、もっとも内側の丸括弧のさらに内側にある
空文字列\index{くうもしれつ@空文字列}(長さが0の文字列)が
基底です。
再帰的なメソッドは、かならずひとつの選択を持っています。
それは、再帰が必要な場合とそうでない場合との選択です。再帰が
必要ではない場合というのは、基底を取り扱う場合のことです。
括弧列を作る\code{paren}の場合は、$n$が1以上かどうかで動作を
選択します。$n$が1以上ならば、自分自身を呼び出して$(n-1)$重の
括弧列を求めて、それをさらに丸括弧で囲んだものを返します。
$n$が0ならば、基底、すなわち空文字列を返します。
次のプログラムは、以上の考え方に基づいて\code{paren}を
定義したものです。
\begin{program}{paren.rb}
\begin{verbatim}
class Integer
def paren
if self >= 1
"(" + (self - 1).paren + ")"
else
""
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("paren.rb")
=> true
irb(main):002:0> 14.paren
=> "(((((((((((((())))))))))))))"
\end{verbatim}
\end{jikkourei}
\subsection{階乗}
$n$が0またはプラスの整数だとするとき、$n$から1までの整数を
すべて掛け算した結果、つまり、
\begin{quote}
$n \times (n-1) \times (n-2) \times \tenten \times 1$
\end{quote}
という計算の結果のことを、$n$の
「階乗\index{かいしょう@階乗}」(factorial)と呼んで、$n\,!$と
書きあらわします。ただし、$0\,!$は1だと定義します。
たとえば、$5\,!$は、
\begin{quote}
$5 \times 4 \times 3 \times 2 \times 1$
\end{quote}
という計算をすればいいわけですから、120ということになります。
この階乗というのも、再帰的な構造を持つ概念の一例です。
なぜなら、$n\,!$を求める計算は、
\begin{displaymath}
\left\{ \begin{array}{ll}
& 0\,! = 1 \\
n \geq 1 ならば & n\,! = n \times (n-1)\,!
\end{array}
\right.
\end{displaymath}
ということだと考えることができるからです。
ですから、階乗を求めるメソッドは、自分自身を使うことによって、
かなりすっきりと定義することができます。次のプログラムは、
階乗を求める\code{factorial}というメソッドを再帰的に
定義したものです。
\begin{program}{fact.rb}
\begin{verbatim}
class Integer
def factorial
if self >= 1
self * (self - 1).factorial
else
1
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("fact.rb")
=> true
irb(main):002:0> 30.factorial
=> 265252859812191058636308480000000
\end{verbatim}
\end{jikkourei}
\subsection{フィボナッチ数列}
フィボナッチ数列
\index{ふぃほなっちすうれつ@フィボナッチ数列}%
(Fibonacci sequence)と呼ばれる数列の第$n$項を求める計算も、
再帰的な構造を持っています。
フィボナッチ数列の第$n$項($F_{n}$)は、
\begin{displaymath}
\left\{ \begin{array}{ll}
& F_{0} = 1 \\
& F_{1} = 1 \\
n \geq 2 ならば & F_{n} = F_{n-2} + F_{n-1}
\end{array}
\right.
\end{displaymath}
という計算によって求めることができます。たとえば、第7項を
求めたいときは、第5項と第6項とを加算すればいいわけです。
次のプログラムは、フィボナッチ数列の第$n$項を求める
\code{fibonacci}というメソッドを再帰的に定義したものです。
\begin{program}{fibona.rb}
\begin{verbatim}
class Integer
def fibonacci
if self >= 2
(self - 2).fibonacci + (self - 1).fibonacci
else
1
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("fibona.rb")
=> true
irb(main):002:0> 30.fibonacci
=> 1346269
\end{verbatim}
\end{jikkourei}
\chapter{クラス}\label{chap:class}
\section{クラスの定義}\label{sec:definitionofclass}
\subsection{クラスを定義する必要性}
Rubyでは、数値や文字列のような、多くのプログラムで必要とされる
基本的なオブジェクトは、
組み込みクラス\index{くみこみくらす@組み込みクラス}、つまり
処理系の中に最初から組み込まれているクラスから生成されます。
しかし、プログラムの中で必要となるオブジェクトは、かならずしも
組み込みクラスのインスタンスだけとは限りません。特殊な問題を
扱うプログラムは、その問題に即した特殊なオブジェクトを
必要とします。たとえば、図形を扱うプログラムは点や線をあらわす
オブジェクトを必要とするでしょうし、ロールプレイングゲームの
プログラムはキャラクターやマップやアイテムをあらわす
オブジェクトを必要とするでしょう。
組み込みクラスのインスタンスではない独自のオブジェクトを
使うためには、それを生成する新しいクラスを作る必要があります。
クラスを作ることを、クラスを「定義する」(define)と言います。
\index{くらす@クラス!0をていきする@\baidash を定義する}%
\index{ていぎする@定義する!くらすを@クラスを\baidash}%
\subsection{クラスを定義する方法}
クラスを定義したいときは、まだ存在していないクラスの名前を
指定したクラス定義を書きます。
クラス定義\index{くらすていき@クラス定義}というのは、
第\ref{sec:definitionofmethod}節で説明したように、
\begin{syntaxquote}
class \framebox[6zw]{クラス名} \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
という形の式のことです。「クラス名」のところに既存のクラスの
名前を書くと、既存のクラスにメソッドの鋳型を
追加することになるわけですが、既存のクラスの名前ではなくて、
まだ存在していないクラスの名前を書くと、その名前を持つ新しい
クラスが定義されることになります。
クラスの名前は、変数の名前と同じように、英字、数字、
アンダースコア(\code{\us})を並べることによって作ります。
ただし、先頭の文字は、英字の大文字でないといけません。
たとえば、\code{Namako}、\code{Uni587}、\code{Ika\us tako}、
\code{IkaTako}などは、クラスに与えることのできる名前です。
それでは、実際にクラスを定義してみましょう。irbに、
\begin{quote}
\begin{verbatim}
class Hitode
end
\end{verbatim}
\end{quote}
という式を入力してみてください。すると、\code{Hitode}という
名前の新しいクラスが定義されます。次に、新しいクラスが
実際にできたかどうかを確かめるために、それに\code{class}という
メッセージを送ってみましょう。クラスというのは、
\code{Class}というクラスのインスタンスですから、irbに、
\begin{quote}
Hitode.class
\end{quote}
という式を入力すると、戻り値として\code{Class}というクラスが
得られるはずです。
クラス定義の中にメソッド定義を書いておくと、
そのメソッド定義によって定義されたメソッドの鋳型がクラスに
追加されます。したがって、そのクラスから生成されたすべての
インスタンスは、そのメソッドの鋳型から生成されたメソッドを
持つことになります。
\subsection{インスタンスの生成}
クラス定義を書くことによって定義されたクラスからインスタンスを
生成したいときは、いったいどうすればいいのでしょうか。
まず、次のプログラムを入力して、ファイルに保存してください。
\begin{program}{kurage.rb}
\begin{verbatim}
class Kurage
def what
"kurage"
end
end
\end{verbatim}
\end{program}
次に、このプログラムをirbで実行してください。すると、
\code{Kurage}という名前のクラスが定義されて、
そのクラスの中に、\code{what}という名前のメソッドを生成する
鋳型が追加されるはずです。
それでは次に、この\code{Kurage}というクラスからインスタンスを
生成してみましょう。
クラス定義によって新しく定義されたクラスは、かならず、
\code{new}という名前のメソッドを持っています。
\code{new}\index{new@\code{new}}は、レシーバーのインスタンスを
生成して、そのインスタンスを戻り値として返す、という
動作をします。ですから、クラス定義によって定義されたクラスの
インスタンスを生成したいときは、そのクラスに\code{new}という
メッセージを送ればいいわけです。
それでは、\code{Kurage}クラスに\code{new}を送ってみましょう。
irbに、
\begin{quote}
k = Kurage.new
\end{quote}
という式を入力してください。すると、\code{Kurage}クラスの
インスタンスが生成されて、それが\code{k}という変数に
代入されます。ですから、
\begin{quote}
k.what
\end{quote}
という式で、変数\code{k}が指し示しているオブジェクトに
\code{what}というメッセージを送ると、\code{kurage}という
文字列が値として得られるはずです。
\subsection{インスタンス変数}
クラスというのがオブジェクトの種類をあらわしているのに対して、
オブジェクトというのは個々のものをあらわしています。
個々のものがいくつかあるとするとき、たとえそれらが同じ
種類のものだとしても、それぞれのものはどこかが違っているのが
普通です。つまり、個々のものは何らかの
個性\index{こせい@個性}を持っているということです。
ところで、先ほど定義した\code{Kurage}クラスからいくつかの
インスタンスを生成したとするとき、それらのインスタンスは個性を
持っていると言えるでしょうか。答はノーです。その理由は、
それらのインスタンスは、個性を表現するものをその内部に
持っていないからです\footnote{ただし、
それぞれのインスタンスは、自分を識別することのできる番号を
持っています。}。
オブジェクトは、普通、変数とメソッドから構成されます。
オブジェクトの中の変数は、個々のオブジェクトの個性を
表現しているオブジェクトを指し示すために使われます。
変数については第\ref{sec:variable}節で説明しましたが、そこで
説明した変数というのは、
「ローカル変数\index{ろおかるへんすう@ローカル変数}」
(local variable)と呼ばれる種類のものでした。
変数を取り扱うことのできる、時間的、空間的、または記述の上での
範囲のことを、その変数の
「スコープ\index{すこおふ@スコープ}」(scope)と呼びます。
ローカル変数というのは、ひとつのメソッドの中の限られた部分が
実行されているあいだだけ存在する変数です。そのようなスコープを
持っているため、ローカル変数は、オブジェクトの個性を
表現しているオブジェクトを指し示すという目的には
使うことができません。オブジェクトの個性を表現している
オブジェクトを指し示すためには、ひとつのメソッドが
実行されているあいだだけではなくて、ひとつのオブジェクトが
存在している限り存在し続ける、というスコープを持つ変数を
使う必要があります。
ひとつのオブジェクトが存在している限り存在し続ける変数は、
「インスタンス変数
\index{いんすたんすへんすう@インスタンス変数}」
(instance variable)と呼ばれます。変数に付ける名前の先頭の
文字をアットマーク\index{あっとまあく@アットマーク}%
(\code{@}\index{"@@\code{@}})にすると、その変数は
インスタンス変数になります。
それでは、次のプログラムを入力して、ファイルに
保存してください。
\begin{program}{ningen.rb}
\begin{verbatim}
class Ningen
def setNamae(namae)
@namae = namae
end
def getNamae
@namae
end
end
\end{verbatim}
\end{program}
このプログラムの中で定義されている\code{Ningen}という
クラスから生成されたインスタンスは、\code{@namae}という
インスタンス変数を持っています。
それでは、\code{Ningen}クラスのインスタンスに個性を
与えてみましょう。まず最初に、
\begin{tttablelist}{}
\item[n1 = Ningen.new]
\item[n2 = Ningen.new]
\end{tttablelist}
という二つの式で、\code{Ningen}クラスの二つのインスタンスを
生成して、それらを\code{n1}と\code{n2}に代入してください。
次に、
\begin{tttablelist}{}
\item[n1.setNamae("Umino Miyuki")]
\item[n2.setNamae("Moroboshi Ataru")]
\end{tttablelist}
という二つの式で、それぞれのインスタンスが持っている
\code{setNamae}というメソッドを呼び出してください。
そうすると、それぞれのインスタンスの中にある
\code{@namae}というインスタンス変数に、異なる文字列が
代入されます。ですから、
\begin{tttablelist}{}
\item[n1.getNamae]
\item[n2.getNamae]
\end{tttablelist}
という二つの式で、それぞれのインスタンスに
\code{getNamae}というメッセージを送ると、それぞれの
インスタンスの\code{getNamae}は、異なる文字列を
返すことになります。
\subsection{カプセル化}
Rubyでは、オブジェクトの外部にあるメソッドはインスタンス変数に
アクセスすることができない、という仕様になっています。
そのような仕様にしている目的は、
「カプセル化\index{かふせるか@カプセル化}」(encapsulation)と
呼ばれるものを実現するためです。さてそれでは、
「カプセル化」というのはいったいどういうことなのでしょうか。
オブジェクトというのは、プログラムを構成する部品の一種です。
部品というものを設計する上で重要なことは、部品を実現する
メカニズムと、部品の使い方とを分離するということです。
メカニズムと使い方とが互いに依存していると、必要に応じて
メカニズムを変更しなければならなくなったときに、使い方まで
変更しなければならなくなってしまって、不便だからです。
部品の設計者がメカニズムと使い方とを分離したいと思っても、
部品の外部からメカニズムが丸見えになっていれば、メカニズムに
依存した使い方が可能になってしまいます。ですから、部品自体に、
内部のメカニズムを外側から扱うことができないようにする機能が
必要になります。そのような機能を使って、使ってもかまわない
部分だけを公開して、それ以外の部分を隠蔽することを、部品を
「カプセル化する\index{かふせるかする@カプセル化する}」
(encapsulate)と言います。「カプセル化」(encapsulation)は、
その名詞形です。
オブジェクトの内部にあるインスタンス変数は、普通、
そのオブジェクトを実現するためのメカニズムとのあいだに密接な
関係があります。ですから、オブジェクトの外部にあるメソッドは
インスタンス変数にアクセスすることができないというRubyの
仕様は、オブジェクトをカプセル化するという目的に大いに
貢献することになります。
\subsection{インスタンス変数の初期化}
新しく作られた変数に最初に代入されるオブジェクトのことを、
その変数の「初期値\index{しょきち@初期値}」(initial value)と
呼びます。そして、変数に初期値を代入することを、変数を
「初期化する\index{しょきかする@初期化する}」(initialize)と
言います。
クラスからインスタンスを生成したときに、
そのインスタンスの中にあるインスタンス変数をその時点で
初期化したい、ということがしばしばあります。そのような
初期化は、\code{initialize}という名前のメソッドを
定義することによって実現することができます。
\code{initialize}\index{initialize@\code{initialize}}という
名前のメソッドを定義すると、そのメソッドは、クラスから
インスタンスが生成された時点で自動的に呼び出されます。
ですから、インスタンス変数に初期値を代入するように
\code{initialize}を定義しておけば、インスタンス変数は、
インスタンスが生成された時点で初期化されることになります。
それでは、次のプログラムを入力して、ファイルに
保存してください。
\begin{program}{saifu.rb}
\begin{verbatim}
class Saifu
def initialize
@kingaku = 1000
end
def dashiire(kingaku)
@kingaku += kingaku
end
end
\end{verbatim}
\end{program}
このプログラムの中で定義されている\code{Saifu}というクラスから
インスタンスを生成すると、その時点で\code{initialize}が
呼び出されて、\code{@kingaku}という変数に1000が代入されます。
ですから、
\begin{quote}
s = Saifu.new
\end{quote}
という式で、\code{Saifu}クラスのインスタンスを\code{s}という
変数に代入したのち、
\begin{quote}
s.dashiire(0)
\end{quote}
という式で、そのインスタンスに\code{dashiire(0)}という
メッセージを送ると、その結果として1000という整数が得られます。
\subsection{\texttt{new}の引数}
クラスが持っている\code{new}\index{new@\code{new}}という
メソッドは、引数を受け取ることができます。\code{new}に引数を
渡すと、\code{new}は、自分が生成したインスタンスの中にある
\code{initialize}に、それらの引数をそのまま渡します。
ですから、引数を受け取るように\code{initialize}を
定義しておくことによって、インスタンス変数を初期化するための
オブジェクトを、インスタンスを生成するときに
指定することができるようになります。
次のプログラムは、先ほどのプログラムを、\code{@kingaku}の
初期値を\code{new}に引数として渡すことができるように
改良したものです。
\begin{program}{saifu2.rb}
\begin{verbatim}
class Saifu
def initialize(kingaku)
@kingaku = kingaku
end
def dashiire(kingaku)
@kingaku += kingaku
end
end
\end{verbatim}
\end{program}
この改良版の\code{initialize}は、1個の引数を受け取って、それを
\code{@kingaku}というインスタンス変数に初期値として
代入します。ですから、
\begin{quote}
s = Saifu.new(3700)
\end{quote}
というように、\code{Saifu}クラスからインスタンスを
生成するときに\code{new}に引数を渡せば、\code{new}がその引数を
\code{initialize}に渡しますので、その引数が\code{@kingaku}に
初期値として代入されることになります。
\subsection{クラスメソッド}
クラスというのもオブジェクトの一種ですので、クラスは、
メソッドの鋳型だけではなくて、メソッドそのものを
持つことも可能です。クラスが持っているメソッドは、
「クラスメソッド\index{くらすめそっと@クラスメソッド}」
(class method)と呼ばれます。たとえば、インスタンスを生成する
\code{new}や、スーパークラスを求める\code{superclass}は、
クラスメソッドの例です。
クラス定義の中にメソッド定義を書くと、普通は、
メソッドではなくてメソッドを生成する鋳型がクラスに
追加されます。さて、それでは、メソッドの鋳型ではなくて、
メソッドそのものをクラスに追加したいときは、
いったいどうすればいいのでしょうか。
\index{くらすめそっと@クラスメソッド!0をていきする@
\baidash を定義する}%
\index{ていきする@定義する!くらすめそっとを@
クラスメソッドを\baidash}%
メソッド定義を書くとき、メソッド名の左側に、クラス名と
ドット(\code{.})を付けると、クラスに追加されるのは、
そのメソッドを生成する鋳型ではなくて、
メソッドそのものになります。つまり、
\begin{syntaxquote}
def \syntax{クラス名}.\syntax{メソッド名}(\syntax{仮引数名},%
\ \tenten\ ) \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
という形のメソッド定義を書くことによって、クラスメソッドを
定義することができるわけです。
それでは、クラスメソッドを実際に定義してみましょう。まず、次の
プログラムを入力してください。
\begin{program}{namako.rb}
\begin{verbatim}
class Namako
def what
"namako"
end
def Namako.what
"class"
end
end
\end{verbatim}
\end{program}
このプログラムの中では、\code{what}という同じ名前を持つ
メソッドが二つ定義されていますが、ひとつは
\code{Namako}クラスのインスタンスの中に作られるメソッドで、
もうひとつは\code{Namako}クラスの中に作られるメソッドです。
それでは、このプログラムを\code{load}で実行したのち、
\begin{quote}
Namako.new.what
\end{quote}
という式で、\code{Namako}クラスのインスタンスに
\code{what}というメッセージを送ってみてください。すると、
そのインスタンスが持っている\code{what}が呼び出されますので、
\code{namako}という文字列が得られるはずです。次に、
\begin{quote}
Namako.what
\end{quote}
という式で、\code{Namako}というクラスに\code{what}という
メッセージを送ってみてください。すると、クラスメソッドの
\code{what}が呼び出されますので、\code{class}という文字列が
得られるはずです。
\section{サブクラスの定義}\label{sec:definitionofsubclass}
\subsection{スーパークラスを指定しないクラス定義}
Rubyでは、\code{Object}以外のすべてのクラスは、かならず、
自分のスーパークラスを持っています。新しいクラスを
定義した場合も、その新しいクラスは、何らかの既存のクラスを
スーパークラスとして持つことになります。
前の節で、新しいクラスを定義するためのクラス定義をいくつか
書きましたが、それらのクラス定義の中には、新しく作るクラスの
スーパークラスが何なのかということを指定する
記述はありませんでした。そのように、スーパークラスを
指定しないで新しいクラスを定義した場合は、スーパークラスとして
\code{Object}\index{Object@\code{Object}}が指定されたと
解釈されます。たとえば、
\begin{quote}
\begin{verbatim}
class Kingyo
end
\end{verbatim}
\end{quote}
という、スーパークラスを指定する記述を含んでいない
クラス定義で、\code{Kingyo}というクラスを
定義したとしましょう。この場合、\code{Kingyo}の
スーパークラスは\code{Object}ですから、
\begin{quote}
Kingyo.superclass
\end{quote}
という式で、\code{Kingyo}に\code{superclass}というメッセージを
送ると、\code{Object}が値として得られます。
\subsection{スーパークラスを指定したクラス定義}
さて、それでは、\code{Object}以外のクラスを
スーパークラスとして指定して新しいクラスを定義するためには、
クラス定義の中にどのような記述を書けばいいのでしょうか。
クラス定義を書くときに、定義されるクラスの名前の右側に
小なり(\code{<})を書いて、すでに存在するクラスの名前を
そのさらに右側に書くと、定義されるクラスは、小なりの右側に
書かれたクラスのサブクラスになります。つまり、
\begin{syntaxquote}
class \framebox[6zw]{クラス名}
\ < \framebox[10zw]{スーパークラス名}\\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
という形のクラス定義
\index{くらすていき@クラス定義!すうはあくらすをしていした@
スーパークラスを指定した\baidash}%
を書くことによって、スーパークラスを指定して新しいクラスを
定義することができるということです。
それでは、次の二つのクラス定義をirbに入力してください。
\begin{quote}
\begin{verbatim}
class Sakana
end
class Unagi < Sakana
end
\end{verbatim}
\end{quote}
これらのクラス定義によって定義される\code{Sakana}と
\code{Unagi}という二つのクラスのあいだには、
\code{Sakana}は\code{Unagi}のスーパークラスで、\code{Unagi}は
\code{Sakana}のサブクラスだ、という関係が生じます。ですから、
\begin{quote}
Unagi.superclass
\end{quote}
という式を評価すると、\code{Sakana}という値が得られます。
\subsection{継承}
オブジェクト指向をサポートするプログラミング言語の大多数は、
スーパークラスが持っている変数やメソッドの鋳型がサブクラスに
自動的に受け継がれるという機能を持っていて、そのような
機能は「継承\index{けいしょう@継承}」(inheritance)と
呼ばれます。そして、継承によって変数やメソッドの鋳型を
受け継ぐことを、変数やメソッドの鋳型を
「継承する\index{けいしょうする@継承する}」(inherit)と
言います。
Rubyも、継承という機能を備えているプログラミング言語の
ひとつです。それでは、irbを使って、本当に変数やメソッドの
鋳型が継承されるかどうかを確かめてみましょう。まず、次の
プログラムを入力してください。
\begin{program}{rikishi.rb}
\begin{verbatim}
class Ningen
def setNamae(namae)
@namae = namae
end
def getNamae
@namae
end
end
class Rikishi < Ningen
def setShikona(shikona)
@shikona = shikona
end
def getShikona
@shikona
end
end
\end{verbatim}
\end{program}
このプログラムの中で定義されている\code{Ningen}は、人間を
あらわすオブジェクトを生成するクラスです。そして、
\code{Rikishi}は、\code{Ningen}クラスのサブクラスで、
力士をあらわすオブジェクトを生成します。
次に、このプログラムを\code{load}で実行したのち、
\begin{quote}
r = Rikishi.new
\end{quote}
という式で、\code{Rikishi}クラスのインスタンスを生成して、
それを\code{r}という変数に代入してください。
\code{Rikishi}クラスは\code{Ningen}クラスの
サブクラスですから、\code{Rikishi}クラスのインスタンスは、
\code{@namae}というインスタンス変数と、\code{setNamae}、
\code{getNamae}というメソッドを持っているはずです。
それでは、実際にメソッドを呼び出してみましょう。まず、
\begin{quote}
r.setNamae("Tamura Yoshio")
\end{quote}
という式を入力してください。すると、\code{r}が指し示している
オブジェクトに対して名前が設定されます。そして次に、
\begin{quote}
r.getNamae
\end{quote}
という式を入力してください。すると、設定されている名前が
値として得られます。
\code{Rikishi}クラスのインスタンスは、\code{Ningen}クラスから
継承した変数とメソッドだけではなくて、力士の四股名を指し示す
\code{@shikona}という独自のインスタンス変数と、
\code{setShikona}、\code{getShikona}という独自のメソッドも
持っています。ですから、
\begin{quote}
r.setShikona("Tokinoumi")
\end{quote}
という式で、\code{r}が指し示しているオブジェクトに四股名を
設定したのち、
\begin{quote}
r.getShikona
\end{quote}
という式を評価すると、設定されている四股名が値として
得られるはずです。
\subsection{継承を利用することの意味}
スーパークラスとサブクラスの関係というのは、分類項目の大分類と
小分類の関係だと考えることができます。つまり、
スーパークラスというのはサブクラスよりも一般的な種類を
あらわしていて、サブクラスというのはスーパークラスよりも特殊な
種類をあらわしている、ということです。ですから、
スーパークラスを指定して新しいクラスを作るということは、すでに
存在する何らかのクラスを特殊化することによって新しいクラスを
作るということを意味しています。
特殊なクラスは、それよりも一般的なクラスが持っている性質を
すべて持っていて、さらに独自の性質も持っている必要があります。
クラスの性質というのは、具体的には、そのインスタンスが
持っている変数やメソッドのことだと考えていいでしょう。つまり、
継承という機能は、スーパークラスはサブクラスよりも一般的で、
サブクラスはスーパークラスよりも特殊なものだという関係を
実現するために存在しているわけです。
プログラムを書くとき、継承という機能を上手に使うことは、
さまざまなメリットを与えてくれます。主要なメリットとしては、
次のようなものがあります。
\begin{enumerate}
\item プログラムの読みやすさを向上させることができます。
いくつかのクラスから構成されるプログラムを書く場合、
それらのクラスが互いに無関係に存在しているよりも、
一般的なものと特殊なものという関係で木の形に
整理されているほうが、はるかに読みやすいプログラムになります。
\item プログラムを書くという作業の効率を
向上させることができます。たとえば、AとBという互いによく似た
クラスを作る場合、AとBをまったく別々のクラスとして
定義するよりも、それらに共通する性質を持つクラスをまず
定義して、そののち、AとBをそのサブクラスとして定義するほうが、
効率的です。
\item 再利用しやすいプログラムを書くことができます。継承を
使って書かれたプログラムの中には、目的に応じた特殊な
機能だけではなくて、それを一般化した機能が、スーパークラスの
定義という形で記述されています。そのような一般的な機能を
記述した部分は、特殊な機能を記述した部分よりも、
ほかのプログラムを書くときに再利用しやすくなっているのです。
\end{enumerate}
\subsection{オーバーライド}
新しいクラスを定義するとき、新しいインスタンス変数やメソッドを
追加するだけではなくて、スーパークラスで定義されている
メソッドの動作を変更したい、ということがしばしばあります。
スーパークラスのメソッドの動作をサブクラスで変更したいときは、
スーパークラスで定義されているメソッドと同じ名前のメソッドを
サブクラスで定義します。このことを、スーパークラスのメソッドを
「オーバーライドする
\index{おおはあらいとする@オーバーライドする}」(override)と
言います。
それでは、実際にスーパークラスのメソッドを
オーバーライドしてみましょう。まず、次のプログラムを
入力して、\code{load}で実行してください。
\begin{program}{maguro.rb}
\begin{verbatim}
class Sakana
def what
"sakana"
end
end
class Maguro < Sakana
def what
"maguro"
end
end
\end{verbatim}
\end{program}
次に、\code{Sakana}クラスのインスタンスが持っている
\code{what}というメソッドを呼び出す、
\begin{quote}
Sakana.new.what
\end{quote}
という式を入力してください。すると、\code{sakana}という
文字列が値として得られます。
\code{Maguro}クラスは\code{Sakana}クラスのサブクラスですので、
\code{what}というメソッドを継承しています。しかし、
\code{Maguro}クラスでは、\code{maguro}という文字列を返す
同じ名前のメソッドによって\code{what}が
オーバーライドされています。ですから、
\begin{quote}
Maguro.new.what
\end{quote}
という式で、\code{Maguro}クラスのインスタンスが持っている
\code{what}を呼び出すと、\code{maguro}という文字列が値として
得られるはずです。
スーパークラスのメソッドをオーバーライドするメソッドを
定義するとき、その定義の中で、オーバーライドされる
スーパークラスのメソッドを使いたい、
ということがしばしばあります。その場合、オーバーライドされる
スーパークラスのメソッドは、
\code{super}\index{super@\code{super}}という特殊な名前を
使うことによって呼び出すことができるようになっています。
それでは、次のプログラムを入力して、\code{load}で
実行してください。
\begin{program}{tonbo.rb}
\begin{verbatim}
class Konchuu
def what
"konchuu"
end
end
class Tonbo < Konchuu
def what
super + "/tonbo"
end
end
\end{verbatim}
\end{program}
\code{Tonbo}クラスは、スーパークラスから継承した
\code{what}というメソッドをオーバーライドしているわけですが、
その定義の中で\code{super}を使うことによって、スーパークラスの
\code{what}を呼び出しています。ですから、
\begin{quote}
Tonbo.new.what
\end{quote}
という式で、\code{Tonbo}クラスのインスタンスが持っている
\code{what}を呼び出すと、\code{konchuu/tonbo}という文字列が
値として得られます。
オーバーライドされるメソッドに引数を渡したいときは、
\begin{quote}
super(350, "hitode")
\end{quote}
というように、\code{super}の右側に丸括弧を書いて、その中に
式を書きます。
引数を渡すための式を\code{super}の右側に書かなかった場合は、
サブクラスのメソッドが受け取った引数をすべて渡すという意味だと
解釈されます。つまり、
\begin{quote}
\begin{verbatim}
def set(a, b, c)
super
end
\end{verbatim}
\end{quote}
というメソッド定義の中の\code{super}は、
\begin{quote}
super(a, b, c)
\end{quote}
という記述と同じ意味になります。もしも、サブクラスのメソッドが
引数を受け取るにもかかわらず、オーバーライドされるメソッドに
まったく引数を渡したくない、という場合は、
\begin{quote}
super()
\end{quote}
というように、
空の丸括弧\index{まるかっこ@丸括弧!からの@空の\baidash}を書く
必要があります。
\subsection{同一のオブジェクトから構成される列}
継承を利用したプログラムの例としてこれまでに紹介したものは、
実用性がほとんどないものばかりでしたので、ここで、実用性が
少しはあるかもしれないプログラムを紹介しておきたいと思います。
\begin{program}{sameseq.rb}
\begin{verbatim}
class SameSequence
def initialize(element, length)
@element = element
@length = length
end
def getElement
@element
end
def getLength
@length
end
def to_s
if @length >= 1
s = @element.to_s
(@length - 1).times do
s += "," + @element.to_s
end
else
s = ""
end
"[" + s + "]"
end
end
class CharSameSequence < SameSequence
def to_s
@element.chr * @length
end
end
class NumericSameSequence < SameSequence
def sum
@element * @length
end
def product
@element ** @length
end
end
\end{verbatim}
\end{program}
このプログラムの中で定義されている\code{SameSequence}という
クラスは、同一のオブジェクトから構成される列をあらわす
オブジェクトを生成します。
このクラスの\code{new}は、1個目の引数として任意の
オブジェクト、2個目の引数として列の長さを受け取って、
そのオブジェクトだけから構成される列をあらわすオブジェクトを
戻り値として返します。たとえば、
\begin{quote}
a = SameSequence.new("hibari", 7)
\end{quote}
という式を評価すると、\code{hibari}という文字列を
7個並べることによってできる列をあらわすオブジェクトが
\code{a}という変数に代入されます。
\code{SameSequence}クラスのインスタンスに\code{to\us s}という
メッセージを送ると、そのインスタンスがあらわしている列を
文字列に変換したものが得られます。それでは、先ほど
\code{a}という変数に代入したオブジェクトに\code{to\us s}を
送ってみましょう。そうすると、
\begin{quote}
[hibari,hibari,hibari,hibari,hibari,hibari,hibari]
\end{quote}
という文字列が得られるはずです。
\code{SameSequence}のサブクラスとして定義されている
\code{CharSameSequence}というクラスは、同一の文字から
構成される列をあらわすオブジェクトを生成します。\code{new}に
渡す1個目の引数は、列を構成する文字の文字コードです。
たとえば、
\begin{quote}
b = CharSameSequence.new("="[0], 40)
\end{quote}
という式を評価すると、イコール(\code{=})という文字を
40個並べることによってできる列をあらわすオブジェクトが
\code{b}という変数に代入されます。
\code{CharSameSequence}クラスの\code{to\us s}は、
スーパークラスの\code{to\us s}とは少し異なる動作をします。
たとえば、先ほど生成したオブジェクトに\code{to\us s}という
メッセージを送ると、
\begin{quote}
========================================
\end{quote}
という文字列が得られます。
\code{SameSequence}のサブクラスとして定義されている
\code{NumericSameSequence}というクラスは、同一の数値から
構成される列をあらわすオブジェクトを生成します。
このクラスでは、レシーバーの和を求める\code{sum}という
メソッドと、積を求める\code{product}というメソッドが
追加されています。たとえば、
\begin{quote}
c = NumericSameSequence.new(2, 10)
\end{quote}
という式で、2という整数を10個並べることによってできる列を
あらわすオブジェクトが\code{c}という変数に
代入されているとすると、\code{c.sum}という式の値は20になって、
\code{c.product}という式の値は1024になります。
\section{モジュール}\label{sec:module}
\subsection{モジュールの基礎}
クラスを生成する\code{Class}\index{Class@\code{Class}}という
クラスは、\code{Module}\index{Module@\code{Module}}という
クラスのサブクラスです。この\code{Module}というクラスの
インスタンスは、
「モジュール\index{もしゅうる@モジュール}」(module)と
呼ばれます。
モジュールは、モジュール、クラス、メソッド、メソッドの
鋳型などを自分の内部に持つことができるという機能を
持っています。この機能は、継承によってクラスにも
受け継がれています。クラスというのは、モジュールに対して、
\begin{itemize}
\item オブジェクトを生成することができる。
\item スーパークラスから性質を継承することができる。
\end{itemize}
という二つの機能を追加したオブジェクトだと
考えることができます。
クラスが持っている鋳型ではないメソッドのことを
「クラスメソッド」と呼ぶのと同じように、モジュールが持っている
鋳型ではないメソッドは、「モジュールメソッド
\index{もしゅうるめそっと@モジュールメソッド}」
(module method)と呼ばれます。モジュールメソッドは、
それを持っているモジュールにメッセージを送ることによって
呼び出すことができます。
\subsection{モジュール定義}
\index{もしゅうる@モジュール!0をていきする@
\baidash を定義する}%
\index{ていきする@定義する!もしゅうるを@モジュールを\baidash}%
新しいモジュールを定義したいときや、すでに存在する
モジュールに何かを追加したいときは、
「モジュール定義\index{もしゅうるていき@モジュール定義}」
(module definition)と呼ばれる式を書きます。モジュール定義は、
\begin{syntaxquote}
module \syntax{モジュール名} \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
という構文を持つ式です。
モジュール定義を評価すると、「モジュール名」のところに書かれた
名前で指定されるモジュールに、「式」のところに書かれた
式によって定義されたものが追加されます。存在しないモジュールの
名前が指定された場合は、その名前を持つ新しいモジュールが
定義されます。なお、モジュールに付ける名前は、クラスの場合と
同じように、先頭の文字が英字の大文字でないといけません。
モジュールにメソッドの鋳型を追加したいときは、
モジュール定義の中に普通のメソッド定義を書きます。メソッドの
鋳型ではなくてモジュールメソッドを追加したいときは、
\index{もしゅうるめそっと@モジュールメソッド!0をていきする@
\baidash を定義する}%
\index{ていきする@定義する!もしゅうるめそっとを@
モジュールメソッドを\baidash}%
\begin{syntaxquote}
def \syntax{モジュール名}.\syntax{メソッド名}(%
\syntax{仮引数名}, \tenten\ ) \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
という形のメソッド定義を書きます。
\begin{program}{umiushi.rb}
\begin{verbatim}
module Umiushi
def Umiushi.modulename
"Umiushi"
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("umiushi.rb")
=> true
irb(main):002:0> Umiushi.modulename
=> "Umiushi"
\end{verbatim}
\end{jikkourei}
\subsection{モジュールのインクルード}
モジュールは、自分の中にメソッドの鋳型を持つことができます。
しかし、モジュールは、インスタンスを生成するという機能を
持っていません。それでは、モジュールが持っているメソッドの
鋳型は、いったいどうすれば利用することができるのでしょうか。
モジュールは、別のモジュールが持っているものを自分の中に
取り込むという機能を持っています。モジュールが、別の
モジュールが持っているものを自分の中に取り込むことを、
モジュールを
「インクルードする\index{いんくるうとする@インクルードする}」
(include)と言います。
モジュールをインクルードするという機能はクラスにも
継承されていますので、クラスも、モジュールが持っているものを
自分の中に取り込むことができます。モジュールをインクルードした
クラスは、インスタンスを生成するとき、モジュールから取り込んだ
メソッドの鋳型からもメソッドを生成します。
モジュールをインクルードしたいときは、
\code{include}\index{include@\code{include}}というメソッドを
使います。モジュール定義またはクラス定義の中に、
\begin{quote}
include(\syntax{モジュール名})
\end{quote}
という形の式を書いておくと、引数で指定されたモジュールが、
モジュールまたはクラスの中にインクルードされます。たとえば、
\begin{quote}
\begin{verbatim}
class Kamenote
include(Funamushi)
end
\end{verbatim}
\end{quote}
というクラス定義を書いたとすると、\code{Kamenote}クラスの中に
\code{Funamushi}モジュールがインクルードされます。
\begin{program}{toyshop.rb}
\begin{verbatim}
module Toyshop
def addself
self + self
end
end
class Numeric
include(Toyshop)
end
class String
include(Toyshop)
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("toyshop.rb")
=> true
irb(main):002:0> 35.addself
=> 70
irb(main):003:0> "Venus".addself
=> "VenusVenus"
\end{verbatim}
\end{jikkourei}
\subsection{mixin}
モジュールというのはさまざまな用途で使われるのですが、
それらのうちでもっとも重要なのは、mixinという用途です。
mixin\index{mixin}というのは、いくつかのクラスに共通して
必要になる機能を、それぞれのクラスで独自に
定義するのではなくて、共通する機能を別のところに作っておいて、
それぞれのクラスがその機能を共有することです。mixinは、
いくつかのクラスで共有したい機能をモジュールの中に
作っておいて、それぞれのクラスはそのモジュールを
インクルードする、という方法によって実現することができます。
機能の共有は、継承を使うことによっても
実現することができますが、継承というのは、あくまで一般的な
クラスの機能を特殊なクラスが受け継ぐということですから、
一般的なものと特殊なものという関係が成り立っていない
クラスのあいだで無理に継承を使うと、プログラムが
不自然なものになってしまいます。ですから、いくつかのクラスで
機能を共有したいけれども、継承を使うと、クラスと
クラスとのあいだの関係が不自然になってしまう、という場合は、
継承ではなくてmixinを使うほうがいいでしょう。
\subsection{名前空間}
モジュールの用途のうちで、mixinに次いで重要なのは、
名前空間という用途です。
「名前空間\index{なまえくうかん@名前空間}」
(namespace)というのは、名前によって識別することのできる、
名前の有効範囲のことです。名前空間の中にあるものの名前は、
名前空間の名前と、その中にあるものの名前とを組み合わせた
名前によって指定されます。
モジュールやクラスの中にあるものは、モジュールやクラスの
名前と、その中にあるものの名前とを組み合わせた名前を書かないと
指定できません。ですから、モジュールやクラスは名前空間として
使うことが可能です。
名前空間の中にあるものを指定したいときは、
\begin{quote}
\syntax{名前空間名}::\syntax{名前}
\end{quote}
という形の名前を書きます。つまり、モジュールまたはクラスの
名前と、その中にあるものの名前とを、
コロンコロン(\code{::}\index{::@\code{::}})をはさんで
連結することによってできる名前を書くわけです。たとえば、
\begin{quote}
Toolbox::Spanner
\end{quote}
という名前は、\code{Toolbox}というモジュールまたは
クラスの中にある\code{Spanner}という名前のものを指定します。
ちなみに、モジュールメソッドやクラスメソッドを呼び出す式を、
ドットの代わりにコロンコロンを使って書くことも可能です。
\begin{program}{ocean.rb}
\begin{verbatim}
module Ocean
class Namako
def Namako.classname
"Namako"
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("ocean.rb")
=> true
irb(main):002:0> Ocean::Namako::classname
=> "Namako"
\end{verbatim}
\end{jikkourei}
プログラムの中では、さまざまなものが、それに与えられた
名前によって識別されます。ものに名前を与える場合には、
「異なるものには異なる名前を与えないといけない」という原則を
守る必要があります。しかし、プログラムの規模が
大きくなればなるほど、その原則を守ることが難しくなります。
気付かないうちに、異なるものに同じ名前が与えられているという
状態、すなわち「名前の衝突」が発生することがあります。
ですから、大規模なプログラムを書く場合には、名前空間を
活用することが必要です。そうすることによって、名前の衝突が
発生することを未然に防ぐことができます。
\subsection{組み込みモジュール}
Rubyの処理系の中にはさまざまなクラスが
組み込まれているわけですが、クラスだけではなくて、さまざまな
モジュールも組み込まれています。処理系の中に組み込まれている
モジュールは、「組み込みモジュール
\index{くみこみもしゅうる@組み込みモジュール}」
(built-in module)と呼ばれます。
組み込みモジュールは、mixinに利用されるものと、名前空間として
使われているものに分類することができます。
mixinに利用される組み込みモジュールの例としては、
\code{Comparable}\index{Comparable@\code{Comparable}}という
モジュールがあります。これは、\code{<}\index{<@\code{<}}、
\code{>}\index{>@\code{>}}、\code{<=}\index{<=@\code{<=}}、
\code{>=}\index{>=@\code{>=}}などの、大小関係を調べる述語を
持っているモジュールです。数値のクラスや文字列のクラスは、
これらの述語を独自に定義しているのではなくて、
\code{Comparable}をインクルードすることによって自分の中に
取り込んでいるのです。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{メッセージ式} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
Math::sqrt($x$) & $x$の平方根を返します。$x$がマイナスだと
例外を発生させます。 \\ \hline
Math::exp($x$) & $x$に対する指数関数の値$(e^{x})$を
返します。 \\ \hline
Math::log($x$) & $x$の自然対数を返します。 \\ \hline
Math::log10($x$) & $x$の常用対数を返します。 \\ \hline
Math::sin($x$) & $x$のサインを返します。 \\ \hline
Math::cos($x$) & $x$のコサインを返します。 \\ \hline
Math::tan($x$) & $x$のタンジェントを返します。 \\ \hline
Math::atan2($y$, $x$) & $y/x$のアークタンジェントを
返します。 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{主要な数学関数}\label{tab:mathematicalfunction}
\index{sqrt@\code{sqrt}}
\index{exp@\code{exp}}
\index{log@\code{log}}
\index{log10@\code{log10}}
\index{sin@\code{sin}}
\index{cos@\code{cos}}
\index{tan@\code{tan}}
\index{atan2@\code{atan2}}
\index{へいほうこん@平方根}
\index{しすうかんすう@指数関数}
\index{しせんたいすう@自然対数}
\index{しょうようたいすう@常用対数}
\index{さいん@サイン}
\index{こさいん@コサイン}
\index{たんしぇんと@タンジェント}
\index{ああくたんしぇんと@アークタンジェント}
\end{table}
モジュールを名前空間として使っている組み込みモジュールの
例としては、\code{Math}\index{Math@\code{Math}}という
モジュールがあります。これは、
表\ref{tab:mathematicalfunction}に示されているような、
さまざまな数学関数\index{すうかくかんすう@数学関数}を
持っているモジュールです。たとえば、
\begin{quote}
Math::sqrt(2)
\end{quote}
という式を評価すると、$\sqrt{2}$が得られます。
\section{ライブラリー}\label{sec:library}
\subsection{ライブラリーの基礎}
プログラムというものは、それ自体の動作を利用することを
目的として書かれることもあれば、別のプログラムに機能を
提供することを目的として書かれることもあります。後者の
プログラムは、
「ライブラリー\index{らいふらりい@ライブラリー}」(library)と
呼ばれます。
ライブラリーは、自分で書いて自分で使うこともできますし、誰かが
書いたものを入手して使うこともできます。
Rubyの場合、ライブラリーによって提供される機能を
利用するためには、ライブラリーを読み込むという処理をする
必要があります。
ライブラリーは、
\code{require}\index{require@\code{require}}という
関数的メソッドを呼び出すことによって読み込むことができます。
このメソッドは、引数としてパス名を受け取って、そのパス名で
指定されたファイルに格納されているライブラリーを読み込みます。
ただし、指定されたライブラリーがすでに読み込まれている場合、
それを重複して読み込むということはしません。
相対パス名でライブラリーを指定した場合、\code{require}は、
あらかじめライブラリーの置き場所として設定された
ディレクトリを探索します。
ライブラリーのファイル名の拡張子が\code{.rb}の場合、
その拡張子は省略することができます。ですから、
\code{namako.rb}というファイル名のライブラリーは、
\begin{quote}
require("namako")
\end{quote}
という式を書くことによって読み込むことができます。
それでは、ライブラリーとして利用されるプログラムと、
それを利用するプログラムとを実際に書いてみましょう。
まず、ライブラリーとして利用されるプログラムを準備します。
次のプログラムは、レシーバーが素数ならば真を返して、
そうでなければ偽を返す、\code{prime}という述語を整数に
追加します。
\begin{program}{prime.rb}
\begin{verbatim}
class Integer
def prime
if self <= 1
false
else
i = 2
found = false
while ! found && i*i <= self
if self%i == 0
found = true
else
i += 1
end
end
! found
end
end
end
\end{verbatim}
\end{program}
そして次は、上のプログラムをライブラリーとして利用する
プログラムです。次のプログラムは、レシーバーを番号とする素数を
求める\code{thprime}というメソッドを整数に追加します(素数の
番号というのは、素数を小さなものから大きなものへと並べたときの
順番をあらわすプラスの整数のことです)。
\begin{program}{thprime.rb}
\begin{verbatim}
require("prime")
class Integer
def thprime
i = 1
number = 0
while number < self
i += 1
if i.prime
number += 1
end
end
i
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("thprime.rb")
=> true
irb(main):002:0> 555.thprime
=> 4019
\end{verbatim}
\end{jikkourei}
\subsection{標準ライブラリー}
処理系に組み込んだほうがいいと思われるほど基本的な
機能ではないけれども、きわめて汎用性が高いと思われる機能は、
普通、処理系とともに配布されるライブラリーによって
提供されます。処理系とともに配布されるライブラリーの集まりは、
「標準ライブラリー
\index{ひょうしゅんらいふらりい@標準ライブラリー}」
(standard library)と呼ばれます。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{ライブラリー名} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
rational & 有理数をあらわすRationalクラスを定義します。
\\ \hline
complex & 複素数をあらわすComplexクラスを定義します。
\\ \hline
matrix & 行列をあらわすMatrixクラスを定義します。
\\ \hline
date & 日付をあらわすDateクラスを定義します。
\\ \hline
kconv & 文字コードを変換する各種のメソッドを定義します。
\\ \hline
cgi & \textrm{CGI}をあらわすCGIクラスを定義します。
\\ \hline
socket & ソケットをあらわす各種のクラスを定義します。
\\ \hline
tk & \textrm{GUI}を作るための各種のクラスを定義します。
\\ \hline
\end{tabular}
\end{ttfamily}
\caption{Rubyの標準ライブラリーのうちの主要なもの}
\label{tab:standardlibrary}
\index{rational@\code{rational}}
\index{complex@\code{complex}}
\index{matrix@\code{matrix}}
\index{date@\code{date}}
\index{kconv@\code{kconv}}
\index{cgi@\code{cgi}}
\index{socket@\code{socket}}
\index{tk@\code{tk}}
\index{ゆうりすう@有理数}
\index{ふくそすう@複素数}
\index{きょうれつ@行列}
\index{ひつけ@日付}
\index{もしこおと@文字コード}
\index{CGI}
\index{そけっと@ソケット}
\index{GUI}
\end{table}
Rubyの処理系も、さまざまなライブラリーとともに
配布されています。表\ref{tab:standardlibrary}に、Rubyの
標準ライブラリーに含まれているライブラリーのうちの主要なものを
示しておきます。
\chapter{組み込みクラス}\label{chap:builtinclass}
\section{例外}\label{sec:exception}
\subsection{例外の基礎}
Rubyの処理系には、\code{Object}、\code{Class}、\code{Fixnum}、
\code{Float}、\code{String}などの、
「組み込みクラス\index{くみこみくらす@組み込みクラス}」
と呼ばれるさまざまなクラスが最初から組み込まれています。
この章では、Rubyの組み込みクラスのうちで、
まだ登場していないものについて説明していきたいと思います。
まず最初に、「例外」と呼ばれるオブジェクトを生成する
クラスを紹介しましょう。
第\ref{sec:recursion}節で、レシーバーの階乗を求める
メソッドを、
\begin{quote}
\begin{verbatim}
class Integer
def factorial
if self >= 1
self * (self - 1).factorial
else
1
end
end
end
\end{verbatim}
\end{quote}
と定義しましたが、これは、厳密には正しい定義とは言えません。
なぜなら、マイナスの整数に対する階乗というものは
定義されていないにもかかわらず、このメソッドは、レシーバーが
マイナスの整数であっても1という戻り値を返すからです。
このメソッドの定義をもっと正しいものにするためには、
レシーバーがマイナスの整数だという不都合な事態に遭遇した場合は
そのことを報告するように改良しないといけません。さて、
それでは、何らかの不都合な事態に遭遇した場合にそのことを
報告する、という動作は、いったいどう書けばいいのでしょうか。
何らかの不都合な事態に遭遇した場合に、それを報告するために
採用されるもっとも一般的な手段は、
「例外\index{れいかい@例外}」(exception)と呼ばれる
オブジェクトを生成する、というものです。例外というのは、
実行中のメソッドの動作を終了させて、メソッドを
呼び出したものに対して、遭遇した不都合な事態を報告する、
という機能を持つオブジェクトのことです。例外を生成することを、
例外を「発生させる\index{はっせいさせる@発生させる}」(raise)と
言います。
例外は、実行中のメソッドの動作を終了させるという機能を
持っています。ですから、例外をそのまま放置すると、
プログラム全体が終了してしまいます。例外が発生したとき、
プログラム全体を終了させるのではなくて、不都合な事態に対する
何らかの処置を実行したいときは、例外がメソッドの動作を
終了させようとするのを抑止する必要があります。例外による
メソッドの動作の終了を抑止することを、例外を
「捕獲する\index{ほかくする@捕獲する}」(catch)と言います。
\subsection{例外クラス}
例外は、
\code{Exception}\index{Exception@\code{Exception}}という
組み込みクラス、またはそれを継承するクラスから生成される
オブジェクトです。そのような、例外を生成するクラスは、
「例外クラス\index{れいかいくらす@例外クラス}」
(exception class)と呼ばれます。Rubyの処理系には、
\code{Exception}だけではなくて、それを継承するさまざまな
例外クラスが組み込まれています。
たとえば、Rubyの処理系には、\code{ZeroDivisionError}%
\index{ZeroDivisionError@\code{ZeroDivisionError}}という
例外クラスが組み込まれています。整数のオブジェクトが持っている
\code{/}という除算のメソッドは、除数がゼロだった場合、
この例外クラスの例外を発生させます\footnote{浮動小数点数の
\code{/}は、ゼロで除算をしても例外は発生させません。}。
それでは、\code{5/0}のような、整数をゼロで除算する式をirbに
入力してみましょう。そうすると、次のようになります。
\begin{quote}
\begin{verbatim}
irb(main):001:0> 5/0
ZeroDivisionError: divided by 0
from (irb):1:in `/'
from (irb):1
irb(main):002:0>
\end{verbatim}
\end{quote}
このように、irbは、例外が発生すると、たいていの場合、
メッセージを出力したのち、次のプロンプトを出力します。例外が
発生したときにirbが出力するメッセージは、発生した例外の
クラス名、例外が持っている文字列、そして例外が発生した場所を
示しています。
irbは、すべての例外を捕獲するわけではありません。
irbが捕獲するのは、\code{StandardError}%
\index{StandardError@\code{StandardError}}という例外クラス、
またはそれを継承するクラスの例外だけです。整数をゼロで
除算したときに発生する例外が捕獲されるのは、
それが\code{StandardError}を継承しているクラスの
例外だからです。
irbに入力された式が評価されている途中で、irbによって
捕獲されない例外が発生した場合、その例外は、irbを
終了させることになります。実は、
\code{exit}という式をirbに入力することによってirbを
終了させることができるのは、
\code{exit}\index{exit@\code{exit}}という関数的メソッドが、
irbによって捕獲されない
\code{SystemExit}\index{SystemExit@\code{SystemExit}}という
クラスの例外を発生させるからです。
\subsection{例外の発生}
例外を発生させたいときは、
\code{raise}\index{raise@\code{raise}}という関数的メソッドを
使います。
引数を何も渡さないで\code{raise}を呼び出すと、\code{raise}は、
\code{RuntimeError}\index{RuntimeError@\code{RuntimeError}}%
という例外クラスの例外を発生させます(\code{RuntimeError}は
\code{StandardError}のサブクラスです)。
\begin{quote}
\begin{verbatim}
irb(main):001:0> raise
RuntimeError:
from (irb):1
irb(main):002:0>
\end{verbatim}
\end{quote}
例外には、遭遇した不都合な事態について説明するために、
1個の文字列を持たせることができます。例外に文字列を
持たせたいときは、持たせたい文字列を引数として\code{raise}に
渡します。
\begin{quote}
\begin{verbatim}
irb(main):001:0> raise("somothing wrong")
RuntimeError: somothing wrong
from (irb):1
irb(main):002:0>
\end{verbatim}
\end{quote}
引数として例外クラスを渡して\code{raise}を呼び出すと、
\code{raise}は、受け取ったクラスの例外を発生させます。
\begin{quote}
\begin{verbatim}
irb(main):001:0> raise(ZeroDivisionError)
ZeroDivisionError: ZeroDivisionError
from (irb):1
irb(main):002:0>
\end{verbatim}
\end{quote}
余談ですが、irbを終了させることのできるメソッドは
\code{exit}だけではありません。\code{raise}を使ってirbを
終了させることも可能です。
\begin{quote}
\begin{verbatim}
irb(main):001:0> raise(SystemExit)
$
\end{verbatim}
\end{quote}
例外クラスを指定して例外を発生させて、さらに、その例外に
文字列を持たせたい、という場合は、\code{raise}に対して、
1個目の引数として例外クラス、2個目の引数として文字列を
渡します。
\begin{quote}
\begin{verbatim}
irb(main):001:0> raise(StandardError, "How terrible it is!")
StandardError: How terrible it is!
from (irb):1
irb(main):002:0>
\end{verbatim}
\end{quote}
次のプログラムは、レシーバーの階乗を求めるメソッドの定義を、
レシーバーがマイナスだった場合は\code{StandardError}という
例外クラスの例外を発生させるように改良したものです。
\begin{program}{fact2.rb}
\begin{verbatim}
class Integer
def factorial
if self >= 1
self * (self - 1).factorial
elsif self == 0
1
else
raise(StandardError,
"factorial is not defined to minus integer")
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("fact2.rb")
=> true
irb(main):002:0> 30.factorial
=> 265252859812191058636308480000000
irb(main):003:0> -30.factorial
StandardError: factorial is not defined to minus integer
from ./fact2.rb:8:in `factorial'
from (irb):3
irb(main):004:0>
\end{verbatim}
\end{jikkourei}
\subsection{例外の捕獲}
例外を捕獲するメソッドを定義したいときは、
\begin{syntaxquote}
def \syntax{メソッド名}(\syntax{仮引数名}, \tenten\ ) \\
\inkuu \framebox[12zw]{式} \\
rescue \syntax{例外クラス名}, \tenten \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
という形のメソッド定義\index{めそっとていき@メソッド定義}を
書きます。この形のメソッド定義の中に含まれている、
\begin{syntaxquote}
rescue \syntax{例外クラス名}, \tenten \\
\inkuu \framebox[12zw]{式}
\end{syntaxquote}
という形の部分は、
「\code{rescue}節\index{rescueせつ@\code{rescue}節}」
(\code{rescue} clause)と呼ばれます。
\code{rescue}節の上に書かれた式が評価されているときに、
\code{rescue}の右側で指定されたクラス、またはそれを継承する
クラスの例外が発生したとすると、その例外は捕獲されて、
\code{rescue}節の中の式が評価されます。指定された例外が
発生しなかった場合、\code{rescue}節の中の式は評価されません。
\begin{program}{divide.rb}
\begin{verbatim}
class Integer
def divide(n)
(self / n).display
"\n".display
rescue ZeroDivisionError
"ゼロでは除算できません。\n".display
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("divide.rb")
=> true
irb(main):002:0> 56.divide(7)
8
=> nil
irb(main):003:0> 56.divide(0)
ゼロでは除算できません。
=> nil
irb(main):004:0>
\end{verbatim}
\end{jikkourei}
\code{rescue}節は、メソッド定義の中に何個でも好きなだけ
書くことができます。そうすることによって、発生した例外の
クラスごとに異なる動作を実行することが可能になります。
\begin{program}{divide2.rb}
\begin{verbatim}
class Integer
def divide(n)
(self / n).display
"\n".display
rescue ZeroDivisionError
"ゼロでは除算できません。\n".display
rescue TypeError
"引数のクラスが間違っています。\n".display
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("divide2.rb")
=> true
irb(main):002:0> 56.divide(0)
ゼロでは除算できません。
=> nil
irb(main):003:0> 56.divide("seven")
引数のクラスが間違っています。
=> nil
irb(main):004:0>
\end{verbatim}
\end{jikkourei}
例外クラスは、\code{Exception}を根とする木の構造を
持っています。根に近い位置にあるクラスの名前を\code{rescue}の
右側に書くことによって、そのクラスから枝分かれしている
すべてのクラスの例外を一網打尽にすることができます。
\begin{program}{divide3.rb}
\begin{verbatim}
class Integer
def divide(n)
(self / n).display
"\n".display
rescue StandardError
"例外が発生しました。\n".display
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("divide3.rb")
=> true
irb(main):002:0> 56.divide(0)
例外が発生しました。
=> nil
irb(main):003:0> 56.divide("seven")
例外が発生しました。
=> nil
irb(main):004:0>
\end{verbatim}
\end{jikkourei}
ちなみに、\code{rescue}の右側の例外クラス名を省略すると、
\code{StandardError}という例外クラスを指定したと解釈されます。
ですから、上のプログラムの\code{rescue}節は、例外クラス名を
省略したとしても同じ意味になります。
メソッド定義の全体ではなくて、その一部分で発生した例外だけを
捕獲したいというときは、その部分に
「\code{begin}式\index{beginしき@\code{begin}式}」
(\code{begin} expression)と呼ばれる式を書きます。
\code{begin}式は、
\begin{syntaxquote}
begin \\
\inkuu \framebox[12zw]{式} \\
rescue \syntax{例外クラス名}, \tenten \\
\inkuu \framebox[12zw]{式} \\
end
\end{syntaxquote}
と書きます。この形の式を評価すると、まず、\code{rescue}節の
上に書かれた式が評価されます。その途中で、\code{rescue}節で
指定されたクラスの例外が発生した場合は、\code{rescue}節の中の
式が評価されます。
\subsection{後始末}
メソッドを定義するとき、例外が発生したか
発生しなかったかにかかわらず、かならず後始末を実行してから
動作が終了するようにしたい、と思うことがしばしばあります。
そのような後始末の動作は、
「\code{ensure}節\index{ensure@\code{ensure}節}」
(\code{ensure} clause)と呼ばれるものを
メソッド定義\index{めそっとていき@メソッド定義}または
\code{begin}式\index{beginしき@\code{begin}式}の中に
書くことによって記述することができます。
\code{ensure}節は、
\begin{quote}
ensure \\[0.4zh]
\inkuu \framebox[12zw]{式}
\vspace{0.8zh}
\end{quote}
と書きます。\code{ensure}節の中の式は、例外が発生したとしても
発生しなかったとしても、かならず評価されます。
\begin{program}{divide4.rb}
\begin{verbatim}
class Integer
def divide(n)
(self / n).display
"\n".display
ensure
"除算はこれで終了です。\n".display
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("divide4.rb")
=> true
irb(main):002:0> 56.divide(7)
8
除算はこれで終了です。
=> nil
irb(main):003:0> 56.divide(0)
除算はこれで終了です。
ZeroDivisionError: divided by 0
from ./divide4.rb:3:in `/'
from ./divide4.rb:3:in `divide'
from (irb):3
irb(main):004:0>
\end{verbatim}
\end{jikkourei}
例外が発生した場合はそれを捕獲して、なおかつ、例外が発生したか
発生しなかったかにかかわらず後始末も実行したい、というときは、
\code{rescue}節と\code{ensure}節の両方をメソッド定義または
\code{begin}式の中に書きます。ただし、\code{rescue}節と
\code{ensure}節は、\code{rescue}節が上で\code{ensure}節が
下という順番で書かないといけません。
\begin{program}{divide5.rb}
\begin{verbatim}
class Integer
def divide(n)
(self / n).display
"\n".display
rescue ZeroDivisionError
"ゼロでは除算できません。\n".display
ensure
"除算はこれで終了です。\n".display
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("divide5.rb")
=> true
irb(main):002:0> 56.divide(7)
8
除算はこれで終了です。
=> nil
irb(main):003:0> 56.divide(0)
ゼロでは除算できません。
除算はこれで終了です。
=> nil
irb(main):004:0>
\end{verbatim}
\end{jikkourei}
\subsection{例外が持っている文字列}
例外を発生させる方法について説明したときに、例外には文字列を
持たせることができるという話をしましたが、それでは、例外が
持っている文字列を利用するためにはどうすればいいのでしょうか。
そのためには、まず、発生した例外を変数に代入する
必要があります。例外を変数に代入したいときは、\code{rescue}の
右側の例外クラス名のさらに右側に、
\begin{quote}
=> \syntax{変数名}
\end{quote}
という形のものを書きます。そうすると、その中で指定された変数に
例外が代入されます。たとえば、
\begin{quote}
\begin{verbatim}
rescue StandardError => e
(e.class.to_s + "\n").display
end
\end{verbatim}
\end{quote}
という\code{rescue}節を書くことによって、発生した例外の
クラス名を出力することができます。
例外が持っている文字列を取り出したいときは、
\code{message}\index{message@\code{message}}というメソッドを
使います。このメソッドは、レシーバーが持っている文字列を
戻り値として返します。
\begin{program}{divide6.rb}
\begin{verbatim}
class Integer
def divide(n)
(self / n).display
"\n".display
rescue StandardError => e
("例外クラス: " + e.class.to_s + "\n" +
"例外が持っている文字列: " + e.message + "\n").display
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("divide6.rb")
=> true
irb(main):002:0> 56.divide(0)
例外クラス: ZeroDivisionError
例外が持っている文字列: divided by 0
=> nil
irb(main):003:0> 56.divide("seven")
例外クラス: TypeError
例外が持っている文字列: String can't be coerced into Fixnum
=> nil
irb(main):004:0>
\end{verbatim}
\end{jikkourei}
\subsection{独自の例外クラス}
Rubyのインタプリタの中には、さまざまな例外クラスが
組み込まれているわけですが、例外クラスは
それらだけではありません。独自の例外クラスを
定義するということも可能です。
独自の例外クラスを定義したいときは、ただ単に、すでに存在する
例外クラスのどれかをスーパークラスとして指定したクラス定義を
書けばいいだけです。独自の例外クラスにメソッドの鋳型を
追加しなくていいならば、クラス定義の中にメソッド定義を書く
必要はありません。たとえば、
\begin{quote}
\begin{verbatim}
class OriginalError < StandardError
end
\end{verbatim}
\end{quote}
というクラス定義を書くことによって、\code{OriginalError}という
独自の例外クラスを定義することができます。
次のプログラムは、\code{OutOfDomain}という独自の例外クラスを
定義して、レシーバーの階乗を求めるメソッドを、レシーバーが
マイナスだった場合はその例外クラスの例外を発生させるように
定義しています。
\begin{program}{fact3.rb}
\begin{verbatim}
class OutOfDomain < StandardError
end
class Integer
def factorial
if self >= 1
self * (self - 1).factorial
elsif self == 0
1
else
raise(OutOfDomain,
"factorial is not defined to minus integer")
end
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("fact3.rb")
true
irb(main):002:0> 30.factorial
265252859812191058636308480000000
irb(main):003:0> -30.factorial
OutOfDomain: factorial is not defined to minus integer
from ./fact3.rb:11:in `factorial'
from (irb):3
irb(main):004:0>
\end{verbatim}
\end{jikkourei}
\section{配列}\label{sec:array}
\subsection{配列の基礎}
Rubyのプログラムは、「配列\index{はいれつ@配列}」(array)と
呼ばれるオブジェクトを扱うことができます。配列は、
\code{Array}\index{Array@\code{Array}}というクラスの
インスタンスです。
配列というのは、オブジェクトを何個でも好きなだけ並べてできる
列を内部に格納することができるオブジェクトのことです(厳密に
言うと、配列の中に格納されるのは
オブジェクトそのものではなくて、オブジェクトを指し示す
「参照\index{さんしょう@参照}」(reference)と呼ばれる
データです)。
配列に格納されているそれぞれのオブジェクトのことを、その配列の
「要素」(element)と呼びます。
\index{はいれつ@配列!0のようそ@\baidash の要素}%
\index{ようそ@要素!はいれつの@配列の\baidash}%
そして、配列に格納されている要素の個数のことを、その配列の
「大きさ」(size)と呼びます。
\index{はいれつ@配列!0のおおきさ@\baidash の大きさ}%
\index{おおきさ@大きさ!はいれつの@配列の\baidash}%
配列の大きさは、0の場合もあります。そのような、要素をまったく
持っていない配列は、「空配列\index{くうはいれつ@空配列}」
(empty array)と呼ばれます。
配列のような、任意の個数のオブジェクトを自分の中に
格納することのできるオブジェクトは、
「コンテナ\index{こんてな@コンテナ}」(container)と
呼ばれます。
\subsection{列挙による配列の生成}
配列は、さまざまな方法で生成することができます。配列を生成する
方法のひとつは、それを構成する要素を列挙する、というものです。
要素を列挙することによって配列を生成したいときは、
\begin{quote}
[\syntax{式}, \syntax{式}, \syntax{式}, \tenten\ ]
\end{quote}
という形の式を書きます。つまり、式をコンマ(\code{,})で区切って
並べて、その全体を
角括弧\index{かくかっこ@角括弧!はいれつをせいせいする@
配列を生成する\baidash}(\code{[\,]}%
\index{[]@\code{[\,]}!はいれつをせいせいする@
配列を生成する\baidash})で囲むわけです。この形の
式を評価すると、それを構成するそれぞれの式が評価されて、
それらの式の値を並べることによってできる配列が、値として
得られます。要素の順番は、式が並んでいる順番と同じです。
たとえば、
\begin{quote}
[38, -21, 0.47, "hitode"]
\end{quote}
という式を評価すると、\code{38}と\code{-21}と\code{0.47}と
\code{"hitode"}というそれぞれのリテラルがあらわしている
オブジェクトを、この順番で並べることによってできる配列が、
値として得られます。
角括弧だけの式、つまり\code{[\,]}という式を評価すると、
値として空配列が得られます。
\subsection{\texttt{new}による配列の生成}
配列は、\code{Array}クラスが持っている\code{new}という
メソッドを呼び出すことによって生成することもできます。
\code{Array}クラスの\code{new}は、引数を何も渡さないで
呼び出した場合、空配列を生成して、それを戻り値として返します。
ですから、
\begin{quote}
Array.new
\end{quote}
という式を評価すると、その値として空配列が得られます。
\code{Array}の\code{new}に、引数として0またはプラスの整数を
渡すと、引数で指定された大きさを持つ、すべての要素が
\code{nil}であるような配列が生成されます。
\begin{quote}
\begin{verbatim}
irb(main):001:0> Array.new(10)
=> [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]
\end{verbatim}
\end{quote}
\code{Array}の\code{new}に、1個目の引数として0またはプラスの
整数を渡して、2個目の引数として何らかのオブジェクトを渡すと、
1個目の引数で指定された大きさを持つ、すべての要素が2個目の
引数であるような配列が生成されます。
\begin{quote}
\begin{verbatim}
irb(main):001:0> Array.new(10, 0)
=> [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
irb(main):002:0> Array.new(3, "namekuji")
=> ["namekuji", "namekuji", "namekuji"]
\end{verbatim}
\end{quote}
\subsection{範囲からの配列の生成}
範囲\index{はんい@範囲}によってあらわされているオブジェクトの
列から配列を生成する、ということも可能です。
範囲から配列を生成したいときは、範囲が持っている
\code{to\us a}%
\index{to_a@\code{to\us a}!はんいの@範囲の\baidash}という
メソッドを使います。これは、レシーバーに含まれている
それぞれのオブジェクトを要素とする配列を生成して、その結果を
戻り値として返すメソッドです。
\begin{quote}
\begin{verbatim}
irb(main):001:0> (20..30).to_a
=> [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]
irb(main):002:0> ("ax".."bc").to_a
=> ["ax", "ay", "az", "ba", "bb", "bc"]
\end{verbatim}
\end{quote}
\subsection{文字列からの配列の生成}
文字列をいくつかの部分に分解して、それぞれの部分から構成される
配列を生成する、ということも可能です。
文字列から配列を生成したいときは、文字列が持っている
\code{split}%
\index{split@\code{split}!もしれつの@文字列の\baidash}という
メソッドを使います。これは、連続する空白でレシーバーを
区切って、それぞれの部分から構成される配列を戻り値として返す
メソッドです。
\begin{quote}
\begin{verbatim}
irb(main):001:0> " above us only sky ".split
=> ["above", "us", "only", "sky"]
\end{verbatim}
\end{quote}
引数として文字列を渡すことによって、何で区切るかということを
指定することもできます。
\begin{quote}
\begin{verbatim}
irb(main):001:0> "www.paradise.ac.jp".split(".")
=> ["www", "paradise", "ac", "jp"]
\end{verbatim}
\end{quote}
引数として空文字列を渡すことによって、長さが1の文字列に
分解することもできます。
\begin{quote}
\begin{verbatim}
irb(main):001:0> "animism".split("")
=> ["a", "n", "i", "m", "i", "s", "m"]
\end{verbatim}
\end{quote}
\subsection{配列の基本的なメソッド}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{メッセージ式} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
$a$.size & $a$の大きさを返します。 \\ \hline
$a$.shift & $a$から先頭の要素を削除して、その要素を
返します。 \\ \hline
$a$.reverse & $a$の要素を逆の順序に並べ替えてできる
配列を返します。 \\ \hline
$a$.sort & $a$の要素を大きさの順序で並べ替えてできる
配列を返します。 \\ \hline
$a$.uniq & $a$の重複する要素をひとつだけにした配列を
返します。 \\ \hline
$a$.join($s$) & $a$の要素を文字列$s$で区切って
連結してできる文字列を返します。 \\ \hline
$a$.empty? & $a$が空配列ならばtrue、そうでなければ
falseを返します。\\ \hline
$a$.member?($o$) & $o$が$a$の要素ならばtrue、
そうでなければfalseを返します。\\ \hline
\end{tabular}
\end{ttfamily}
\caption{配列の基本的なメソッド}
\label{tab:basicmethodsofarray}
\index{size@\code{size}!はいれつの@配列の\baidash}
\index{shift@\code{shift}}
\index{reverse@\code{reverse}}
\index{sort@\code{sort}}
\index{uniq@\code{uniq}}
\index{join@\code{join}!はいれつの@配列の\baidash}
\index{empty?@\code{empty?}!はいれつの@配列の\baidash}
\index{member?@\code{member?}}
\end{table}
配列というオブジェクトは、自分自身を取り扱うためのさまざまな
メソッドを持っています。表\ref{tab:basicmethodsofarray}は、
配列が持っているメソッドのうちの基本的なものを示しています。
irbを使って、配列が持っているメソッドの動作を
確かめてみることにしましょう。たとえば、
\begin{quote}
[58, 33, 27, 63].join("/")
\end{quote}
という式をirbに入力してみてください。そうすると、
\code{join}は、レシーバーを構成するそれぞれの要素を文字列に
変換して、それらをスラッシュ(\code{/})で区切って
連結することによってできる文字列を戻り値として返します。
ですから、
\begin{quote}
"58/33/27/63"
\end{quote}
という文字列が、式の値として出力されます。
\code{shift}\index{shift@\code{shift}}というメソッドは、
レシーバーの先頭の要素を削除して、その要素を戻り値として
返します。レシーバー自体を変化させるという点に
注意してください。
\code{shift}の動作を、実際に確かめてみましょう。まず、
\begin{quote}
a = [74, 21, 60, 83]
\end{quote}
という式をirbに入力することによって、\code{a}という変数に
配列を代入してください。次に、
\begin{quote}
a.shift
\end{quote}
という式で、\code{shift}を呼び出してください。すると、
\code{shift}は、\code{a}が指し示している配列から先頭にある
74という要素を削除して、その要素を戻り値として返します。次に、
\code{a}という変数名を入力してください。すると、先頭の要素を
削除したのちの配列、つまり、
\begin{quote}
[21, 60, 83]
\end{quote}
という配列が出力されるはずです。
\subsection{配列への要素の追加}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{演算子式} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
$a$ << $o$ & $a$の末尾に$o$を追加して、その結果を
返します。 \\ \hline
$a$ + $b$ & $a$の右側に$b$を連結した配列を返します。
\\ \hline
$a$ - $b$ & $b$の要素を$a$から取り除いた配列を返します。
\\ \hline
$a$ * $n$ & $a$を$n$回繰り返して連結した配列を返します。
\\ \hline
$a$ \& $b$ & $a$と$b$に共通する要素から構成される配列を
返します。 \\ \hline
$a$ \vl\ $b$ & $a$と$b$のどちらかに含まれている要素から
構成される配列を返します。 \\ \hline
$a$[$i$] & $a$の$i$番目の要素を返します。 \\ \hline
$a$[$i$..$j$] & $a$の$i$番目から$j$番目までの部分配列を
返します。 \\ \hline
$a$[$i$, $n$] & $a$の$i$番目から始まる長さが$n$の
部分配列を返します。 \\ \hline
$a$[$i$] = $o$ & $a$の$i$番目の要素を$o$に置き換えます。
\\ \hline
$a$[$i$..$j$] = $b$ & $a$の$i$番目から$j$番目までの
部分配列を$b$に置き換えます。 \\ \hline
$a$[$i$, $n$] = $b$ & $a$の$i$番目から始まる長さが$n$の
部分配列を$b$に置き換えます。 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{配列の演算}\label{tab:arrayoperation}
\index{<<@\code{<<}}
\index{+@\code{+}!はいれつの@配列の\baidash}
\index{-@\code{-}!はいれつの@配列の\baidash}
\index{*@\code{*}!はいれつの@配列の\baidash}
\index{&@\code{\&}}
\index{"|@\code{\vl}!はいれつの@配列の\baidash}
\index{[]@\code{[\,]}!はいれつからようそをとりたす@
配列から要素を取り出す\baidash}
\index{かくかっこ@角括弧!はいれつからようそをとりたす@
配列から要素を取り出す\baidash}
\index{[]=@\code{[\,]=}!はいれつの@配列の\baidash}
\end{table}
配列は、表\ref{tab:arrayoperation}に示されているような
さまざまな演算を持っています。
\code{<<}\index{<<@\code{<<}}は、レシーバーの末尾に要素を
追加して、そののちのレシーバーを戻り値として返す、という
動作をする演算です。\code{<<}も、\code{shift}と同じように、
レシーバーを変化させるメソッドです。
irbを使って、\code{<<}の動作を実際に確かめてみましょう。まず、
\begin{quote}
a = Array.new(4, "kani")
\end{quote}
という式を入力してください。すると、
\begin{quote}
["kani", "kani", "kani", "kani"]
\end{quote}
という配列が\code{a}という変数に代入されます。次に、
\begin{quote}
a << "fujitsubo"
\end{quote}
という式を入力してください。そうすると、\code{a}が
指し示している配列の末尾に\code{"fujitsubo"}という文字列が
追加されて、そののちの配列が値として得られます。ですから、
\begin{quote}
["kani", "kani", "kani", "kani", "fujitsubo"]
\end{quote}
という配列が式の値として出力されます。さらに、\code{a}が
指し示している配列が変化している、ということも
確認しておきましょう。\code{a}という変数名をirbに
入力することによって、それが指し示している配列をirbに
出力させてみてください。
それでは、\code{<<}を使ってプログラムを
書いてみることにしましょう。次のプログラムの中で定義されている
\code{sequence}は、等差数列になっている配列を生成する
メソッドです。
\begin{program}{sequen.rb}
\begin{verbatim}
class Numeric
def sequence(e, s)
a = []
step(e, s) { |x| a << x }
a
end
end
\end{verbatim}
\end{program}
\code{sequence}は、$b$と$e$と$s$が数値だとするとき、
\begin{quote}
$b$.sequence($e$, $s$)
\end{quote}
というメッセージ式で呼び出すと、$b$を初項、$s$を公差とする、
$e$を超えない範囲($s$がマイナスの場合は、$e$を下回らない
範囲)の等差数列になっている配列を、戻り値として返します。
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("sequen.rb")
=> true
irb(main):002:0> 0.sequence(100, 15)
=> [0, 15, 30, 45, 60, 75, 90]
irb(main):003:0> 100.sequence(0, -15)
=> [100, 85, 70, 55, 40, 25, 10]
irb(main):004:0> 0.0.sequence(10.0, 1.5)
=> [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0]
\end{verbatim}
\end{jikkourei}
\subsection{配列からの要素の取り出し}
次に、配列から要素を取り出す方法について説明しましょう。
配列を構成するそれぞれの要素は、先頭から何番目にあるかという
番号を持っています。ただし、要素の番号は、先頭を0番目と
数えます。たとえば、
\begin{quote}
["spring", "summer", "autumn", "winter"]
\end{quote}
という配列の場合、\code{"spring"}は0番目で、\code{"winter"}は
3番目です。
番号を指定することによって配列から要素を取り出したいときは、
配列が持っている\code{[\,]}%
\index{[]@\code{[\,]}!はいれつからようそをとりたす@
配列から要素を取り出す\baidash}%
\index{かくかっこ@角括弧!はいれつからようそをとりたす@
配列から要素を取り出す\baidash}%
という演算を使います。$a$が配列で、$i$が番号だとするとき、
\begin{quote}
$a$[$i$]
\end{quote}
という式を評価すると、$a$の$i$番目の要素が値として得られます。
たとえば、
\begin{quote}
["spring", "summer", "autumn", "winter"][2]
\end{quote}
という式を評価すると、値として\code{"autumn"}が得られます。
配列を構成するそれぞれの要素は、0またはプラスの番号のほかに、
マイナスの番号も持っています。マイナスの番号は、配列の末尾から
先頭へ向かって、$-1$、$-2$、$-3$、$-4$、\tenten 、と
付けられています。\code{[\,]}は、マイナスの番号で要素を
指定することもできます。たとえば、
\begin{quote}
["spring", "summer", "autumn", "winter"][-3]
\end{quote}
という式を評価すると、値として\code{"summer"}が得られます。
\code{[\,]}は、レシーバーの中に存在していない要素の番号が
指定された場合は、戻り値として\code{nil}を返します。たとえば、
\begin{quote}
["spring", "summer", "autumn", "winter"][4]
\end{quote}
という式の値は、\code{nil}になります。
\subsection{配列の要素の置き換え}
配列が持っている\code{[\,]=}%
\index{[]=@\code{[\,]=}!はいれつの@配列の\baidash}という演算を
使うことによって、番号で指定された配列の要素を別の
オブジェクトに置き換える、ということができます。$a$が配列で、
$i$が番号で、$o$がオブジェクトだとするとき、
\begin{quote}
$a$[$i$] = $o$
\end{quote}
という式を評価すると、$a$の$i$番目の要素が$o$に
置き換わります。\code{[\,]=}も、\code{shift}や\code{<<}と
同じように、レシーバーを変化させるメソッドです。
irbを使って、\code{[\,]=}の動作を実際に試してみましょう。
まず、
\begin{quote}
a = Array.new(6, "namako")
\end{quote}
という式を入力してください。すると、
\begin{quote}
["namako", "namako", "namako", "namako", "namako", "namako"]
\end{quote}
という配列が\code{a}という変数に代入されます。次に、
\begin{quote}
a[3] = "umiushi"
\end{quote}
という式を入力してください。そうすると、\code{a}が
指し示している配列の3番目の要素が\code{"umiushi"}に
置き換わります。それでは、そうなったかどうかを
確かめてみましょう。\code{a}という変数名を入力してください。
すると、
\begin{quote}
["namako", "namako", "namako", "umiushi", "namako", "namako"]
\end{quote}
という配列が出力されるはずです。
\subsection{配列と代入演算}
第\ref{sec:variable}節で説明したように、変数というのは
オブジェクトに付ける名札のようなものです。オブジェクトに
変数という名札を付けることを、変数にオブジェクトを
「代入する」と言います。変数にオブジェクトを代入したいときは、
\code{=}\index{=@\code{=}}という演算を使います。
\code{=}に可能な動作は、ひとつの変数にひとつのオブジェクトを
代入する、ということだけではありません。実は、いくつかの変数の
それぞれに異なるオブジェクトを代入する、ということも
可能なのです。そのような代入は、
「多重代入\index{たしゅうたいにゅう@多重代入}」
(multiple assignment)と呼ばれます。
多重代入を実行したいときは、
\begin{quote}
\syntax{変数名}, \tenten\ = \syntax{式}, \tenten
\end{quote}
というように、変数名をコンマで区切って並べたものを\code{=}の
左辺に書いて、式をコンマで区切って並べたものを右辺に書きます。
このような式を評価すると、それぞれの式の値が、並んでいる
順番のとおりに、対応する変数に代入されます。そして、式全体の
値は、それぞれの式の値から構成される配列になります。
実際に試してみましょう。まず、
\begin{quote}
a, b, c = 63, 42, 21
\end{quote}
という式をirbに入力してみてください。すると、その式の
値として、
\begin{quote}
[63, 42, 21]
\end{quote}
という配列が得られるわけですが、それだけではなくて、\code{a}に
63、\code{b}に42、\code{c}に21が代入されます。それでは、
それらの変数名を入力することによって、そうなっているかどうかを
確かめてみてください。
配列を構成するそれぞれの要素を変数に多重代入する、ということも
可能です。変数名をコンマで区切って並べたものを\code{=}の左辺に
書いて、配列を求める式を右辺に書くと、その配列のそれぞれの
要素が変数に多重代入されます。たとえば、
\begin{quote}
d, e, f = [93, 62, 31]
\end{quote}
という式を評価すると、\code{d}に93、\code{e}に62、\code{f}に
31が代入されます。
なお、右辺の要素の個数が左辺の変数名の個数よりも少ない場合、
対応する要素のない変数には\code{nil}が代入されます。
\subsection{配列のイテレーター}
\index{はいれつ@配列!0のいてれえたあ@\baidash のイテレーター}
\index{いてれえたあ@イテレーター!はいれつの@配列の\baidash}
次に、配列が持っているイテレーターを紹介することにしましょう。
配列が持っているイテレーターのうちでもっとも動作が単純なのは、
\code{each}%
\index{each@\code{each}!はいれつの@配列の\baidash}という
イテレーターです。\code{each}は、レシーバーを構成する
それぞれの要素を順番にブロックに渡してブロックを実行します。
たとえば、
\begin{quote}
\begin{verbatim}
[78, "yadokari", 0.462].each do |e|
e.display
"\n".display
end
\end{verbatim}
\end{quote}
という式を評価すると、配列を構成するそれぞれの要素が
出力されます。ちなみに、\code{each}は、レシーバーをそのまま
戻り値として返します。
次のプログラムの中で定義されている\code{sum}というメソッドは、
レシーバーが数値の配列ならば、それらの数値を合計した結果を
戻り値として返します。
\begin{program}{sum.rb}
\begin{verbatim}
class Array
def sum
s = 0
each { |n| s += n }
s
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("sum.rb")
=> true
irb(main):002:0> [71, 22, 63, 98].sum
=> 254
\end{verbatim}
\end{jikkourei}
配列が持っている\code{each}以外のイテレーターも、レシーバーを
構成するそれぞれの要素を順番にブロックに渡してブロックを
実行する、という動作の基本は\code{each}と共通です。
\code{map}\index{map@\code{map}}というイテレーターは、
ブロックの中の式の値から構成される配列を戻り値として返します。
たとえば、
\begin{quote}
\verb/[5, 4, 7, 2, 8].map { |n| n * n }/
\end{quote}
という式を評価すると、
\begin{quote}
[25, 16, 49, 4, 64]
\end{quote}
というように、レシーバーを構成するそれぞれの数値を
2乗したものから構成される配列が値として得られます。
次のプログラムの中で定義されている\code{mapadd}という
メソッドは、レシーバーの要素と引数が数値ならば、それぞれの
要素と引数とを加算した結果から構成される配列を返します。
また、レシーバーの要素と引数が文字列ならば、それぞれの要素と
引数とを連結した結果から構成される配列を返します。
\begin{program}{mapadd.rb}
\begin{verbatim}
class Array
def mapadd(a)
map { |e| e + a }
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("mapadd.rb")
=> true
irb(main):002:0> [47, 33, 28, 16].mapadd(1000)
=> [1047, 1033, 1028, 1016]
irb(main):003:0> ["ebi", "kani", "tako"].mapadd("modoki")
=> ["ebimodoki", "kanimodoki", "takomodoki"]
\end{verbatim}
\end{jikkourei}
\subsection{コマンドライン引数}
シェルは、読み込んだコマンドを空白で区切っていくつかの単語に
分解して、先頭の単語をプログラムの名前とみなして、その名前の
プログラムを起動します。そして、残りの単語を、起動した
プログラムに渡します。シェルからプログラムへ渡される
それぞれの単語は、「コマンドライン引数
\index{こまんとらいんひきすう@コマンドライン引数}」
(command line argument)と呼ばれます。
ruby\index{ruby}という、対話型ではないRubyのインタプリタは、
任意の個数のコマンドライン引数をシェルから
受け取ることができます。rubyは、受け取った
コマンドライン引数のうちの先頭の単語をパス名とみなして、
そのパス名で指定されたファイルの中のプログラムを実行します。
そして、残りのコマンドライン引数を、自分が起動したプログラムに
渡します。たとえば、
\begin{quote}
ruby program.rb ringo mikan ichigo
\end{quote}
というコマンドでrubyを起動したとすると、rubyは、
\code{program.rb}というファイルに格納されているプログラムを
起動して、\code{ringo}、\code{mikan}、\code{ichigo}という
3個のコマンドライン引数を、そのプログラムに渡します。
rubyは、それぞれのコマンドライン引数を要素とする配列を作って、
その配列に\code{ARGV}\index{ARGV@\code{ARGV}}という名前を
付けて、その配列をプログラムに渡します。ですから、Rubyの
プログラムの中に\code{ARGV}と書くと、それは、
コマンドライン引数から構成される配列を意味することになります。
それでは、受け取ったコマンドライン引数をすべて出力する
プログラムを書いてみましょう。
\begin{program}{echo.rb}
\begin{verbatim}
ARGV.join(" ").display
"\n".display
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
$ ruby echo.rb kaki ichijiku biwa momo kuri
kaki ichijiku biwa momo kuri
\end{verbatim}
\end{jikkourei}
\code{ARGV}を構成する要素はすべて文字列ですので、それを
数値として扱いたい場合は、\code{to\us i}や\code{to\us f}などを
使って、それを数値に変換する必要があります。
次のプログラムは、コマンドライン引数として1個の整数を
受け取って、1からその整数までのそれぞれの整数を出力します。
\begin{program}{oneton.rb}
\begin{verbatim}
if ARGV.size == 1
ARGV[0].to_i.times do |i|
(i + 1).display
" ".display
end
"\n".display
else
"使い方: ruby oneton.rb 整数\n".display
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
$ ruby oneton.rb
使い方: ruby oneton.rb 整数
$ ruby oneton.rb 23
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
\end{verbatim}
\end{jikkourei}
なお、決まった個数のコマンドライン引数を受け取るプログラムを
書くときは、このプログラムのように、コマンドライン引数の個数を
確認して、それが正しくない場合はプログラムの使い方
\index{ふろくらむ@プログラム!0のつかいかた@\baidash の使い方}%
\index{つかいかた@使い方!ふろくらむの@プログラムの\baidash}%
(usage)を出力するようにしておくと、使う人に対して親切な
プログラムになります。
\section{ハッシュ}\label{sec:hash}
\subsection{ハッシュの基礎}
Rubyの組み込みクラスの中には、コンテナを生成するクラスが、
\code{Array}のほかにもうひとつあります。それは、
\code{Hash}\index{Hash@\code{Hash}}というクラスです。
このクラスは、「ハッシュ\index{はっしゅ@ハッシュ}」(hash)と
呼ばれるオブジェクトを生成します\footnote{ハッシュは、
「辞書\index{ししょ@辞書}」(dictionary)とか
「連想配列\index{れんそうはいれつ@連想配列}」
(associative array)などと呼ばれることもあります。}。
ハッシュというのはコンテナの一種ですから、任意の個数の
オブジェクトをその中に格納することができます。それらの
オブジェクトは、ハッシュの
「要素\index{はっしゅ@ハッシュ!0のようそ@\baidash の要素}%
\index{ようそ@要素!はっしゅの@ハッシュの\baidash}」(element)と
呼ばれます。ただし、ハッシュのひとつの要素は、
ひとつのオブジェクトではありません。ハッシュの場合は、
二つのオブジェクトがペアになったものがひとつの
要素になるのです。ハッシュの要素を構成する二つのオブジェクトの
それぞれは、「キー
\index{はっしゅ@ハッシュ!0のようそのきい@
\baidash の要素のキー}%
\index{きい@キー!はっしゅのようその
@ハッシュの要素の\baidash}」
(key)と「値
\index{はっしゅ@ハッシュ!0のようそのあたい@
\baidash の要素の値}%
\index{あたい@値!はっしゅのようその@
ハッシュの要素の\baidash}」(value)と呼ばれます。
配列は、その中で要素がどんな順序で並んでいるかという情報を
持っています。ですから、配列のそれぞれの要素は、それが
何番目にあるかという番号によって指定することができます。
それに対して、ハッシュは、要素がどんな順序で並んでいるかという
情報を持っていません。ですから、ハッシュのそれぞれの要素を、
それが何番目にあるかという番号で指定することはできません。
それでは、ハッシュの要素を指定したいときは、いったい
どうすればいいのでしょうか。
ハッシュには、それぞれの要素は互いに異なるキーを
持っていないといけない、という制約が課されています。この制約の
お蔭で、ハッシュの要素は、その要素のキーによって
指定することができます。
ちなみに、ハッシュの要素の値に関しては、互いに
異なっていないといけないという制約はありません。ですから、
ひとつのハッシュの中に同一の値を持つ要素が
2個以上含まれていてもかまいません。
ハッシュを構成している要素の個数を、そのハッシュの「大きさ
\index{はっしゅ@ハッシュ!0のおおきさ@\baidash の大きさ}%
\index{おおきさ@大きさ!はっしゅの@ハッシュの\baidash}」
(size)と呼びます。そして、大きさが0のハッシュは、
「空ハッシュ\index{くうはっしゅ@空ハッシュ}」(empty hash)と
呼ばれます。
\subsection{ハッシュを生成する方法}
ハッシュは、配列と同じように、要素を列挙することによって
生成することができます。
要素を列挙することによってハッシュを生成する場合、ハッシュの
ひとつの要素は、
\begin{quote}
\syntax{式$_{1}$}=>\syntax{式$_{2}$}
\end{quote}
という形の記述によってあらわされます。このような記述を書くと、
式$_{1}$の値が要素のキーになって、式$_{2}$の値が要素の
値になります。たとえば、
\begin{quote}
"ichigo"=>180
\end{quote}
と書くことによって、キーが\code{ichigo}という文字列で値が
180という整数であるような要素をあらわすことができます。
要素を列挙することによってハッシュを生成したいときは、
\begin{quote}
\lb \syntax{要素}, \syntax{要素}, \syntax{要素}, \tenten\ \rb
\end{quote}
という形の式を書きます。つまり、ハッシュのそれぞれの要素を
コンマ(\code{,})で区切って並べて、その全体を中括弧
\index{ちゅうかっこ@中括弧!はっしゅをせいせいする@
ハッシュを生成する\baidash}(\code{\lb\,\rb}%
\index{"{"}@\code{\lb\,\rb}!はっしゅをせいせいする@
ハッシュを生成する\baidash})で囲むわけです。この形の式を
評価すると、その中に記述された要素から構成されるハッシュが
値として得られます。たとえば、
\begin{quote}
\verb|{"momo"=>180, "kaki"=>140, "nashi"=>200}|
\end{quote}
という式を評価すると、キーが\code{momo}で値が180という要素、
キーが\code{kaki}で値が140という要素、キーが\code{nashi}で値が
200という要素、という3個の要素から構成されるハッシュが、
値として得られます。
ひとつのハッシュの中で、キーのクラスや値のクラスを
一定にしないといけないという制約はありません。ですから、
\begin{quote}
\verb|{"iruka"=>63, 707=>true, false=>"kujira"}|
\end{quote}
というような、キーや値のクラスが混在しているハッシュを
作ることも可能です。
中括弧だけの式、つまり\code{\lb\,\rb}という式を評価すると、
値として空ハッシュが得られます。
\subsection{ハッシュの基本的なメソッド}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{メッセージ式} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
$h$.size & $h$の大きさを返します。 \\ \hline
$h$.keys & $h$のすべてのキーから構成される配列を返します。
\\ \hline
$h$.values & $h$のすべての値から構成される配列を返します。
\\ \hline
$h$.to\us a & $h$の要素をあらわす配列から構成される配列を
返します。 \\ \hline
$h$.empty? & $h$が空ハッシュならばtrue、そうでなければ
falseを返します。\\ \hline
$h$.key?($k$) & $h$がキー$k$を持つならばtrue、
そうでなければfalseを返します。 \\ \hline
$h$.value?($v$) & $h$が値$v$を持つならばtrue、
そうでなければfalseを返します。 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{ハッシュの基本的なメソッド}
\label{tab:basicmethodsofhash}
\index{size@\code{size}!はっしゅの@ハッシュの\baidash}
\index{keys@\code{keys}}
\index{values@\code{values}}
\index{to_a@\code{to\us a}!はっしゅの@ハッシュの\baidash}
\index{empty?@\code{empty?}!はっしゅの@ハッシュの\baidash}
\index{key?@\code{key?}}
\index{value?@\code{value?}}
\end{table}
ハッシュは、自分自身を取り扱うためのさまざまなメソッドを
持っています。表\ref{tab:basicmethodsofhash}は、ハッシュが
持っているメソッドのうちの基本的なものを示しています。
\code{keys}と\code{values}と\code{to\us a}は、いずれも、
レシーバーを配列に変換するメソッドです。
\code{keys}\index{keys@\code{keys}}は、要素のキーだけから
構成される配列を返すメソッドで、
\code{values}\index{values@\code{values}}は、要素の値だけから
構成される配列を返すメソッドです。
\code{to\us a}%
\index{to_a@\code{to\us a}!はっしゅの@ハッシュの\baidash}は、
それぞれの要素を、キーと値から構成される配列に変換して、
それらの配列から構成される配列を返します。
\begin{quote}
\begin{verbatim}
irb(main):001:0> h = {"a"=>37, "b"=>80, "c"=>21, "d"=>14}
=> {"a"=>37, "b"=>80, "c"=>21, "d"=>14}
irb(main):002:0> h.keys
=> ["a", "b", "c", "d"]
irb(main):003:0> h.values
=> [37, 80, 21, 14]
irb(main):004:0> h.to_a
=> [["a", 37], ["b", 80], ["c", 21], ["d", 14]]
\end{verbatim}
\end{quote}
\subsection{ハッシュからの要素の取り出し}
ハッシュから要素を取り出したいときは、ハッシュが持っている
\code{[\,]}%
\index{[]@\code{[\,]}!はっしゅの@ハッシュの\baidash}%
\index{かくかっこ@角括弧!はっしゅの@ハッシュの\baidash}%
という演算を使います。$h$がハッシュで、$k$が
オブジェクトだとするとき、
\begin{quote}
$h$[$k$]
\end{quote}
という式で\code{[\,]}を呼び出すと、\code{[\,]}は、$k$を
キーとする要素を$h$から取り出して、その要素の値を戻り値として
返します。
\begin{quote}
\begin{verbatim}
irb(main):001:0> tensuu = {"sansuu"=>22, "rika"=>61}
=> {"sansuu"=>22, "rika"=>61}
irb(main):002:0> tensuu["rika"]
=> 61
\end{verbatim}
\end{quote}
\subsection{ハッシュの要素の追加と値の変更}
ハッシュに要素を追加したいとき、または要素の値を
変更したいときは、ハッシュが持っている\code{[\,]=}%
\index{[]=@\code{[\,]=}!はっしゅの@ハッシュの\baidash}という
演算を使います。$h$がハッシュで、$k$と$v$が
オブジェクトだとするとき、
\begin{quote}
$h$[$k$] = $v$
\end{quote}
という式で\code{[\,]=}を呼び出すと、\code{[\,]=}は、$k$を
キーとする$h$の要素が存在していなかった場合は、キーが$k$で値が
$v$という要素を$h$に追加します。$k$をキーとする$h$の要素が
すでに存在していた場合は、その要素の値を$v$に変更します。
\begin{quote}
\begin{verbatim}
irb(main):001:0> tensuu = {"sansuu"=>22, "rika"=>61}
=> {"sansuu"=>22, "rika"=>61}
irb(main):002:0> tensuu["kokugo"] = 93
=> 93
irb(main):003:0> tensuu
=> {"kokugo"=>93, "sansuu"=>22, "rika"=>61}
irb(main):004:0> tensuu["sansuu"] = 87
=> 87
irb(main):005:0> tensuu
=> {"kokugo"=>93, "sansuu"=>87, "rika"=>61}
\end{verbatim}
\end{quote}
次のプログラムの中で定義されている\code{toHash}という配列の
メソッドは、引数として配列を受け取って、レシーバーを構成する
それぞれの要素をキー、引数を構成するそれぞれの要素を値とする
ハッシュを戻り値として返します。
\begin{program}{tohash.rb}
\begin{verbatim}
class Array
def toHash(v)
h = {}
size.times { |i| h[self[i]] = v[i] }
h
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("tohash.rb")
=> true
irb(main):002:0> ["a", "b", "c", "d"].toHash([34, 27, 52, 93])
=> {"a"=>34, "b"=>27, "c"=>52, "d"=>93}
\end{verbatim}
\end{jikkourei}
\subsection{ハッシュの要素の削除}
ハッシュの要素を削除したいときは、\code{delete}%
\index{delete@\code{delete}!はっしゅの@ハッシュの\baidash}%
というメソッドを使います。このメソッドは、引数として受け取った
オブジェクトをキーとする要素をレシーバーから削除して、削除した
要素の値を戻り値として返します。
\begin{quote}
\begin{verbatim}
irb(main):001:0> tensuu = {"sansuu"=>22, "rika"=>61}
=> {"sansuu"=>22, "rika"=>61}
irb(main):002:0> tensuu.delete("rika")
=> 61
irb(main):003:0> tensuu
=> {"sansuu"=>22}
\end{verbatim}
\end{quote}
\subsection{デフォルト値}
ハッシュが持っている\code{[\,]}という演算は、指定されたキーを
持つ要素がレシーバーの中に存在していなかった場合、
「デフォルト値\index{てふぉるとち@デフォルト値}」
(default value)と呼ばれるオブジェクトを返します。
デフォルト値は、それが明示的に設定されていなければ、
\code{nil}が設定されています。
\begin{quote}
\begin{verbatim}
irb(main):001:0> tensuu = {"kokugo"=>93, "sansuu"=>87}
=> {"kokugo"=>93, "sansuu"=>87}
irb(main):002:0> tensuu["rika"]
=> nil
\end{verbatim}
\end{quote}
ハッシュに設定されているデフォルト値を変更したいときは、
\code{default=}\index{default=@\code{default=}}という
メソッドを使います。$h$がハッシュで$d$が
オブジェクトだとするとき、
\begin{quote}
$h$.default = $d$
\end{quote}
という式で\code{default=}を呼び出すと、$h$のデフォルト値が
$d$に変更されます。
\begin{quote}
\begin{verbatim}
irb(main):001:0> nedan = {"mikan"=>220, "ringo"=>180}
=> {"ringo"=>180, "mikan"=>220}
irb(main):002:0> nedan["ichigo"]
=> nil
irb(main):003:0> nedan.default = 200
=> 200
irb(main):004:0> nedan["ichigo"]
=> 200
\end{verbatim}
\end{quote}
\subsection{ハッシュのイテレーター}
\index{はっしゅ@ハッシュ!0のいてれえたあ@
\baidash のイテレーター}
\index{いてれえたあ@イテレーター!はっしゅの@
ハッシュの\baidash}
ハッシュは、\code{each}%
\index{each@\code{each}!はっしゅの@ハッシュの\baidash}という
イテレーターを持っています。このイテレーターは、レシーバーの
それぞれの要素について、そのキーと値を渡してブロックを
実行します。
次のプログラムの中で定義されている\code{intersection}という
ハッシュのメソッドは、引数として1個のハッシュを受け取って、
レシーバーと引数とで共通するキーを持つ要素を
統合することによってできるハッシュを戻り値として返します。
\begin{program}{intsec.rb}
\begin{verbatim}
class Hash
def intersection(h)
intsec = {}
each do |k, v|
if h.key?(k)
intsec[k] = [v, h[k]]
end
end
intsec
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
irb(main):001:0> load("intsec.rb")
=> true
irb(main):002:0> h1 = {"kuma"=>37, "tanuki"=>21, "shika"=>85}
=> {"shika"=>85, "tanuki"=>21, "kuma"=>37}
irb(main):003:0> h2 = {"tanuki"=>78, "mogura"=>44, "kuma"=>62}
=> {"kuma"=>62, "tanuki"=>78, "mogura"=>44}
irb(main):004:0> h1.intersection(h2)
=> {"kuma"=>[37, 62], "tanuki"=>[21, 78]}
\end{verbatim}
\end{jikkourei}
\subsection{中括弧の省略}
メソッドに渡す引数として、要素を列挙してハッシュを生成する式を
書く場合、引数がそれ1個だけならば、その式の中括弧は
省略することができます。
\index{ちゅうかっこ@中括弧!0のしょうりゃく@\baidash の省略}%
それでは、irbを使って実際に確かめてみましょう。まず、
\begin{quote}
\begin{verbatim}
def sonomama(a)
a
end
\end{verbatim}
\end{quote}
という式を入力してください。そうすると、受け取った引数を
そのまま返すだけの、\code{sonomama}という関数的メソッドが
定義されます。次に、
\begin{quote}
sonomama("taika"=>645, "meiji"=>1868, "heisei"=>1989)
\end{quote}
という式を入力してください。すると、1個のハッシュが
戻り値として返ってきます。つまり、メッセージ式の丸括弧の中に
ハッシュの要素を列挙すると、それらの要素から構成される1個の
ハッシュを引数として渡すという意味になるわけです。
\section{ファイル}\label{sec:file}
\subsection{ファイルの基礎}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{メッセージ式} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
$i$.read & $i$の内容を読み込んで文字列として返します。
\\ \hline
$i$.readlines & $i$の内容を読み込んで行の配列として
返します。 \\ \hline
$i$.gets & $i$から\textrm{1}行を読み込んで返します。
\\ \hline
$i$.each & 行単位で読み込みを繰り返すイテレーターです。
\\ \hline
$i$.getc & $i$から\textrm{1}文字を読み込んで
文字コードとして返します。 \\ \hline
$i$.each\us byte & 文字単位で読み込みを繰り返す
イテレーターです。 \\ \hline
$i$.write($s$) & $i$に文字列$s$を書き込みます。 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{読み込みと書き込みのメソッド}
\label{tab:readwritemethods}
\index{read@\code{read}}
\index{readlines@\code{readlines}}
\index{gets@\code{gets}}
\index{each@\code{each}!IOおふしぇくとの@
IOオブジェクトの\baidash}
\index{getc@\code{getc}}
\index{each_byte@\code{each\us byte}!IOおふしぇくとの@
IOオブジェクトの\baidash}
\index{write@\code{write}}
\end{table}
Rubyには、\code{IO}\index{IO@\code{IO}}という
組み込みクラスがあります。このクラスは、プログラムがデータを
読み込んだり書き込んだりする対象をあらわすオブジェクトを
生成します。\code{IO}またはそれを継承するクラスの
インスタンスは、
「IOオブジェクト\index{IOおふしぇくと@IOオブジェクト}」
(IO object)と呼ばれます。IOオブジェクトは、データを
書き込んだり読み込んだりするためのさまざまなメソッドを
持っています。表\ref{tab:readwritemethods}は、
IOオブジェクトが持っている読み込みと書き込みのメソッドを
示しています。
ファイル\index{ふぁいる@ファイル}は、プログラムがデータの
読み込みや書き込みをする対象のひとつです。ですから、ファイルを
あらわすIOオブジェクトを生成して、それが持っているメソッドを
使うことによって、そのファイルに対してデータの
読み書きを実行することができます。
ファイルに対する読み書きをするためのIOオブジェクトは、
\code{IO}クラスをスーパークラスとする
\code{File}\index{File@\code{File}}という組み込みクラスから
生成されます。
ファイルからデータを読み込んだり、ファイルにデータを
書き込んだりするためには、それに先立って、そのための準備をする
必要があります。ファイルに対する読み書きのための
準備をすることを、ファイルを
「オープンする\index{おおふんする@オープンする}」(open)と
言います。
ファイルに対して読み書きを実行したときは、それが終わったのち、
その後始末をする必要があります。ファイルに対する読み書きが
終わったのちにその後始末をすることを、ファイルを
「クローズする\index{くろおすする@クローズする}」(close)と
言います。
\subsection{ファイルをあらわすIOオブジェクトの生成}
ファイルをあらわすIOオブジェクトを生成したいときは、
\code{open}%
\index{open@\code{open}!ふぁいるの@ファイルの\baidash}という
関数的メソッドを使います。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{文字列} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
r & ファイルの先頭から読み込む。デフォルト。 \\ \hline
w & ファイルの内容を削除したのちに書き込む。 \\ \hline
a & ファイルの内容を削除しないで、その末尾に書き込む。
\\ \hline
r+ & ファイルの先頭から読み書きをする。
\\ \hline
w+ & ファイルの内容を削除したのちに読み書きをする。
\\ \hline
a+ & ファイルの末尾から読み書きをする。
\\ \hline
b & 上記の文字列の右側に書いて、バイナリーモードを
指定する。 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{オープンモードをあらわす文字列}
\label{tab:openmodestring}
\end{table}
\code{open}は、二つの文字列を引数として受け取ります。
ひとつ目はファイルを指定するパス名で、二つ目は
「オープンモード\index{おおふんもおと@オープンモード}」
(open mode)と呼ばれるものをあらわす文字列です。
オープンモードというのは、ファイルをオープンする
目的のことです。表\ref{tab:openmodestring}は、オープンモードを
あらわす文字列の意味を示しています。たとえば、データを
読み込むためにファイルをオープンしたいときは、\code{r}という
文字列を二つ目の引数として\code{open}に渡します。
\code{open}は、引数で指定されたファイルを指定された
オープンモードでオープンして、そのファイルをあらわす
IOオブジェクト(\code{File}クラスのインスタンス)を渡して
ブロックを実行します。そして、ブロックの実行が終了したのち、
そのファイルをクローズします。ファイルは、ブロックの実行が
正常に終了した場合だけではなくて、例外が発生して実行が中断した
場合も、かならずクローズされます。
たとえば、
\begin{quote}
open("namako.txt", "r") \syntax{ブロック}
\end{quote}
というような式で\code{open}を呼び出したとすると、
\code{open}は、\code{namako.txt}というパス名のファイルを、
そこからデータを読み込むという目的でオープンして、
そのファイルをあらわすIOオブジェクトを渡してブロックを
実行します。
なお、\code{open}に渡す二つ目の引数、つまりオープンモードを
あらわす文字列は、読み込みのためにファイルをオープンする場合は
省略することができます。ですから、上の式は、
\begin{quote}
open("namako.txt") \syntax{ブロック}
\end{quote}
と書いても同じ意味になります。
なお、\code{open}は、オープンモードが\code{w}、\code{a}、
\code{w+}、\code{a+}のいずれかで、存在しないファイルのパス名が
指定された場合は、新しい空のファイルを作って、そのファイルを
あらわすIOオブジェクトを生成します。
\subsection{読み書き位置}
IOオブジェクトがあらわしているものに対する読み書きは、
「読み書き位置\index{よみかきいち@読み書き位置}」
(read/write position)と呼ばれる位置に対して実行されます。
\code{r}でファイルをオープンした場合、オープンした直後の
読み書き位置は、ファイルの先頭です。
\code{w}でファイルをオープンした場合も、ファイルは
空になっているわけですから、最初の読み書き位置はファイルの
先頭です。それに対して、\code{a}でファイルをオープンした場合、
最初の読み書き位置はファイルの末尾になります。
データの読み書きをするメソッドは、読み書き位置に対して
読み書きを実行して、そののち、次に読み書きを実行するべき位置へ
読み書き位置を移動させます。
ファイルの末尾という位置のことを
「ファイルの終わり\index{ふぁいるのおわり@ファイルの終わり}」
(end of file)と呼びます。
\subsection{ファイル全体の読み込み}
\code{File}クラスのインスタンスは、\code{IO}クラスから
継承した、データの読み込みや書き込みのためのさまざまな
メソッドを持っていますので、それらのメソッドを
使うことによって、ファイルに対する読み込みや書き込みを
実行することができます。
ファイルの中のデータをすべて読み込みたいときは、
\code{read}\index{read@\code{read}}というメソッドを使います。
\code{read}は、読み書き位置からファイルの終わりまでのデータを
読み込んで、それをひとつの文字列として返します。
次のプログラムは、ファイルの内容をそのまま出力します。
\begin{program}{read.rb}
\begin{verbatim}
if ARGV.size == 1
open(ARGV[0]) do |f|
f.read.display
end
else
"使い方: ruby read.rb パス名\n".display
end
\end{verbatim}
\end{program}
ファイルの内容をすべて読み込むメソッドとしては、
\code{read}のほかに、
\code{readlines}\index{readlines@\code{readlines}}%
というのもあります。\code{readlines}は、ファイルの内容を行に
分割して、それぞれの行から構成される配列を戻り値として
返します。なお、配列を構成するそれぞれの行の末尾には、改行を
あらわす文字が付いたままになっています。文字列の末尾にある
改行は、文字列が持っている
\code{chomp}\index{chomp@\code{chomp}}というメソッドを
使うことによって取り除くことができます。
次のプログラムは、ファイルを構成するそれぞれの行を角括弧で
囲んで出力します。
\begin{program}{lines.rb}
\begin{verbatim}
if ARGV.size == 1
open(ARGV[0]) do |f|
f.readlines.each do |line|
("[" + line.chomp + "]\n").display
end
end
else
"使い方: ruby lines.rb パス名\n".display
end
\end{verbatim}
\end{program}
\subsection{行単位での読み込み}
ファイルからデータを1行だけ読み込みたいときは、
\code{gets}\index{gets@\code{gets}}というメソッドを使います。
\code{gets}は、読み書き位置からデータを1行だけ読み込んで、
それを戻り値として返します(改行も含まれます)。ただし、
読み書き位置がファイルの終わりに到達している場合は、
戻り値として\code{nil}を返します。
次のプログラムは、ファイルを構成するそれぞれの行に
番号を付けて出力します。
\begin{program}{linenum.rb}
\begin{verbatim}
if ARGV.size == 1
open(ARGV[0]) do |f|
n = 0
while line = f.gets
n += 1
(n.to_s + ": " + line).display
end
end
else
"使い方: ruby linenum.rb パス名\n".display
end
\end{verbatim}
\end{program}
ファイルの終わりに到達するまでファイルからの読み込みを
繰り返すという動作を記述するときは、このプログラムのように、
\code{while}式\index{whileしき@\code{while}式}が
しばしば使われます。
\code{while}式を使って読み込みを繰り返す場合には、繰り返しの
条件のところに読み込みを実行する式を書く、というのが
常套手段です。読み込みを実行するメソッドの多くは、ファイルの
終わりに到達すると\code{nil}(つまり偽)を返すように
定義されていますので、そのように書いておくことによって、
ファイルの終わりに到達したところで繰り返しを
終了させることができます。
\subsection{行単位での読み込みを繰り返すイテレーター}
\index{IOおふしぇくと@IOオブジェクト!0のいてれえたあ@
\baidash のイテレーター}%
\index{いてれえたあ@イテレーター!IOおふしぇくとの@
IOオブジェクトの\baidash}%
ファイルからデータを行単位で読み込むという動作を繰り返すための
方法としては、\code{gets}と\code{while}式を使う方法のほかに、
\code{each}%
\index{each@\code{each}!IOおふしぇくとの@
IOオブジェクトの\baidash}というイテレーターを使うという
方法もあります。
\code{each}は、読み込んだ行(改行も含まれます)を渡して
ブロックを実行するということを、ファイルの終わりに到達するまで
繰り返すイテレーターです。
次のプログラムは、ファイルの内容を出力したのち、それを
構成している行の個数を出力します。
\begin{program}{count.rb}
\begin{verbatim}
if ARGV.size == 1
open(ARGV[0]) do |f|
count = 0
f.each do |line|
count += 1
line.display
end
(count.to_s + " lines\n").display
end
else
"使い方: ruby count.rb パス名\n".display
end
\end{verbatim}
\end{program}
\subsection{文字単位での読み込み}
ファイルからデータを1文字だけ読み込みたいときは、
\code{getc}\index{getc@\code{getc}}というメソッドを使います。
\code{getc}は、読み書き位置からデータを1文字だけ読み込んで、
その文字の文字コードを戻り値として返します。ただし、
読み書き位置がファイルの終わりに到達している場合は、
戻り値として\code{nil}を返します。
文字コードを文字列に変換したいときは、整数が持っている
\code{chr}\index{chr@\code{chr}}というメソッドを使います。
\code{chr}は、レシーバーを文字コードとする文字から構成される、
長さが1の文字列を返すメソッドです。たとえば、
イコール(\code{=})という文字の文字コードは61ですから、
\begin{quote}
61.chr
\end{quote}
という式を評価すると、\code{"="}という文字列が値として
得られます。
次のプログラムは、ファイルの内容に含まれているすべての空白を
ドット(\code{.})に変換した結果を出力します。
\begin{program}{sptodot.rb}
\begin{verbatim}
if ARGV.size == 1
open(ARGV[0]) do |f|
while c = f.getc
if c == 32 # 32は空白の文字コード
".".display
else
c.chr.display
end
end
end
else
"使い方: ruby sptodot.rb パス名\n".display
end
\end{verbatim}
\end{program}
\subsection{文字単位での読み込みを繰り返すイテレーター}
\index{IOおふしぇくと@IOオブジェクト!0のいてれえたあ@
\baidash のイテレーター}%
\index{いてれえたあ@イテレーター!IOおふしぇくとの@
IOオブジェクトの\baidash}%
ファイルからデータを文字単位で読み込むという動作を
繰り返すための方法としては、\code{getc}と\code{while}式を使う
方法のほかに、\code{each\us byte}%
\index{each_byte@\code{each\us byte}!IOおふしぇくとの@
IOオブジェクトの\baidash}というイテレーターを使うという
方法もあります。
\code{each\us byte}は、読み込んだ文字の文字コードを渡して
ブロックを実行するということを、ファイルの終わりに到達するまで
繰り返すイテレーターです。
次のプログラムは、コマンドライン引数で指定された文字数で、
ファイルを構成する行を再編成して、その結果を出力します。
\begin{program}{fixline.rb}
\begin{verbatim}
if ARGV.size == 2
n = ARGV[1].to_i
open(ARGV[0]) do |f|
count = 0
f.each_byte do |c|
if c != 10 # 10は改行の文字コード
count += 1
if count == n
"\n".display
count = 0
end
c.chr.display
end
end
end
else
"使い方: ruby fixline.rb パス名 1行の文字数\n".display
end
\end{verbatim}
\end{program}
\subsection{書き込み}
ファイルにデータを書き込みたいときは、
\code{write}\index{write@\code{write}}というメソッドを
使います。\code{write}は、引数として文字列を受け取って、
読み書き位置にその文字列を書き込みます。
次のプログラムは、ファイルの内容を別のファイルにコピーします。
\begin{program}{copy.rb}
\begin{verbatim}
if ARGV.size == 2
open(ARGV[0]) do |inf|
open(ARGV[1], "w") do |outf|
outf.write(inf.read)
end
end
else
"使い方: ruby copy.rb コピー元 コピー先\n".display
end
\end{verbatim}
\end{program}
\subsection{標準入出力}
オペレーティングシステムは、「標準入出力
\index{ひょうしゅんにゅうしゅつりょく@標準入出力}」
(standard IO)と呼ばれる三つのファイルを持っています。
標準入出力は、実体を持たない仮想的なファイルで、
オペレーティングシステムによって特定のファイルに
割り当てられることによって、実際に読み書きをすることが
可能になります。
標準入出力を構成する三つのファイルは、それぞれ、
「標準入力\index{ひょうしゅんにゅうりょく@標準入力}」
(standard input)、
「標準出力\index{ひょうしゅんしゅつりょく@標準出力}」
(standard output)
「標準エラー\index{ひょうしゅんえらあ@標準エラー}」
(standard error)と呼ばれます。通常、標準入力はキーボードに、
標準出力と標準エラーはモニターに割り当てられていますが、
それらの割り当てを別のファイルに切り替えることも可能です。
標準入出力をキーボードやモニターから別のファイルに
切り替えることを、標準入出力を
「リダイレクトする\index{りたいれくとする@リダイレクトする}」
(redirect)と言います(名詞は
「リダイレクション\index{りたいれくしょん@リダイレクション}」
(redirection)です)。
ちなみに、
\code{display}\index{display@\code{display}}というのは、
レシーバーを標準出力に書き込むメソッドです。
Rubyでは、標準入出力をあらわすIOオブジェクトのそれぞれに、
\begin{quote}
\begin{tabbing}
\hspace{4zw} \= \kill
STDIN\index{STDIN@\code{STDIN}} \> 標準入力 \\
STDOUT\index{STDOUT@\code{STDOUT}} \> 標準出力 \\
STDERR\index{STDERR@\code{STDERR}} \> 標準エラー
\end{tabbing}
\end{quote}
という名前が与えられています。ですから、
\begin{quote}
line = STDIN.gets
\end{quote}
という式を評価することによって、標準入力(通常は
キーボード)から1個の行を読み込んで、それを\code{line}という
変数に代入することができます。
次の\code{irblike.rb}は、irbと同じように、rubyを対話的に
使うことができるようにするプログラムです(irbに比べると、
機能がかなり貧弱ですが)。
\begin{program}{irblike.rb}
\begin{verbatim}
while true
"irblike> ".display
begin
line = STDIN.gets
("=> " + eval(line).inspect + "\n").display
rescue => e
(e.class.to_s + ": " + e.message + "\n" +
e.backtrace.join("\n") + "\n").display
end
end
\end{verbatim}
\end{program}
このプログラムは、irbと同じように、式として\code{exit}を
入力することによって終了させることができます。
ところで、このプログラムには、ここで初めてこの文章に登場する
メソッドが、三つ、使われていますので、それらを簡単に
紹介しておくことにしましょう。
\begin{tttablelist}{backtrace}
\item[eval]\index{eval@\code{eval}}
関数的メソッドです。引数として文字列を受け取って、それをRubyの
式とみなして評価して、その結果として得られた値を戻り値として
返します。
\item[inspect]\index{inspect@\code{inspect}}
すべてのオブジェクトが持っているメソッドです。
\code{to\us s}と同じように、レシーバーを文字列に変換した
結果を返します。\code{inspect}と\code{to\us s}との相違点は、
前者のほうが後者よりも、レシーバーを想起させやすい文字列に
変換するという点にあります。
\item[backtrace]\index{backtrace@\code{backtrace}}
例外が持っているメソッドです。レシーバーが発生した時点で
実行の途上にあるメソッドについての情報を、文字列の配列という
形式で返します。
\end{tttablelist}
\subsection{フィルター}
標準入力からデータを読み込んで、そのデータに対して何らかの
処理を実行して、その結果を標準出力に書き込む、という動作をする
プログラムのことを、
「フィルター\index{ふぃるたあ@フィルター}」(filter)と
呼びます。ただし、ほとんどのフィルターは、コマンドライン引数で
パス名が指定された場合は、標準入力ではなくて指定された
ファイルからデータを読み込むように作られています。
たとえば、UNIXのcatというプログラムもフィルターのひとつです。
コマンドライン引数を何も渡さないでcatを起動すると、catは、
標準入力からデータを読み込んで、それをそのまま標準出力に
書き込みます。コマンドライン引数を何個か渡して起動した場合は、
引数の順番のとおりに、引数によって指定されたファイルから
データを読み込んで、それを標準出力に書き込みます。
\subsection{リダイレクション}
標準入出力は、通常はキーボードやモニターに
割り当てられているわけですが、それをファイルに
切り替える(つまりリダイレクトする
\index{りたいれくとする@リダイレクトする})ということも
可能です。
標準入力をキーボードからファイルにリダイレクトしたいときは、
シェルに対して、
\begin{quote}
\syntax{コマンド} < \syntax{パス名}
\end{quote}
という形のコマンドを入力します。そうすると、標準入力は
小なり(\code{<})の右側のパス名で指定されたファイルに
リダイレクトされて、その状態で、小なりの左側のコマンドが
実行されます。たとえば、
\begin{quote}
cat < asagao.txt
\end{quote}
というコマンドをシェルに入力すると、\code{asagao.txt}の内容が
モニターに出力されます。
標準出力をモニターからファイルにリダイレクトしたいときは、
シェルに対して、
\begin{quote}
\syntax{コマンド} > \syntax{パス名}
\end{quote}
という形のコマンドを入力します。そうすると、標準出力は
大なり(\code{>})の右側のパス名で指定されたファイルに
リダイレクトされて、その状態で、大きいなりの左側のコマンドが
実行されます。たとえば、
\begin{quote}
cat > himawari.txt
\end{quote}
というコマンドをシェルに入力すると、キーボードに入力した
データが\code{himawari.txt}に書き込まれます。
大なり(\code{>})ではなくて、大なり大なり(\code{>>})を使って
標準出力をリダイレクトすることも可能です。大なり大なりを
使った場合、標準出力に書き込んだデータは、ファイルの末尾に
追加されます。
\subsection{パイプ}
標準入出力はファイルにリダイレクトすることができるわけですが、
それだけではなくて、標準入出力を媒介にして二つのプログラムを
結合する、ということも可能です。それをしたいときは、
「パイプ\index{はいふ@パイプ}」(pipe)と呼ばれる機構を
使います。
シェルのコマンドの中では、パイプは、縦棒
(\code{|}\index{"|@\code{|}!はいふの@パイプの\baidash})という
文字によってあらわされます。シェルに対して、
\begin{quote}
\syntax{コマンド$_{1}$} | \syntax{コマンド$_{2}$}
\end{quote}
という形のコマンドを入力すると、\mbox{コマンド$_{1}$}で
起動されたプログラムの標準出力と、\mbox{コマンド$_{2}$}で
起動されたプログラムの標準入力とが結合されます。たとえば、
\begin{quote}
ls -l | cat -n
\end{quote}
というコマンドをシェルに入力すると、ディレクトリの一覧に
行番号を付けたものが出力されます。
\subsection{\texttt{ARGF}}
スクリプト言語の多くは、フィルターが簡単に
書けるようにするための機能を
持っています\footnote{sed\index{sed}やawk\index{awk}のように、
フィルターを書くことを第一の目的として設計された
スクリプト言語もあります。}。Rubyもその例外ではありません。
Rubyでは、フィルターを簡単に書くことができるようにするために、
\code{ARGF}\index{ARGF@\code{ARGF}}という名前のものが
準備されています。\code{ARGF}というのは、コマンドライン引数を
パス名とみなして、それらのパス名で指定されたファイルを、
その順番のとおりに連結してできた仮想的なファイル、というものを
あらわしているオブジェクトです。そして、コマンドライン引数が
0個の場合、\code{ARGF}は、標準入力をあらわす
オブジェクトになります。
\code{ARGF}があらわしているファイルは、読み込みの
オープンモードでオープンされています。\code{ARGF}が
あらわしているファイルからデータを読み込みたいときは、それが
持っているメソッドを使います。\code{ARGF}が持っている
読み込みのメソッドは、IOオブジェクトが持っているものと、
名前も動作も同じです。
それでは、実際にフィルターを書いてみましょう。次の
プログラムは、大なり(\code{>})と空白を行の先頭に挿入する
フィルターです。
\begin{program}{quote.rb}
\begin{verbatim}
ARGF.each do |line|
("> " + line).display
end
\end{verbatim}
\end{program}
このプログラムを、たとえば、
\begin{quote}
ruby quote.rb namako.txt umiushi.txt hitode.txt
\end{quote}
というコマンドで起動したとすると、このプログラムは、
コマンドライン引数で指定された3個のファイルを、
その順番のとおりに連結することによってできた仮想的なファイルの
内容を読み込んで、大なりと空白をそれぞれの行の先頭に挿入した
結果を出力します。
コマンドライン引数が0個の場合、\code{ARGF}は標準入力を
扱うことになりますので、
\begin{quote}
cal 7 1999 | ruby quote.rb
\end{quote}
というコマンドをシェルに入力したとすると、\code{quote.rb}は、
calが出力したカレンダーを処理することになります。
\subsection{\texttt{ARGF}からファイルを除外する方法}
フィルターに渡すコマンドライン引数は、かならずしもすべてが
読み込みの対象となるファイルのパス名とは限りません。しかし、
Rubyの処理系は、\code{ARGF}を作るとき、コマンドライン引数は
すべてパス名だと頭ごなしに決め付けてしまいます。それでは、
読み込むファイルのパス名ではないコマンドライン引数を受け取る
フィルターは、いったいどのように書けばいいのでしょうか。
Rubyのプログラムは、コマンドライン引数を
\code{ARGV}\index{ARGV@\code{ARGV}}という名前の配列として
受け取ります。たとえば、
\begin{quote}
ruby tanpopo.rb sumire renge nanohana
\end{quote}
というコマンドで\code{tanpopo.rb}というプログラムを
起動したとすると、そのプログラムの中の\code{ARGV}は、
\begin{quote}
["sumire", "renge", "nanohana"]
\end{quote}
という配列になります。
実は、\code{ARGF}の対象となるパス名というのは、\code{ARGV}の
内容によって決定されるのです。ですから、\code{ARGV}から要素を
削除すれば、その要素は\code{ARGF}の対象から除外されますし、
\code{ARGV}に要素を追加すれば、その要素は\code{ARGF}の
対象として認識されます。
配列の先頭の要素を削除したいときは、配列が持っている
\code{shift}というメソッドを使います。
\code{shift}\index{shift@\code{shift}}は、レシーバーの先頭の
要素を削除して、その要素を戻り値として
返します(レシーバー自体が変化するという点に
注意してください)。たとえば、
\begin{quote}
a = [24, 18, 60, 77]
\end{quote}
という式で配列を変数に代入して、そののち、
\begin{quote}
a.shift
\end{quote}
という式を評価したとすると、式の値として24が得られて、
変数の中の配列は、
\begin{quote}
[18, 60, 77]
\end{quote}
に変化します。
次のプログラムは、1個目のコマンドライン引数と
大なり(\code{>})と空白を行の先頭に挿入するフィルターです。
\begin{program}{quote2.rb}
\begin{verbatim}
name = ARGV.shift
ARGF.each do |line|
(name + "> " + line).display
end
\end{verbatim}
\end{program}
\subsection{オプション}
コマンドライン引数のうちで、プログラムに対して通常とは異なる
動作を指示するもののことを、
「オプション\index{おふしょん@オプション}」(option)と
呼びます。オプションは、普通、オプションではない普通の引数と
区別するために、先頭にマイナス(\code{-})という文字を書きます。
オプションを受け付けるフィルターを作るためには、
コマンドライン引数がオプションかどうかを判断して、
オプションならばそれを\code{ARGV}から削除するという処理を
書く必要があります。
次のプログラムは、ファイルの内容をそのまま出力する
フィルターですが、\code{-n}というオプションを付けて
起動すると、それぞれの行の先頭に行番号を付けます。
\begin{program}{cat.rb}
\begin{verbatim}
if ARGV[0] == "-n"
ARGV.shift
n = 0
ARGF.each do |line|
n += 1
(n.to_s + ": " + line).display
end
else
ARGF.read.display
end
\end{verbatim}
\end{program}
\subsection{\texttt{File}のクラスメソッド}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{メッセージ} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
delete($p$) & パス名$p$を持つものを削除します。
\\ \hline
rename($p$, $q$) & パス名を$p$から$q$へ変更します。
\\ \hline
size($p$) & パス名$p$を持つファイルの大きさを返します。
\\ \hline
mtime($p$) & パス名$p$を持つファイルの最終更新時刻を
返します。 \\ \hline
exist?($p$) & パス名$p$を持つものが存在するならばtrueを
返します。 \\ \hline
file?($p$) & パス名$p$を持つものがファイルならばtrueを
返します。 \\ \hline
directory?($p$) & パス名$p$を持つものがディレクトリならば
trueを返します。 \\ \hline
basename($p$) & パス名$p$の末尾の名前を返します。
\\ \hline
basename($p$, $e$) & パス名$p$の末尾の名前から拡張子$e$を
取り除いた残りを返します。 \\ \hline
dirname($p$) & パス名$p$から末尾の名前を取り除いた残りを
返します。 \\ \hline
split($p$) & パス名$p$を末尾とそれ以外に分解して、
配列にして返します。 \\ \hline
join($s$, \tenten\ ) & パス名の区切り文字をはさんで引数を
連結した結果を返します。 \\ \hline
expand\us path($p$) & パス名$p$を絶対パス名に変換した
結果を返します。 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{\texttt{File}のクラスメソッド}
\label{tab:classmethodsoffile}
\index{delete@\code{delete}!ふぁいるの@ファイルの\baidash}
\index{rename@\code{rename}}
\index{size@\code{size}!ふぁいるの@ファイルの\baidash}
\index{mtime@\code{mtime}}
\index{exist?@\code{exist?}}
\index{file?@\code{file?}}
\index{directory?@\code{directory?}}
\index{basename@\code{basename}}
\index{dirname@\code{dirname}}
\index{split@\code{split}!はすめいの@パス名の\baidash}
\index{join@\code{join}!はすめいの@パス名の\baidash}
\index{expand_path@\code{expand\us path}}
\end{table}
\code{File}\index{File@\code{File}}というクラスは、
クラスメソッドとして、ファイルやディレクトリを取り扱うための
さまざまなメソッドを持っています。
表\ref{tab:classmethodsoffile}は、\code{File}クラスが
持っているクラスメソッドのうちの主要なものを示しています。
\section{ディレクトリ}\label{sec:directory}
\subsection{\texttt{Dir}のクラスメソッド}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{メッセージ} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
pwd & カレントディレクトリの絶対パス名を返します。
\\ \hline
chdir($p$) & パス名$p$を持つディレクトリを
カレントディレクトリにします。 \\ \hline
mkdir($p$) & パス名$p$を持つディレクトリを作ります。
\\ \hline
rmdir($p$) & パス名$p$を持つディレクトリを削除します。
\\ \hline
entries($p$) & パス名$p$を持つディレクトリの中にあるものの
名前の配列を返します。 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{\texttt{Dir}のクラスメソッド}
\label{tab:classmethodsofdir}
\index{pwd@\code{pwd}}
\index{chdir@\code{chdir}}
\index{mkdir@\code{mkdir}}
\index{rmdir@\code{rmdir}}
\index{entries@\code{entries}}
\end{table}
Rubyのインタプリタには、
\code{Dir}\index{Dir@\code{Dir}}という名前のクラスが
組み込まれています。このクラスは、クラスメソッドとして、
ディレクトリ\index{てぃれくとり@ディレクトリ}を取り扱うための
さまざなメソッドを持っています。
表\ref{tab:classmethodsofdir}は、\code{Dir}クラスが持っている
クラスメソッドのうちの主要なものを示しています。
\subsection{ディレクトリの内容に対する処理}
ディレクトリの中にあるすべてのものに対して何らかの処理を
実行したい、というときは、まず、ディレクトリの中にあるものの
名前を調べて、次に、それらの名前を持つものに対する処理を
繰り返します。
ディレクトリの中にあるものの名前を調べたいときは、
\code{Dir}クラスが持っている
\code{entries}\index{entries@\code{entries}}という
クラスメソッドを使います。このメソッドは、引数で指定された
ディレクトリの中にあるものの名前から構成される
配列を戻り値として返します。なお、その配列は、指定された
ディレクトリ自身(\code{.})とその親ディレクトリ(\code{..})も
含んでいる、という点に注意してください。
次のプログラムは、指定されたディレクトリの中にあるものの
それぞれについて、それがディレクトリならば、その名前を
角括弧で囲んだものを出力して、それがファイルならば、その名前と
大きさと最終更新時刻を出力します。
\begin{program}{dirlist.rb}
\begin{verbatim}
class String
def joinPath(p)
if self[size - 1, 1] == "/"
self + p
else
self + "/" + p
end
end
end
def dirlist(p)
Dir.entries(p).sort.each do |e|
pe = p.joinPath(e)
if File.directory?(pe)
("[" + e + "]\n").display
elsif File.file?(pe)
([e, File.size(pe), File.mtime(pe)].join(", ") +
"\n").display
end
end
end
if ARGV.size == 1
dirlist(ARGV[0])
else
"使い方: ruby dirlist.rb パス名\n".display
end
\end{verbatim}
\end{program}
\subsection{再帰的なディレクトリの処理}
メソッドを
再帰的に\index{さいきてきな@再帰的な}定義することによって、
指定されたディレクトリだけではなくて、そのディレクトリを
根とする木の全体を処理することができます。
次のプログラムは、指定されたディレクトリを根とする木の中にある
すべてのディレクトリについて、その大きさ(その中にある
ファイルの大きさの合計)を出力します。
\begin{program}{dirsize.rb}
\begin{verbatim}
class String
def joinPath(p)
if self[size - 1, 1] == "/"
self + p
else
self + "/" + p
end
end
end
def dirsize(p)
sum = 0
(Dir.entries(p) - [".", ".."]).each do |e|
pe = p.joinPath(e)
if File.directory?(pe)
sum += dirsize(pe)
elsif File.file?(pe)
sum += File.size(pe)
end
end
(p + ": " + sum.to_s + "\n").display
sum
end
if ARGV.size == 1
dirsize(ARGV[0])
else
"使い方: ruby dirsize.rb パス名\n".display
end
\end{verbatim}
\end{program}
\section{正規表現}\label{sec:regularexpression}
\subsection{正規表現とは何か}
文字列を処理するときには、しばしば、その中に含まれている特定の
パターン(構造)を探し出す必要が生じます。そして、パターンを
探し出すという処理を記述するためには、そのパターンそのものを
記述する方法が必要になります。文字列のパターンを記述する
方法としては、「正規表現」と呼ばれるものがもっともよく
使われています。
「正規表現\index{せいきひょうけん@正規表現}」
(regular expression)というのは、文字列を使って文字列の
パターンを表現するための言語のひとつです。また、この言語を
使って作られた文字列のことも、「正規表現」と呼ばれます。
正規表現によってあらわされるパターンと文字列とが
一致することを、正規表現(またはそれがあらわしている
パターン)と文字列とが
「マッチする\index{まっちする@マッチする}」(match)と
言います(名詞は
「マッチング\index{まっちんく@マッチング}」(matching)です)。
文字列を扱うプログラムの多くは、文字列のパターンを
表現するために正規表現を使っています。その代表的な例として、
grep\index{grep}というプログラムがあります。grepはフィルターの
一種で、コマンドライン引数として正規表現を受け取って、
読み込んだ文字列のうちで、受け取った正規表現とマッチする
文字列が含まれている行だけを出力する、という動作をします。
テキストエディターも、たいていのものは正規表現が扱えるように
作られています。また、sed\index{sed}、awk\index{awk}、
Perl\index{Perl}、Ruby\index{Ruby}のような、スクリプト言語と
呼ばれる言語の大多数は、その一部分として正規表現を
含んでいます。
\subsection{正規表現の基礎の基礎}
1個の特定の文字というパターンをあらわす正規表現は、たいていの
場合、その文字そのものです。たとえば、数字の\code{8}という
文字は、数字の\code{8}という正規表現によってあらわされます。
特定のパターンのうしろに特定のパターンが続いているという
構造のことを「連接\index{れんせつ@連接}」(sequence)と
呼びます。連接は、正規表現と正規表現とをパターンの
順番のとおりに並べることによって表現することができます。
たとえば、\code{pi}という正規表現は、\code{p}という
文字のうしろに\code{i}という文字が続いているというパターン、
つまり\code{pi}という文字列をあらわします。
ですから、たいていの場合、特定の文字列というパターンをあらわす
正規表現は、それとまったく同じ文字列になります。たとえば、
\code{kamome}という文字列は、\code{kamome}という
正規表現によってあらわされます。
\subsection{正規表現オブジェクト}
Rubyでは、正規表現は、
\code{Regexp}\index{Regexp@\code{Regexp}}というクラスの
インスタンスとして扱われます。このクラスのインスタンスは、
「正規表現オブジェクト
\index{せいきひょうけんおふしぇくと@正規表現オブジェクト}」
(regular expression object)と呼ばれます。
\code{Regexp}クラスのインスタンスを作る方法は二つあります。
ひとつは「正規表現リテラル
\index{せいきひょうけんりてらる@正規表現リテラル}」
(regular expression literal)と呼ばれるリテラルを書く方法で、
もうひとつは\code{Regexp}クラスが持っている\code{new}という
クラスメソッドを使う方法です。
正規表現リテラルは、
\begin{quote}
/\syntax{正規表現}/
\end{quote}
というように、正規表現の前後に
スラッシュ\index{すらっしゅ@スラッシュ}を書くことによって
作ります。正規表現リテラルを評価すると、その正規表現を
扱う正規表現オブジェクトが値として得られます。たとえば、
\begin{quote}
re = /suzume/
\end{quote}
という式を評価すると、\code{suzume}という正規表現を扱う
正規表現オブジェクトが作られて、それが\code{re}という変数に
代入されます。
\code{Regexp}クラスの\code{new}というクラスメソッドは、
文字列を正規表現オブジェクトに変換したいときに使われます。
このメソッドは、引数として1個の文字列を受け取って、
その文字列を正規表現オブジェクトに変換して、それを戻り値として
返します。たとえば、
\begin{quote}
re = Regexp.new("uguisu")
\end{quote}
という式を評価すると、\code{uguisu}という正規表現を扱う
正規表現オブジェクトが作られて、それが\code{re}という変数に
代入されます。
\subsection{マッチングの演算}
文字列の中に含まれている特定のパターンを探し出したいときは、
正規表現オブジェクトが持っている
\code{=\ti}\index{=~@\code{=\ti}}という演算を使います。
この演算は、引数として文字列を受け取って、レシーバーと
マッチする部分文字列を引数の中で探索します。そして、マッチする
部分文字列のうちで、もっとも左にあるものの位置をあらわす
整数(先頭の文字を0番目と数えます)を戻り値として返します。
たとえば、
\begin{quote}
\verb|/game/ =~ "oyagamekogame"|
\end{quote}
という式を評価したとすると、値として3という整数が得られます。
レシーバーとマッチする部分文字列が引数の中にまったく存在しない
場合、\code{=\ti}は、戻り値として\code{nil}を返します。
\code{=\ti}の戻り値を真偽値と解釈すると、整数は真という
意味で、\code{nil}は偽という意味になります。ですから、
\code{=\ti}は、文字列の中に正規表現とマッチする部分文字列が
含まれているかどうかを調べる述語だと考えることもできます。
つまり、
\begin{syntaxquote}
if \fbox{正規表現} =\ti\ \fbox{文字列} \\
\inkuu \framebox[15zw][l]{マッチした場合の処理} \\
else \\
\inkuu \framebox[15zw][l]{マッチしなかった場合の処理} \\
end
\end{syntaxquote}
という形の\code{if}式を書くことによって、特定のパターンと
マッチする部分文字列が文字列の中に含まれているかどうかで動作を
選択することができる、ということです。
次のプログラムは、grepとほぼ同じ動作をするフィルターをRubyで
書いてみたものです。
\begin{program}{grep.rb}
\begin{verbatim}
re = Regexp.new(ARGV.shift)
ARGF.each do |line|
if re =~ line
line.display
end
end
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
$ ruby grep.rb line grep.rb
ARGF.each do |line|
if re =~ line
line.display
\end{verbatim}
\end{jikkourei}
正規表現オブジェクトだけではなくて、文字列のオブジェクトも、
文字列の中に含まれている特定のパターンを探し出す、
\code{=\ti}\index{=~@\code{=\ti}}という演算を持っています。
正規表現オブジェクトの\code{=\ti}と文字列のオブジェクトの
\code{=\ti}は、レシーバーと引数が逆になっているという点が
違うだけで、それ以外の動作は同じです。ですから、
\begin{quote}
\verb|"oyagamekogame" =~ /game/|
\end{quote}
という式を評価したとすると、値として3という整数が得られます。
\subsection{メタ文字}
正規表現を構成するそれぞれの文字は、基本的には、自分自身という
パターンを意味しています。しかし、特定の文字列ではなくて、
いくつかの文字列とマッチするようなパターンを表現するためには、
自分自身ではない特別な意味をいくつかの文字に与える
必要があります。
正規表現を書くために使われる、自分自身ではなくて何か別のことを
意味している文字は、「メタ文字\index{めたもし@メタ文字}」
(metacharacter)と呼ばれます。
どの文字をメタ文字として使うのかというのは、正規表現を扱う
プログラムごとに多少の違いがありますが、
それらのプログラムのうちの多くは、
\begin{quote}
\verb_\ . [ ] - ^ $ * + ? { } ( ) |_
\end{quote}
というような文字をメタ文字として使っていて、それぞれの
メタ文字の意味も、ほぼ統一されています。
\subsection{エスケープ}
ところで、メタ文字自身をあらわす正規表現、つまり特定の
メタ文字だけとマッチする正規表現は、どのように
書けばいいのでしょうか。たとえば、ドット(\code{.})という
メタ文字とマッチする正規表現というのは、いったい
どう書くのでしょう。
メタ文字は、自分自身という意味を持っていませんので、
メタ文字自身をあらわす正規表現を書くためには、メタ文字が
持っている本来の意味を、その文字自身という意味に
変更しないといけません。文字が持っている本来の意味を別の意味に
変更するすることを、文字を
「エスケープする\index{えすけえふする@エスケープする}」
(escape)と言います。
文字をエスケープしたいときは、
バックスラッシュ\index{はっくすらっしゅ@バックスラッシュ}%
(\code{\bs}\index{\@\code{\bs}})というメタ文字を使います。
バックスラッシュというのは、その直後に書かれた文字を
エスケープするという意味を持つ文字です。
バックスラッシュでメタ文字をエスケープすると、その文字の
意味は、メタ文字としての意味から、その文字自身という意味に
変更されます。たとえば、ドット(\code{.})というのは
メタ文字ですので、ドット自身ではなくてメタ文字としての意味を
持っています。しかし、\code{\bs .}というように、
バックスラッシュの右側にドットを書くと、その2文字は、
ドット自身をあらわす正規表現になります。
ちなみに、バックスラッシュ自身もメタ文字ですから、
バックスラッシュ自身をあらわす正規表現は、
\code{\bs \bs}\index{\\@\code{\bs \bs}}と書く必要があります。
また、スラッシュ\index{すらっしゅ@スラッシュ}(\code{/})という
文字はメタ文字ではありませんが、正規表現リテラルを作るための
特別な文字ですので、正規表現リテラルの中でスラッシュ自身を
記述するためには、\code{\bs /}というように、バックスラッシュを
使ってエスケープしないといけません。
バックスラッシュによってエスケープすることができるのは、
メタ文字だけではありません。メタ文字ではない文字を
エスケープするということも可能です。つまり、自分自身という
本来の意味を持っている文字に対して別の意味を与える、
ということもできるわけです。
メタ文字ではない文字のいくつかは、それをバックスラッシュで
エスケープすると、その文字自身とは異なる意味を持つ
正規表現になります。たとえば、英小文字の\code{n}は
メタ文字ではありませんので、自分自身というのが本来の
意味ですが、バックスラッシュでエスケープした
\code{\bs n}\index{\n@\code{\bs n}}という2文字は、
改行\index{かいきょう@改行}(newline)という文字をあらわす
正規表現になります。同じように、
\code{\bs r}\index{\r@\code{\bs r}}はキャリッジリターン
\index{きゃりっしりたあん@キャリッジリターン}%
(carriage return)、\code{\bs t}\index{\t@\code{\bs t}}は
タブ\index{たふ@タブ}(tab)、
\code{\bs f}\index{\f@\code{\bs f}}は
改ページ\index{かいへえし@改ページ}(formfeed)という文字を
あらわす正規表現です。ちなみに、空白、タブ、改行、
キャリッジリターン、改ページ、という5種類の文字は、総称して
「ホワイトスペース
\index{ほわいとすへえす@ホワイトスペース}」(white space)と
呼ばれます。
\subsection{文字クラス}
文字の集合のことを
「文字クラス\index{もしくらす@文字クラス}」
(character class)と呼びます。正規表現は、指定された
文字クラスに属する任意の文字というパターンを表現することも
可能です。
すべての文字の集合(ただし改行は除きます)という文字クラスに
属する任意の文字というパターンは、ドット
\index{とっと@ドット!せいきひょうけんの@正規表現の\baidash}%
(\code{.}%
\index{.@\code{.}!せいきひょうけんの@正規表現の\baidash})%
というメタ文字によってあらわされます。たとえば、
\code{yu.iko}という正規表現は、\code{yu}と
\code{iko}とのあいだに1個の任意の文字がある、というパターンを
あらわしています。
それでは、irbを使って確かめてみましょう。
\begin{quote}
/yu.iko/ =\ti\ "yumiko"
\end{quote}
という式を入力してみてください。\code{yu.iko}という
正規表現は、\code{yumiko}という文字列の全体と
マッチしますので、文字列の先頭を意味する0という整数が
戻り値として返ってきます。右辺の文字列を、\code{yukiko}、
\code{yuriko}、\code{yu8iko}、\code{yu@iko}などに変えても、
同じように0が返ってくるはずです。しかし、ドットという
正規表現は、あくまで1個の文字としかマッチしませんので、
右辺が\code{yushiko}という文字列だと、戻り値として
\code{nil}が返ってきます。
文字を列挙することによって文字クラスを指定したいときは、
角括弧\index{かくかっこ@角括弧!せいきひょうけんの@
正規表現の\baidash}(\code{[\,]}%
\index{[]@\code{[\,]}!せいきひょうけんの@正規表現の\baidash})%
というメタ文字を使います。文字クラスに属する文字を角括弧の中に
列挙したものは、その文字クラスに含まれる任意の文字という
パターンをあらわす正規表現になります。たとえば、
\code{yu[mkr]iko}という正規表現は、\code{yu}と
\code{iko}とのあいだに、\code{m}、\code{k}、\code{r}のうちの
いずれかひとつがある、というパターンをあらわしています。
ですから、
\begin{quote}
/yu[mkr]iko/ =\ti\ "yumiko"
\end{quote}
という式の値は0ですが、
\begin{quote}
/yu[mkr]iko/ =\ti\ "yubiko"
\end{quote}
という式の値は\code{nil}になります。
文字を列挙することによって文字クラスを指定するのではなくて、
文字コードの範囲を指定することによって文字クラスを指定する、
ということも可能です。
文字コードの範囲で文字クラスを指定したいときは、
マイナス\index{まいなす@マイナス}(\code{-}%
\index{-@\code{-}!せいきひょうけんの@正規表現の\baidash})%
というメタ文字を使います。角括弧の中に、
\begin{quote}
\syntax{文字$_{1}$} - \syntax{文字$_{2}$}
\end{quote}
という形のものを書くと、それは、文字$_{1}$から
文字$_{2}$までという文字コードの範囲に含まれるすべての文字を
列挙したのと同じ意味になります。たとえば、\code{[a-z]}という
正規表現は、任意の英字の小文字というパターンをあらわします。
ですから、
\begin{quote}
/yu[a-z]iko/ =\ti\ "yumiko"
\end{quote}
という式の値は0になります。右辺の文字列を\code{yukiko}や
\code{yubiko}や\code{yuxiko}などに変えても同じです。しかし、
\code{yuMiko}や\code{yu8iko}や\code{yu@iko}などだと
\code{nil}になります。
文字クラスを指定する方法には、それに属する文字について
記述するという方法のほかに、それに属さない文字について
記述するという方法もあります。
属さない文字を記述することによって文字クラスを
指定したいときは、サーカムフレックス
\index{さあかむふれっくす@サーカムフレックス}%
(\code{\cf}\index{^@\code{\cf}})というメタ文字を使います。
左角括弧の直後にサーカムフレックスを書くと、文字クラスは、
それに属する文字によって記述されるのではなくて、それに属さない
文字によって記述されることになります。たとえば、
\code{[\cf d]}という正規表現は、\code{d}という文字を除いた
すべての文字、というパターンをあらわします。ですから、
\begin{quote}
/yu[\cf m]iko/ =\ti\ "yumiko"
\end{quote}
という式の値は\code{nil}になりますが、右辺の文字列を
\code{yukiko}や\code{yuxiko}や\code{yu8iko}や
\code{yu@iko}などに変えると、0になります。
サーカムフレックスとマイナスとを組み合わせることも可能です。
たとえば、\code{[\cf A-Za-z]}という正規表現は、英字以外の
すべての文字、というパターンをあらわします。ですから、
\begin{quote}
/yu[\cf A-Za-z]iko/ =\ti\ "yumiko"
\end{quote}
という式の値は\code{nil}になります。右辺の文字列を
\code{yukiko}や\code{yuxiko}や\code{yuMiko}などに変えても
同じです。しかし、\code{yu8iko}や\code{yu@iko}などに変えると、
0になります。
文字クラスをあらわす角括弧の中では、大多数のメタ文字は、
バックスラッシュでエスケープしなくても自分自身をあらわします。
角括弧の中でもかならずエスケープしないといけないメタ文字は、
バックスラッシュのみです。右角括弧(\code{]})は、
左角括弧(\code{[})の直後に書いた場合、自分自身をあらわします。
マイナス(\code{-})は、左角括弧の直後または右角括弧の直前に
書けば自分自身という意味になります。そして、
サーカムフレックス(\code{\cf})も、左角括弧の直後でなければ
自分自身をあらわします。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|l|} \hline
\multicolumn{1}{|c|}{略記法} &
\multicolumn{1}{c|}{もとの正規表現} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
\bs d & [0-9] & 数字 \\ \hline
\bs D & [\cf 0-9] & 数字以外 \\ \hline
\bs w & [0-9A-Za-z] & 英数字 \\ \hline
\bs W & [\cf 0-9A-Za-z] & 英数字以外 \\ \hline
\bs s & \verb|[ \t\n\r\f]| & ホワイトスペース \\ \hline
\bs S & \verb|[^ \t\n\r\f]| & ホワイトスペース以外
\\ \hline
\end{tabular}
\end{ttfamily}
\caption{文字クラスの略記法}\label{tab:charclassshorthand}
\index{\d@\code{\bs d}}
\index{\D@\code{\bs D}}
\index{\w@\code{\bs w}}
\index{\W@\code{\bs W}}
\index{\s@\code{\bs s}}
\index{\S@\code{\bs S}}
\end{table}
なお、文字クラスのうちで、しばしば使われる
いくつかのものについては、図\ref{tab:charclassshorthand}に
示したような略記法があります。
\index{りゃっきほう@略記法!もしくらすの@文字クラスの\baidash}%
\index{もしくらす@文字クラス!0のりゃっきほう@
\baidash の略記法}%
\subsection{繰り返し}
メタ文字を使うことによって、同じパターンがいくつも
繰り返されている、というパターンをあらわす正規表現を作ることも
可能です。
0回以上の繰り返しを表現したいときは、
アスタリスク\index{あすたりすく@アスタリスク}(\code{*}%
\index{*@\code{*}!せいきひょうけんの@正規表現の\baidash})%
というメタ文字を使います。何らかの正規表現の直後に
アスタリスクを書いたものは、その正規表現によってあらわされた
パターンが0回以上繰り返されたもの、というパターンを意味する
正規表現になります。たとえば、\code{m*}という正規表現は、
長さが0以上の\code{m}の列、というパターンをあらわします。
ですから、
\begin{quote}
/yum*iko/ =\ti\ "yuiko"
\end{quote}
という式の値は0になります。右辺の文字列を\code{yumiko}や
\code{yummiko}や\code{yummmiko}や\code{yummmmiko}などに
変えても同じです。
同じように、\code{[mk]*}という正規表現は、\code{m}または
\code{k}から構成される、長さが0以上の文字列とマッチします。
それでは、
\begin{quote}
/yu[mk]*iko/ =\ti\ "yuiko"
\end{quote}
という式の右辺を、\code{yumiko}、\code{yukiko}、
\code{yukmiko}、\code{yumkiko}、\code{yukmmiko}、
\code{yumkmmkiko}などに変えて試してみてください。
1回以上の繰り返しとはマッチするけれども、繰り返しの回数が
0回のときはマッチしないようにしたい、というときは、
アスタリスクの代わりにプラス\index{ふらす@プラス}(\code{+}%
\index{+@\code{+}!せいきひょうけんの@正規表現の\baidash})%
というメタ文字を使います。たとえば、\code{m+}という
正規表現は、長さが1以上の\code{m}の列、というパターンを
あらわします。ですから、
\begin{quote}
/yum+iko/ =\ti\ "yumiko"
\end{quote}
という式の値は0で、右辺の文字列を\code{yummiko}や
\code{yummmiko}や\code{yummmmiko}などに変えても同じですが、
\code{yuiko}に変えると\code{nil}になります。
任意の回数の繰り返しではなくて、0回と1回の繰り返しだけと
マッチする正規表現を書きたい、というときは、クエスチョンマーク
\index{くえすちょんまあく
@クエスチョンマーク!せいきひょうけんの@正規表現の\baidash}%
(\code{?}\index{?@\code{?}!せいきひょうけんの@
正規表現の\baidash})というメタ文字を使います。たとえば、
\code{m?}という正規表現は、空文字列または\code{m}、という
パターンをあらわします。ですから、
\begin{quote}
/yum?iko/ =\ti\ "yumiko"
\end{quote}
という式の値は0で、右辺の文字列を\code{yuiko}に変えても
同じですが、\code{yummiko}に変えると\code{nil}になります。
繰り返しの回数を整数で指定したいときは、
中括弧\index{ちゅうかっこ@中括弧!せいきひょうけんの@
正規表現の\baidash}(\code{\lb\,\rb}%
\index{"{"}@\code{\lb\,\rb}!せいきひょうけんの@
正規表現の\baidash})というメタ文字を使います。たとえば、
\code{a\lb 4\rb}という正規表現は、\code{aaaa}というパターンを
あらわします。
$n$回から$m$回までの繰り返しをあらわす正規表現は、やはり
中括弧を使って、\code{\lb $n$,$m$\rb}と書きます。たとえば、
\code{a\lb 4,7\rb}という正規表現は、長さが4から7までの
\code{a}の列、というパターンをあらわします。
$n$回以上の任意の回数の繰り返しをあらわす正規表現は、
\code{\lb $n$,\rb}と書きます。たとえば、
\code{a\lb 4,\rb}という正規表現は、長さが4以上の\code{a}の列、
というパターンをあらわします。
繰り返しの対象となる正規表現の範囲は、繰り返しをあらわす記述の
直前にあるものだけ、という点に注意してください。つまり、
\code{mi+}という正規表現で繰り返しの対象になるのは、
\code{mi}ではなくて、\code{i}だということです。
いくつかの正規表現の列を繰り返しの対象として指定したいときは、
丸括弧\index{まるかっこ@丸括弧!せいきひょうけんの@
正規表現の\baidash}%
\index{()@\code{(\,)}!せいきひょうけんの@正規表現の\baidash}%
というメタ文字で、指定したい正規表現の列を囲みます。たとえば、
\code{(mi)+}という正規表現は、\code{mi}という文字列を
1回以上繰り返したもの、というパターンをあらわします。
ですから、
\begin{quote}
/yu(mi)+ko/ =\ti\ "yumiko"
\end{quote}
という式の値は0で、右辺の文字列を\code{yumimiko}や
\code{yumimimiko}などに変えても同じです。
\subsection{選択}
二つのパターンのうちのどちらか、というパターンの選択を
表現したいときは、縦棒\index{たてほう@縦棒}(\code{|}%
\index{"|@\code{|}!せいきひょうけんの@正規表現の\baidash})%
というメタ文字を使います。
縦棒を使って選択を記述したいときは、
\begin{quote}
\syntax{正規表現の列} | \syntax{正規表現の列}
\end{quote}
という形の正規表現を書きます。そうすると、縦棒の左右に書かれた
それぞれの正規表現の列があらわしているパターンのどちらか、
という意味の正規表現になります。たとえば、
\code{a|b}という正規表現は、\code{a}または\code{b}のどちらか、
というパターンをあらわします。選択の対象がさらに
選択であってもかまいませんので、\code{a|b|c}という正規表現を
書くことによって、\code{a}または\code{b}または
\code{c}のいずれか、というパターンをあらわすことも可能です。
縦棒による選択の範囲は、その直前と直後の
正規表現だけではなくて、そのさらに左や右にも及ぶ、という点に
注意してください。つまり、\code{ab|cd}という正規表現と
マッチする文字列は、\code{abd}と\code{acd}ではなくて、
\code{ab}と\code{cd}だということです。
選択の対象となる正規表現の範囲を狭く限定したいときは、
その範囲を丸括弧\index{まるかっこ@丸括弧!せいきひょうけんの@
正規表現の\baidash}%
\index{()@\code{(\,)}!せいきひょうけんの@正規表現の\baidash}で
囲みます。たとえば、\code{a(b|c)d}という正規表現は、
\code{abd}と\code{acd}という二つの文字列とマッチします。
同じように、\code{ma(ri\vl sa)ko}という正規表現は、
\code{mariko}と\code{masako}という二つの文字列と
マッチしますので、
\begin{quote}
/ma(ri\vl sa)ko/ =\ti\ "mariko"
\end{quote}
という式の値は0で、右辺の文字列を\code{masako}に変えても、
やはり0です。
\subsection{アンカー}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{アンカー} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
\cf & 行の先頭(文字列の先頭または改行の直後) \\ \hline
\$ & 行の末尾(文字列の末尾または改行の直前) \\ \hline
\bs A & \cf と同じ \\ \hline
\bs Z & \$と同じ \\ \hline
\bs z & 文字列の末尾(改行は意識しない) \\ \hline
\bs b & 単語の境界(角括弧の中ではバックスペース)
\\ \hline
\bs B & 単語の境界ではない位置 \\ \hline
\bs G & 前回の探索でマッチした部分文字列の末尾 \\ \hline
(?=$r$) & 正規表現$r$とマッチした位置 \\ \hline
(?!$r$) & 正規表現$r$とはマッチしない位置 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{アンカー}\label{tab:anchor}
\index{^@\code{\cf}}
\index{$@\code{\$}}
\index{\A@\code{\bs A}}
\index{\Z@\code{\bs Z}}
\index{\z@\code{\bs z}}
\index{\b@\code{\bs b}}
\index{\B@\code{\bs B}}
\index{\G@\code{\bs G}}
\index{(?=)@\code{(?=$r$)}}
\index{(?"!)@\code{(?!$r$)}}
\end{table}
パターンが文字列の中の特定の位置にあるときだけマッチする
正規表現を書きたいときは、文字列の中の特定の位置を指定する
正規表現を使います。そのような正規表現は、
「アンカー\index{あんかあ@アンカー}」(anchor)と呼ばれます。
表\ref{tab:anchor}は、アンカーにはどのようなものがあるか
ということを示したものです。
たとえば、行の先頭(文字列の先頭または改行の直後)という位置を
指定したいときは、サーカムフレックス
\index{さあかむふれっくす@サーカムフレックス}%
(\code{\cf}\index{^@\code{\cf}})というメタ文字をアンカーとして
使います。たとえば、
\begin{quote}
\verb|/xyz/ =~ "cccxyzccc\nxyzccc"|
\end{quote}
という式の値は3ですが、
\begin{quote}
\verb|/^xyz/ =~ "cccxyzccc\nxyzccc"|
\end{quote}
という式の値は10になります。
行の末尾(文字列の末尾または改行の直前)という位置を
指定したいときは、ドルマーク\index{とるまあく@ドルマーク}%
(\code{\$}\index{$@\code{\$}})というメタ文字をアンカーとして
使います。たとえば、
\begin{quote}
\verb|/xyz/ =~ "cccxyzcccxyz\nccc"|
\end{quote}
という式の値は3ですが、
\begin{quote}
\verb|/xyz$/ =~ "cccxyzcccxyz\nccc"|
\end{quote}
という式の値は9になります。
\subsection{部分文字列の置き換え}
文字列のオブジェクトは、正規表現を扱うことのできるさまざまな
メソッドを持っています。それらのメソッドを使うことによって、
単にパターンを探し出すだけではなくて、発見された
パターンに対してさまざまな処理を実行することができます。
第\ref{sec:message}節と第\ref{sec:iteratior}節で紹介した
\code{gsub}\index{gsub@\code{gsub}}も、正規表現を
扱うことのできるメソッドのひとつです。
\code{gsub}は、レシーバーの中で部分文字列を探索して、
発見された部分文字列を別の文字列に置き換えることによってできる
文字列を戻り値として返すメソッドです。実は、\code{gsub}が
探索する部分文字列というのは、正規表現で指定することも
可能なのです。
1個目の引数として正規表現を渡して\code{gsub}を呼び出すと、
\code{gsub}は、その正規表現とマッチしたすべての部分文字列を、
2個目の引数またはブロックの中の式の値に置き換えます。
たとえば、
\begin{quote}
"ccc3017cc529cccc84122cc".gsub(/[0-9]+/, "///")
\end{quote}
という式を評価したとすると、その値として、
\begin{quote}
"ccc///cc///cccc///cc"
\end{quote}
という文字列が得られます。
次のプログラムは、読み込んだ文字列のうちで、指定された
パターンとマッチする部分文字列を別の文字列に置き換えたものを
標準出力に書き込む、という動作をするフィルターです。
\begin{program}{replace.rb}
\begin{verbatim}
re = Regexp.new(ARGV.shift)
s = ARGV.shift
ARGF.read.gsub(re, s).display
\end{verbatim}
\end{program}
\begin{jikkourei}
\begin{verbatim}
$ ruby replace.rb [a-z] x replace.rb
xx = Rxxxxx.xxx(ARGV.xxxxx)
x = ARGV.xxxxx
ARGF.xxxx.xxxx(xx, x).xxxxxxx
\end{verbatim}
\end{jikkourei}
\subsection{文字列の分解}
文字列のオブジェクトは、引数として与えられた
正規表現にしたがってレシーバーをいくつかの部分に分解して、
それらの部分から構成される配列を戻り値として返すメソッドを、
二つ持っています。ひとつは\code{scan}、もうひとつは
\code{split}です。
\code{scan}\index{scan@\code{scan}}は、引数として正規表現を
受け取って、レシーバーから、引数とマッチしたすべての
部分文字列を取り出して、それらから構成される配列を戻り値として
返すメソッドです。たとえば、
\begin{quote}
"ccc4372ccccc691cccc80115ccc".scan(/[0-9]+/)
\end{quote}
という式を評価すると、
\begin{quote}
["4372", "691", "80115"]
\end{quote}
という配列が値として得られます。
\code{split}%
\index{split@\code{split}!もしれつの@文字列の\baidash}は、
第\ref{sec:array}節で紹介したように、レシーバーを
いくつかの部分に区切って、それぞれの部分から構成される配列を
戻り値として返すメソッドです。
引数として正規表現を渡して\code{split}を呼び出すと、
\code{split}は、それがあらわしているパターンでレシーバーを
区切ります。たとえば、
\begin{quote}
\verb|"east, west , north ,south".split(/ *, */)|
\end{quote}
という式を評価すると、
\begin{quote}
["east", "west", "north", "south"]
\end{quote}
という配列が値として得られます。
ちなみに、\code{/ *, */}という正規表現を引数として
渡すのではなくて、
\begin{quote}
\verb|"east, west , north ,south".split(",")|
\end{quote}
というように、\code{","}という文字列を引数として渡して
\code{split}を呼び出した場合は、
\begin{quote}
["east", " west ", " north ", "south"]
\end{quote}
というように、コンマの前後の空白が、単語の前後に
残されることになります。
\chapter{ネットワーク}\label{chap:network}
\section{ネットワークの基礎}\label{sec:foundationofnetwork}
\subsection{サーバーとクライアント}
ネットワークを利用して通信をするプログラムのペアは、普通、
両者の関係が対等ではなくて、一方はサービスを提供する側で、
他方はそのサービスを利用する側、というように役割が
分化しています。サービスを提供するプログラムは
「サーバー\index{さあはあ@サーバー}」(server)と呼ばれ、
サービスを利用するプログラムは
「クライアント\index{くらいあんと@クライアント}」(client)と
呼ばれます。
サーバーは、コンピュータの上で常に動作し続けていて、
クライアントからの接続を待っています。そして、クライアントが
自分に接続して何らかの要求を送ってきた場合、その要求に
したがってクライアントにサービスを提供します。
クライアントがサーバーに接続してから、その接続を
終了するまでの期間に両者のあいだで交される一連の通信は、
「セッション\index{せっしょん@セッション}」(session)と
呼ばれます。
プログラムとプログラムとが通信をするためには、両者が、
あらかじめ定められている通信のための規約にしたがって動作する
必要があります。そのような規約は、
「プロトコル\index{ふろとこる@プロトコル}」(protocol)と
呼ばれます。標準として使われるプロトコルについては、
IETF\index{IETF}(Internet Engineering Task Force)という名前の
組織で議論されています\footnote{IETFのURLは
\code{http://www.ietf.org/}です。}。
IETFは、標準として提案されたプロトコルを
RFC\index{RFC}(Request For Comments)と呼ばれる文書にして
公開しています。それぞれのRFCには番号が与えられていて、
RFC2822とかRFC2396というような記述で、特定のRFCに
言及することができるようになっています\footnote{RFCは、
\code{http://www.rfc-editor.org/rfc/}などのサイトから
ダウンロードすることができます。}。
\subsection{IPアドレス}
ネットワークに接続されているコンピュータのことを
「ホスト\index{ほすと@ホスト}」(host)と呼びます。プログラムと
プログラムとが通信をするためには、相手のプログラムが
動作しているホストを識別する必要があります。
ホストはかならず、ほかのホストが自分を
識別することができるように、
「IPアドレス\index{IPあとれす@IPアドレス}」(IP address)と
呼ばれる番号を持っています(RFC791)。
IPアドレスは、32個のビットから構成される列です。それを
書きあらわすときは、普通、それを8ビットずつに4等分して、
それぞれの部分を10進数にして、それらをドット
\index{とっと@ドット!IPあとれすの@IPアドレスの\baidash}%
(\code{.}%
\index{.@\code{.}!IPあとれすの@IPアドレスの\baidash})で
区切ります。たとえば、
\begin{quote}
11010011000001100110110100110010
\end{quote}
というIPアドレスは、
\begin{quote}
211.6.109.50
\end{quote}
と書きあらわされます。
\subsection{ホスト名}
IPアドレスというのは人間にとっては扱いにくいものなので、
英字や数字などを使って作られた
「ホスト名\index{ほすとめい@ホスト名}」(host name)と呼ばれる
名前を使ってホストを識別することもできるようになっています。
しかし、膨大な台数のホストが接続されているネットワークでは、
それぞれのホストのホスト名を管理することがきわめて困難です。
そのため、大規模なネットワークでは、ネットワークを
「ドメイン\index{とめいん@ドメイン}」(domain)と呼ばれる領域に
分割して、それぞれのドメインごとにホスト名を
管理することができるようにしています。ドメインは、その中を
さらにドメインに分割することも可能です。ですから、
ドメインというのは、ディレクトリと同じように階層的な構造を
持つことになります。
ドメインは、「ドメイン名\index{とめいんめい@ドメイン名}」
(domain name)と呼ばれる名前によって識別されます。そして、
ネットワーク上のホストは、ドメイン名によって修飾された
ホスト名によって識別されることになります。
ドメイン名でホスト名を修飾したいときは、左端にホスト名を
書いて、その右側に、階層の下にあるものから上にあるものへ順番に
ドメイン名を並べていって、それらのあいだを
ドット\index{とっと@ドット!ほすとめいの@ホスト名の\baidash}%
(\code{.}\index{.@\code{.}!ほすとめいの@ホスト名の\baidash})で
区切ります。つまり、
\begin{quote}
\syntax{ホスト名}.\syntax{ドメイン名}.\ \tenten\ .%
\syntax{ドメイン名}
\end{quote}
というように書くわけです。たとえば、\code{com}という
ドメインの中の\code{example}というドメインの中の
\code{www}というホストを指定したいときは、
\begin{quote}
www.example.com
\end{quote}
という名前を書けばいいわけです。
なお、個々のホストに付けられた名前というのが「ホスト名」という
言葉の本来の意味ですが、普通、ホスト名とドメイン名から
構成される名前の列のことも「ホスト名」と呼ばれます。
\subsection{ポート}
クライアントがサーバーに接続するためには、そのサーバーが
動作しているホストを指定する必要があるわけですが、それだけでは
まだ充分ではありません。ひとつのホストの上で動作している
サーバーはひとつだけとは限らないからです。
ホストが持っている通信のための出入口のことを
「ポート\index{ほおと@ポート}」(port)と呼びます。1台のホストは
いくつものポートを持っていて、サーバーは、
それらのポートのうちのどれかひとつを使ってクライアントからの
接続を待っています。ですから、クライアントは、ポートを
指定することによって特定のサーバーに
接続することができるわけです。
ポートは、「ポート番号\index{ほおとはんこう@ポート番号}」
(port number)と呼ばれる番号によって識別されます。
ポート番号は、0から65535までの整数です。標準として使われる
プロトコルは、何番のポートを使うのかということも定めていて、
それらのポートは
「well-knownポート\index{well-knownほおと@well-knownポート}」
(well-known port)と呼ばれます。
\subsection{ソケット}
プログラムにとって、通信の相手となるプログラムは、そこから
データを読み込んだりそこへデータを書き込んだりすることのできる
対象として見えます。プログラムが別のプログラムと
通信をするためには、通信の相手をあらわすオブジェクトを作る
必要があります。そのようなオブジェクトは、
「ソケット\index{そけっと@ソケット}」(socket)と呼ばれます。
Rubyでは、データの読み書きの対象は、
\code{IO}\index{IO@\code{IO}}というクラスの
インスタンスによってあらわされます。\code{IO}クラスの
インスタンスは
「IOオブジェクト\index{IOおふしぇくと@IOオブジェクト}」と
呼ばれ、それは、データを読み込んだり
書き込んだりするためのさまざまなメソッドを持っています。
ソケットというのもデータの読み書きの対象ですので、Rubyでは、
各種のソケットのクラスは、すべて\code{IO}クラスを
継承しています。つまり、RubyのソケットはIOオブジェクトの
一種だということです。したがって、相手のプログラムにデータを
送信したり、送られてきたデータを受信したりしたいときは、
ソケットのクラスが\code{IO}クラスから継承した読み書きの
メソッドを、どれでも使うことができます。
各種のソケットのクラスはRubyの
組み込みクラスではありませんので、それらのクラスを利用する
プログラムは、それらを定義しているライブラリーを読み込む
必要があります。各種のソケットのクラスは、
\code{socket}\index{socket@\code{socket}}という名前の
ライブラリーの中で定義されています。ですから、プログラムの
先頭に、
\begin{quote}
require("socket")
\end{quote}
という式を書いておけば、各種のソケットのクラスを
利用することができるようになります。
\subsection{TCP}
ネットワークを使って通信をするプログラムは、地層のように
積み重なったいくつかのプロトコルを使うことになります。
ネットワークで利用されるさまざまなサービスは、
それぞれのサービスごとのプロトコルを持っているわけですが、
それらのプロトコルのひとつ下の層としては、多くの場合、
TCP\index{TCP}(Transmission Control Protocol)という名前の
プロトコル(RFC793)が使われています。
TCPを使って通信をするクライアントを書きたいときは、
\code{TCPSocket}\index{TCPSocket@\code{TCPSocket}}という
クラスから生成されたソケットを使います。このクラスは、
\code{open}%
\index{open@\code{open}!そけっとの@ソケットの\baidash}という
クラスメソッドを持っていて、このメソッドを使うことによって、
クライアントから見たTCPによる通信の相手をあらわすソケットを
生成することができます。
\code{TCPSocket}クラスの\code{open}は、$h$が通信先の
ホスト名で、$p$が利用したいサービスのポート番号だとするとき、
\begin{quote}
TCPSocket.open($h$, $p$)
\end{quote}
という式で呼び出します。そうすると、\code{open}は、指定された
ホストの指定されたポートでサービスを提供しているプログラムを
あらわすソケットを生成して、それを戻り値として返します。
たとえば、
\begin{quote}
sock = TCPSocket.open("www.example.com", 80)
\end{quote}
という式を評価することによって、\code{www.example.com}という
ホストの80番のポートでサービスを提供しているプログラムを
あらわすソケットを生成して、それを\code{sock}という変数に
代入することができます。
ソケットを生成したあとは、それが持っている読み込みのメソッドを
使ってデータを受信したり、書き込みのメソッドを使ってデータを
送信したりすることができます。
そして、通信が終了したときは、かならずその
後始末をしないといけません。ファイルの後始末と同じように、
ソケットの後始末をすることも、ソケットを
「クローズする\index{くろおすする@クローズする}」(close)と
言います。ソケットのクローズは、ソケットが持っている
\code{close}\index{close@\code{close}}というメソッドを
使うことによって実行することができます。たとえば、
\code{sock}という変数がソケットを指し示しているとするならば、
\begin{quote}
sock.close
\end{quote}
という式を評価することによって、ソケットを
クローズすることができます。
\subsection{改行}
どのような文字を使って改行\index{かいきょう@改行}を
あらわすかというのは、オペレーティングシステムごとに
異なっています。MacOSでは文字コードが13の
CR\index{CR}(carriage return)と呼ばれる文字が使われ、UNIXでは
文字コードが10のLF\index{LF}(line feed)と呼ばれる文字が
使われ、Windowsでは、CRLF\index{CRLF}、つまりCRとLFから
構成される文字列が使われます。
しかし、プログラムが別のプログラムと通信をするときに、相手の
オペレーティングシステムによって改行の文字を使い分ける
必要はありません。なぜなら、通信で使われる改行はCRLFに
統一されているからです。
文字列をあらわすリテラルの中では、CRは\code{\bs r}という
記述であらわされ、LFは\code{\bs n}という記述であらわされます。
ですから、\code{"\bs r\bs n"}というリテラルを
書くことによって、CRLFをあらわすことができます。
受信した行の末尾に付いているCRLFを取り除きたいときは、
文字列が持っている\code{chomp}\index{chomp@\code{chomp}}という
メソッドに、引数として\code{"\bs r\bs n"}を渡します。たとえば、
\code{sock}という変数がソケットを指し示しているとするとき、
\begin{quote}
\verb|line = sock.gets.chomp("\r\n")|
\end{quote}
という式を書くことによって、1個の行を受信して、その行末から
CRLFを取り除いたものを\code{line}に代入する、
ということができます。
\subsection{クライアントのクラス}
次のプログラムは、クライアントをあらわす\code{Client}という
クラスを定義します。
\begin{program}{client.rb}
\begin{verbatim}
require("socket")
class Client
def initialize(host, port)
@socket = TCPSocket.open(host, port)
end
def close
@socket.close
end
def read(length)
if length == 0
@socket.read
else
@socket.read(length)
end
end
def send(s)
("C: " + s + "\n").display
@socket.write(s + "\r\n")
end
def receive
line = @socket.gets.chomp("\r\n")
("S: " + line + "\n").display
line
end
def sendReceive(s)
send(s)
receive
end
end
\end{verbatim}
\end{program}
このクラスの中で定義されている\code{read}というメソッドは、
引数としてデータの大きさを受け取って(単位はバイト)、
その大きさのデータをサーバーから受信します。引数として0を
渡すと、セッションが終了するまでデータを受信し続けます。
\code{send}というメソッドは、引数として文字列を受け取って、
それを標準出力に出力して、同じものをサーバーへ送信します。
\code{receive}というメソッドは、サーバーから1行の文字列を
受信して、それを標準出力に出力して、同じものを戻り値として
返します。
\section{HTTP}\label{sec:HTTP}
\subsection{HTTPの概要}
「ウェブ\index{うぇふ@ウェブ}」(web)あるいは
「WWW\index{WWW}」(world wide web)と呼ばれるサービスを
取り扱うプログラムは、
HTTP\index{HTTP}(Hypertext Transfer Protocol)と呼ばれる
プロトコル(RFC2616)を使って通信をします。なお、HTTPには
いくつかのバージョンがあって、それぞれのバージョンのHTTPは、
HTTP/1.0とかHTTP/1.1というように、バージョン番号を含んだ名前で
呼ばれます。
特定のプロトコルを使って通信をするサーバーとクライアントの
それぞれは、普通、そのプロトコルの名前を頭に付けて、
「何々サーバー」とか「何々クライアント」と呼ばれます。
ですから、HTTPを使って通信をするサーバーとクライアントは、
「HTTPサーバー」と「HTTPクライアント」と
呼ばれることになります。
HTTPサーバーは、通常、80番のポートを使ってHTTPクライアントと
通信をします。
HTTPサーバーが提供しているサービスというのは、基本的には、
ファイルの内容をクライアントに送信することです。
HTTPサーバーは、ファイルの内容の要求を意味するデータを
HTTPクライアントから受け取った場合、要求されたファイルの内容を
クライアントに送信します。
HTTPクライアントが何らかのサービスを要求するためにサーバーに
送るデータは、
「リクエスト\index{りくえすと@リクエスト}」(request)と
呼ばれます。そして、リクエストに応えてHTTPサーバーが
クライアントに送るデータは、
「レスポンス\index{れすほんす@レスポンス}」(response)と
呼ばれます。
\subsection{リクエスト}
HTTPクライアントが送信するリクエストは、
「リクエスト行\index{りくえすときょう@リクエスト行}」
(request line)と呼ばれるひとつの行で始まります。
リクエスト行は、
\begin{quote}
\syntax{メソッド名} \syntax{パス名} \syntax{バージョン} CRLF
\end{quote}
という形式の文字列です。「メソッド名」のところには、サーバーが
持っている機能を識別する名前を指定します。たとえば、ファイルの
内容を要求する場合は、\code{GET}\index{GET@\code{GET}}という
メソッド名を指定します。
「パス名」のところには、ファイルの絶対パス名を指定します。
\code{GET}メソッドを指定した場合は、ここで指定したファイルの
内容が送られてくることになります。
サーバーの設定によっては、パス名のところに、ファイルではなくて
ディレクトリのパス名を指定することもできます(ただし、末尾に
スラッシュを付ける必要があります)。それが可能になっている
場合は、指定されたディレクトリにある、サーバーで設定されている
名前(たとえば\code{index.html}など)のファイルの内容が
送られてきます。
「バージョン」のところには、バージョン番号を含んだHTTPの名前、
つまり、\code{HTTP/1.0}とか\code{HTTP/1.1}というような文字列を
指定します。
ですから、たとえば、HTTP/1.1を使って
ルートディレクトリの下にある\code{namako.htm}というファイルの
内容を要求したいとすると、クライアントは、
\begin{quote}
GET /namako.htm HTTP/1.1
\end{quote}
というリクエスト行を送信すればいいわけです。
HTTPクライアントは、リクエスト行に続けて、
「ヘッダー\index{へったあ@ヘッダー}」(header)と呼ばれる
何行かの文字列を送信します。ヘッダーを構成するそれぞれの行は、
「フィールド\index{ふぃいると@フィールド}」(field)と
呼ばれます。フィールドは、
\begin{quote}
\syntax{フィールド名}:\ \syntax{フィールド本体} CRLF
\end{quote}
という形式の文字列です。たとえば、
\code{User-Agent}\index{User-Agent@\code{User-Agent}}という
名前のフィールドを使うことによって、
\begin{quote}
User-Agent:\ Gamera/6.0
\end{quote}
というように、クライアントの名前やバージョンを
送信することができます。
HTTP/1.1では、\code{Host}\index{Host@\code{Host}}という
フィールドはかならず送信しないといけない、と定められています。
それ以外のフィールドは、
送信してもしなくてもどちらでもかまいません。
\code{Host}フィールドというのは、サーバーが動作している
ホストのホスト名を指定するフィールドで、たとえば、
\begin{quote}
Host:\ www.example.com
\end{quote}
というようなものを送信します。
HTTPクライアントは、ヘッダーの送信が終了したのち、そのことを
サーバーに通知するために、
空行\index{くうきょう@空行}(改行だけの行)を送信する
必要があります。
HTTPサーバーに対してファイルの内容を要求する場合は、以上の
三つのもの、つまり、リクエスト行、ヘッダー、そして空行を
リクエストとして送信します。そうすると、その結果として、
ファイルの内容を含むレスポンスがサーバーから送られてきます。
\subsection{レスポンス}
HTTPサーバーが送信するレスポンスの構造は、リクエストの構造と
よく似ています。
レスポンスは、
「ステータス行\index{すてえたすきょう@ステータス行}」
(status line)と呼ばれる行で始まります。サーバーは、その次に
ヘッダーを送信して、ヘッダーが終わったのち、空行を送信します。
そして、\code{GET}メソッドのリクエストに対応するレスポンスの
場合は、その空行に続けて、ファイルの内容を送信します。
ステータス行は、
\begin{quote}
\syntax{バージョン} \syntax{ステータスコード} \syntax{理由}
\ CRLF
\end{quote}
という形式の文字列です。「バージョン」のところは、
\code{HTTP/1.1}というような、バージョン番号を含んだHTTPの
名前です。
「ステータスコード\index{すてえたすこおと@ステータスコード}」
(status code)というのは、リクエストがどのように
処理されたかということをあらわす3桁の10進数のことです。
たとえば、処理が成功した場合のステータスコードは\code{200}、
ファイルが見付からないというエラーが発生した場合の
ステータスコードは\code{404}、というように、さまざまな
ステータスコードが定められています。
「理由」のところは、ステータスコードが
あらわしているものについての簡潔な説明です。たとえば、
\code{200}の場合は\code{OK}、\code{404}の場合は
\code{Not Found}というような文字列になります。ですから、
HTTP/1.1のサーバーは、要求された処理に成功した場合、
\begin{quote}
HTTP/1.1 200 OK
\end{quote}
というステータス行を送信することになります。
HTTPサーバーは、ステータス行に続けて、何行かのフィールドから
構成されるヘッダーを送信します。それらのフィールドのうちで
もっとも重要なのは、送信するデータの大きさ(単位はバイト)を
通知する\code{Content-Length}というフィールドです。たとえば、
\begin{quote}
Content-Length:\ 3876
\end{quote}
というフィールドは、空行のあとに送信するデータの大きさが
3876バイトだということを示しています。
\subsection{HTTPクライアントの例}
それでは、Rubyを使ってHTTPクライアントを書いてみましょう。
\begin{program}{http.rb}
\begin{verbatim}
require("client")
class HTTP < Client
def initialize(host, path)
super(host, 80)
@host = host
@path = path
end
def sendRequest
send("GET " + @path + " HTTP/1.1")
send("Host: " + @host)
send("")
end
def receiveHeader
length = 0
while (field = receive) != ""
if /^Content\-Length/ =~ field
length = field.scan(/[0-9]+/)[0].to_i
end
end
length
end
def receiveResource(length)
if @path[@path.size - 1, 1] == "/"
filename = "index.html"
else
filename = File.basename(@path)
end
open(filename, "w") do |outf|
outf.write(read(length))
end
end
def receiveResponse
receiveResource(receiveHeader)
end
end
if ARGV.size == 2
http = HTTP.new(ARGV[0], ARGV[1])
http.sendRequest
http.receiveResponse
http.close
else
"使い方: ruby http.rb ホスト名 パス名\n".display
end
\end{verbatim}
\end{program}
このプログラムを、たとえば、
\begin{quote}
ruby http.rb www.example.com /namako.htm
\end{quote}
というコマンドで実行したとすると、\code{www.example.com}という
ホストのHTTPサーバーから、\code{/namako.htm}というファイルの
内容が送られてくることになります。ただし、このホストと
ファイルは実在しませんので、実在するホストとファイルを指定して
試してみてください。
\section{SMTP}\label{sec:SMTP}
\subsection{MTAとMDAとMUA}
ホストのユーザーが別のユーザーに対してデータを送ったり
受け取ったりするためのシステムは、
「電子メール\index{てんしめえる@電子メール}」
(electronic mail)または単に
「メール\index{めえる@メール}」(mail)と呼ばれます。そして、
メールを使ってユーザーとユーザーとのあいだで交換される
データは、
「メールメッセージ\index{めえるめっせえし@メールメッセージ}」
(mail message)と呼ばれます。
メールというサービスを実現するためのプログラムは、MTA、MDA、
MUAと呼ばれる3種類のプログラムに分類することができます。
MTA\index{MTA}(mail transfer agent)というのは、ホストから
ホストへメールメッセージを転送するプログラムのことです。MTAは、
受け取ったメールメッセージを別のホストのMTAに転送するか、
またはMDAに渡します。
MDA\index{MDA}(mail delivery agent)というのは、MTAから
メールメッセージを受け取って、それをユーザーのメールボックスに
配達するプログラムのことです。
MUA\index{MUA}(mail user agent)というのは、ユーザーが
メールメッセージを取り扱うためのプログラムのことです。
ユーザーは、MUAを使うことによって、メールメッセージを書いて
送信したり、メールメッセージを受け取って
閲覧したりすることができます。
MTAが別のホストのMTAにメールメッセージを送信するときや、MUAが
MTAにメールメッセージを送信するときには、
SMTP\index{SMTP}(Simple Mail Transfer Protocol)という
プロトコル(RFC2821)が使われます。そして、メールボックスが
置かれているホストとは異なるホストでMUAを使っている場合には、
メールボックスからメールメッセージをダウンロードするために、
POP3\index{POP3}(Post Office Protocol Version 3)という
プロトコル(RFC1939)または
IMAP\index{IMAP}(Internet Message Access Protocol)という
プロトコル(RFC2060)が使われます。
\subsection{メールメッセージの書き方}
次に、メールメッセージというものはどのように書けばいいのか
ということについて、ごく簡単に説明しておくことにしましょう。
なお、メールメッセージの基本的な書き方については、RFC2822という
RFCで規定されていますので、もっと詳しく知りたい方はそちらを
参照してください。
メールメッセージの全体は、何個かの行から構成される文字列です。
改行は、CRLFであらわされます。
メールメッセージは、先頭に
「ヘッダー\index{へったあ@ヘッダー}」(header)と呼ばれる
部分があって、その下に「本文\index{ほんふん@本文}」(body)と
呼ばれる部分が続きます。ヘッダーと本文とのあいだは、
空行\index{くうきょう@空行}(改行だけの行)で区切ります。
ヘッダーというのは、メールメッセージ自身についての
情報(送信者、受信者、主題など)を書くための部分です。
ヘッダーは、
「フィールド\index{ふぃいると@フィールド}」(field)と呼ばれる
文字列から構成されます。
フィールドにはさまざまな種類があって、それらの種類は、
「フィールド名\index{ふぃいるどめい@フィールド名}」
(field name)と呼ばれる名前によって識別されます。たとえば、
送信者のアドレスを書くフィールドのフィールド名は、
\code{From}です。同じように、受信者は\code{To}、主題は
\code{Subject}、というようにフィールド名が決まっています。
ひとつのフィールドは、
\begin{quote}
\syntax{フィールド名}:\ \syntax{フィールド値} CRLF
\end{quote}
という形式で書きます。たとえば、送信者のアドレスの
フィールドは、
\begin{quote}
From:\ [email protected]
\end{quote}
というように書くことになります。
ヘッダーは、ASCII\index{ASCII}と呼ばれる文字コードを使って
書かないといけないことになっています。ASCIIは仮名や漢字を
含んでいませんので、ヘッダーの中で日本語を使うためには、
MIME\index{MIME}と呼ばれる規定(RFC2045--2049)にしたがって、
日本語の文字をASCIIの文字に変換する必要があります。
メールメッセージの本文というのは、送信者が受信者に伝えたい
内容を書くための部分です。この部分には、日本語の文章を
書いてもかまいません。ただし、その場合に使うことのできる
日本語の文字コードは、
JIS\index{JIS}のみです\footnote{JISという文字コードの正式な
名称はISO--2022--JPです。}。メールメッセージの本文にしたい
文章が、Shift\_JIS\index{Shift_JIS@Shift\_JIS}や
EUC--JP\index{EUC-JP@EUC--JP}などのJIS以外の文字コードで
書かれている場合は、送信する前にそれをJISに変換する
必要があります。
\code{kconv}\index{kconv@\code{kconv}}という名前のRubyの
ライブラリーは、日本語の文字コードを変換するためのいくつかの
メソッドを定義しています。その中にある
\code{tojis}\index{tojis@\code{tojis}}というメソッドを使うと、
Shift\_JISまたはEUC--JPをJISに変換することができます。
\code{tojis}は、文字列のオブジェクトの中に作られるメソッドで、
レシーバーの文字コードをJISに変換した結果を戻り値として
返します。
なお、JISを使ってメールメッセージの本文を書く場合は、
ヘッダーの中に、
\begin{tttablelist}{}
\item[MIME-Version:\ 1.0]
\item[Content-Type:\ text/plain; charset=iso-2022-jp]
\end{tttablelist}
という二つのフィールドを書いておく必要があります。
\begin{figure}[tb]\centering
\begin{tabular}{|l|} \hline
\begin{minipage}{30zw}
\setlength{\baselineskip}{\programlineskip}
\vspace{0.6zh}
\begin{verbatim}
To: [email protected]
From: [email protected]
Subject: Chinese restaurant
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-2022-jp
この度、脱サラして中華料理の店をオープンしました。
ぜひ食べに来てください。
\end{verbatim}
\par
\vspace{-0.2zh}
\end{minipage} \\ \hline
\end{tabular}
\caption{メールメッセージの例}
\label{fig:exampleofmailmessage}
\end{figure}
さて、メールメッセージの書き方についての説明は、以上で
終わりです。図\ref{fig:exampleofmailmessage}に、
メールメッセージの一例を書いておきましたので、
参考にしてください。
\subsection{SMTPのセッション}
MTAは、SMTP\index{SMTP}(Simple Mail Transfer Protocol)という
プロトコルを使って、メールメッセージを別のホストへ転送します。
また、MUAも、MTAにメールメッセージを送信するときに
同じプロトコルを使います。SMTPを使ってメールメッセージを
転送する場合、受信するほうのプログラムがサーバーになって、
送信するほうのプログラムがクライアントになります。
SMTPサーバーは、通常、25番のポートを使ってSMTPクライアントと
通信をします。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{コマンド} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
helo ホスト名 & クライアントが動作しているホストの名前を
通知します。 \\ \hline
mail from:<アドレス> & 送信者のアドレスを通知します。
\\ \hline
rcpt to:<アドレス> & 受信者のアドレスを通知します。
\\ \hline
data &
これからメールメッセージを送信するということを
通知します。 \\ \hline
quit & セッションを終了するということを通知します。
\\ \hline
\end{tabular}
\end{ttfamily}
\caption{SMTPの主要なコマンド}\label{tab:commandsofSMTP}
\index{helo@\code{helo}}
\index{mail@\code{mail}}
\index{rcpt@\code{rcpt}}
\index{data@\code{data}}
\index{quit@\code{quit}}
\end{table}
SMTPクライアントは、「コマンド\index{こまんと@コマンド}」
(command)と呼ばれる文字列をSMTPサーバーに送ることによって、
サーバーに対してさまざまな情報を通知します。SMTPには、
表\ref{tab:commandsofSMTP}のようなコマンドがあります。
サーバーは、受け取ったコマンドを処理したのち、
「応答\index{おうとう@応答}」(reply)と呼ばれる文字列を
クライアントに送ります。
SMTPでは、セッションを進行させる順序がかなり厳格に
決まっていて、クライアントは、\code{helo}、\code{mail}、
\code{rcpt}、\code{data}、\code{quit}、という順序でコマンドを
送信する必要があります。
1回のセッションでは、メールメッセージを1通だけしか
送信することができません。しかし、1回のセッションで1通の
メールメッセージを2人以上の受信者に送信する、ということは
可能です。その場合は、それぞれの受信者のアドレスを引数とする
2個以上の\code{rcpt}コマンドを送信します。
メールメッセージは、\code{data}コマンドを送信して、
それに対する応答がサーバーから返ってきたのちに送信します。
メールメッセージの送信が終了したとき、クライアントは、
メールメッセージがこれで終わりだということをサーバーに
通知するために、ドット(\code{.})%
\index{とっと@ドット!めえるめっせえしの@
メールメッセージの\baidash}%
\index{.@\code{.}!めえるめっせえしの@
メールメッセージの\baidash}%
のみの行を送信しないといけません。サーバーは、
メールメッセージの受信が終了したときも、クライアントに応答を
返します。
\subsection{SMTPクライアントの例}
次のプログラムは、Rubyで書かれたSMTPクライアントの一例です。
\begin{program}{smtp.rb}
\begin{verbatim}
require("client")
require("kconv")
class String
def getFieldValue
value = split(/:/)
if value.size >= 2
value[1].delete(" ")
else
""
end
end
end
class SMTP < Client
def initialize(argv)
host, @path = argv
super(host, 25)
@to = @from = ""
end
def readHeader
open(@path) do |inf|
header = true
while (line = inf.gets.chomp) && header
if line == ""
header = false
elsif /^To/ =~ line
@to = line.getFieldValue
elsif /^From/ =~ line
@from = line.getFieldValue
end
end
end
end
def sendMail
receive
sendReceive("helo localhost")
sendReceive("mail from:<" + @from + ">")
sendReceive("rcpt to:<" + @to + ">")
sendReceive("data")
open(@path) do |inf|
inf.each do |line|
send(line.chomp.tojis)
end
end
sendReceive(".")
sendReceive("quit")
end
end
if ARGV.size == 2
smtp = SMTP.new(ARGV)
smtp.readHeader
smtp.sendMail
smtp.close
else
("使い方: ruby smtp.rb ホスト名 パス名\n").display
end
\end{verbatim}
\end{program}
それでは、エディターを使ってメールメッセージをファイルに
保存したのち、SMTPサーバーのホスト名と、メールメッセージの
パス名を指定して、このプログラムを起動してみてください。
そうすると、そのメールメッセージがSMTPサーバーへ
送信されるはずです。
\chapter{GUI}\label{chap:gui}
\section{GUIの基礎}\label{sec:foundationofgui}
\subsection{GUIとは何か}
機械などが持っている、人間に何かを報告したり人間からの指示を
受け付けたりする部分のことを、「ユーザーインターフェース
\index{ゆうさあいんたあふぇえす@ユーザーインターフェース}」
(user interface)と言います。
コンピュータのプログラムも、たいていのものは何らかの
ユーザーインターフェースを持っています。プログラムの
ユーザーインターフェースとしては、現在、CUIとGUIと呼ばれる
2種類のものが主流です。
CUI\index{CUI}(character user interface)というのは、文字列を
媒介とするユーザーインターフェースのことです。CUIの場合、
プログラムは文字列を出力することによって人間に何かを報告し、
人間はキーボードから文字列を入力することによってプログラムに
指示を与えます。
それに対して、GUI\index{GUI}(graphical user interface)は、
図形を媒介とするユーザーインターフェースです。GUIの場合、
プログラムはモニターの画面に図形を表示することによって人間に
何かを報告し、人間はマウスなどの装置を使ってその図形を
操作することによってプログラムに指示を与えます。
\subsection{Tk}
Rubyの処理系はGUIを作る機能を内蔵していませんので、GUIを持つ
プログラムをRubyで書くためには、そのためのライブラリーを
使う必要があります。
Rubyで使うことのできるGUIのライブラリーには
さまざまなものがあるのですが、この文章では、Tkという
ライブラリーを使ってGUIを作る方法について
説明していくことにします。
Tk\index{Tk}というのは、
John Ousterhout\index{Ousterhout, John}さんという人が作った
GUIのライブラリーで、Tkという名前は、toolkitという単語を
縮めたものです。
Tkは、もともとはTcl\index{Tcl}というプログラミング言語で
使うために作られたものなのですが、現在では、Tclだけではなくて
Perl\index{Perl}やRubyでもそれを使うことができます。それぞれの
言語とTkとを組み合わせたものは、Tcl/Tk\index{Tcl/Tk}、
Perl/Tk\index{Perl/Tk}、Ruby/Tk\index{Ruby/Tk}というように
呼ばれます。
Ruby/Tkは、GUIを作るためのさまざまなクラスやモジュールから
構成されていて、それらのクラスやモジュールは、
\code{tk}\index{tk@\code{tk}}というファイル名の
ライブラリーの中で定義されています。ですから、Rubyの
プログラムの先頭に、
\begin{quote}
require("tk")
\end{quote}
という式を書いておけば、そのプログラムは、Ruby/Tkの機能を
使ってGUIを作ることができるようになります。
\subsection{イベントループ}
GUIを持つプログラムは、人間からの指示を受け取って、
その指示に対応する処理を実行する、ということを何度も
繰り返します。そのような繰り返しは、
「イベントループ\index{いへんとるうふ@イベントループ}」
(event loop)と呼ばれます。
Tkでは、\code{Tk}\index{Tk@\code{Tk}}というモジュールが
持っている
\code{mainloop}\index{mainloop@\code{mainloop}}という
メソッドがイベントループになっています。Tkを使ってGUIを作る
プログラムは、かならずこのメソッドを呼び出す必要があります。
それでは、\code{mainloop}を呼び出すだけのプログラムを書いて、
それを実行してみましょう。
\begin{program}{empty.rb}
\begin{verbatim}
require("tk")
Tk.mainloop
\end{verbatim}
\end{program}
このプログラムを実行すると、空のウィンドウがモニターに
表示されるはずです。
\subsection{ウィジェ{}ット}
GUIを作るためのは、ウィンドウの上にさまざまな部品を取り付ける
必要があります。そのような、GUIを作るための部品は、
「ウィジェ{}ット\index{うぃしぇっと@ウィジェ{}ット}」
(widget)と呼ばれます。ちなみに、widgetという単語は、
window gadgetという言葉を縮めたものです。ウィジェ{}ットには、
ラベル、ボタン、キャンバス、エントリー、リストボックスなどの
さまざまな種類があります。
Rubyでは、ウィジェ{}ットは、「ウィジェ{}ットクラス
\index{うぃしぇっとくらす@ウィジェ{}ットクラス}」
(widget class)と呼ばれるクラスのインスタンスによって
表示されます。たとえば、ラベルという種類のウィジェ{}ットは、
\code{TkLabel}\index{TkLabel@\code{TkLabel}}というクラスの
インスタンスによって表示されます。なお、
「ウィジェ{}ット」という言葉は、画面の上に表示される部品という
意味だけではなくて、それを表示しているオブジェクトという
意味でも使われます。
ウィジェ{}ットは、ウィジェ{}ットクラスが持っている
\code{new}というクラスメソッドを呼び出すことによって
生成することができます。たとえば、
\begin{quote}
label = TkLabel.new
\end{quote}
という式を書くことによって、ラベルのオブジェクトを
生成して、それを\code{label}という変数に
代入することができます。
「ラベル\index{らべる@ラベル}」(label)というのは、
文字列(テキスト)をその上に表示することを目的として使われる
ウィジェ{}ットです。ウィジェ{}ットの上に表示される文字列を
設定したいときは、それが持っている
\code{text}\index{text@\code{text}}というメソッドを使います。
\code{text}に引数として文字列を渡すと、その文字列が
ウィジェ{}ットの上に表示されます。たとえば、
\code{label}という変数にラベルが格納されているとするとき、
\begin{quote}
label.text("namako")
\end{quote}
というメッセージ式を評価すると、そのラベルの上に
\code{namako}という文字列が表示されます。
ちなみに、ウィンドウというのも、ウィジェ{}ットの種類の
ひとつです。Tkには、ウィンドウを生成するクラスとして、
\code{TkRoot}\index{TkRoot@\code{TkRoot}}と
\code{TkToplevel}\index{TkToplevel@\code{TkToplevel}}という
二つのものがあります。\code{TkRoot}のインスタンスは
「ルートウィジェ{}ット
\index{るうとうぃしぇっと@ルートウィジェ{}ット}」
(root widget)と呼ばれ、\code{TkToplevel}のインスタンスは
「トップレベル
\index{とっふれへる@トップレベル!Tkの@Tkの\baidash}」
(toplevel)と呼ばれます。\code{mainloop}を呼び出すと、
ひとつのウィンドウが自動的に表示されるのですが、
このウィンドウはルートウィジェ{}ットです。
\subsection{ジオメトリーマネージャー}
ウィンドウ以外のウィジェ{}ットは、単独では画面の上に
表示されません。それを画面に表示するためには、それを
ウィンドウの上に取り付ける必要があります。
土台となるウィジェ{}ット(たとえばウィンドウ)の上に
ウィジェ{}ットを取り付けたいときは、「ジオメトリーマネージャー
\index{しおめとりいまねえしゃあ@ジオメトリーマネージャー}」
(geometry manager)と呼ばれるものを使います。
ジオメトリーマネージャーというのは、ウィジェ{}ットが
持っているメソッドで、ウィジェ{}ットの配置を管理するという
動作をするもののことです。
Tkには、\code{pack}\index{pack@\code{pack}}、
\code{grid}\index{grid@\code{grid}}、
\code{place}\index{place@\code{place}}という3種類の
ジオメトリーマネージャーがあります。それらのうちで、
もっともよく使われるのは、\code{pack}という
ジオメトリーマネージャーです。\code{pack}は、土台となる
ウィジェ{}ットを必要最小限に小さくして、その中に
ウィジェ{}ットを詰め込む、という動作をします。
\begin{program}{label.rb}
\begin{verbatim}
require("tk")
label = TkLabel.new
label.text("私はラベルです。")
label.pack
Tk.mainloop
\end{verbatim}
\end{program}
この\code{pack}というジオメトリーマネージャーについては、
第\ref{sec:pack}節で、もう少し詳しく説明したいと思います。
\subsection{ウィジェ{}ットの初期設定}
\code{new}を使ってウィジェ{}ットを生成するとき、ブロックを
\code{new}に渡すと、そのブロックは、生成された
ウィジェ{}ットの中の\code{initialize}によって実行されます。
通常、ウィジェ{}ットに表示させる文字列を設定したり、
ウィジェ{}ットを土台に取り付けたりする、というような
ウィジェ{}ットの初期設定は、\code{new}に渡すブロックの中に
書いておきます。なお、そのブロックの中では、メッセージ式の
レシーバーを省略すると、メッセージは、新しく生成された
ウィジェ{}ットに送られます。
次のプログラムは、先ほどのプログラムを、ブロックを使う形に
書き換えたものです。
\begin{program}{label2.rb}
\begin{verbatim}
require("tk")
TkLabel.new do
text("私はラベルです。")
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
Tkを使うプログラムでは、ルートウィジェ{}ットは暗黙のうちに
生成されるわけですが、それを初期設定したいときは、それを
生成する記述を明示的に書く必要があります。
ルートウィジェ{}ットというのは
\code{TkRoot}\index{TkRoot@\code{TkRoot}}というクラスの
インスタンスですので、
\begin{quote}
TkRoot.new \syntax{ブロック}
\end{quote}
という式を書くことによって、ルートウィジェ{}ットを
初期設定することができます。
ルートウィジェ{}ットのタイトルバーに表示されるタイトルを
設定したいときは、
\code{title}\index{title@\code{title}}というメソッドを
使います。\code{title}に引数として文字列を渡すと、その文字列が
タイトルバーの上に表示されます。
\begin{program}{title.rb}
\begin{verbatim}
require("tk")
TkRoot.new do
title("I am a root widget.")
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{フォント}
Ruby/Tkでは、ウィジェ{}ットの上に表示される文字のフォントは、
\code{TkFont}\index{TkFont@\code{TkFont}}というクラスの
インスタンスとして取り扱われます。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{キー} &
\multicolumn{1}{c|}{値} \\ \hline \hline
size & 大きさ(単位はポイント) \\ \hline
family & ファミリー(times、helvetica、courierなど)
\\ \hline
weight & 太さ(normalまたはbold) \\ \hline
slant & 傾き(romanまたはitalic) \\ \hline
\end{tabular}
\end{ttfamily}
\caption{フォントの属性を指定するキーと値}
\label{tab:attributeoffont}
\index{size@\code{size}!ふぉんとの@フォントの\baidash}
\index{family@\code{family}}
\index{weight@\code{weight}}
\index{slant@\code{slant}}
\end{table}
\code{TkFont}クラスのインスタンスを生成する\code{new}は、
フォントの属性を指定するハッシュを引数として受け取ります。
そのハッシュは、表\ref{tab:attributeoffont}に示したような
キーと値から構成されます。たとえば、
\begin{quote}
TkFont.new("size"=>24, "weight"=>"bold", "slant"=>"italic")
\end{quote}
という式を書くことによって、大きさ24ポイント、太字、
イタリック、というフォントで文字を表示するための
\code{TkFont}クラスのインスタンスを生成することができます。
ウィジェ{}ットにフォントを設定したいときは、ウィジェ{}ットが
持っている\code{font}\index{font@\code{font}}というメソッドを
使います。\code{font}は、\code{TkFont}クラスのインスタンスを
引数として受け取って、それをレシーバーに設定します。
\begin{program}{font.rb}
\begin{verbatim}
require("tk")
times = TkFont.new("family"=>"times", "size"=>18)
helvetica = TkFont.new("family"=>"helvetica", "size"=>18)
TkLabel.new do
text("このフォントはTimesです。")
font(times)
pack
end
TkLabel.new do
text("このフォントはHelveticaです。")
font(helvetica)
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{色}
ウィジェ{}ットが持っているメソッドを使うことによって、
ウィジェ{}ットの背景色や前景色(文字の色)を
設定することができます。
\index{いろ@色!うぃしぇっとの@ウィジェ{}ットの\baidash}%
\index{うぃしぇっと@ウィジェ{}ット!0のいろ@\baidash の色}%
Ruby/Tkでは、色は、
\begin{quote}
\#\syntax{赤}\syntax{緑}\syntax{青}
\end{quote}
という形の文字列によって記述されます。赤、緑、青という三つの
場所には、光の三原色のそれぞれの明るさを指定する2桁の16進数を
書きます。たとえば、\code{\#ff0000}と書けば赤色、
\code{\#00ffff}と書けば水色、\code{\#ff8000}と書けば
オレンジ色をあらわすことになります。
ウィジェ{}ットの背景色は、
\code{background}\index{background@\code{background}}という
メソッドを呼び出すことによって設定することができて、
ウィジェ{}ットの前景色は、
\code{foreground}\index{foreground@\code{foreground}}という
メソッドを呼び出すことによって設定することができます。
これらのメソッドは、色をあらわす文字列を引数として受け取って、
その色をレシーバーに設定します。
\begin{program}{color.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
TkLabel.new do
text("背景はネイビーで文字は黄色。")
font(f)
background("#000080")
foreground("#ffff00")
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\section{ボタン}\label{sec:button}
\subsection{普通のボタン}
人間によってクリックされたときに何らかの動作を実行する
ウィジェ{}ットは、「ボタン\index{ほたん@ボタン}」
(button)と呼ばれます。
ボタンは、
\code{TkButton}\index{TkButton@\code{TkButton}}というクラスの
インスタンスです。ボタンの上に表示する文字列は、ラベルの場合と
同じように、\code{text}というメソッドを使うことによって
設定することができます。
ボタンには、クリックされたときに実行する動作を設定する
必要があります。動作の設定には、ボタンが持っている
\code{command}\index{command@\code{command}}というメソッドを
使います。\code{command}にブロックを渡すと、\code{command}は、
レシーバーに対して、クリックされたときにそのブロックを
実行するという設定をします。たとえば、
\begin{quote}
\verb|command { a = 3 }|
\end{quote}
という式で動作を設定したとすると、ボタンをクリックしたときに、
\code{a}という変数に3が代入されることになります。
\begin{program}{countup.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
count = 0
countlabel = TkLabel.new do
text("0")
font(f)
pack
end
TkButton.new do
text("増やす")
font(f)
command do
count += 1
countlabel.text(count.to_s)
end
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{Tk変数オブジェクト}
ボタンには、「チェ{}ックボタン
\index{ちぇっくほたん@チェ{}ックボタン}」(check button)と
「ラジオボタン\index{らしおほたん@ラジオボタン}」
(radio button)と呼ばれる2種類の変種があります
\footnote{チェ{}ックボタンは、「チェ{}ックボックス
\index{ちぇっくほっくす@チェ{}ックボックス}」(check box)と
呼ばれることもあります。}。普通のボタンとそれらの変種との
最大の相違点は、普通のボタンは状態を持たないのに対して
変種のほうは状態を持つ、というところにあります。
チェ{}ックボタンやラジオボタンを使うためには、
あらかじめ、その状態を保持するための箱を作っておく
必要があります。ウィジェ{}ットの状態を保持するための
箱というのは、「Tk変数オブジェクト
\index{Tkへんすうおふしぇくと@Tk変数オブジェクト}」
(Tk variable object)と呼ばれるオブジェクトです。
このオブジェクトは、ウィジェ{}ットの状態として1個の文字列を
保持することができるようになっています。
Tk変数オブジェクトは、
\code{TkVariable}\index{TkVariable@\code{TkVariable}}という
クラスのインスタンスです。\code{TkVariable}クラスの
\code{new}は、引数として1個の文字列を受け取って、
Tk変数オブジェクトを生成して、それが保持する状態の初期値として
引数を設定します。たとえば、
\begin{quote}
var = TkVariable.new("namako")
\end{quote}
という式を評価すると、\code{namako}という文字列が初期値として
設定されたTk変数オブジェクトが生成されて、それが
\code{var}という変数に代入されます。
Tk変数オブジェクトから、それが状態として保持している文字列を
取り出したいときは、Tk変数オブジェクトが持っている
\code{value}\index{value@\code{value}}というメソッドを
使います。\code{value}は、レシーバーが状態として保持している
文字列を戻り値として返します。
Tk変数オブジェクトが状態として保持している文字列を
変更したいときは、Tk変数オブジェクトが持っている
\code{value=}\index{value=@\code{value=}}というメソッドを
使います。\code{value}は、引数として文字列を受け取って、
それをレシーバーに設定します。たとえば、\code{var}という
変数にTk変数オブジェクトが代入されているとするとき、
\begin{quote}
var.value = "umiushi"
\end{quote}
という式を評価すると、そのTk変数オブジェクトが保持している
文字列が\code{umiushi}に置き換わります。
Tk変数オブジェクトをラベルに設定すると、そのラベルは、
設定されたTk変数オブジェクトの内容を表示するようになります。
Tk変数オブジェクトをラベルに設定したいときは、ラベルが
持っている\code{textvariable}%
\index{textvariable@\code{textvariable}}というメソッドを
使います。\code{textvariable}は、引数として
Tk変数オブジェクトを受け取って、それをレシーバーに
設定します。
Tk変数オブジェクトをチェ{}ックボタンやラジオボタンに
設定したいときは、それらのボタンが持っている
\code{variable}\index{variable@\code{variable}}という
メソッドを使います。\code{variable}は、Tk変数オブジェクトを
引数として受け取って、それをレシーバーに設定します。
\subsection{チェ{}ックボタン}
チェ{}ックボタン\index{ちぇっくほたん@チェ{}ックボタン}は、
チェ{}ックが入っていない状態と入っている状態という二つの状態を
取ることのできるウィジェ{}ットです。チェ{}ックボタンに
設定されたTk変数オブジェクトの内容は、チェ{}ックが
入っていないときは\code{0}という文字列で、チェ{}ックが
入っているときは\code{1}という文字列です。
チェ{}ックボタンは、\code{TkCheckButton}%
\index{TkCheckButton@\code{TkCheckButton}}というクラスの
インスタンスです。\code{text}メソッドでチェ{}ックボタンに
文字列を設定すると、チェ{}ックが表示される場所の右側に、
その文字列が表示されます。
\begin{program}{check.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
var = TkVariable.new("0")
TkLabel.new do
textvariable(var)
font(f)
pack
end
TkCheckButton.new do
text("チェックボタン")
variable(var)
font(f)
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{ラジオボタン}
ラジオボタン\index{らしおほたん@ラジオボタン}も、
チェ{}ックボタンと同じように、チェ{}ックが入っていない状態と
入っている状態という二つの状態を持つウィジェ{}ットです。
チェ{}ックボタンとラジオボタンとの相違点は、前者が単独で
動作するのに対して、後者はグループで動作するという
ところにあります。
ラジオボタンのグループは、ひとつのTk変数オブジェクトを使って
作ることができます。同一のTk変数オブジェクトを複数の
ラジオボタンに設定すると、それらのラジオボタンは
ひとつのグループを形成します。
ラジオボタンのひとつのグループの中では、チェ{}ックが
入っているのは常にひとつだけです。そして、チェ{}ックが
入っていないラジオボタンをクリックすると、クリックしたほうに
チェ{}ックが移動します。この動作は、次のような
メカニズムによって実現されています。
ラジオボタンは、自分を識別するために1個の文字列を
保持しています。実は、ラジオボタンにチェ{}ックが入るのは、
Tk変数オブジェクトが保持している文字列と、自分を識別する
文字列とが一致しているときだけなのです。そして
ラジオボタンは、自分がクリックされたときに自分を識別する
文字列をTk変数オブジェクトに設定します。ですから、チェ{}ックが
入っていないラジオボタンをクリックすると、クリックしたほうへ
チェ{}ックが移動することになります。
ちなみに、このメカニズムからわかるとおり、チェ{}ックが
入っているラジオボタンがどれなのかということを知りたいときは、
Tk変数オブジェクトが保持している文字列を
調べればいいわけです。
ラジオボタンは、\code{TkRadioButton}%
\index{TkRadioButton@\code{TkRadioButton}}というクラスの
インスタンスです。チェ{}ックボックスと同じように、
\code{text}メソッドでラジオボタンに文字列を設定すると、
チェ{}ックが表示される場所の右側に、その文字列が表示されます。
ラジオボタンを作るときには、それを識別するための文字列を
設定する必要があります。その文字列は、ラジオボタンが持っている
\code{value}\index{value@\code{value}}というメソッドを
使うことによって設定します。\code{value}は、引数として文字列を
受け取って、それを、レシーバーを識別するための文字列として
設定します。
\begin{program}{radio.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
gender = TkVariable.new("female")
TkLabel.new do
textvariable(gender)
font(f)
pack
end
TkRadioButton.new do
text("女性")
value("female")
variable(gender)
font(f)
pack
end
TkRadioButton.new do
text("男性")
value("male")
variable(gender)
font(f)
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\section{\texttt{pack}}\label{sec:pack}
\subsection{\texttt{pack}が受け取る引数}
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{キー} &
\multicolumn{1}{c|}{値} \\ \hline \hline
side & ウィジェ{}ットを詰め込む方向 \\ \hline
anchor & 配置領域の中での位置 \\ \hline
fill & 引き伸ばしの指定 \\ \hline
padx & $x$軸方向の余白の大きさ \\ \hline
pady & $y$軸方向の余白の大きさ \\ \hline
ipadx & $x$軸方向の詰めものの大きさ \\ \hline
ipady & $y$軸方向の詰めものの大きさ \\ \hline
\end{tabular}
\end{ttfamily}
\caption{\texttt{pack}が受け取るハッシュのキーと値}
\label{tab:attributeofpack}
\index{side@\code{side}}
\index{anchor@\code{anchor}}
\index{fill@\code{fill}}
\index{padx@\code{padx}}
\index{pady@\code{pady}}
\index{ipadx@\code{ipadx}}
\index{ipady@\code{ipady}}
\end{table}
ウィジェ{}ットを土台の中に詰め込む
\code{pack}\index{pack@\code{pack}}という
ジオメトリーマネージャーには、どのようにウィジェ{}ットを
詰め込むのかということを指定するためのハッシュを引数として
渡すことができます。そのハッシュは、
表\ref{tab:attributeofpack}に示したようなキーと値から
構成されます。
\subsection{詰め込みの方向}
\code{pack}を使ってウィジェ{}ットを思ったとおりの位置に
配置するためには、そのウィジェ{}ットを土台に対してどういう
方向へ詰め込むのかということを指定する必要があります。
それを指定したいときは、\code{pack}に渡すハッシュの
\code{side}\index{side@\code{side}}というキーに対して値を
与えます。
\code{side}に与えることのできる値は、\code{top}、
\code{bottom}、\code{left}、\code{right}のいずれかで、
それらの値は、土台に対してウィジェ{}ットを詰め込む方向を
あらわしています。デフォルトは\code{top}です。
\code{pack}によってウィジェ{}ットがどのように
配置されのるかというのは、詰め込む順番に依存して決まります。
指定された方向へウィジェ{}ットが詰め込まれると、それとは逆の
方向に、仮想的な残りの領域ができます。そして、それ以降に
詰め込まれるウィジェ{}ットは、その残りの領域を
使うことになります。ですから、ウィジェ{}ットを詰め込む
方向というのは、それ以降に詰め込むウィジェ{}ットの位置を
決定するためのものだと考えるとわかりやすいでしょう。
\begin{program}{side.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>20)
TkButton.new do
text("1:left")
font(f)
pack("side"=>"left")
end
TkButton.new do
text("2:top")
font(f)
pack("side"=>"top")
end
TkButton.new do
text("3:left")
font(f)
pack("side"=>"left")
end
Tk.mainloop
\end{verbatim}
\end{program}
このプログラムでは、ひとつ目のウィジェ{}ットを左の方向へ
詰め込んでいます。ですから、それ以降に詰め込む
ウィジェ{}ットは、その右側の領域を使うことになります。
そして、二つ目のウィジェ{}ットは上の方向へ
詰め込まれていますので、三つ目のウィジェ{}ットはその下に
配置されます。
\subsection{配置領域の中での位置}
土台の上に残されている、ウィジェ{}ットを詰め込むことのできる
領域のことを、「配置領域」と呼ぶことにしましょう。そして、
詰め込まれるウィジェ{}ットそのものの領域のことを「表示領域」と
呼ぶことにしましょう。
表示領域が配置領域よりも小さい場合、ウィジェ{}ットは、
デフォルトでは配置領域の中央に配置されます。しかし、
配置領域の中のそれ以外の位置にウィジェ{}ットを配置することも
可能です。それをしたいときは、\code{pack}に渡すハッシュの
\code{anchor}\index{anchor@\code{anchor}}というキーに値を
与えます。
\code{anchor}に与えることのできる値は、\code{center}、
\code{n}、\code{ne}、\code{e}、\code{se}、\code{s}、
\code{sw}、\code{w}、\code{nw}のいずれかで、
\code{center}以外のそれぞれの値は、北、北東、東、南東、などの
方位をあらわしています。
\begin{program}{anchor.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>20)
TkButton.new do
text("左右に長いウィジェット")
font(f)
pack
end
TkButton.new do
text("右寄せ")
font(f)
pack("anchor"=>"e")
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{引き延ばし}
ウィジェ{}ットの大きさというのは、基本的には、その内部に
表示されるものの大きさによって決まります。しかし、
いくつかのウィジェ{}ットを並べて配置する場合には、
それらの大きさをそろえないと、見栄えがよくありません。
並んでいるいくつかのウィジェ{}ットの大きさを
そろえたいときは、小さなウィジェ{}ットを大きく引き延ばす、
という技法を使います。ウィジェ{}ットの大きさを
引き延ばしたいときは、\code{pack}に渡すハッシュの
\code{fill}\index{fill@\code{fill}}というキーに値を与えます。
\code{fill}に与えることのできる値は、\code{none}、\code{x}、
\code{y}、\code{both}のいずれかです。\code{none}は
引き延ばさない、\code{x}は$x$軸方向にのみ引き延ばす、
\code{y}は$y$軸方向にのみ引き延ばす、\code{both}はどちらの
方向にも引き延ばす、という意味で、デフォルトは
\code{none}です。
\begin{program}{fill.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>20)
TkButton.new do
text("左右に長いウィジェット")
font(f)
pack
end
TkButton.new do
text("短い")
font(f)
pack("fill"=>"x")
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{余白}
ウィジェ{}ットの周囲に余白を作りたいときは、\code{pack}に渡す
ハッシュの\code{padx}\index{padx@\code{padx}}または
\code{pady}\index{pady@\code{pady}}というキーに値を与えます。
\code{padx}に与える値は$x$軸方向の余白の大きさ、\code{pady}に
与える値は$y$軸方向の余白の大きさで、単位はピクセルです。
\begin{program}{pad.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>20)
TkButton.new do
text("デフォルト")
font(f)
pack
end
TkButton.new do
text("上下左右に余白")
font(f)
pack("padx"=>50, "pady"=>50)
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{詰めもの}
ウィジェ{}ットの上に表示されるテキストなどの周囲に詰めものを
詰めることによってウィジェ{}ットの大きさを大きくする、
ということも可能です。それをしたいときは、\code{pack}に渡す
ハッシュの\code{ipadx}\index{ipadx@\code{ipadx}}または
\code{ipady}\index{ipady@\code{ipady}}というキーに値を
与えます。\code{ipadx}は$x$軸方向の詰めものの大きさ、
\code{ipady}は$y$軸方向の詰めものの大きさで、単位は
ピクセルです。
\begin{program}{ipad.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>20)
TkButton.new do
text("デフォルト")
font(f)
pack
end
TkButton.new do
text("上下左右に詰めもの")
font(f)
pack("ipadx"=>50, "ipady"=>50)
end
Tk.mainloop
\end{verbatim}
\end{program}
\section{ダイアログボックス}\label{sec:dialogbox}
\subsection{ダイアログボックスの基礎}
人間との対話のためにプログラムが一時的に画面に表示する
ウィンドウは、「ダイアログボックス
\index{たいあろくほっくす@ダイアログボックス}」(dialog box)と
呼ばれます。
いくつかの定型的なダイアログボックスは、
\code{Tk}\index{Tk@\code{Tk}}というモジュールが持っている
メソッドを使うことによって表示することができます。
\subsection{メッセージボックス}
人間に対してメッセージを伝えたり、人間に対して単純な
問い合わせをしたりするときに使われるダイアログボックスは、
「メッセージボックス
\index{めっせえしほっくす@メッセージボックス}」(message box)と
呼ばれます。
メッセージボックスを表示したいときは、\code{Tk}が持っている
\code{messageBox}\index{messageBox@\code{messageBox}}という
メソッドを使います。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{キー} &
\multicolumn{1}{c|}{値} \\ \hline \hline
type & メッセージボックスの種類 \\ \hline
icon & 表示するアイコン \\ \hline
default & デフォルトにするボタンの名前 \\ \hline
title & タイトルバーに表示する文字列 \\ \hline
message & 表示する文字列 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{\texttt{messageBox}が受け取るハッシュのキーと値}
\label{tab:attributeofmessagebox}
\index{type@\code{type}}
\index{icon@\code{icon}}
\index{default@\code{default}}
\index{title@\code{title}}
\index{message@\code{message}}
\end{table}
\code{messageBox}は、表示するメッセージボックスを細かく
設定するためのハッシュを引数として受け取ります。
そのハッシュは、表\ref{tab:attributeofmessagebox}に
示されているキーと値から構成されます。
\code{type}というキーに対応する値は、メッセージボックスの
種類をあらわす文字列です。メッセージボックスの種類としては、
\begin{quote}
\code{ok}\zenkuu \code{okcancel}\zenkuu \code{yesno}\zenkuu
\code{yesnocancel}\zenkuu \code{retrycancel}\zenkuu
\code{abortretryignore}
\end{quote}
という6種類のものがあります。デフォルトは\code{ok}です。
\code{icon}というキーに対応する値は、表示するアイコンを
あらわす文字列です。アイコンは、\code{info}、\code{question}、
\code{error}という3種類の中から選ぶことができます。
デフォルトは\code{info}です。
\code{default}というキーに対応する値は、デフォルトにする
ボタンの名前です。メッセージボックスのそれぞれのボタンには、
\code{ok}、\code{cancel}、\code{yes}、\code{no}というような
名前が付いていますので、その名前でボタンを指定します。
\begin{program}{message.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
TkButton.new do
text("押してください。")
font(f)
command do
Tk.messageBox("title" => "thanks",
"message" => "ありがとうございました。")
end
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\code{messageBox}は、戻り値として、押されたボタンの名前を
返します。
\begin{program}{yesno.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
returned = TkLabel.new do
font(f)
pack
end
TkButton.new do
text("押してください。")
font(f)
command do
returned.text("")
returned.text(Tk.messageBox("type" => "yesno",
"icon" => "question", "default" => "no",
"title" => "emptiness",
"message" => "お腹が空きましたか?"))
end
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{ファイルを選択するダイアログボックス}
\code{Tk}が持っている
\code{getOpenFile}\index{getOpenFile@\code{getOpenFile}}または
\code{getSaveFile}\index{getSaveFile@\code{getSaveFile}}という
メソッドを使うことによって、
ファイルを選択するためのダイアログボックスを
表示することができます。
\code{getOpenFile}はデータを読み込むファイルを選択するための
メソッドで、存在しないファイルを選択した場合にエラーの
ダイアログボックスを表示します。それに対して、
\code{getSaveFile}のほうはデータを保存するファイルを
選択するためのメソッドで、すでに存在するファイルを選択した
場合、上書きしてもいいかどうかを確認するダイアログボックスを
表示します。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{キー} &
\multicolumn{1}{c|}{値} \\ \hline \hline
filetypes & 選択可能なファイルのタイプ \\ \hline
defaultextension & 最初に選択されている拡張子 \\ \hline
initialdir & 最初に選択されているディレクトリー \\ \hline
initialfile & 最初に入力されているファイル名 \\ \hline
title & タイトルバーに表示する文字列 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{ファイルを選択するダイアログボックスが受け取る
ハッシュのキーと値}
\label{tab:attributeoffiledialog}
\index{filetypes@\code{filetypes}}
\index{defaultextension@\code{defaultextension}}
\index{initialdir@\code{initialdir}}
\index{initialfile@\code{initialfile}}
\index{title@\code{title}}
\end{table}
\code{getOpenFile}と\code{getSaveFile}も、ひとつのハッシュを
引数として受け取ります。そのハッシュは、
表\ref{tab:attributeoffiledialog}に示されているキーと値から
構成されます。
\code{filetypes}というキーに与える値は、ファイルのタイプ名と
拡張子から構成される配列を並べてできる、
\begin{quote}
[["css", ".css"], ["html", [".htm", ".html"]], ["all", ".*"]]
\end{quote}
というような配列です。
\code{getOpenFile}と\code{getSaveFile}は、戻り値として、
選択されたファイルの絶対パス名を返します。ただし、
ダイアログボックスをキャンセルで閉じた場合は空文字列を
返します。
\begin{program}{getopen.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
returned = TkLabel.new do
font(f)
pack
end
TkButton.new do
text("ファイルの選択")
font(f)
command do
returned.text("")
returned.text(Tk.getOpenFile(
"filetypes" => [
["ruby", ".rb"],
["C", ".c"],
["all", ".*"]],
"defaultextension" => ".rb"))
end
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{色を選択するダイアログボックス}
色を選択するためのダイアログボックスを表示したいときは、
\code{Tk}が持っている
\code{chooseColor}\index{chooseColor@\code{chooseColor}}という
メソッドを使います。このメソッドは、選択された色をあらわす
文字列を戻り値として返します(ダイアログボックスをキャンセルで
閉じた場合は空文字列を返します)。
\code{chooseColor}も、ひとつのハッシュを引数として
受け取ります。
\code{initialcolor}\index{initialcolor@\code{initialcolor}}%
というキーに、色をあらわす文字列を値として与えることによって、
選択される色の初期値を設定することができます。
\begin{program}{chcolor.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
color = "#99ccff"
returned = TkLabel.new do
font(f)
text(color)
background(color)
pack("ipadx"=>50, "ipady"=>50)
end
TkButton.new do
text("色の選択")
font(f)
command do
newcolor = Tk.chooseColor("initialcolor"=>color)
if newcolor != ""
color = newcolor
returned.text(color)
returned.background(color)
end
end
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\section{メニューバー}\label{sec:menubar}
\subsection{メニューバーの基礎}
メニュー\index{めにゅう@メニュー}を表示するための帯状の
ウィジェ{}ットは、
「メニューバー\index{めにゅうはあ@メニューバー}」(menubar)と
呼ばれます。メニューバーは、
\code{TkMenubar}\index{TkMenubar@\code{TkMenubar}}という
クラスのインスタンスです。
メニューバーを生成するためには、メニューの仕様を記述した配列を
作る必要があります。そして、その配列を作るためには、
「手続きオブジェクト」と呼ばれるものを作る必要があります。
というわけで、メニューバーの生成について説明するのに先立って、
まず、手続きオブジェクトについて説明して、次に、メニューの
仕様を記述する方法について説明することにしましょう。
\subsection{手続きオブジェクト}
「手続きオブジェクト
\index{てつつきおふしぇくと@手続きオブジェクト}」
(procedure object)というのは、何らかの動作をあらわしている
オブジェクトのことです。手続きオブジェクトは、
\code{Proc}\index{Proc@\code{Proc}}というクラスの
インスタンスです。
手続きオブジェクトは、
\code{proc}\index{proc@\code{proc}}という関数的メソッドを
使うことによって生成することができます。\code{proc}は、
受け取ったブロックを実行するという動作をあらわす
手続きオブジェクトを生成して、それを戻り値として返します。
たとえば、
\begin{quote}
\verb/sanbai = proc { |x| x * 3 }/
\end{quote}
という式を評価すると、受け取ったオブジェクトを3倍するという
動作をあらわす手続きオブジェクトが生成されて、それが
\code{sanbai}という変数に代入されます。
手続きオブジェクトがあらわしている動作を実行したいときは、
それが持っている\code{call}\index{call@\code{call}}という
メソッドを呼び出します。\code{call}に引数を渡すと、
その引数は、手続きオブジェクトによって実行されるブロックに
渡されます。そして、ブロックの中の式の値が、\code{call}の
戻り値になります。たとえば、\code{sanbai}という変数に先ほどの
手続きオブジェクトが代入されているとするとき、
\begin{quote}
sanbai.call(7)
\end{quote}
というメッセージ式を評価すると、21という整数が値として
得られます。
\subsection{メニューの仕様}
メニューバーを生成するために必要となる、メニューの仕様を
記述した配列というのは、配列の配列の配列、つまり三重の
入れ子になった配列です。
メニューの仕様を記述した配列のそれぞれの要素は、
\begin{syntaxquote}
[[\syntax{項目名}], \\
\inkuu [\syntax{項目名}, \syntax{手続きオブジェクト}], \\
\inkuu \tatetenten \\
]
\end{syntaxquote}
という形の配列です。この配列で、メニューバーを構成するひとつの
項目の仕様を記述します。先頭の要素は、メニューバーの上に
最初から表示されている項目をあらわしていて、それに続く要素は、
メニューバーの項目がクリックされたときに表示されるメニューの
項目をあらわしています。「項目名」のところには、メニューの上に
表示される文字列を書き、「手続きオブジェクト」のところには、
項目がクリックされたときに実行される動作をあらわす
手続きオブジェクトを書きます。たとえば、
\begin{quote}
\begin{verbatim}
[["うどん"],
["きつね", proc { kitsune }],
["月見", proc { tsukimi }],
["カレー", proc { curry }]
]
\end{verbatim}
\end{quote}
という配列を含んでいる配列からメニューバーを生成すると、
そのメニューバーの上に「うどん」という項目が表示され、
その項目をクリックすると、「きつね」と「月見」と
「カレー」という項目から構成されるメニューが表示されます。
そして、そのメニューの項目のいずれかをクリックすると、それに
対応する手続きオブジェクトが実行されます。
\subsection{メニューバーの生成}
メニューバーは、ほかのウィジェ{}ットと同じように、
\code{new}というクラスメソッドを使って生成します。
メニューバーを生成する\code{TkMenubar}というクラスの
\code{new}には、二つの引数を渡す必要があります。1個目の引数は
\code{nil}で、2個目の引数はメニューバーの仕様を記述した
配列です。
メニューバーは、
\code{tearoff}\index{tearoff@\code{tearoff}}というメソッドを
持っています。これは、メニューバーからメニューを
切り離すことができるかどうかを設定するメソッドです。引数として
\code{true}を渡すと切り離しができるようになり、\code{false}を
渡すと切り離しができなくなります。デフォルトは
\code{true}です。
\begin{program}{menubar.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>20)
def order(item)
Tk.messageBox("message" => "注文: " + item)
end
spec = [
[["料理"],
["焼きそば", proc { order("焼きそば") }],
["カレー", proc { order("カレー") }]
],
[["飲み物"],
["烏龍茶", proc { order("烏龍茶") }],
["コーヒー", proc { order("コーヒー") }]
]
]
TkMenubar.new(nil, spec) do
tearoff(false)
font(f)
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\section{入力のウィジェ{}ット}\label{sec:entrywidgets}
\subsection{エントリー}
改行を含まない文字列を人間から受け取るウィジェ{}ットは、
「エントリー\index{えんとりい@エントリー}」(entry)と
呼ばれます。エントリーは、
\code{TkEntry}\index{TkEntry@\code{TkEntry}}というクラスの
インスタンスです。
エントリーの横の長さを設定したいときは、
\code{width}\index{width@\code{width}}というメソッドを
使います。\code{width}は、表示することのできる文字数を
引数として受け取ります。なお、入力することのできる文字列の
長さは、エントリーの横の長さには制限されません。
エントリーに入力されている文字列を取り出したいときは、
\code{value}\index{value@\code{value}}というメソッドを
使います。\code{value}は、エントリーに入力されている文字列を
戻り値として返します。また、
\code{value=}\index{value=@\code{value=}}というメソッドを
使うことによって、エントリーに文字列を
設定することも可能です。
\subsection{フォーカス}
キーボードというのはひとつのコンピュータに
ひとつだけしかありませんので、表示されているいくつかの
ウィジェ{}ットのうちで、キーボードから入力された文字を
受け取ることができるものは、ひとつの時点ではひとつだけです。
キーボードから入力された文字を受け取ることができる状態にある
ウィジェ{}ットは、
「フォーカス\index{ふぉおかす@フォーカス}」(focus)が
設定されている、と言われます。
フォーカスの設定は、マウスやキーボードの操作によって
切り替えることも可能ですが、プログラムの側で特定の
ウィジェ{}ットにフォーカスを設定することも可能です。
それをしたいときは、フォーカスを設定したいウィジェ{}ットが
持っている\code{focus}\index{focus@\code{focus}}という
メソッドを呼び出します。
\begin{program}{entry.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
label = TkLabel.new do
font(f)
pack
end
entry = TkEntry.new do
width(30)
font(f)
focus
pack
end
TkButton.new do
text("転送")
font(f)
command do
label.text(entry.value)
end
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\code{textvariable}\index{textvariable@\code{textvariable}}%
というメソッドを使ってTk変数オブジェクトをエントリーに
設定すると、エントリーに入力された文字列は、
そのTk変数オブジェクトに格納されることになります。
\begin{program}{entry2.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
var = TkVariable.new("")
TkLabel.new do
textvariable(var)
font(f)
pack
end
TkEntry.new do
width(30)
textvariable(var)
font(f)
focus
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{テキストウィジェ{}ット}
改行を含む文字列、つまりいくつかの行から構成される文字列を
人間から受け取るウィジェ{}ットは、
「テキストウィジェ{}ット
\index{てきすとうぃしぇっと@テキストウィジェ{}ット}」
(text widget)と
呼ばれます。テキストウィジェ{}ットは、
\code{TkText}\index{TkText@\code{TkText}}というクラスの
インスタンスです。
テキストウィジェ{}ットの大きさを設定したいときは、
\code{height}\index{height@\code{height}}と
\code{width}\index{width@\code{width}}というメソッドを
使います。\code{height}は表示することのできる行数を
設定するメソッドで、\code{width}は1行に表示することのできる
文字数を設定するメソッドです。
テキストウィジェ{}ットの横の長さよりも長い行を
どう表示するかということについては、デフォルトでは、行の途中で
折り返して表示するという設定になっています。行を折り返さずに、
左右にスクロールできるように設定したいときは、
\code{wrap}\index{wrap@\code{wrap}}というメソッドを
呼び出して、引数として\code{none}という文字列を渡します。
\begin{program}{text.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>20)
TkText.new do
height(10)
width(30)
wrap("none")
font(f)
focus
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{スクロールバー}
ウィジェ{}ットをスクロールさせるために使われる細長い
ウィジェ{}ットは、
「スクロールバー
\index{すくろおるはあ@スクロールバー}」
(scrollbar)と
呼ばれます。スクロールバーは、
\code{TkScrollbar}\index{TkScrollbar@\code{TkScrollbar}}という
クラスのインスタンスです。
スクロールバーの操作によってテキストウィジェ{}ットの表示が
スクロールするようにしたいときは、テキストウィジェ{}ットが
持っている、
\code{xscrollbar}\index{xscrollbar@\code{xscrollbar}}または
\code{yscrollbar}\index{yscrollbar@\code{yscrollbar}}という
メソッドを使います。これらのメソッドは、引数として
スクロールバーを受け取って、それをレシーバーに設定します。
\code{xscrollbar}は水平方向のスクロールに使うスクロールバーを
設定し、\code{yscrollbar}は垂直方向のスクロールに使う
スクロールバーを設定します。
\begin{program}{scroll.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>20)
scroll = TkScrollbar.new do
pack("side"=>"right", "fill"=>"y")
end
TkText.new do
height(10)
width(30)
font(f)
focus
yscrollbar(scroll)
pack("side"=>"right", "fill"=>"y")
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{テキストエディター}
テキストウィジェ{}ットを使って、ごく単純な
テキストエディター
\index{てきすとえてぃたあ@テキストエディター}を
書いてみましょう。
テキストウィジェ{}ットに入力された文字列を取り出したり、
テキストウィジェ{}ットに文字列を設定したりしたいときは、
エントリーの場合と同じように、
\code{value}\index{value@\code{value}}と
\code{value=}\index{value=@\code{value=}}というメソッドを
使います。
\begin{program}{editor.rb}
\begin{verbatim}
require("tk")
class Editor
def initialize(path)
f = TkFont.new("family"=>"times", "size"=>20)
spec = [
[["ファイル"],
["開く...", proc { open }],
["保存", proc { save }],
["名前を付けて保存...", proc { saveAs }]
]
]
TkMenubar.new(nil, spec) do
tearoff(false)
font(f)
pack("side"=>"top", "anchor"=>"w")
end
scroll = TkScrollbar.new do
pack("side"=>"right", "fill"=>"y")
end
@text = TkText.new do
width(70)
height(20)
font(f)
focus
yscrollbar(scroll)
pack("side"=>"right", "fill"=>"y")
end
@path = ""
readFile(path)
Tk.mainloop
end
def readFile(path)
if path != ""
File.open(path) do |f|
@text.value = f.read
end
@path = path
end
end
def writeFile(path)
if path != ""
File.open(path, "w") do |f|
f.write(@text.value)
end
@path = path
end
end
def open
readFile(Tk.getOpenFile)
end
def save
if @path != ""
writeFile(@path)
else
saveAs
end
end
def saveAs
writeFile(Tk.getSaveFile)
end
end
if ARGV.size == 0
Editor.new("")
else
Editor.new(ARGV[0])
end
\end{verbatim}
\end{program}
\section{キャンバス}\label{sec:canvas}
\subsection{キャンバスの生成}
Tkには、「キャンバス\index{きゃんはす@キャンバス}」(canvas)と
呼ばれるウィジェ{}ットがあります。これは、その上に図形を
描画することができるウィジェ{}ットで、
\code{TkCanvas}\index{TkCanvas@\code{TkCanvas}}というクラスの
インスタンスです。
キャンバスの大きさは、
\code{height}\index{height@\code{height}}と
\code{width}\index{width@\code{width}}というメソッドを使って
設定します。\code{height}が縦の長さ、\code{width}が横の
長さで、単位はピクセルです。
キャンバスの背景の色は、ほかのウィジェ{}ットと同じように、
\code{background}\index{background@\code{background}}という
メソッドを使って設定します。
\begin{program}{canvas.rb}
\begin{verbatim}
require("tk")
TkCanvas.new do
height(200)
width(300)
background("#ccffff")
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
図形や文字列やウィジェ{}ットなど、キャンバスの上に
表示されるものは、「キャンバスオブジェクト
\index{きゃんはすおふしぇくと@キャンバスオブジェクト}」
(canvas object)と呼ばれます。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{クラス名} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
TkcRectangle & 長方形 \\ \hline
TkcOval & 楕円 \\ \hline
TkcArc & 円弧 \\ \hline
TkcLine & 折れ線 \\ \hline
TkcPolygon & 多角形 \\ \hline
TkcText & 文字列 \\ \hline
TkcWindow & ウィジェ{}ット \\ \hline
TkcBitmap & \textrm{XBM}形式の画像 \\ \hline
TkcImage & \textrm{PPM、PGM、GIF}などの形式の画像
\\ \hline
\end{tabular}
\end{ttfamily}
\caption{キャンバスオブジェクトのクラス}
\label{tab:canvasobject}
\index{TkcRectangle@\code{TkcRectangle}}
\index{TkcOval@\code{TkcOval}}
\index{TkcArc@\code{TkcArc}}
\index{TkcLine@\code{TkcLine}}
\index{TkcPolygon@\code{TkcPolygon}}
\index{TkcText@\code{TkcText}}
\index{TkcWindow@\code{TkcWindow}}
\index{TkcBitmap@\code{TkcBitmap}}
\index{TkcImage@\code{TkcImage}}
\index{ちょうほうけい@長方形}
\index{たえん@楕円}
\index{えんこ@円弧}
\index{おれせん@折れ線}
\index{たかっけい@多角形}
\index{もしれつ@文字列}
\index{うぃしぇっと@ウィジェ{}ット}
\index{かそう@画像}
\end{table}
キャンバスの上にキャンバスオブジェクトを表示するためには、
それを表示するオブジェクトを生成する必要があります。
キャンバスオブジェクトを表示するオブジェクトも、
「キャンバスオブジェクト」と呼ばれます。
表\ref{tab:canvasobject}は、キャンバスオブジェクトを生成する
クラスの一覧です。
キャンバスオブジェクトを生成するためには、そのクラスの
\code{new}を呼び出して、いくつかの引数を渡す必要があります。
1個目の引数はキャンバスで、2個目以降は、キャンバス上の位置を
指定する座標などです。
たとえば、長方形\index{ちょうほうけい@長方形}を
表示したいときは、\code{TkcRectangle}の\code{new}に対して、
\begin{quote}
\syntax{キャンバス}, $x_{1}$, $y_{1}$, $x_{2}$, $y_{2}$
\end{quote}
という引数を渡します。$(x_{1}, y_{1})$と$(x_{2}, y_{2})$は、
長方形の対角線の両端の座標です。ちなみに、キャンバスの
座標系は、左上の隅が原点で、$x$軸は右向き、$y$軸は下向きです。
\begin{program}{rect.rb}
\begin{verbatim}
require("tk")
canvas = TkCanvas.new do
width(400)
height(300)
pack
end
TkcRectangle.new(canvas, 50, 100, 300, 200)
TkcRectangle.new(canvas, 200, 50, 350, 250)
Tk.mainloop
\end{verbatim}
\end{program}
図形のキャンバスオブジェクトは、デフォルトでは、線の太さが
1ピクセル、線の色が黒で、内部を塗りつぶさずに表示されます。
線の太さ、線の色、内部を塗りつぶす色を設定したいときは、
\code{new}にブロックを渡して、そのブロックの中でメソッドを
呼び出します。線の太さを設定するメソッドは
\code{width}\index{width@\code{width}}、線の色を設定する
メソッドは\code{outline}\index{outline@\code{outline}}、
そして図形の内部の色を設定するメソッドは
\code{fill}\index{fill@\code{fill}}です。\code{width}は
太さをあらわす整数を引数として受け取り、\code{outline}と
\code{fill}は、色をあらわす文字列を引数として受け取ります。
\code{outline}に空文字列を渡すと線が表示されなくなり、
\code{fill}に空文字列を渡すと内部が塗りつぶされなくなります。
\begin{program}{initobj.rb}
\begin{verbatim}
require("tk")
canvas = TkCanvas.new do
width(400)
height(300)
pack
end
TkcRectangle.new(canvas, 50, 50, 300, 200) do
width(10)
outline("#0080ff")
fill("#80ff80")
end
TkcRectangle.new(canvas, 100, 100, 350, 250) do
outline("")
fill("#ffff80")
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{楕円と円弧}
キャンバスの上に楕円\index{たえん@楕円}を表示したいときは、
\code{TkcOval}\index{TkcOval@\code{TkcOval}}というクラスの
インスタンスを生成します。\code{TkcOval}の\code{new}には、
\begin{quote}
\syntax{キャンバス}, $x_{1}$, $y_{1}$, $x_{2}$, $y_{2}$
\end{quote}
という引数を渡します。$(x_{1}, y_{1})$と$(x_{2}, y_{2})$は、
楕円に外接する長方形の対角線の両端の座標です。
\begin{program}{oval.rb}
\begin{verbatim}
require("tk")
canvas = TkCanvas.new do
width(400)
height(300)
pack
end
TkcOval.new(canvas, 50, 100, 350, 200)
TkcOval.new(canvas, 100, 150, 200, 250)
TkcOval.new(canvas, 250, 50, 300, 250)
Tk.mainloop
\end{verbatim}
\end{program}
キャンバスの上に円弧\index{えんこ@円弧}を表示したいときは、
\code{TkcArc}\index{TkcArc@\code{TkcArc}}というクラスの
インスタンスを生成します。\code{TkcArc}の\code{new}に渡す
引数は、楕円の場合と同じです。
円弧を表示するためには、\code{new}に渡すブロックの中で、
\code{start}、\code{extent}、\code{style}というメソッドを
呼び出すことによって、その円弧の属性を設定する必要があります。
\code{start}\index{start@\code{start}}は、円弧の開始点の角度を
設定するメソッドです。角度は、中心から見て右方向が0度で、
反時計回りに大きくなっていきます。
\code{extent}\index{extent@\code{extent}}は、円弧の終了点の
角度を設定するメソッドです。プラスの数値を指定した場合は、
開始点から終了点に向かって反時計回りに円弧が表示され、
マイナスの数値を指定した場合は、時計回りに円弧が表示されます。
\code{style}\index{style@\code{style}}は、円弧のスタイルを
設定するメソッドです。\code{arc}という文字列を引数として
渡すと、円弧のみが表示されます。\code{chord}を渡すと、開始点と
終了点をつなぐ直線が追加されます。\code{pieslice}を渡すと、
中心と開始点、中心と終了点をつなぐ直線が追加されます。
\begin{program}{arc.rb}
\begin{verbatim}
require("tk")
canvas = TkCanvas.new do
width(400)
height(300)
pack
end
TkcArc.new(canvas, 50, 30, 250, 200) do
start(0)
extent(225)
style("arc")
end
TkcArc.new(canvas, 100, 80, 300, 250) do
start(0)
extent(225)
style("chord")
end
TkcArc.new(canvas, 150, 130, 350, 300) do
start(0)
extent(225)
style("pieslice")
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{折れ線と多角形}
キャンバスの上に折れ線\index{おれせん@折れ線}を
表示したいときは、
\code{TkcLine}\index{TkcLine@\code{TkcLine}}というクラスの
インスタンスを生成します。\code{TkcLine}の\code{new}には、
\begin{quote}
\syntax{キャンバス}, $x_{1}$, $y_{1}$, $x_{2}$, $y_{2}$,%
\ \tenten, $x_{n}$, $y_{n}$
\end{quote}
という引数を渡します。そうすると、$(x_{1}, y_{1})$、
$(x_{2}, y_{2})$、\tenten 、$(x_{n}, y_{n})$、という点を順番に
直線で連結した折れ線が描画されます。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{メソッド名} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
arrow & 矢印の指定(none、first、last、both)
\\ \hline
arrowshape &
矢印の形(\textrm{3}個の数値から構成される配列)
\\ \hline
capstyle & 線の端点の形状(butt、projecting、round)
\\ \hline
joinstyle & 線の接続点の形状(miter、bevel、round)
\\ \hline
\end{tabular}
\end{ttfamily}
\caption{折れ線の形状を設定するメソッド}
\label{tab:shapeofline}
\index{arrow@\code{arrow}}
\index{arrowstyle@\code{arrowstyle}}
\index{capstyle@\code{capstyle}}
\index{joinstyle@\code{joinstyle}}
\index{やしるし@矢印}
\index{たんてん@端点}
\index{せつそくてん@接続点}
\end{table}
折れ線の形状は、表\ref{tab:shapeofline}に示したメソッドを
使うことによって設定することができます。ちなみに、
\code{arrowshape}に渡す引数は1個の配列で、1個目は
矢印\index{やしるし@矢印}の根元から先端までの長さ、2個目は
翼端をつなぐ直線と中心線との交点から先端までの長さ、3個目は
中心線と翼端とのあいだの距離です。
\begin{program}{line.rb}
\begin{verbatim}
require("tk")
canvas = TkCanvas.new do
width(400)
height(300)
pack
end
TkcLine.new(canvas, 30, 30, 150, 150, 30, 270)
TkcLine.new(canvas, 100, 30, 220, 150, 100, 270) do
arrow("last")
arrowshape([30, 40, 10])
end
TkcLine.new(canvas, 170, 30, 290, 150, 170, 270) do
width(20)
capstyle("round")
end
TkcLine.new(canvas, 240, 30, 360, 150, 240, 270) do
width(20)
joinstyle("bevel")
end
Tk.mainloop
\end{verbatim}
\end{program}
キャンバスの上に多角形\index{たかっけい@多角形}を
表示したいときは、
\code{TkcPolygon}\index{TkcPolygon@\code{TkcPolygon}}という
クラスのインスタンスを生成します。\code{TkcPolygon}の
\code{new}には、多角形を構成するそれぞれの頂点の座標を
引数として渡します。
\begin{program}{polygon.rb}
\begin{verbatim}
require("tk")
canvas = TkCanvas.new do
width(400)
height(300)
pack
end
TkcPolygon.new(canvas, 200, 100, 30, 200, 370, 200) do
outline("")
fill("#80ff00")
end
TkcPolygon.new(canvas,
120, 50, 80, 250, 320, 250, 280, 50) do
width(20)
outline("#8000ff")
fill("")
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{画像}
Ruby/Tkで扱うことのできる画像は、「ビットマップイメージ
\index{ひっとまっふいめえし@ビットマップイメージ}」
(bitmap image)と
「フォトイメージ\index{ふぉといめえし@フォトイメージ}」
(photo image)という2種類のものに分類することができます。
ビットマップイメージのほうは単色の画像で、
フォトイメージのほうはフルカラーの画像です。
フォトイメージは、
\code{TkPhotoImage}\index{TkPhotoImage@\code{TkPhotoImage}}%
というクラスのインスタンスとして扱われます。このクラスの
インスタンスに対して画像のデータを設定したいときは、
そのオブジェクトが持っている
\code{file}\index{file@\code{file}}というメソッドを使います。
このメソッドを呼び出して、画像のデータが格納されている
ファイルのパス名を引数として渡すと、このメソッドは、
ファイルから画像のデータを読み込んで、それをレシーバーに
設定します。たとえば、
\begin{quote}
\begin{verbatim}
TkPhotoImage.new do
file("namako.gif")
end
\end{verbatim}
\end{quote}
という式を書くことによって、\code{TkPhotoImage}クラスの
インスタンスを生成して、\code{namako.gif}というパス名で
指定されたファイルに格納されている画像データをそれに
設定することができます。
キャンバスの上にフォトイメージを表示したいときは、
\code{TkcImage}\index{TkcImage@\code{TkcImage}}というクラスの
インスタンスを生成します。\code{TkcImage}の\code{new}には、
\begin{quote}
\syntax{キャンバス}, $x$, $y$
\end{quote}
という引数を渡します。そうすると、$(x, y)$という点を中心とする
位置に画像を表示するキャンバスオブジェクトが生成されます。
\code{TkcImage}クラスのインスタンスに画像を
表示させるためには、そのキャンバスオブジェクトが持っている
\code{image}\index{image@\code{image}}というメソッドを使って、
フォトイメージの設定をする必要があります。\code{image}は、
フォトイメージを引数として受け取って、それをレシーバーに
設定します。
\begin{program}{image.rb}
\begin{verbatim}
require("tk")
canvas = TkCanvas.new do
width(400)
height(300)
pack
end
img = TkPhotoImage.new do
file("sample.gif")
end
TkcImage.new(canvas, 200, 150) do
image(img)
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{キャンバスオブジェクトの移動}
すべてのキャンバスオブジェクトは、
\code{move}\index{move@\code{move}}というメソッドを
持っています。これは、レシーバーが表示されている位置を
移動させるメソッドです。
\code{move}は、$x$軸方向の距離と$y$軸方向の距離を指定する2個の
整数(単位はピクセル)を引数として受け取って、それらの距離だけ
レシーバーを移動させます。
\begin{program}{move.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
canvas = TkCanvas.new do
width(400)
height(300)
pack
end
circle = TkcOval.new(canvas, 190, 140, 220, 170) do
fill("#ffcc00")
end
TkButton.new do
text("右")
font(f)
command do
circle.move(10, 0)
end
pack("side"=>"right")
end
TkButton.new do
text("左")
font(f)
command do
circle.move(-10, 0)
end
pack("side"=>"left")
end
Tk.mainloop
\end{verbatim}
\end{program}
\section{トップレベル}\label{sec:toplevel}
\subsection{トップレベルの生成}
第\ref{sec:foundationofgui}節で説明したように、ウィンドウを
生成するクラスとしては、
\code{TkRoot}\index{TkRoot@\code{TkRoot}}と
\code{TkToplevel}\index{TkToplevel@\code{TkToplevel}}という
二つのものがあります。\code{TkRoot}のインスタンスは、
ルートウィジェ{}ット、つまり\code{mainloop}を呼び出したときに
自動的に表示されるウィンドウです。そして、\code{TkToplevel}の
インスタンスは、「トップレベル
\index{とっふれへる@トップレベル!Tkの@Tkの\baidash}」
(toplevel)と呼ばれるウィンドウです。
\code{TkToplevel}クラスのインスタンスを\code{new}を使って
生成すると、それだけでウィンドウが表示されます。タイトルバーに
表示する文字列は、ルートウィジェ{}ットの場合と同じように、
\code{title}\index{title@\code{title}}というメソッドを
呼び出すことによって設定することができます。
\begin{program}{toplevel.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
count = 0
TkButton.new do
text("ウィンドウを開く")
font(f)
command do
count += 1
TkToplevel.new do
title("window " + count.to_s)
end
end
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{トップレベルへのウィジェ{}ットの取り付け}
ウィジェ{}ットを生成するクラスの\code{new}は、
そのウィジェ{}ットを取り付ける土台となるウィジェ{}ットを
1個目の引数として受け取ります。ですから、ウィジェ{}ットを
生成するクラスの\code{new}を呼び出すときに、1個目の引数として
トップレベルを渡すことによって、そのトップレベルの上に
ウィジェ{}ットを取り付けることができます。
ちなみに、1個目の引数として\code{nil}を渡すか、または引数を
すべて省略した場合は、土台としてルートウィジェ{}ットを
指定するという意味になります。
\begin{program}{countup2.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>18)
count = 0
countlabel = TkLabel.new do
text("0")
font(f)
pack("padx" => 50)
end
toplevel = TkToplevel.new
TkButton.new(toplevel) do
text("増やす")
font(f)
command do
count += 1
countlabel.text(count.to_s)
end
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{グラブ}
トップレベルを使うことによって、独自の機能を持つ
ダイアログボックスを作ることができます。ただし、独自の
ダイアログボックスを作るためには、ウィジェ{}ットが持っている
いくつかの特殊な機能を使う必要があります。その場合に必要になる
機能というのは、グラブ、消滅、そして待機です。
「グラブ\index{くらふ@グラブ}」(grab)というのは、自分に対する
操作が終了するまでのあいだ、自分以外のウィジェ{}ットに対する
操作を制限するという機能のことです。グラブを使いたいときは、
ウィジェ{}ットが持っている
\code{grab}\index{grab@\code{grab}}というメソッドを
呼び出します。
引数を渡さずに\code{grab}を呼び出した場合、\code{grab}は、
ほかのプログラムに対する操作までは制限しません。
ほかのプログラムに対しても操作を制限したいときは、
\code{global}という文字列を引数として渡して\code{grab}を
呼び出します。
グラブを解除したいときは、\code{release}という文字列を
引数として渡して\code{grab}を呼び出します。
\subsection{ウィジェ{}ットの消滅とその待機}
ダイアログボックスは、自分に対する操作が終了したときに、
自分自身を消滅させる必要があります。ウィジェ{}ットを
消滅させたいときは、それが持っている
\code{destroy}\index{destroy@\code{destroy}}というメソッドを
使います。
また、ダイアログボックスを表示するという処理は、
そのダイアログボックスに対する操作が終了するまでのあいだ、
その先へ進まずに待機している必要があります。処理を
待機させたいときは、ウィジェ{}ットが持っている
\code{wait\us destroy}%
\index{wait_destroy@\code{wait\us destroy}}というメソッドを
使います。このメソッドは、レシーバーが存在しているあいだは
何もしないで待機していて、レシーバーが消滅すると終了します。
\subsection{文字列を読み込むダイアログボックス}
これまでに説明した\code{grab}や\code{destroy}や
\code{focus}などを使えば、独自のダイアログボックスを
作ることができます。
それでは、例として、文字列を読み込むダイアログボックスを
作ってみましょう。
\begin{program}{getstr.rb}
\begin{verbatim}
require("tk")
module Dialog
def Dialog.getString(init, size)
var = TkVariable.new(init)
toplevel = TkToplevel.new do
grab
end
f = TkFont.new("family"=>"helvetica", "size"=>18)
entry = TkEntry.new(toplevel) do
width(size)
font(f)
textvariable(var)
focus
pack
end
TkButton.new(toplevel) do
text("OK")
font(f)
command do
toplevel.grab("release")
toplevel.destroy
end
pack
end
toplevel.wait_destroy
var.value
end
end
f = TkFont.new("family"=>"times", "size"=>18)
var = TkVariable.new("string")
label = TkLabel.new do
textvariable(var)
font(f)
pack
end
TkButton.new do
text("文字列の変更")
font(f)
command do
var.value = Dialog.getString(var.value, 30)
end
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
\section{バインディング}\label{sec:binding}
\subsection{バインディングの基礎}
GUIを持つプログラムは、それに対して人間が何らかの
操作をしたときに、それに対応する処理を実行します。GUIの上で
何らかの操作が発生した、という出来事は、
「イベント\index{いへんと@イベント}」(event)と呼ばれます。
そして、イベントが発生したときに実行される処理は、
「イベント処理\index{いへんとしょり@イベント処理}」
(event processing)と呼ばれます。
イベントに対して何らかの動作をイベント処理として
割り当てることを、イベントに動作を
「バインドする\index{はいんとする@バインドする}」(bind)と
言います(名詞形は
「バインディング\index{はいんてぃんく@バインディング}」
(binding)です)。ウィジェ{}ットやキャンバスオブジェクトは、
イベントが自分の上で発生したときに、そのイベントに
バインドされている動作を実行することができる、という機能を
持っています。
イベントに動作をバインドしたいときは、その動作を実行する
ウィジェ{}ットまたはキャンバスオブジェクトが持っている
\code{bind}\index{bind@\code{bind}}というメソッドを
呼び出します。\code{bind}は、2個または3個の引数を
受け取ります。1個目の引数はイベントの種類を指定する文字列で、
2個目の引数は、そのイベントにバインドする動作をあらわす
手続きオブジェクトです。3個目の引数については、もう少しあとで
説明します。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|l|l|} \hline
\multicolumn{1}{|c|}{タイプ} &
\multicolumn{1}{c|}{説明} \\ \hline \hline
ButtonPress & マウスのボタンを押す。 \\ \hline
Button & ButtonPressと同じ。 \\ \hline
ButtonRelease & マウスのボタンを離す。 \\ \hline
Motion & マウスを移動させる。 \\ \hline
Enter & マウスポインターを重ねる。 \\ \hline
Leave & マウスポインターを離す。 \\ \hline
KeyPress & キーボードのキーを押す。 \\ \hline
Key & KeyPressと同じ。 \\ \hline
KeyRelease & キーボードのキーを離す。 \\ \hline
\end{tabular}
\end{ttfamily}
\caption{イベントのタイプ}\label{tab:typeofevents}
\index{ButtonPress@\code{ButtonPress}}
\index{Button@\code{Button}}
\index{ButtonRelease@\code{ButtonRelease}}
\index{Motion@\code{Motion}}
\index{Enter@\code{Enter}}
\index{Leave@\code{Leave}}
\index{KeyPress@\code{KeyPress}}
\index{Key@\code{Key}}
\index{KeyRelease@\code{KeyRelease}}
\end{table}
イベントの種類を指定する文字列は、
\begin{quote}
\syntax{修飾子}\code{-}\syntax{タイプ}\code{-}\syntax{詳細}
\end{quote}
という形式で書きます。ただし、最低限必要なのは「タイプ」という
部分だけです。「タイプ」の部分には、表\ref{tab:typeofevents}に
示されている、イベントのタイプを指定する文字列のいずれかを
書きます。たとえば、\code{ButtonPress}という文字列を
書くことによって、マウスのボタンを押すというイベントを
指定することができます。
次のプログラムによって表示される数字は、マウスで
クリックすると1だけ増えます。
\begin{program}{release.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>24)
count = 0
TkLabel.new do
text("0")
font(f)
bind("ButtonRelease", proc do
count += 1
text(count.to_s)
end)
pack("padx" => 50)
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{マウスのボタンの指定}
マウス\index{まうす@マウス}の特定のボタンによるイベントに
限定して動作をバインドしたいときは、イベントのタイプを指定する
文字列の右側にマイナスを書いて、そのさらに右側に、マウスの
ボタンを指定する番号を書きます。
3個のボタンを持つマウスの場合、それぞれのボタンには、左から
順番に、1、2、3、という番号が与えられています。ボタンが
2個しかないマウスの場合は、左が1で右が3です。
次のプログラムによって表示される数字は、マウスの左ボタンで
クリックすると1だけ増えて、右ボタンでクリックすると1だけ
減ります。
\begin{program}{btnnum.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>24)
count = 0
TkLabel.new do
text("0")
font(f)
bind("ButtonRelease-1", proc do
count += 1
text(count.to_s)
end)
bind("ButtonRelease-3", proc do
count -= 1
text(count.to_s)
end)
pack("padx" => 50)
end
Tk.mainloop
\end{verbatim}
\end{program}
次のプログラムによって表示される長方形は、マウスの左ボタンで
クリックすると線が太くなり、右ボタンでクリックすると線が
細くなります。
\begin{program}{width.rb}
\begin{verbatim}
require("tk")
w = 30
canvas = TkCanvas.new do
width(400)
height(300)
pack
end
TkcRectangle.new(canvas, 100, 100, 300, 200) do
width(w)
outline("#000080")
fill("#00ff00")
bind("ButtonRelease-1", proc do
w += 2
width(w)
end)
bind("ButtonRelease-3", proc do
if w >= 2
w -= 2
width(w)
end
end)
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{キーボードのキーの指定}
キーボード\index{きいほおと@キーボード}の特定のキーによる
イベントに限定して動作をバインドしたいときは、イベントの
タイプを指定する文字列の右側にマイナスを書いて、そのさらに
右側に、「キーシム」と呼ばれる文字列を書きます。
「キーシム\index{きいしむ@キーシム}」(keysym)というのは、
キーボードのそれぞれのキーが持っている、自分を識別するための
文字列のことです。たとえば、スペースは\code{space}、コンマは
\code{comma}、スラッシュは\code{slash}、エンターは
\code{Enter}、右のシフトは\code{Shift\us R}、左向き矢印は
\code{Left}、というキーシムで識別されます。なお、数字と英字の
キーについては、そのキーの文字がそのまま
キーシムになっています。
次のプログラムによって表示される円は、矢印のキーを
押すことによって上下左右に移動させることができます。
\begin{program}{keymove.rb}
\begin{verbatim}
require("tk")
canvas = TkCanvas.new do
width(400)
height(300)
pack
end
circle = TkcOval.new(canvas, 190, 140, 220, 170) do
fill("#00ffcc")
end
TkRoot.new do
bind("KeyPress-Right", proc do
circle.move(10, 0)
end)
bind("KeyPress-Left", proc do
circle.move(-10, 0)
end)
bind("KeyPress-Up", proc do
circle.move(0, -10)
end)
bind("KeyPress-Down", proc do
circle.move(0, 10)
end)
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{マウスの修飾子}
イベントのタイプを指定する文字列の左側には、マイナスで
区切って、
「修飾子\index{しゅうしょくし@修飾子}」(modifier)と
呼ばれる文字列を何個でも好きなだけ書くことができます。修飾子を
書くことによって、いくつかの操作の組み合わせであるような
イベントを指定することができます。
\code{Button1}という文字列は、マウスの左ボタンを押しながら
何らかの操作をするというイベントを指定するための修飾子です。
たとえば、
\begin{quote}
Button1-Motion
\end{quote}
という文字列を書くことによって、マウスの左ボタンで
ドラッグするというイベントを指定することができます。同様に、
\code{Button2}で真ん中のボタン、\code{Button3}で右ボタンを
指定することができます。
次のプログラムによって表示される数字は、マウスの左ボタンで
ドラッグすると、それに応じて増えていきます。
\begin{program}{drag.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>24)
count = 0
TkLabel.new do
text("0")
font(f)
bind("Button1-Motion", proc do
count += 1
text(count.to_s)
end)
pack("padx" => 50)
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{キーボードの修飾子}
\code{Shift}、\code{Control}、\code{Alt}という修飾子を
書くことによって、シフトキー、コントロールキー、オルトキーを
押しながら何らかの操作をする、というイベントを
指定することができます。
なお、シフトキーを押しながら別のキーを操作するという
イベントを指定したいときは、修飾子を使うのではなくて、
その操作に対応するキーシムを使う必要があります。たとえば、
シフトキーを押しながら\code{a}のキーを押すというイベントは、
\code{KeyPress-A}という文字列で指定されます。
次のプログラムによって表示される数字は、コントロールキーを
押しながら上向き矢印キーを押すと、1だけ増えます。
\begin{program}{control.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>24)
count = 0
label = TkLabel.new do
text("0")
font(f)
pack("padx" => 50)
end
TkRoot.new do
bind("Control-KeyPress-Up", proc do
count += 1
label.text(count.to_s)
end)
end
Tk.mainloop
\end{verbatim}
\end{program}
\subsection{イベントキーワード}
ウィジェ{}ットやキャンバスオブジェクトは、自分の上でイベントが
発生したとき、発生したイベントに関する情報をあらわす
オブジェクトを、そのイベントにバインドされている
手続きオブジェクトに渡すことができます。ただし、そのためには、
\code{bind}に渡す3個目の引数で、どのようなオブジェクトを
渡すのかということを指定しておく必要があります。
\begin{table}[tb]\centering
\begin{ttfamily}
\begin{tabular}{|c|l|} \hline
文字列 &
\multicolumn{1}{c|}{説明} \\ \hline \hline
\%b & マウスのボタンの番号 \\ \hline
\%x & ウィジェ{}ット内でのマウスの$x$座標 \\ \hline
\%y & ウィジェ{}ット内でのマウスの$y$座標 \\ \hline
\%X & 画面全体でのマウスの$x$座標 \\ \hline
\%Y & 画面全体でのマウスの$y$座標 \\ \hline
\%A & キーに対応する文字 \\ \hline
\%K & キーに対応するキーシム \\ \hline
\end{tabular}
\end{ttfamily}
\caption{イベントキーワード}\label{tab:eventkeywords}
\end{table}
手続きオブジェクトに渡すオブジェクトは、
「イベントキーワード
\index{いへんときいわあと@イベントキーワード}」
(event keyword)と呼ばれる文字列を書くことによって指定します。
イベントキーワードには、表\ref{tab:eventkeywords}に
示したようなものがあります。
イベントキーワードを空白で区切って並べることによってできた
文字列を、3個目の引数として\code{bind}に渡すと、その文字列に
含まれるイベントキーワードによって指定されたオブジェクトが、
イベントが発生したときに手続きオブジェクトに渡されます。
たとえば、
\begin{quote}
\%x \%y
\end{quote}
という文字列を\code{bind}に渡すと、イベントが発生したときの
マウスの$x$座標と$y$座標が手続きオブジェクトに渡されます。
次のプログラムは、キャンバスの上でマウスが動かされたときに、
そのときのマウスの座標をラベルで表示します。
\begin{program}{coordi.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>24)
label = TkLabel.new do
font(f)
pack
end
TkCanvas.new do
width(400)
height(300)
background("#99ff99")
bind("Motion", proc do |x, y|
label.text("(" + x.to_s + "," + y.to_s + ")")
end, "%x %y")
pack
end
Tk.mainloop
\end{verbatim}
\end{program}
次のプログラムは、キーボードのキーが押されたときに、
押されたキーのキーシムをラベルで表示します。
\begin{program}{keysym.rb}
\begin{verbatim}
require("tk")
f = TkFont.new("family"=>"times", "size"=>24)
label = TkLabel.new do
font(f)
pack("padx" => 50)
end
TkRoot.new do
bind("KeyPress", proc do |keysym|
label.text(keysym)
end, "%K")
end
Tk.mainloop
\end{verbatim}
\end{program}
次のプログラムによって表示される円は、マウスの左ボタンで
ドラッグすることによって移動させることができます。
\begin{program}{dragoval.rb}
\begin{verbatim}
require("tk")
dx = 0
dy = 0
canvas = TkCanvas.new do
width(400)
height(300)
pack
end
TkcOval.new(canvas, 190, 140, 220, 170) do
fill("#99ff66")
bind("ButtonPress", proc do |x, y|
dx = x
dy = y
end, "%x %y")
bind("Button1-Motion", proc do |x, y|
move(x - dx, y - dy)
dx = x
dy = y
end, "%x %y")
end
Tk.mainloop
\end{verbatim}
\end{program}
\section{タイマー}\label{sec:timer}
\subsection{バックグラウンド処理}
GUIを使って人間と対話をするプログラムは、基本的には、人間が
何らかの操作をしたときだけ動作をします。つまり、人間が操作を
何もしていないときは、自分も何もしていないわけです。しかし、
GUIを持っていて、かつ、人間によって操作されていないあいだも
何らかの処理を実行するようなプログラムを書きたい、
という場合もあります。そのようなプログラムが実行する、
人間による操作とは無関係に進行する処理は、
「バックグラウンド処理
\index{はっくくらうんとしょり@バックグラウンド処理}」
(background processing)と呼ばれます。
GUIを作るためのライブラリーの多くは、
「タイマー\index{たいまあ@タイマー}」(timer)と呼ばれるものを
作る機能を持っています。タイマーというのは、一定の時間ごとに
動作を実行するオブジェクトのことです。バックグラウンド処理は、
タイマーを使うことによって実現することができます。
\subsection{タイマーの生成}
Ruby/Tkでは、タイマーは、
\code{TkAfter}\index{TkAfter@\code{TkAfter}}というクラスの
インスタンスです。このクラスの\code{new}は、いくつかの引数を
受け取って、それらの引数で指定されたタイマーを生成します。
\code{TkAfter}クラスの\code{new}が受け取る引数の1個目は、
動作を実行する時間の間隔を指定する整数(単位はミリ秒)です。
たとえば5000という整数を渡すと、5秒間隔で動作を
実行することになります。
引数の2個目は、動作を繰り返す回数を指定する整数です。無限に
繰り返したい場合は、$-1$を渡します。
引数の3個目は、実行する動作をあらわす手続きオブジェクトです。
たとえば、
\begin{quote}
\verb|TkAfter.new(10000, 4, proc { namako })|
\end{quote}
という式でタイマーを生成したとすると、そのタイマーは、
\code{namako}というメソッドを10秒ごとに4回呼び出します。
手続きオブジェクトは、引数の3個目だけではなくて4個目以降にも
好きなだけ引数として渡すことができます。2個以上の
手続きオブジェクトを渡した場合、それらの手続きオブジェクトは、
一定の時間間隔ごとにローテーションで実行されることになります。
生成された直後のタイマーは、停止した状態になっています。
タイマーに動作を開始させるためには、それが持っている
\code{start}\index{start@\code{start}}というメソッドを
呼び出す必要があります。また、
\code{stop}\index{stop@\code{stop}}というメソッドを
呼び出すことによって、動作しているタイマーを停止させることも
可能です。
それでは、タイマーを使ってバックグラウンド処理を実行する
プログラムを書いてみましょう。次のプログラムによって表示される
数字は、1秒ごとに1ずつ増加していきます。
\begin{program}{timer.rb}
\begin{verbatim}
require("tk")
count = 0
f = TkFont.new("family"=>"times", "size"=>24)
label = TkLabel.new do
text("0")
font(f)
pack("padx" => 50)
end
TkAfter.new(1000, -1, proc do
count += 1
label.text(count.to_s)
end).start
Tk.mainloop
\end{verbatim}
\end{program}
\section{ゲーム}\label{sec:game}
\subsection{ゲームの基礎}
この節では、ゲーム\index{けえむ@ゲーム}の
プログラムというものはどうすれば書くことができるのか、
ということについて考えてみたいと思います。
ゲームのプログラムが画面の上に表示するさまざまな
グラフィ{}ックスのことを、
「キャラクター\index{きゃらくたあ@キャラクター}」(character)と
呼ぶことにします。大多数のゲームでは、キャラクターがゲームの
進行にともなって移動していき、それらの位置関係によって得点が
加算されたり勝敗が決まったりします。
次のプログラムは、キャラクターを表現するオブジェクトを生成する
\code{Character}というクラスを定義しています。
\begin{program}{chara.rb}
\begin{verbatim}
class Character
def initialize(x, y, width, height)
@x = x
@y = y
@width = width
@height = height
end
def to_a
[@x, @y, @width, @height]
end
def locate(x, y)
@x = x
@y = y
end
def move(mx, my)
@x += mx
@y += my
end
def outside(chara)
x, y, width, height = chara.to_a
if @x < x
"west"
elsif @x + @width > x + width
"east"
elsif @y < y
"north"
elsif @y + @height > y + height
"south"
else
"inside"
end
end
def Character.overlap(a, alength, b, blength)
if a < b
b <= a + alength
else
a <= b + blength
end
end
def collision(chara)
x, y, width, height = chara.to_a
Character.overlap(@x, @width, x, width) &&
Character.overlap(@y, @height, y, height)
end
end
\end{verbatim}
\end{program}
\code{Character}クラスは、キャラクターをひとつの
長方形とみなして、その位置と大きさを扱います。キャラクターの
位置と大きさは、\code{@x}、\code{@y}、\code{@width}、
\code{@height}という4個のインスタンス変数によって示されます。
\code{@x}と\code{@y}は長方形の左上の頂点の座標で、
\code{@width}は横の長さ、\code{@height}は縦の長さです。
\code{locate}と\code{move}というメソッドは、キャラクターを
移動させるためのものです。\code{locate}が移動先の位置を
絶対的な座標で受け取るのに対して、\code{move}は、現在位置を
基準とする相対的な座標で受け取ります。
\code{outside}というメソッドは、引数として1個のキャラクターを
受け取って、レシーバーが完全に引数の内側にあるかどうかを
判定します。完全に内側にある場合は\code{inside}という文字列を
返し、そうでない場合は、外に出ている方角をあらわす文字列を
返します。
キャラクターを実現する上で重要なのは、それが別のキャラクターと
衝突したかどうかを判定するという処理です。そのような処理は、
「当たり判定\index{あたりはんてい@当たり判定}」
(collision detection)と呼ばれます。
\code{Character}クラスの中で定義されている
\code{collision}は、当たり判定をするメソッドです。
このメソッドは、引数として1個のキャラクターを受け取って、
レシーバーと引数とが少しでも重なっているかどうかを調べて、
重なっているならば真、そうでなければ偽を返します。
\code{Character}クラスでは、キャラクターの形状を一律に
長方形とみなして当たり判定をしますので、キャラクターの実際の
形状が長方形ではない場合は、判定の結果に多少の誤差が生じます。
本格的なゲームのプログラムを書く場合は、キャラクターの形状に
応じた当たり判定のメソッドを書く必要があります。
\subsection{テニスのプログラム}
上で定義した\code{Character}クラスを使った具体的なゲームの
プログラムの例として、テニスのプログラムを書いてみましょう。
このゲームは、プレーヤーがマウスを使ってラケットを
動かすことによってボールを打ち返す、というものです。ラケットと
ボールは壁で囲まれたコートの中にあって、ボールは壁に当たると
跳ね返ります\footnote{どちらかと言えばテニスよりもスカッシュに
近いですね。}。得点は、ラケットでボールを打つたびに
加算されます。そして、ラケットの背後にある壁にボールが当たった
場合は、ゲームオーバーです。
それでは、次のプログラムを入力して、実行してみてください。
\begin{program}{tennis.rb}
\begin{verbatim}
require("tk")
require("chara")
class Court < Character
def initialize(cwidth, cheight, color)
super(0, 0, cwidth, cheight)
@canvas = TkCanvas.new do
width(cwidth)
height(cheight)
background(color)
pack
end
end
def getCanvas
@canvas
end
end
class Racket < Character
def initialize(width, height, court, color)
cx, cy, cwidth, cheight = court.to_a
@half_w = width / 2
x = cwidth / 2 - @half_w
y = cheight - (height + 50)
super(x, y, width, height)
@co = TkcRectangle.new(court.getCanvas,
x, y, x + width, y + height) { fill(color) }
end
def locate(lx)
lx -= @half_w
x = to_a[0]
move(lx - x, 0)
@co.move(lx - x, 0)
end
end
class Ball < Character
def initialize(size, court, color, velocity)
super(0, 0, size, size)
@co = TkcOval.new(court.getCanvas,
0, 0, size, size) { fill(color) }
@court = court
@velocity = velocity
reset
end
def reset
@co.move(- to_a[0], - to_a[1])
locate(0, 0)
@direction = "se"
end
def turn
case outside(@court)
when "west"
if @direction == "sw"
@direction = "se"
elsif @direction == "nw"
@direction = "ne"
end
when "east"
if @direction == "se"
@direction = "sw"
elsif @direction == "ne"
@direction = "nw"
end
when "north"
if @direction == "ne"
@direction = "se"
elsif @direction == "nw"
@direction = "sw"
end
end
end
def beyondSouth
outside(@court) == "south"
end
def move(x, y)
super(@velocity * x, @velocity * y)
@co.move(@velocity * x, @velocity * y)
end
def dirmove
case @direction
when "se"
move(1, 1)
when "sw"
move(-1, 1)
when "nw"
move(-1, -1)
when "ne"
move(1, -1)
end
end
def hit
if @direction == "se"
@direction = "ne"
elsif @direction == "sw"
@direction = "nw"
end
end
def south
@direction[0,1] == "s"
end
end
class Tennis
def initialize
f = TkFont.new("family"=>"times", "size"=>24)
@label = TkLabel.new do
font(f)
pack
end
court = Court.new(600, 500, "#006600")
@racket = Racket.new(80, 20, court, "#ffffff")
court.getCanvas.bind("Motion", proc do |x|
@racket.locate(x)
end, "%x")
@ball = Ball.new(30, court, "#ffff99", 5)
reset
TkAfter.new(5, -1, proc { background }).start
Tk.mainloop
end
def reset
@score = 0
@label.text("0")
@ball.reset
end
def hit
@ball.hit
@score += 1
@label.text(@score.to_s)
end
def background
if @ball.beyondSouth
Tk.messageBox("message" => "This game was over.")
reset
end
@ball.turn
if @ball.south && @ball.collision(@racket)
hit
end
@ball.dirmove
end
end
Tennis.new
\end{verbatim}
\end{program}
\subsection{テニスのキャラクター}
\code{Character}というのは、あくまでキャラクターというものを
一般化したクラスですので、実際のキャラクターを
生成するためには、\code{Character}クラスのサブクラスを
定義する必要があります。
テニスのゲームは、コート、ラケット、ボールという3個の
キャラクターを持っています。それらのキャラクターは、それぞれ、
\code{Court}、\code{Racket}、\code{Ball}というクラスから
生成されます。そして、コートはキャンバスとして画面の上に
表示され、ラケットとボールはキャンバスオブジェクトとして
キャンバスの上に表示されます。
ラケットは、マウスによって左右に
移動させることができないといけませんので、\code{locate}という、
そのためのメソッドを持っています。このメソッドは、引数として
移動先の$x$座標を受け取って、キャラクターとしての位置と
キャンバスオブジェクトとしての位置の両方を移動させます。
ボールは、\code{@direction}というインスタンス変数を
持っていて、その変数が指し示している文字列が、現在の進行方向を
あらわしています。そして、\code{dirmove}というメソッドが
呼び出されるたびに、少しずつ移動していきます。\code{turn}という
メソッドは、ボールが壁に当たったときに、その進行方向を
変更します。また、ボールがラケットに当たったときは、
\code{hit}というメソッドによって進行方向が変更されます。
\chapter*{参考文献}\label{chap:bibliography}
\addcontentsline{toc}{chapter}{参考文献}
\markboth{参考文献}{参考文献}
\begin{biblio}
\item[RubyFAQ,2002]
\booktitle{Ruby FAQ}, maintained by Dave Thomas, 2002.
\bibliourl{http://www.rubycentral.com/faq/}
\item[Slagell,2002]
Mark Slagell, \booktitle{Teach Yourself Ruby in 21 Days},
Sams Publishing, 2002, ISBN 978-0-672-32252-5.
\item[Thomas,2005]
David Thomas with Chad Fowler and Andrew Hunt,
\booktitle{Programming Ruby:\
The Pragmatic Programmer's Guide, Second Edition},
Pragmatic Programmers, 2005,
ISBN 978-0-9745140-5-5.
第I部〜第III部の邦訳(田和勝)、
『プログラミングRuby・第2版・言語編』、オーム社、2006、
ISBN 978-4-274-06642-9。
第IV部の邦訳(田和勝)、
『プログラミングRuby・第2版・ライブラリ編』、オーム社、2006、
ISBN 978-4-274-06643-6。
\item[青木,2002]
青木峰郎、『Rubyソースコード完全解説』、インプレス、2002、
ISBN 978-4-8443-1721-0。
\item[高橋,2002]
高橋征義、後藤裕蔵、『たのしいRuby\baidash
Rubyではじめる気軽なプログラミング\baidash 』、
ソフトバンクパブリッシング、2002、ISBN 978-4-7973-1408-3。
\item[永井,2001]
永井秀利、『Rubyを256倍使うための本・界道編』、アスキー、
2001、ISBN 978-4-7561-3993-1。
\item[原,2000]
原信一郎、『Rubyプログラミング入門』、オーム社、2000、
ISBN 978-4-274-06385-5。
\item[前田,2002]
前田修吾、まつもとゆきひろ、やまだあきら、永井秀利、
『Rubyアプリケーションプログラミング』、オーム社、2002、
ISBN 978-4-274-06461-6。
\item[まつもと,1999]
まつもとゆきひろ、石塚圭樹、
『オブジェクト指向スクリプト言語Ruby』、アスキー、1999、
ISBN 978-4-7561-3254-3。
\item[まつもと,2000]
まつもとゆきひろ、『Rubyデスクトップリファレンス』、
オライリー・ジャパン、2000、ISBN 978-4-87311-023-3。
\item[まつもと,2003]
まつもとゆきひろ、『Ruby 1.6リファレンスマニュアル』、2003。
\bibliourl{http://www.ruby-lang.org/ja/man-1.6/}
\item[るびきち,2003]
るびきち、『Rubyシェルプログラミング』、技術評論社、2003、
ISBN 978-4-7741-1798-0。
\end{biblio}
% 索引の出力
\clearpage
\setlength{\baselineskip}{\indexlineskip}
\addcontentsline{toc}{chapter}{索引}
\printindex
\end{document}
|
http://theanarchistlibrary.antirep.net/t/tt/translating-the-interface.tex
|
antirep.net
|
CC-MAIN-2019-35
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2019-35/segments/1566027312128.3/warc/CC-MAIN-20190817102624-20190817124624-00223.warc.gz
| 187,514,224
| 2,881
|
\documentclass[DIV=13,%
BCOR=0mm,%
headinclude=false,%
footinclude=false,open=any,%
fontsize=10pt,%
oneside,%
paper=a5]%
{scrbook}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainfont{TeX Gyre Pagella}
% these are not used but prevents XeTeX to barf
\setsansfont[Scale=MatchLowercase]{CMU Sans Serif}
\setmonofont[Scale=MatchLowercase]{CMU Typewriter Text}
\setmainlanguage{english}
% global style
\pagestyle{plain}
\usepackage{microtype} % you need an *updated* texlive 2012, but harmless
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{verbatim}
% http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\PassOptionsToPackage{hyphens}{url}\usepackage[hyperfootnotes=false,hidelinks,breaklinks=true]{hyperref}
\usepackage{bookmark}
% footnote handling
\usepackage[fragile]{bigfoot}
\usepackage{perpage}
\DeclareNewFootnote{default}
\DeclareNewFootnote{B}
\MakeSorted{footnoteB}
\renewcommand*\thefootnoteB{(\arabic{footnoteB})}
\deffootnote[3em]{0em}{4em}{\textsuperscript{\thefootnotemark}~}
% continuous numbering across the document. Defaults to resetting at chapter. Unclear
% \usepackage{chngcntr}
% \counterwithout{footnote}{chapter}
\usepackage[shortlabels]{enumitem}
\usepackage{tabularx}
\usepackage[normalem]{ulem}
\def\hsout{\bgroup \ULdepth=-.55ex \ULset}
% https://tex.stackexchange.com/questions/22410/strikethrough-in-section-title
% Unclear if \protect \hsout is needed. Doesn't looks so
\DeclareRobustCommand{\sout}[1]{\texorpdfstring{\hsout{#1}}{#1}}
\usepackage{wrapfig}
\usepackage{indentfirst}
% remove the numbering
\setcounter{secnumdepth}{-2}
% remove labels from the captions
\renewcommand*{\captionformat}{}
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\KOMAoption{captions}{belowfigure,nooneline}
\addtokomafont{caption}{\centering}
% avoid breakage on multiple <br><br> and avoid the next [] to be eaten
\newcommand*{\forcelinebreak}{\strut\\*{}}
\newcommand*{\hairline}{%
\bigskip%
\noindent \hrulefill%
\bigskip%
}
% reverse indentation for biblio and play
\newenvironment*{amusebiblio}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newenvironment*{amuseplay}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newcommand*{\Slash}{\slash\hspace{0pt}}
\addtokomafont{disposition}{\rmfamily}
\addtokomafont{descriptionlabel}{\rmfamily}
% forbid widows/orphans
\frenchspacing
\sloppy
\clubpenalty=10000
\widowpenalty=10000
% http://tex.stackexchange.com/questions/304802/how-not-to-hyphenate-the-last-word-of-a-paragraph
\finalhyphendemerits=10000
% given that we said footinclude=false, this should be safe
\setlength{\footskip}{2\baselineskip}
\title{Translating the interface}
\date{}
\author{}
\subtitle{}
% https://groups.google.com/d/topic/comp.text.tex/6fYmcVMbSbQ/discussion
\hypersetup{%
pdfencoding=auto,
pdftitle={Translating the interface},%
pdfauthor={},%
pdfsubject={},%
pdfkeywords={doc; howto}%
}
\begin{document}
\begin{titlepage}
\strut\vskip 2em
\begin{center}
{\usekomafont{title}{\huge Translating the interface\par}}%
\vskip 1em
\vskip 2em
\vskip 1.5em
\vfill
\strut\par
\end{center}
\end{titlepage}
\cleardoublepage
\tableofcontents
% start a new right-handed page
\cleardoublepage
\chapter{Enabling the language in the admin interface}
Go to \texttt{/admin/sites}, edit, set the Locale and\Slash{}or add the code to the
Multilanguage setting.
\chapter{Technical details (for developers)}
See
\href{https://github.com/melmothx/amusewiki/blob/master/LOCALIZATION.txt}{\texttt{LOCALIZATION.txt}}
in the root of the distribution.
This document also contains the procedure if you want to override the
translation on a per-site basis.
\chapter{Translating the interface (for translators\Slash{}non-tech)}
\begin{enumerate}[1.]
\item\relax
Install \href{http://poedit.net/}{Poedit}.
\item\relax
Go to \url{https://github.com/melmothx/amusewiki/releases} and download
the \textbf{latest}. Unpack the archive and find the .po file with your
language code in the \texttt{lib/AmuseWikiFarm/I18N} directory.
\item\relax
Open the .po file with Poedit. Add the translations. Please
preserve the \%1, \%2, in the message. They are placeholders for
dynamic content. Save (of course). Send the .po file to
\texttt{melmothx (at) gmail (dot) com}.
\end{enumerate}
Done.
When a new release comes out, repeat from point 2 (unless you
uninstalled Poedit in the meanwhile).
% begin final page
\clearpage
% new page for the colophon
\thispagestyle{empty}
\begin{center}
\bigskip
\includegraphics[width=0.25\textwidth]{logo-amw.pdf}
\bigskip
\end{center}
\strut
\vfill
\begin{center}
Translating the interface
\bigskip
\bigskip
\textbf{amusewiki.org}
\end{center}
% end final page with colophon
\end{document}
|
https://www.pivi.de/refbase-0.9.5/search.php?sqlQuery=SELECT%20author%2C%20title%2C%20type%2C%20year%2C%20publication%2C%20abbrev_journal%2C%20volume%2C%20issue%2C%20pages%2C%20keywords%2C%20abstract%2C%20thesis%2C%20editor%2C%20publisher%2C%20place%2C%20abbrev_series_title%2C%20series_title%2C%20series_editor%2C%20series_volume%2C%20series_issue%2C%20edition%2C%20language%2C%20author_count%2C%20online_publication%2C%20online_citation%2C%20doi%2C%20serial%20FROM%20refs%20WHERE%20serial%20%3D%2035%20ORDER%20BY%20first_author%2C%20author_count%2C%20author%2C%20year%2C%20title&client=&formType=sqlSearch&submit=Cite&viewType=&showQuery=0&showLinks=1&showRows=10&rowOffset=&wrapResults=1&citeOrder=&citeStyle=APA&exportFormat=RIS&exportType=html&exportStylesheet=&citeType=LaTeX&headerMsg=
|
pivi.de
|
CC-MAIN-2021-49
|
application/x-latex
|
application/x-latex
|
crawl-data/CC-MAIN-2021-49/segments/1637964362930.53/warc/CC-MAIN-20211204033320-20211204063320-00466.warc.gz
| 953,870,505
| 1,257
|
%&LaTeX
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\begin{document}
\begin{thebibliography}{1}
\bibitem{1998} (1998). \textit{Lebensraum Wasser: fischereiliche Untersuchungen im Rheinsystem} (Vol. 23).
\end{thebibliography}
\end{document}
|
http://www.sr-ix.com/Project-Archive/Without-Borders-1989-Anarchist-Gathering-Booklet/SCHEDULE.TEX
|
sr-ix.com
|
CC-MAIN-2023-14
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2023-14/segments/1679296950373.88/warc/CC-MAIN-20230402012805-20230402042805-00170.warc.gz
| 97,421,872
| 1,635
|
\input booklet
\vsize=3.6in
\hsize=5.9in
\font\rm=cmss8 \rm
\def\circleA{{A\hskip-7.8pt$\bigcirc$}}
\def\neaten{\vrule height1pt width0pt&
\vrule height1pt width0pt&
\vrule height1pt width0pt&
\vrule height1pt width0pt&
\vrule height1pt width0pt&
\vrule height1pt width0pt&
\vrule height1pt width0pt&
\vrule height1pt width0pt&
\vrule height1pt width0pt\cr}
\def\horizbar{\noalign{\hrule width 407.7pt}}
\def\blnk{}
\def\hbar{\hrulefill}
\def\jot{\hskip.25em}
\vbox{
\offinterlineskip
\baselineskip=8pt
\lineskiplimit=-1000pt
\tabskip=0pt
\centerline{\hl without borders general schedule}
\smallskip
\centerline{(More detailed schedules and descriptions can be found elsewhere in this guidebook.)}
\vskip14pt
\vfill
\halign to \hsize{
\strut\vrule\hfil\jot#\jot\vrule& % time of day
\hfil\jot#\jot\hfil\vrule& % tuesday
\hfil\jot#\jot\hfil\vrule& % ...
\hfil\jot#\jot\hfil\vrule&
\hfil\jot#\jot\hfil\vrule&
\hfil\jot#\jot\hfil\vrule&
\hfil\jot#\jot\hfil\vrule&
\hfil\jot#\jot\hfil\vrule&
\hfil\jot#\jot\hfil\vrule\cr % ... tuesday
\horizbar
\strut&tuesday&wednesday&thursday&friday&
saturday&\quad sunday\quad&monday&tuesday\cr
\horizbar
10:00&obnoxious& obnoxious& \blnk& brunch 10-12;&brunch 10-12;&\blnk& brunch 10-12;& brunch 10-12;\cr
10:30& \blnk& \blnk& \hbar& general& general& \blnk& general& general\cr
11:00&wimmin's& wimmin's& general& assembly& assembly& \hbar& assembly& assembly\cr
11:30& \blnk& \blnk& assembly& 11-12& 11-12& \blnk& 11-12& 11-12\cr
12:00&network& network& \blnk& \hbar& \hbar& \circleA& \hbar& \hbar\cr
12:30& \blnk& \blnk& \hbar& \hbar& \hbar& \blnk& \hbar& \hbar\cr
1:00&gathering& gathering& \hbar& \blnk& \blnk& picnic& \blnk& \blnk\cr
1:30& \blnk& \blnk& \blnk& day& day& \blnk& day& \blnk\cr
2:00&and& and& \blnk& of& of& and& of& \blnk\cr
2:30& \blnk& \blnk& workshops&anti-& anti-& \blnk& networking& workshops\cr
3:00&men's& men's& \blnk& sexism& racism& festival& events& \blnk\cr
3:30& \blnk& \blnk& \blnk& events& events& \blnk& and& \blnk\cr
4:00&campout& campout& \blnk& and& and& in& workshops& \blnk\cr
4:30& \blnk& \blnk& \blnk& workshops& workshops& \blnk& \blnk& \blnk\cr
5:00& \blnk& \blnk& \hbar& \blnk& \blnk& dolores& \blnk& \blnk\cr
5:30& \blnk& \blnk& dinner& \blnk& \blnk& \blnk& \blnk& \blnk\cr
6:00& \blnk& \blnk& is& \blnk& \blnk& park& \blnk& \blnk\cr
6:30& \blnk& \blnk& served& \blnk& \blnk& \blnk& \blnk& \blnk\cr
7:00& \blnk& \blnk& \blnk& \hbar& \hbar& \blnk& \hbar& \hbar\cr
7:30& \blnk& \blnk& \blnk& dinner& dinner& \blnk& dinner& dinner\cr
8:00& \blnk& \blnk& \hbar& is& is& \hbar& is& is\cr
8:30& \blnk& \blnk& \blnk& served& served& \blnk& served& served\cr
9:00& \blnk& \blnk& \blnk& \hbar& \hbar& \blnk& \hbar& \hbar\cr
9:30& \blnk& \blnk& \blnk& \blnk& \blnk& \blnk& \blnk& \blnk\cr
%10:00& \blnk& \blnk& \blnk& \blnk& \blnk& \blnk& \blnk& \blnk\cr
\horizbar
} % end halign
} % end vbox
%\boxit{1}{\box4}
\supereject\end
|
https://ftp.pl.vim.org/packages/tex/biblio/bibtex/contrib/zootaxa-bst/example.tex
|
vim.org
|
CC-MAIN-2022-33
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2022-33/segments/1659882570692.22/warc/CC-MAIN-20220807181008-20220807211008-00580.warc.gz
| 292,711,348
| 3,112
|
\documentclass{article}
\usepackage{natbib}
\usepackage{amsmath}
\usepackage[USenglish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[colorlinks=true,citecolor=blue]{hyperref}
\author{Gustavo A. Ballen}
\date{\today}
\title{An example manuscript using the \texttt{zootaxa.bst} reference style for Bib\TeX}
\begin{document}
\maketitle
This example uses \texttt{natbib} for handling taxonomic author citations, that behave a bit different from usual bibliographic citations. For details see this blog post: https://gaballench.wordpress.com/2019/03/22/referencing-zoological-name-authorships-in-latex/
The usage is pretty simple: Just install \texttt{zootaxa.bst} in a place where \texttt{bibtex} can find it and the compile a couple times with bibtex before compiling with latex. Rinse and repeat if needed. Also, don't forget to create your \texttt{bibtex} \texttt{.bib} bibliography file. Please note that three lines are absolutely necessary for this:
\begin{verbatim}
\documentclass{article}
\usepackage{natbib}
...
...
...
\bibliographystyle{zootaxa}
\bibliography{example-refs}
\end{document}
\end{verbatim}
The command \texttt{usepackage} activates the \texttt{natbib} package necessary for managing references. The command \texttt{bibliographystyle} will tell the system to use \texttt{zootaxa.bst}. The command \texttt{bibliography} points the \texttt{.bib} file. Please note that the fact that we are not indicating paths indicates that 1) the files are in the path (in the case of the package if it was installed where the system can find it), or the in working directory where the remaining files are found (e.g., the bibliography file).
The Instructions for Authors on zootaxa's website indicate that:
A) Journal paper:
Smith, A. (1999) Title of the paper. Title of the journal in full, volume number, page range.
B) Book chapter:
Smith, A. \& Smith, B. (2000) Title of the Chapter. In: Smith, A, Smith, B. \& Smith, C. (Eds), Title of Book. Publisher name and location, pp. x–y.
C) Book:
Smith, A., Smith, B. \& Smith, C. (2001) Title of Book. Publisher name and location, xyz pp.
D) Internet resources
Author (2002) Title of website, database or other resources, Publisher name and location (if indicated), number of pages (if known). Available from: http://xxx.xxx.xxx/ (Date of access).
Dissertations resulting from graduate studies and non-serial proceedings of conferences/symposia are to be treated as books and cited as such. Papers not cited must not be listed in the references.
Also, the separator between authors should the the ampersand (\&), and the abbreviation \textit{et allii} should be italized (\textit{et al.})
All of these aspects are handled automatically by \texttt{zootaxa.bst}. For instance, the following text will make use of several references that will be rendered into text according to rules of zootaxa, while generating the references also in the appropriate format.
\section{Live example}
Seven genus-group names based on extant taxa have been allocated to the Sphyraenidae: \textit{Agriosphyraena} \citealp{Fowler1903} (type \textit{Esox barracuda}), \textit{Australuzza} \citealp{Whitley1947} (type \textit{Sphyraena novaehollandiae}), \textit{Callosphyraena} \citealp{Smith1956} (type \textit{Sphyraema toxeuma}, junior synonym of \textit{Sphyraena forsteri}), \textit{Indosphyraena} \citealp{Smith1956} (type \textit{Sphyraena africana}), \textit{Sphyraenella} \citealp{Smith1956} (type \textit{Sphyraena flavicauda}), and \textit{Sphyraena} \citealp{Artedi1793} (type \textit{Esox sphyraena}). All of these genera are currently considered synonyms of \textit{Sphyraena}. \cite{Smith1956} elevated all the previous names to subgeneric rank, while \citet{DeSylva1963} deemed such actions unjustified, synonymizing all of these into \textit{Sphyraena} Röse (correct authorship is by Artedi instead).
\citet{Santini2015} has presented an overview of six fossil species names associated with \textit{Sphyraena}; these authors mentioned \textit{Sphyraena fluctuosa} as a Sphyraenid species based on otolihts; however, such species was originally described by \citet{Nolf1972} in the genus \textit{Platycephalus} (Scorpaeniformes) and subsequently ratified in that genus \citep[e.g.,][]{Huyghebaert1979}. It is herein excluded from the Sphyraenid fossil species. \textit{Sphyraena intermedia} \citealp{Bassani1889} was mentioned also by Santini et al. without noting that another species of extant \textit{Sphyraena} was described with the same specific epithet \citep{Pastore2009}; therefore the latter species by Pastore is herein found to be primary homonym of \textit{Sphyraena intermedia} \citep{Bassani1889}, a fossil species known from the Oligocene of Italy and consequently the name by Pastore is deemed permanently invalid under Article 57.2 of the \citet{ICZN1999}.
The style handles properly situations just like web pages through the \texttt{@misc} tag \citep[e.g., ][]{EschmeyerWeb} and book sections \citep{Switchenska1968,Bohm1924}.
\section{Acknowledgements}
First of all to the open source community for doing all this sharing and modification possible for newer and case-specific uses. I never thought there will be the day that one could prepare a manuscript for zootaxa entirely in \LaTeX and this is a step forward. This late-hours project was indirectly funded by FAPESP through a doctoral scholarship. Many thanks to the Stack Overflow community. This as much of the software projects are speeded up a lot by its existence.
\bibliographystyle{zootaxa}
\bibliography{example-refs}
\end{document}
|
http://kleine.mat.uniroma3.it/mp_arc/e/02-364.latex
|
uniroma3.it
|
CC-MAIN-2019-18
|
application/x-latex
|
application/x-latex
|
crawl-data/CC-MAIN-2019-18/segments/1555578526807.5/warc/CC-MAIN-20190418201429-20190418223429-00198.warc.gz
| 94,245,749
| 35,113
|
\documentstyle[12pt]{article}
\makeatletter
%%% ====================================================================
%%% @TeX-file{
%%% filename = "amssym.tex",
%%% version = "2.2",
%%% date = "22-Dec-1994",
%%% time = "10:06:33 EST",
%%% checksum = "41516 282 863 9138",
%%% author = "American Mathematical Society",
%%% copyright = "Copyright (C) 1994 American Mathematical Society,
%%% all rights reserved. Copying of this file is
%%% authorized only if either:
%%% (1) you make absolutely no changes to your copy,
%%% including name; OR
%%% (2) if you do make changes, you first rename it
%%% to some other name.",
%%% address = "American Mathematical Society,
%%% Technical Support,
%%% Electronic Products and Services,
%%% P. O. Box 6248,
%%% Providence, RI 02940,
%%% USA",
%%% telephone = "401-455-4080 or (in the USA and Canada)
%%% 800-321-4AMS (321-4267)",
%%% FAX = "401-331-3842",
%%% email = "[email protected] (Internet)",
%%% codetable = "ISO/ASCII",
%%% keywords = "amsfonts, msam, msbm, math symbols",
%%% supported = "yes",
%%% abstract = "This is part of the AMSFonts distribution,
%%% It is the plain TeX source file for the
%%% AMSFonts user's guide.",
%%% docstring = "The checksum field above contains a CRC-16
%%% checksum as the first value, followed by the
%%% equivalent of the standard UNIX wc (word
%%% count) utility output of lines, words, and
%%% characters. This is produced by Robert
%%% Solovay's checksum utility.",
%%% }
%%% ====================================================================
%% Save the current value of the @-sign catcode so that it can
%% be restored afterwards. This allows us to call amssym.tex
%% either within an AMS-TeX document style file or by itself, in
%% addition to providing a means of testing whether the file has
%% been previously loaded. We want to avoid inputting this file
%% twice because when AMSTeX is being used \newsymbol will give an
%% error message if used to define a control sequence name that is
%% already defined.
%%
%% If the csname is not equal to \relax, we assume this file has
%% already been loaded and \endinput immediately.
\expandafter\ifx\csname pre amssym.tex at\endcsname\relax \else \endinput\fi
%% Otherwise we store the catcode of the @ in the csname.
\expandafter\chardef\csname pre amssym.tex at\endcsname=\the\catcode`\@
%% Set the catcode to 11 for use in private control sequence names.
\catcode`\@=11
%% Load amssym.def if necessary: If \newsymbol is undefined, do nothing
%% and the following \input statement will be executed; otherwise
%% change \input to a temporary no-op.
\begingroup\ifx\undefined\newsymbol \else\def\input#1 {\endgroup}\fi
%%% ====================================================================
%%% @TeX-file{
%%% filename = "amssym.def",
%%% version = "2.2",
%%% date = "22-Dec-1994",
%%% time = "10:14:01 EST",
%%% checksum = "28096 117 438 4924",
%%% author = "American Mathematical Society",
%%% copyright = "Copyright (C) 1994 American Mathematical Society,
%%% all rights reserved. Copying of this file is
%%% authorized only if either:
%%% (1) you make absolutely no changes to your copy,
%%% including name; OR
%%% (2) if you do make changes, you first rename it
%%% to some other name.",
%%% address = "American Mathematical Society,
%%% Technical Support,
%%% Electronic Products and Services,
%%% P. O. Box 6248,
%%% Providence, RI 02940,
%%% USA",
%%% telephone = "401-455-4080 or (in the USA and Canada)
%%% 800-321-4AMS (321-4267)",
%%% FAX = "401-331-3842",
%%% email = "[email protected] (Internet)",
%%% codetable = "ISO/ASCII",
%%% keywords = "amsfonts, msam, msbm, math symbols",
%%% supported = "yes",
%%% abstract = "This is part of the AMSFonts distribution,
%%% It is the plain TeX source file for the
%%% AMSFonts user's guide.",
%%% docstring = "The checksum field above contains a CRC-16
%%% checksum as the first value, followed by the
%%% equivalent of the standard UNIX wc (word
%%% count) utility output of lines, words, and
%%% characters. This is produced by Robert
%%% Solovay's checksum utility.",
%%% }
%%% ====================================================================
\expandafter\ifx\csname amssym.def\endcsname\relax \else\endinput\fi
%
% Store the catcode of the @ in the csname so that it can be restored later.
\expandafter\edef\csname amssym.def\endcsname{%
\catcode`\noexpand\@=\the\catcode`\@\space}
% Set the catcode to 11 for use in private control sequence names.
\catcode`\@=11
%
% Include all definitions related to the fonts msam, msbm and eufm, so that
% when this file is used by itself, the results with respect to those fonts
% are equivalent to what they would have been using AMS-TeX.
% Most symbols in fonts msam and msbm are defined using \newsymbol;
% however, a few symbols that replace composites defined in plain must be
% defined with \mathchardef.
\def\undefine#1{\let#1\undefined}
\def\newsymbol#1#2#3#4#5{\let\next@\relax
\ifnum#2=\@ne\let\next@\msafam@\else
\ifnum#2=\tw@\let\next@\msbfam@\fi\fi
\mathchardef#1="#3\next@#4#5}
\def\mathhexbox@#1#2#3{\relax
\ifmmode\mathpalette{}{\m@th\mathchar"#1#2#3}%
\else\leavevmode\hbox{$\m@th\mathchar"#1#2#3$}\fi}
\def\hexnumber@#1{\ifcase#1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or
9\or A\or B\or C\or D\or E\or F\fi}
\font\tenmsa=msam10
\font\sevenmsa=msam7
\font\fivemsa=msam5
\newfam\msafam
\textfont\msafam=\tenmsa
\scriptfont\msafam=\sevenmsa
\scriptscriptfont\msafam=\fivemsa
\edef\msafam@{\hexnumber@\msafam}
\mathchardef\dabar@"0\msafam@39
\def\dashrightarrow{\mathrel{\dabar@\dabar@\mathchar"0\msafam@4B}}
\def\dashleftarrow{\mathrel{\mathchar"0\msafam@4C\dabar@\dabar@}}
\let\dasharrow\dashrightarrow
\def\ulcorner{\delimiter"4\msafam@70\msafam@70 }
\def\urcorner{\delimiter"5\msafam@71\msafam@71 }
\def\llcorner{\delimiter"4\msafam@78\msafam@78 }
\def\lrcorner{\delimiter"5\msafam@79\msafam@79 }
% Note that there should not be a final space after the digits for a
% \mathhexbox@.
\def\yen{{\mathhexbox@\msafam@55}}
\def\checkmark{{\mathhexbox@\msafam@58}}
\def\circledR{{\mathhexbox@\msafam@72}}
\def\maltese{{\mathhexbox@\msafam@7A}}
\font\tenmsb=msbm10
\font\sevenmsb=msbm7
\font\fivemsb=msbm5
\newfam\msbfam
\textfont\msbfam=\tenmsb
\scriptfont\msbfam=\sevenmsb
\scriptscriptfont\msbfam=\fivemsb
\edef\msbfam@{\hexnumber@\msbfam}
\def\Bbb#1{{\fam\msbfam\relax#1}}
\def\widehat#1{\setbox\z@\hbox{$\m@th#1$}%
\ifdim\wd\z@>\tw@ em\mathaccent"0\msbfam@5B{#1}%
\else\mathaccent"0362{#1}\fi}
\def\widetilde#1{\setbox\z@\hbox{$\m@th#1$}%
\ifdim\wd\z@>\tw@ em\mathaccent"0\msbfam@5D{#1}%
\else\mathaccent"0365{#1}\fi}
\font\teneufm=eufm10
\font\seveneufm=eufm7
\font\fiveeufm=eufm5
\newfam\eufmfam
\textfont\eufmfam=\teneufm
\scriptfont\eufmfam=\seveneufm
\scriptscriptfont\eufmfam=\fiveeufm
\def\frak#1{{\fam\eufmfam\relax#1}}
\let\goth\frak
% Restore the catcode value for @ that was previously saved.
\csname amssym.def\endcsname
%% Most symbols in fonts msam and msbm are defined using \newsymbol. A few
%% that are delimiters or otherwise require special treatment have already
%% been defined as soon as the fonts were loaded. Finally, a few symbols
%% that replace composites defined in plain must be undefined first.
\newsymbol\boxdot 1200
\newsymbol\boxplus 1201
\newsymbol\boxtimes 1202
\newsymbol\square 1003
\newsymbol\blacksquare 1004
\newsymbol\centerdot 1205
\newsymbol\lozenge 1006
\newsymbol\blacklozenge 1007
\newsymbol\circlearrowright 1308
\newsymbol\circlearrowleft 1309
\undefine\rightleftharpoons
\newsymbol\rightleftharpoons 130A
\newsymbol\leftrightharpoons 130B
\newsymbol\boxminus 120C
\newsymbol\Vdash 130D
\newsymbol\Vvdash 130E
\newsymbol\vDash 130F
\newsymbol\twoheadrightarrow 1310
\newsymbol\twoheadleftarrow 1311
\newsymbol\leftleftarrows 1312
\newsymbol\rightrightarrows 1313
\newsymbol\upuparrows 1314
\newsymbol\downdownarrows 1315
\newsymbol\upharpoonright 1316
\let\restriction\upharpoonright
\newsymbol\downharpoonright 1317
\newsymbol\upharpoonleft 1318
\newsymbol\downharpoonleft 1319
\newsymbol\rightarrowtail 131A
\newsymbol\leftarrowtail 131B
\newsymbol\leftrightarrows 131C
\newsymbol\rightleftarrows 131D
\newsymbol\Lsh 131E
\newsymbol\Rsh 131F
\newsymbol\rightsquigarrow 1320
\newsymbol\leftrightsquigarrow 1321
\newsymbol\looparrowleft 1322
\newsymbol\looparrowright 1323
\newsymbol\circeq 1324
\newsymbol\succsim 1325
\newsymbol\gtrsim 1326
\newsymbol\gtrapprox 1327
\newsymbol\multimap 1328
\newsymbol\therefore 1329
\newsymbol\because 132A
\newsymbol\doteqdot 132B
\let\Doteq\doteqdot
\newsymbol\triangleq 132C
\newsymbol\precsim 132D
\newsymbol\lesssim 132E
\newsymbol\lessapprox 132F
\newsymbol\eqslantless 1330
\newsymbol\eqslantgtr 1331
\newsymbol\curlyeqprec 1332
\newsymbol\curlyeqsucc 1333
\newsymbol\preccurlyeq 1334
\newsymbol\leqq 1335
\newsymbol\leqslant 1336
\newsymbol\lessgtr 1337
\newsymbol\backprime 1038
\newsymbol\risingdotseq 133A
\newsymbol\fallingdotseq 133B
\newsymbol\succcurlyeq 133C
\newsymbol\geqq 133D
\newsymbol\geqslant 133E
\newsymbol\gtrless 133F
\newsymbol\sqsubset 1340
\newsymbol\sqsupset 1341
\newsymbol\vartriangleright 1342
\newsymbol\vartriangleleft 1343
\newsymbol\trianglerighteq 1344
\newsymbol\trianglelefteq 1345
\newsymbol\bigstar 1046
\newsymbol\between 1347
\newsymbol\blacktriangledown 1048
\newsymbol\blacktriangleright 1349
\newsymbol\blacktriangleleft 134A
\newsymbol\vartriangle 134D
\newsymbol\blacktriangle 104E
\newsymbol\triangledown 104F
\newsymbol\eqcirc 1350
\newsymbol\lesseqgtr 1351
\newsymbol\gtreqless 1352
\newsymbol\lesseqqgtr 1353
\newsymbol\gtreqqless 1354
\newsymbol\Rrightarrow 1356
\newsymbol\Lleftarrow 1357
\newsymbol\veebar 1259
\newsymbol\barwedge 125A
\newsymbol\doublebarwedge 125B
\undefine\angle
\newsymbol\angle 105C
\newsymbol\measuredangle 105D
\newsymbol\sphericalangle 105E
\newsymbol\varpropto 135F
\newsymbol\smallsmile 1360
\newsymbol\smallfrown 1361
\newsymbol\Subset 1362
\newsymbol\Supset 1363
\newsymbol\Cup 1264
\let\doublecup\Cup
\newsymbol\Cap 1265
\let\doublecap\Cap
\newsymbol\curlywedge 1266
\newsymbol\curlyvee 1267
\newsymbol\leftthreetimes 1268
\newsymbol\rightthreetimes 1269
\newsymbol\subseteqq 136A
\newsymbol\supseteqq 136B
\newsymbol\bumpeq 136C
\newsymbol\Bumpeq 136D
\newsymbol\lll 136E
\let\llless\lll
\newsymbol\ggg 136F
\let\gggtr\ggg
\newsymbol\circledS 1073
\newsymbol\pitchfork 1374
\newsymbol\dotplus 1275
\newsymbol\backsim 1376
\newsymbol\backsimeq 1377
\newsymbol\complement 107B
\newsymbol\intercal 127C
\newsymbol\circledcirc 127D
\newsymbol\circledast 127E
\newsymbol\circleddash 127F
\newsymbol\lvertneqq 2300
\newsymbol\gvertneqq 2301
\newsymbol\nleq 2302
\newsymbol\ngeq 2303
\newsymbol\nless 2304
\newsymbol\ngtr 2305
\newsymbol\nprec 2306
\newsymbol\nsucc 2307
\newsymbol\lneqq 2308
\newsymbol\gneqq 2309
\newsymbol\nleqslant 230A
\newsymbol\ngeqslant 230B
\newsymbol\lneq 230C
\newsymbol\gneq 230D
\newsymbol\npreceq 230E
\newsymbol\nsucceq 230F
\newsymbol\precnsim 2310
\newsymbol\succnsim 2311
\newsymbol\lnsim 2312
\newsymbol\gnsim 2313
\newsymbol\nleqq 2314
\newsymbol\ngeqq 2315
\newsymbol\precneqq 2316
\newsymbol\succneqq 2317
\newsymbol\precnapprox 2318
\newsymbol\succnapprox 2319
\newsymbol\lnapprox 231A
\newsymbol\gnapprox 231B
\newsymbol\nsim 231C
\newsymbol\ncong 231D
\newsymbol\diagup 201E
\newsymbol\diagdown 201F
\newsymbol\varsubsetneq 2320
\newsymbol\varsupsetneq 2321
\newsymbol\nsubseteqq 2322
\newsymbol\nsupseteqq 2323
\newsymbol\subsetneqq 2324
\newsymbol\supsetneqq 2325
\newsymbol\varsubsetneqq 2326
\newsymbol\varsupsetneqq 2327
\newsymbol\subsetneq 2328
\newsymbol\supsetneq 2329
\newsymbol\nsubseteq 232A
\newsymbol\nsupseteq 232B
\newsymbol\nparallel 232C
\newsymbol\nmid 232D
\newsymbol\nshortmid 232E
\newsymbol\nshortparallel 232F
\newsymbol\nvdash 2330
\newsymbol\nVdash 2331
\newsymbol\nvDash 2332
\newsymbol\nVDash 2333
\newsymbol\ntrianglerighteq 2334
\newsymbol\ntrianglelefteq 2335
\newsymbol\ntriangleleft 2336
\newsymbol\ntriangleright 2337
\newsymbol\nleftarrow 2338
\newsymbol\nrightarrow 2339
\newsymbol\nLeftarrow 233A
\newsymbol\nRightarrow 233B
\newsymbol\nLeftrightarrow 233C
\newsymbol\nleftrightarrow 233D
\newsymbol\divideontimes 223E
\newsymbol\varnothing 203F
\newsymbol\nexists 2040
\newsymbol\Finv 2060
\newsymbol\Game 2061
\newsymbol\mho 2066
\newsymbol\eth 2067
\newsymbol\eqsim 2368
\newsymbol\beth 2069
\newsymbol\gimel 206A
\newsymbol\daleth 206B
\newsymbol\lessdot 236C
\newsymbol\gtrdot 236D
\newsymbol\ltimes 226E
\newsymbol\rtimes 226F
\newsymbol\shortmid 2370
\newsymbol\shortparallel 2371
\newsymbol\smallsetminus 2272
\newsymbol\thicksim 2373
\newsymbol\thickapprox 2374
\newsymbol\approxeq 2375
\newsymbol\succapprox 2376
\newsymbol\precapprox 2377
\newsymbol\curvearrowleft 2378
\newsymbol\curvearrowright 2379
\newsymbol\digamma 207A
\newsymbol\varkappa 207B
\newsymbol\Bbbk 207C
\newsymbol\hslash 207D
\undefine\hbar
\newsymbol\hbar 207E
\newsymbol\backepsilon 237F
% Restore the catcode value for @ that was previously saved.
\catcode`\@=\csname pre amssym.tex at\endcsname
\textheight 23 cm
\textwidth 15.8 cm
\addtolength{\topmargin}{-2.1cm}
\addtolength{\oddsidemargin}{-1.4cm}
\parskip 5pt plus 2pt minus 2pt \parindent 17pt
\topsep 0pt plus 1pt
\partopsep 3pt plus 1pt minus 2pt \itemsep 0pt
\parsep 3pt plus 1pt minus 1pt
\@addtoreset{equation}{section}
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\let\Nsection\section
\def\section#1{\@ifstar{Nsection*}
{\def\thesection{\arabic{section}.}
\@startsection{section}{1}{\z@}{-3.5ex
plus -1ex minus
-.2ex}{2.3ex plus .2ex}{\bf}{\uppercase\expandafter{#1}}
\def\thesection{\arabic{section}}}}
\def\subsection{\@startsection{subsection}{2}{\z@}
{-3.25ex plus -1ex minus
-.2ex}{-1em}{\bf}}
\def\thesubsection {\thesection.\alph{subsection}}
\def\thebibliography#1{\par\vskip 6 mm\noindent
{\bf REFERENCES} \par \list
{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\usecounter{enumi}}
\def\newblock{\hskip .11em plus .33em minus -.07em}
\sloppy
\sfcode`\.=1000\relax}
\let\endthebibliography=\endlist
\arraycolsep 5pt \tabcolsep 6pt \arrayrulewidth .4pt
\doublerulesep 2pt
\tabbingsep \labelsep
\def\address#1{\gdef\@address{#1}}
\def\maketitle{\par
\begingroup
\def\thefootnote{\fnsymbol{footnote}}
\def\@makefnmark{\hbox
to 0pt{$^{\@thefnmark}$\hss}}
\if@twocolumn
\twocolumn[\@maketitle]
\else \newpage
\global\@topnum\z@ \@maketitle
\fi\thispagestyle{empty}\@thanks
\endgroup
\setcounter{footnote}{0}
\let\maketitle\relax
\let\@maketitle\relax
\gdef\@thanks{}\gdef\@author{}
\gdef\@title{}\let\thanks\relax}
\def\@maketitle{\newpage
\null
\vskip 10mm \begin{center}
{\bf\uppercase\expandafter{\@title}\par} \vskip 4 mm
{\bf\@author \par}% \vskip 4 mm {\@address \par} %\address ist neu
\end{center}
\vskip 20 mm}
\newcommand{\nc}{\newcommand}
\newtheorem{lemma}{Lemma} [section]
\newtheorem{theorem}[lemma]{Theorem}
\newtheorem{proposition}[lemma]{Proposition}
\newtheorem{corollary}[lemma]{Corollary}
\newtheorem{remark}[lemma]{Remark}
\newtheorem{assumption}[lemma]{Assumption}
\newtheorem{example}[lemma]{Example}
\newenvironment{Remark}{\begin{remark}\rm }{\end{remark}
\medskip}
\newtheorem{definition}[lemma]{Definition}
\newenvironment{Definition}{\begin{definition}\rm }{\end{definition}\medskip}
\nc{\QED}{\mbox{}\hfill \raisebox{-2pt}{\rule{5.6pt}{8pt}\rule{4pt}{0pt}}
\medskip\par}
\newenvironment{Proof}{\noindent
\parindent=0pt\abovedisplayskip = 0.5\abovedisplayskip
\belowdisplayskip=\abovedisplayskip{\bf Preuve. }}{\QED}
\newenvironment{Example}{\begin{example}\rm }{\QED\end{example}\medskip}
\nc{\di}{\displaystyle}
\nc{\SS}{{\rm I\mkern-4.0mu S}}
\nc{\SSs}{{\sf S\mkern-6.5mu S}}
\nc{\C}{{\rm I\mkern-4.0mu C}}
\nc{\R}{{\rm I\mkern-4.0mu R}}
\nc{\Z}{{\sf Z\mkern-6.5mu Z}}
\nc{\CCa}{\mbox{$C \mkern-10.5mu\raisebox{.18em}{$\scriptstyle/$}\mkern3mu$}}
\nc{\CCb}{C\mkern-11.5mu I\mkern4mu}
\nc{\Cc}{\mathchoice{\CCa}{\CCa}{\CCb}{C\mkern-10.5mu I\mkern3mu}}
\renewcommand{\Re}{\mathop{\rm Re}}
\renewcommand{\Im}{\mathop{\rm Im}}
\newcommand{\pp}{{ \partial }}
\renewcommand{\O}[1]{{\cal O}(#1)}
\nc{\Ref}[1]{~\mbox{\rm (\ref{#1})}}
\nc{\REF}[1]{~\mbox{\rm \ref{#1}}}
\nc{\Norm}[2]{\|#1\|\left.\vphantom{T_{j_0}^0}\!\!\right._{#2}}
\nc{\Log}{\mathop {\rm Log}\nolimits}
% Store the catcode of the @ in the csname so that it can be restored later.
\expandafter\chardef\csname pre amssym.def at\endcsname=\the\catcode`\@
% Set the catcode to 11 for use in private control sequence names.
\catcode`\@=11
\def\undefine#1{\let#1\undefined}
\def\newsymbol#1#2#3#4#5{\let\next@\relax
\ifnum#2=\@ne\let\next@\msafam@\else
\ifnum#2=\tw@\let\next@\msbfam@\fi\fi
\mathchardef#1="#3\next@#4#5}
\def\mathhexbox@#1#2#3{\relax
\ifmmode\mathpalette{}{\m@th\mathchar"#1#2#3}%
\else\leavevmode\hbox{$\m@th\mathchar"#1#2#3$}\fi}
\def\hexnumber@#1{\ifcase#1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or
9\or A\or B\or C\or D\or E\or F\fi}
\font\tenmsa=msam10
\font\sevenmsa=msam7
\font\fivemsa=msam5
\newfam\msafam
\textfont\msafam=\tenmsa
\scriptfont\msafam=\sevenmsa
\scriptscriptfont\msafam=\fivemsa
\edef\msafam@{\hexnumber@\msafam}
\mathchardef\dabar@"0\msafam@39
\def\dashrightarrow{\mathrel{\dabar@\dabar@\mathchar"0\msafam@4B}}
\def\dashleftarrow{\mathrel{\mathchar"0\msafam@4C\dabar@\dabar@}}
\let\dasharrow\dashrightarrow
\def\ulcorner{\delimiter"4\msafam@70\msafam@70 }
\def\urcorner{\delimiter"5\msafam@71\msafam@71 }
\def\llcorner{\delimiter"4\msafam@78\msafam@78 }
\def\lrcorner{\delimiter"5\msafam@79\msafam@79 }
\def\yen{{\mathhexbox@\msafam@55 }}
\def\checkmark{{\mathhexbox@\msafam@58 }}
\def\circledR{{\mathhexbox@\msafam@72 }}
\def\maltese{{\mathhexbox@\msafam@7A }}
\font\tenmsb=msbm10
\font\sevenmsb=msbm7
\font\fivemsb=msbm5
\newfam\msbfam
\textfont\msbfam=\tenmsb
\scriptfont\msbfam=\sevenmsb
\scriptscriptfont\msbfam=\fivemsb
\edef\msbfam@{\hexnumber@\msbfam}
\def\Bbb#1{\fam\msbfam\relax#1}
\def\widehat#1{\setbox\z@\hbox{$\m@th#1$}%
\ifdim\wd\z@>\tw@ em\mathaccent"0\msbfam@5B{#1}%
\else\mathaccent"0362{#1}\fi}
\def\widetilde#1{\setbox\z@\hbox{$\m@th#1$}%
\ifdim\wd\z@>\tw@ em\mathaccent"0\msbfam@5D{#1}%
\else\mathaccent"0365{#1}\fi}
\font\teneufm=eufm10
\font\seveneufm=eufm7
\font\fiveeufm=eufm5
\def\frak#1{{\fam\eufmfam\relax#1}}
\let\goth\frak
% Restore the catcode value for @ that was previously saved.
\catcode`\@=\csname pre amssym.def at\endcsname
\renewcommand{\Re}{\mathop{\rm Re}}
\renewcommand{\Im}{\mathop{\rm Im}}
\renewcommand{\R}{{\Bbb R}}
\renewcommand{\S}{{\Bbb S}}
\begin{document}
\title{The scattering matrix for the Schr\"odinger operator with a
long-range electromagnetic
potential}
\author{Ph. Roux and D. Yafaev
\\Department of Mathematics, University of Rennes,\\
Campus Beaulieu, 35042, Rennes, France,
\\ [email protected], [email protected]}
\maketitle
\begin{abstract}
We consider the Schr\"odinger operator $H=(i\nabla+A)^2 +V$ in the
space $L_2({\R}^d)$ with long-range electrostatic $V(x)$ and magnetic
$A(x)$ potentials. Using the scheme of smooth perturbations, we give an
elementary proof of the existence and completeness of modified wave
operators for the pair $H_0=-\Delta,~H$. Our main goal is to study spectral
properties of the corresponding scattering matrix $S(\lambda)$. We obtain
its stationary representation and show that its singular part (up to compact
terms) is a pseudodifferential operator with an oscillating amplitude which
is an explicit function of $V$ and $A$. Finally, we deduce from this result
that, in general, for each $\lambda>0$ the spectrum of $S(\lambda)$ covers
the whole unit circle.
\end{abstract}
\section{Introduction}
Let the Schr\"odinger operator $H$ be defined by differential expression
\begin{equation}\label{eq:H0}
H= H(V,A)= (i\nabla+A(x))^2 +V(x),
\end{equation}
where the scalar function $V(x)$ and the vector-valued function
$A(x)=(A_1(x),\ldots,A_d(x))$ are real valued and called the electrostatic
and magnetic potentials, respectively. We assume that the potentials are
$C^\infty$-functions satisfying the assumption
\begin{equation} \label{eq:H1}
|\partial_x^\alpha A(x)|+ |\partial_x^\alpha V(x)|\leq
C_\alpha (1+|x|)^{-\rho-|\alpha|},~~\rho>0,
\end{equation}
for all multi-indices $\alpha$. Then $H$ is a self-adjoint operator in the
space ${\cal H}=L_2(\R^d)$ on domain ${\cal D}(H)={\cal D}(H_0)$ of the
``free" operator $H_0=-\Delta$. Our approach to the scattering theory for
the pair $H_0,~H$ relies on wave operators with non-trivial identifications
$J_\pm$ (depending on the sign of $t$)
\begin{equation}\label{eq:MWO}
W_\pm = W_\pm(H,H_0;J_\pm ) =
s-\lim_{t\rightarrow\pm\infty} e^{iHt} J_\pm e^{-iH_0t}.
\end{equation}
We construct $J_\pm$ as pseudodifferential operators (PDO). Such wave
operators were first introduced by Isozaki and Kitada in \cite{IK3}, where
the Enss method was used for the proof of their existence and completeness
(the method of \cite{IK3} was extended to long-range magnetic
potentials in \cite{NICO2}). We show that the long-range scattering fits
into the theory of smooth perturbations (in the sense of Kato). This
yields, in particular, the stationary (in terms of the resolvent)
representation for the corresponding scattering matrix
$S(\lambda)$ which allows us to study its structure
and spectral properties. Actually, we follow closely the paper \cite{Y3}
where the case $\rho>1/2$ (and $A=0$) was considered. However consideration
of the general case $\rho>0$ is technically much more involved.
The operators $J_\pm$ emerge naturally as PDO with symbols
constructed in terms of approximate eigenfunctions $\Psi_\pm(x,\xi)=
e^{i\varphi_\pm(x,\xi)}$ of the operator $H$. Substituting
$\Psi=e^{i\varphi}$ in the Schr\"odinger equation $H\Psi=|\xi|^2\Psi$
and neglecting imaginary terms, we
obtain the eikonal equation
\begin{equation}\label{eq:eikonal}
|\nabla \varphi|^2-2<A,\nabla\varphi>+V(x)+|A(x)|^2 -|\xi|^2=0,
~~\nabla=\nabla_x,
\end{equation}
for the phase function $\varphi=\varphi_\pm$.
We seek approximate solutions of this equation in the form
\begin{equation}\label{eq:E3}
\varphi_\pm(x,\xi)= < \xi,x> +\Phi_\pm(x,\xi)
\end{equation}
where $ \Phi_\pm(x,\xi)= o(|x|)$ as $|x|\to\infty$.
Such solutions can be constructed by an explicit procedure described
in Section~4.
Then the Schr\"odinger equation for $\Psi_\pm=e^{i\varphi_\pm}$ is satisfied
up to short-range terms (that is, satisfying an estimate of the type
(\ref{eq:H1}) with $\rho>1$) off
any neighbourhood of the direction
$\hat{x}=\mp\hat{\xi}$.
To get rid of the ``bad" direction
$\hat{x}=\mp\hat{\xi}$, we introduce in the symbol $j_\pm(x,\xi)$ suitable
cut-off
functions $\zeta_\pm(x,\xi) $, such that $\zeta_\pm$ are
asymptotically homogeneous in $x$ of degree $0$, $\zeta_\pm(x,\xi) =0 $
in a conical neighbourhood (in ${\Bbb R}^{2d}$) of the set
$\hat{x}=\mp\hat{\xi}$ and
$\zeta_\pm(x,\xi) =1 $ off somewhat larger neighbourhood of this set.
At the same time we localize our considerations on a compact energy subinterval
of ${\Bbb R}_+=(0,\infty)$. The symbol of the PDO $J_\pm$ can be defined by
the equality
\begin{equation}\label{eq:E0}
j_\pm(x,\xi)= e^{i\Phi_\pm(x,\xi)}\zeta_\pm(x,\xi).
\end{equation}
As in \cite{Y3}, from analytical point of view our approach relies on
the limiting absorption principle and the radiation estimates. The first of
these results means that the operator $\left<x\right>^{-p},~p>1/2,$ is
locally $H$-smooth on any bounded interval disjoint from zero (see
Definition \ref{PR1}). The second, pertaining to the critical case $p=1/2$,
ensures local $H$-smoothness of the operators
$G_j=\left<x\right>^{-1/2}\nabla^\bot_j,~j=1,\dots d$, where
\begin{equation}\label{eq:GRADBOT}
\nabla^\bot_j u=\partial_j u - |x|^{-2} < \nabla u, x > x_j,
\quad j=1,\ldots, d.
\end{equation}
Let $T_\pm =H J_\pm -J_\pm H_0$ be the ``effective perturbation". It
follows from definition
(\ref{eq:E0}) that
both operators $T=T_\pm$ factorize into a sum of products of locally
$H_0\,$- and $H$-smooth operators
\begin{equation}\label{eq:W5}
T = \left< x\right>^{-p} B^{(r)} \left< x\right>^{-p}
+\sum_{j=1}^d G_j^* B^{(s)} G_j,\quad p>1/2,
\end{equation}
where the operators $B^{(r)}=B^{(r)}_\pm ,\, B^{(s)}=B^{(s)}_\pm $ are
bounded.
This implies the
existence of all wave operators $W_\pm(H,H_0,J_\gamma),
W_\pm(H_0,H,J_\gamma^*),$ both for $\gamma =``+"$ and $\gamma =``-"$.
The operators $W_\pm(H,H_0,J_\pm)$ are isometric
since $J_\pm^*J_\pm e^{-iH_0t}f\sim e^{-iH_0t}f$ as $t\rightarrow\pm\infty$.
For the proof of
completeness of $W_\pm(H,H_0,J_\pm)$, we use that, for a suitable choice
of the cut-off functions $\zeta_+$ and $\zeta_-$, the
operator $J_+J_+^*+J_-J_-^*-I$ is essentially compact.
Finally, we check that wave operators (\ref{eq:MWO}) coincide with wave
operators obtained by a time-dependent modification of the free dynamics in
the coordinate representation (see \cite{Y5}). In the special case where
$V=0$ and $A$ satisfies assumption (\ref{eq:H1}) with $\rho>1/2$ and the
additional condition of transversal gauge
\begin{equation}\label{eq:H3}
<A(x),x>=0
\end{equation}
(for $ x\in\R^d $ large enough),
the identifications $J_\pm$ can be replaced
in (\ref{eq:MWO}) by the identity operator, that is the usual wave
operators $W_\pm(H,H_0)$ exist.
Thus, we recover the well known result \cite{LOSTHA}
of Loss and Thaller about long-range magnetic scattering.
Since the scattering operator ${\bf S}=W_+^*W_-$ commutes with $H_0$, it
reduces in the spectral representation of $H_0$ to the multiplication by the
operator-function $S(\lambda),~\lambda>0,$ acting in the space ${\goth
N}=L_2(\S^{d-1})$ and known as the scattering matrix (SM). Our study of
$S(\lambda)$ relies on its stationary representation in terms of the
resolvent $R(z)=(H-z)^{-1}$ of the operator $H$. To describe it,
we need to introduce the auxiliary wave operator $W_+(H_0,H_0; J_+^* J_-)$.
It commutes with $H_0$ and hence acts in the spectral representation of $H_0$
as multiplication by the operator-function ${\cal W}(\lambda):
{\goth N}\rightarrow {\goth N}$. Then (see \cite{IK4,Y3,Y5})
\begin{equation}\label{eq:S2}
S(\lambda)= {\cal W}(\lambda) -2\pi i\Gamma_0(\lambda)\left(J_+^*T_-
-T_+^*R(\lambda+i0)T_-\right)\Gamma_0^*(\lambda),
\end{equation}
where
\begin{equation}\label{eq:DV1}
(\Gamma_0(\lambda)f)(\omega)=2^{-1/2}k^{(d-2)/2}\hat{f}(k\omega),
\quad k=\lambda^{1/2}>0,\;\omega\in\S^{d-1},
\end{equation}
is, up to the numerical factor, the restriction of the Fourier
transform $\hat{f}={\cal F}f$ to the sphere of radius $k$.
Formula (\ref{eq:S2}) is actually of abstract nature and, roughly speaking,
is valid always when its right-hand side is well defined.
In our particular case ${\cal W}(\lambda)=0$ for all $\lambda> 0$.
Then, using
the resolvent estimates called usually propagation estimates (see
\cite{J,JMP,M2}), we show that the part of $S(\lambda)$
containing in (\ref{eq:S2}) the resolvent of $H$ is a compact operator.
Thus, the essential spectrum of $S(\lambda)$ is determined by the
explicit operator
$-2\pi i\Gamma_0(\lambda)J_+^*T_-\Gamma_0^*(\lambda)$ which we consider as
a PDO
on the unit sphere. In the general case $\rho>0$ this PDO is determined by
its amplitude
$a(y , \omega, \omega';\lambda)$ where $\omega,\omega'\in\S^{d-1}$ are close
to some point $\omega_0$ and $y$ belongs to the
hyperplane orthogonal to $\omega_0$. It turns out that, essentially,
$a(y , \omega, \omega'; \lambda)=\exp(i\theta(y , \omega,
\omega';\lambda))$ where
$\theta(y , \omega, \omega;\lambda)\rightarrow\infty$ as
$|y|\rightarrow\infty$.
Actually, the asymptotics of
$\theta(y , \omega, \omega;\lambda)$ as
$|y|\to\infty$ is determined by the asymptotics of $V(x)$ and $A(x)$
as $|x|\rightarrow\infty$. For homogeneous potentials
of degree $-\rho$, $\rho\in(0,1)$, the function $\theta$ is asymptotically
homogeneous of degree
$1-\rho$ and it has, generically, a logarithmic growth if $\rho=1$. In
particular, this implies \cite{Y4} that the spectrum of the SM covers the
whole unit circle ${\Bbb T}$. This situation is completely different from
the short-range case where the principal symbol of PDO $S(\lambda)$ equals
$1$ which corresponds to the Dirac-function in its kernel. In this case the
spectrum of $S(\lambda)$ consists of eigenvalues accumulating at the point 1
only. Thus, in the long- and short-range cases the singularities and
the spectral structure of $S(\lambda)$ are of qualitatively different
nature.
A detailed analysis of singularities (as well as asymptotic expansion
as $\lambda\rightarrow\infty$) of the SM $S(\lambda)$ can be found
in \cite{Y1} where a method, somewhat different from this paper,
was used.
Technically, our paper relies on the PDO calculus. Thus, we treat the
operators $J_\pm$ and $T_\pm$
as PDO. For any $\rho\in (0,1)$, they belong to the H\"ormander classes
${\cal S}^0_{\rho,1-\rho}$ and ${\cal S}^{-1}_{\rho,1-\rho}$, respectively. In
these classes a convenient PDO calculus can be developed for $\rho>1/2$
only. This creates new difficulties for potentials
satisfying (\ref{eq:H1}) for $\rho\in (0,1/2]$. Fortunately, the
operators $J_\pm$ and $T_\pm$ fit into the framework of PDO with oscillating
symbols developed in \cite{Y4}. Auxiliary results concerning
PDO calculus are discussed in Section~2.
\section{Pseudodifferential operators}
{\bf 2.1.}
We need some elementary facts about PDO defined by the equality
\begin{equation}\label{eq:PDO1}
(Af)(x)=(2\pi)^{-d/2}\int_{\R^d}e^{i < \xi,x> } a(x,\xi)\hat{f}(\xi) d\xi,
\end{equation}
where
$$ \hat{f}(\xi)= \left({\cal F}f\right)(\xi)
=(2\pi)^{-d/2}\int_{\R^d}e^{-i<\xi,x > }f(x) dx$$
is the Fourier transform of $f$ from the Schwartz class ${\cal S}=
{\cal S}(\R^d)$. We denote by
${\cal S}^{m}_{\rho,\delta}$ the class of symbols $a\in C^\infty
(\R^d\times \R^d)$
satisfying, for all multi-indices $\alpha$ and $\beta$, the estimates
\begin{equation}\label{eq:PDO2}
|\partial_x^\alpha \partial_\xi^\beta a(x,\xi)|\leq
C_{\alpha,\beta} (1+|x|)^{m-\rho|\alpha|+\delta|\beta|}.
\end{equation}
Here and below $C,c$ are different positive constants, whose precise values
are of no importance. Moreover, we assume that $a(x,\xi)=0$ for
sufficiently large $|\xi|$.
We always suppose that $\rho >0,\;\delta<1$ and set
${\cal S}^{m} ={\cal S}^{m}_{1,0}$. The operators $A$ and $A^\ast$ are
well-defined as mappings of the Schwartz class ${\cal S} $ into itself. The
calculus of PDO can be conveniently developed (see, e.g., \cite{Hor3} or
\cite{Sh}) in the classes ${\cal S}^m_{\rho,\delta}$ if $\rho>1/2>\delta$,
but it fails in the general case.
To treat the case $\rho\leq 1/2$, we need a more special class of PDO
with oscillating symbols introduced in \cite{Y4}. Let us denote by ${\cal
C}^m(\Phi)$ the class of symbols admitting the representation
\begin{equation}\label{eq:PDO4}
a(x,\xi)=e^{i \Phi (x,\xi) } b(x,\xi), \quad \Phi\in {\cal S}^r,
\quad b\in {\cal S}^m,\quad r\in[0,1).
\end{equation}
Since ${\cal C}^m(\Phi)\subset {\cal
S}^m_{1-r,r},$ only the case $r\geq 1/2$ requires a special study.
Occasionally we use the notation ${\cal S}^m_{\rho,\delta}$ and ${\cal
C}^m(\Phi)$ for PDO (\ref{eq:PDO1}) with symbols from these classes. The
operator of multiplication by $(1+|x|^2)^{1/2}$ is denoted by $\left<
x\right>$.
Let us collect a necessary information on the calculus of PDO.
Note that compared to the standard definition of PDO
the roles of the variables $x$ and $\xi$ in (\ref{eq:PDO1})
are interchanged. However, the operator ${\cal F}A^\ast {\cal F}^\ast$
satisfies the usual assumptions. This allows us to recover all results of PDO
theory for operators (\ref{eq:PDO1}). We start
with an elementary assertion, which can be proven by the standard
technique (see, e.g., \cite{Hor3} or \cite{Sh}).
\begin{proposition}\label{PDO1}
Suppose that $a_1\in {\cal C}^{m_1}(\Phi)$ for some $\Phi\in{\cal S}^r,
~r\in[0,1)$, $a_2\in {\cal S}^{m_2}$ and
$a_0(x,\xi)=a_1(x,\xi)a_2(x,\xi)$. Let $A_j$ be the PDO with symbol
$a_j$, $j=0,1,2$. Then $ A_1 A_2$ and $ A_2 A_1$ are PDO from the class
${\cal C}^m(\Phi)$ where $m=m_1+m_2$ and the PDO $A_1 A_2-A_0$ and
$A_2 A_1-A_0$ belong to the class
${\cal C}^{m+r-1}(\Phi)$.
\end{proposition}
The following two assertions are borrowed directly from \cite{Y4}.
\begin{proposition}\label{PDO3}
Let $A\in{\cal C}^m(\Phi)$. Then the operator $A$ is bounded in the space
$L_2(\R^d)$ if $m=0$, and it is compact if $m<0$.
\end{proposition}
\begin{proposition}\label{PDO4}
Let $A_j,\: j=1,2,$ be PDO with symbols $a_j\in {\cal C}^0(\Phi)$ and let
$A $ be the PDO with symbol $a_1(x,\xi)\overline{a_2(x,\xi)}$. Then both
operators $A- A_1 A_2^*$
and $A-A_2^*A_1$ are compact in the space
$L_2(\R^d)$.
\end{proposition}
To formulate further results on PDO,
we need the following technical
\begin{lemma}\label{PDO1wwp}
Let $\Omega_0\in C_0^\infty ({\Bbb R}^d)$, $\Omega_0(\xi)=1$ for
$|\xi|\leq R_0-1$ and
$\Omega_0(\xi)=0$ for $|\xi|\geq R_0 $ $($for some $R_0>1)$.
Let $\Omega_1\in C^\infty ({\Bbb R}^d)$,
$\Omega_1(\xi)=0$ for $|\xi|\leq R_1$ and
$\Omega_1(\xi)=1$ for $|\xi|\geq R_1+1$. Assume that $R_1>R_0$.
We denote by $\Omega_j$, $j=0,1$,
the multiplication operators $($in the momentum representation$)$
by the functions $\Omega_j(\xi)$. Let
$g$ be the multiplication operator by a function $g \in C^\infty(\R^d)$
such that
$\partial^\alpha g(x)=O(|x|^{n-|\alpha|})$ as
$|x|\to\infty$ for some
$n$ and all $\alpha$. Then the operator
$ \Omega_0 g\Omega_1 = \Omega_0 g_0\Omega_1$ where $g_0\in {\cal S} $.
\end{lemma}
{\it Proof.} --
In the momentum representation $g$ acts as the convolution
with the function $\hat{g}(\xi)$ where $\hat{g}\in C^\infty $
except the point zero and
decays at infinity, together with all its derivatives,
faster that any power of $|\xi|^{-1}$.
Therefore $\Omega_0 g\Omega_1$ is the integral operator with kernel
\begin{equation}\label{eq:aux1}
(2\pi)^{-d/2}\Omega_0(\xi) \hat{g}(\xi-\xi^\prime)\Omega_1(\xi^\prime),
\end{equation}
which equals $0$ if $|\xi-\xi^\prime|\leq R_1-R_0$.
Let $\omega \in C^\infty ({\Bbb R}^d)$, $\omega(\xi)=0$ for $|\xi|\leq
(R_1-R_0)/2$
and $\omega(\xi)=1$ for $|\xi|\geq R_1-R_0$.
Then kernel (\ref{eq:aux1}) is not
changed if we replace $\hat{g}(\xi-\xi^\prime)$ by $\hat{g}_0(\xi-\xi^\prime)$
where $\hat{g}_0(\xi) = \hat{g}(\xi)\omega(\xi)$ belongs to
$ {\cal S} .\quad\Box$
\begin{lemma}\label{PDO1ww}
Let $A$ be a PDO with symbol $a$ from
the class ${\cal S}^{m}_{\rho,\delta}$
where $\rho >0,\;\delta<1$ and $m$ are arbitrary and
$a(x,\xi)=0$ if $|\xi|\geq R$.
Let $g$ and $ \Omega_1$ be the same as in Lemma~$\ref{PDO1wwp}$ and $R_1>R$.
Then for any $p$ the operator
$A g\Omega_1 \langle x\rangle^p$
is bounded in $L_2(\R^d)$.
\end{lemma}
{\it Proof.} --
Assuming that $p$ is an even integer and commuting the operators
$\Omega_1$ and $ \langle x\rangle^p$, we reduce the problem to the case $p=0$.
Let $ \Omega_0$ be the same as in Lemma~\ref{PDO1wwp} with $R_0\in (R,R_1)$.
Then $A g\Omega_1 =A\Omega_0 g\Omega_1 $, so that,
by Lemma~\ref{PDO1wwp}, we may suppose that $g\in {\cal S} $.
In the coordinate representation, the operator
$A g$ has kernel
\begin{equation}\label{eq:Kr}
(2\pi)^{-d}\int_{\R^d}e^{i < \xi,x-x^\prime> } a(x,\xi) d\xi \: g(x^\prime).
\end{equation}
Using the formula
$\langle x \rangle^{-k}\langle D_\xi\rangle^{k}e^{i < \xi,x > }=e^{i <
\xi,x > }$ and integrating by parts, we estimate the kernel (\ref{eq:Kr}) by
$
\langle x \rangle^{m-(1-\delta) k} \langle x^\prime\rangle^k |g(x^\prime)|.
$
For sufficiently large $k$, both functions of $x$ and $x^\prime$
belong to $L_2(\R^d )$,
and hence the operator $A g$ belongs to the Hilbert-Schmidt class.
$\quad\Box$
Now it easy to check the following two assertions.
\begin{proposition}\label{PDO5}
Let $A\in{\cal C}^{m}(\Phi)$ for some $m$. Then the operator $A\left<
x\right>^{-m}$ is bounded in the space $L_2(\R^d)$.
\end{proposition}
{\it Proof.} --
Assume that $a(x,\xi)=0$ for $|\xi|\geq R$. Let $ \Omega_1$
be the same operator as in Lemma~\ref{PDO1wwp} with $R_1>R$ and
$\Omega_2=I- \Omega_1$. Clearly,
$ \left< x\right>^{-m}\Omega_2$ is a PDO from the class ${\cal S}^{-m}$.
Therefore,
by Proposition~\ref{PDO1}, the PDO $A (\left< x\right>^{-m}\Omega_2)$
belongs to the class ${\cal C}^0 (\Phi)$ and hence, by Proposition~\ref{PDO3},
it is bounded. The operator
$A \left< x\right>^{-m}\Omega_1 $
is bounded according to Lemma~\ref{PDO1ww}.
$\quad\Box$
\begin{proposition}\label{PDO6}
Suppose that $A$ is a PDO with symbol $a\in{\cal C}^{m}(\Phi)$, for
some $\Phi\in{\cal S}^{r}$ with $ r\in[0,1)$, and $G$ is a PDO
$($actually, a differential operator$)$ with symbol
$g(x,\xi)=\sum_{|s|\leq s_0}g_s(x)\xi^s$, where
$g_s\in C^\infty(\R^d)$ and $\partial^\alpha
g_s(x)=O(|x|^{n-|\alpha|})$ as $|x|\to\infty$
for some $n$ and all $\alpha$. Let $T$ be the PDO with
symbol
$t(x,\xi)=|g(x,\xi)|^2 a(x,\xi)$. Then the operator $\left< x\right>^p
(G^\ast A G-T)\left<
x\right>^p$ is bounded if $2p=-m-2n+1-r$.
\end{proposition}
{\it Proof.} --
Let $a_1(x,\xi)$ be the symbol of the PDO $A_1=G^\ast A$. By direct calculation
we show that
\[
a_1(x,\xi)-\overline{g(x,\xi)} a (x,\xi)\in C^{m+n+r-1}(\Phi).
\]
Assuming that $a(x,\xi)=0$ for $|\xi|\geq R$, we introduce the same operators
$\Omega_1,\Omega_2$ as in Proposition~\ref{PDO5}. Proposition~\ref{PDO1}
implies that, up to terms from the class $C^{m+2n+r-1}(\Phi)$,
the operator $A_1 G\Omega_2$ has symbol $t(x,\xi)$. Therefore the operator
$\left< x\right>^p (G^\ast A G\Omega_2-T)\left< x\right>^p$ is bounded by
Proposition~\ref{PDO5}.
It remains to take into account that the
operator $\left< x\right>^p A_1 G \Omega_1 \left< x\right>^p$ is bounded
for any $p$ according to Lemma~\ref{PDO1ww}.
$\quad\Box$
For the study of the SM we need to consider PDO defined by
their amplitudes. We define such operators in terms of the corresponding
sesquilinear forms on ${\cal S} \times{\cal S} $
\begin{equation}\label{eq:PDO5b}
\left({\bf A}f_1,f_2\right) =(2\pi)^{-d}\int_{\R^d}
\int_{\R^d}\int_{\R^d}e^{i<\xi'-\xi,x>}{\bf
a}(x,\xi,\xi')\hat{f}_1(\xi')\overline{\hat{f}_2(\xi)}dxd\xi d\xi'.
\end{equation}
We suppose that the amplitude ${\bf a}(x,\xi,\xi')$ belongs to the
class ${\cal S}^m_{\rho,\delta,\delta}$ defined quite similarly to
${\cal S}^m_{\rho,\delta}$ with $\xi$ replaced by $(\xi,\xi')$ in
(\ref{eq:PDO2}) and that ${\bf a}(x,\xi,\xi')$ is compactly supported in
$\xi$ and $\xi'$.
Again we denote ${\cal S}^m={\cal S}^m_{1,0,0}$.
Let us consider (cf. (\ref{eq:PDO4})) a special class ${\cal C}^m(\Theta)$ of
amplitudes admitting the representation
\begin{equation} \label{eq:PDO6}
{\bf a}(x,\xi,\xi')=e^{i \Theta (x,\xi,\xi') } {\bf
b}(x,\xi,\xi'),
\quad \Theta\in {\cal S}^r,\quad r\in[0,1),\quad {\bf b}\in {\cal S}^m.
\end{equation}
Such operators reduce to PDO with oscillating symbols.
\begin{proposition}\label{PDO7}
Let $\bf A$ de defined by $(\ref{eq:PDO5b})$ with amplitude $(\ref{eq:PDO6})$.
Then ${\bf A}=A$
where $A$ is a PDO
$ (\ref{eq:PDO1})$ with symbol $ (\ref{eq:PDO4})$ and
\begin{eqnarray*}
\Phi(x,\xi)&=&\Theta(x,\xi,\xi)+\Theta_1(x,\xi),\quad
\Theta_1\in{\cal S}^{2r-1},
\\
b(x,\xi)&=&{\bf b}(x,\xi,\xi)+ b_1(x,\xi),\quad
b_1 \in{\cal S}^{m+r-1}.
\end{eqnarray*}
In particular, if ${\bf b}(x,\xi,\xi)=0$, then $ A$ belongs to the class
${\cal
C}^{m+r-1}(\Phi)$.
\end{proposition}
This result (its proof can be found in \cite{Y4}) allows us to extend
Propositions~\ref{PDO3} and \ref{PDO5} to operators $\bf A$ defined by
(\ref{eq:PDO5b}).
\begin{proposition}\label{PDO3AA}
Let ${\bf A}\in{\cal C}^{m}(\Theta)$. Then the operator $\bf A$ is
bounded in the space
$L_2(\R^d)$ if $m=0$, and it is compact if $m<0$. Moreover, the operator
${\bf A}\left< x\right>^{-m}$ is also bounded.
\end{proposition}
\bigskip
{\bf 2.2.}
The spectral representation of $H_0=-\Delta$ can be constructed in terms of
the operator $\Gamma_0(\lambda)$ defined by (\ref{eq:DV1}). Let ${\goth
N}=L_2(\S^{d-1})$ and $({\cal U}f)(\lambda)=\Gamma_0(\lambda)f, ~f\in{\cal
S}(\R^d),~\lambda>0$. Then the operator ${\cal U}$ extends by
continuity to a unitary operator ${\cal U}:L_2(\R^d)\rightarrow
L_2(\R_+;{\goth N})$, and the operator $H_0$ is diagonalized by $\cal U$,
that is $({\cal U}H_0f)(\lambda)=\lambda({\cal U}f)(\lambda)$ for
$f\in{\cal D}(H_0)$.
The operator
$\Gamma_0(\lambda)$ is directly related to the
spectral family $E_0(\lambda)$ of the operator $H_0$ and to its resolvent
$R_0(z)=(H_0-z)^{-1}$.
Put $$\delta_\varepsilon (H_0 -\lambda)=(2\pi
i)^{-1}(R_0(\lambda+i\varepsilon)
-R_0(\lambda - i\varepsilon) ).$$
For any $f_1,f_2\in{\cal S} $ the limit and the derivative below exist and
satisfy (see, e.g., \cite{YMST})
\[
\lim_{\varepsilon\rightarrow 0}
\left(\delta_\varepsilon (H_0 -\lambda)f_1,f_2\right)
=d\left(E_0(\lambda)f_1,f_2\right)/d\lambda
=\left(\Gamma_0(\lambda)f_1,\Gamma_0(\lambda)f_2\right)_{\goth N}.
\]
We recall the Sobolev trace theorem.
\begin{proposition}\label{DV1}
For $p>1/2$ the operator-function $\Gamma_0(\lambda)\left<
x\right>^{-p}~:{\cal H}\rightarrow{\goth
N} $ is compact and H\"older
continuous in norm with respect to the parameter $\lambda >0$.
\end{proposition}
For construction of the SM, we have to give a precise definition of the
operator $ {\bf A}^\flat(\lambda):=\Gamma_0(\lambda){\bf
A}\Gamma_0^*(\lambda)$
appearing in
(\ref{eq:S2}) which imposes rather stringent conditions on ${\bf A}$.
Practically we consider only PDO ${\bf A}$ defined by (\ref{eq:PDO5b}),
although the definition below is of abstract nature. Note that, for a
PDO ${\bf A}$, the operator $ {\bf A}^\flat(\lambda)$ is also defined as
a PDO on the unit sphere ${\Bbb S}^{d-1}$.
It is convenient to define the operator $ {\bf A}^\flat(\lambda)$
in terms of its sesquilinear form $({\bf A}^\flat(\lambda)g_1,g_2 )$.
\begin{definition}\label{PDO11}
Let $g_1,g_2\in C^\infty(\S^{d-1})$, and let $\psi_1,\psi_2\in
C^\infty_0(\R_+)$ be such that $\psi_1(k)=\psi_2(k)=1$. Set
$\hat{f}_j(\xi)=g_j(\hat{\xi})\psi_j(|\xi|),~j=1,2.$
Then
\begin{equation}\label{eq:lim}
({\bf A}^\flat(\lambda)g_1,g_2 )_{\goth N}:=2
k^{2-d}\lim_{\varepsilon\to 0}
\left({\bf A}\delta_\varepsilon(H_0-\lambda) {f}_1,
\delta_{\varepsilon}(H_0-\lambda){f}_2\right),
\end{equation}
provided this limit exists for all $g_1,g_2\in C^\infty(\S^{d-1})$.
\end{definition}
By definition (\ref{eq:DV1}), if $g\in C^\infty(\S^{d-1}),\psi \in
C_0^\infty(\R_+)$ and
$\hat{f}(\xi)=g(\hat{\xi})\psi(|\xi|)$, then
$$
\left(\Gamma_0(\lambda)f\right)(\omega)=2^{-1/2}k^{(d-2)/2}\psi(k)g(\omega),~~ k
=\lambda^{1/2}.
$$
The operator $\Gamma_0^*(\lambda)$ formally adjoint to
$\Gamma_0(\lambda)$ is defined, e.g., for $g\in C^\infty(\S^{d-1})$ by the
equality
\begin{equation}\label{eq:DV2} (\Gamma_0^*(\lambda)g)(x)=
2^{-1/2}k^{(d-2)/2}(2\pi)^{-d/2}\int_{\S^{d-1}} e^{ik < \omega,x>}g(\omega)
d\omega,~~k=\lambda^{1/2}>0.
\end{equation}
Therefore Definition~\ref{PDO11} gives an exact meaning to the formal
expression
$\Gamma_0(\lambda){\bf A}\Gamma_0^*(\lambda)$.
If $B={\cal F}{\bf A}{\cal F}^*$ is an integral operator with kernel
$B(\xi,\xi')$ which is continuous near the surface $|\xi|=|\xi'|=k$,
then, by (\ref{eq:DV1}) and (\ref{eq:DV2}), ${\bf A}^\flat(\lambda)$ is also
an integral operator with kernel
$$
b(\omega,\omega';\lambda)=2^{-1}k^{d-2}B(k\omega,k\omega').
$$
If $\bf A$ is a PDO (\ref{eq:PDO5b}) with amplitude
${\bf a}\in {\cal S}^m_{\rho,\delta,\delta} $, then
the kernel
\[
B(\xi,\xi')= (2\pi)^{-d} \int _{\R^d} e^{i <\xi' -\xi,x >} {\bf a}
(x,\xi, \xi') dx
\]
(understood as an oscillatory integral) of the operator $B={\cal F}{\bf
A}{\cal
F}^\ast$ is well defined and infinitely
differentiable off the diagonal $\xi=\xi'$.
Thus, we have the
following obvious assertion.
\begin{proposition}\label{PDO12}
Let ${\bf a}\in {\cal S}^m_{\rho,\delta,\delta} $ for some $\rho>0$,
$\delta <1$, and let $\chi_1$
and
$\chi_2$ be multiplication operators by
$C^\infty(\S^{d-1})$-functions with disjoint supports. Then
$(\chi_1 {\bf A} \chi_2)^\flat(\lambda)$ is an integral operator with
$C^\infty$-kernel of
variables $\omega$,
$\omega^\prime$ $($and $\lambda>0)$.
\end{proposition}
However due to a
possible strong singularity of the function $B(\xi,\xi')$ at $\xi=\xi'$,
the operator
${\bf A}^\flat(\lambda)$ exists only under special assumptions on ${\bf a}
(x,\xi, \xi')$.
In the case ${\bf a}\in {\cal C}^{m}(\Theta)$, $m <-1$,
the diagonal singularity of $B(\xi,\xi')$
is weak, so no additional restrictions are required.
\begin{proposition}\label{PDO10}
Let ${\bf A}$ belong to the class ${\cal C}^{m}(\Theta)$ where $m <-1$.
Then ${\bf A}^\flat(\lambda)$ is well-defined for all
$\lambda>0$ and is a compact operator in ${\goth N}$.
Moreover, ${\bf A}^\flat(\lambda)$ depends norm continuously on $\lambda$.
\end{proposition}
{\it Proof}. --
Indeed,
\[
{\bf A}^\flat(\lambda)= \Bigl(\Gamma_0(\lambda)\left< x\right>^{-p}\Bigr)
\Bigl( \left< x\right>^{p}{\bf A}\left< x\right>^{p}\Bigr)
\Bigl( \left< x\right>^{-p}\Gamma_0^\ast(\lambda)\Bigr),\quad p= m/2.
\]
Since $p>1/2$, Proposition~\ref{DV1} applies to the first and third factors.
The second factor
is bounded in ${\cal H}$ by Proposition~\ref{PDO3AA}.$\quad\Box$
Let us now consider the general case ${\bf a}\in {\cal
S}^m_{\rho,\delta,\delta} $
where $m$ is arbitrary. It turns out (see \cite{LY,Y4})
that for $m\geq-1$ the operator
${\bf A}^\flat(\lambda)$ exists if ${\bf a} (x,\xi, \xi')=0$ for
$(x,\xi)$ belonging to a neighbourhood of the conormal bundle
of the sphere $|\xi|=k$ and $\xi'$
close to $\xi$. In view of Proposition~\ref{PDO12},
we may suppose that $\xi$
and $\xi'$ are close to each other or, to put it differently,
we can take
in Definition~\ref{PDO11} functions $g_1$ and $g_2$
supported in a neighbourhood of the same point
$\omega_0\in\S^{d-1}$. Let $ \Pi_{\omega_0}$
be the hyperplane orthogonal to $\omega_0$, and let
$\Omega=\Omega(\omega_0,\gamma)\subset\S^{d-1}$ be determined by the condition
$\langle\omega,\omega_0\rangle>\gamma>0$.
The number $\gamma$ can be chosen arbitrary
close to $1$. We denote by $\zeta=\varkappa(\omega)$
the orthogonal projection of $\omega$ on $ \Pi_{\omega_0}$;
in particular, we assume
that $ \varkappa(\omega_0)=0$. We denote by $\Sigma$
the orthogonal projection of $\Omega$ on the hyperplane
$\Pi_{\omega_0}$ and identify points $\omega\in\Omega$
and $\zeta=\varkappa(\omega)$.
%% Sometimes we do not distinguish in notation points $\omega$ and $\zeta$.
The hyperplane
$\Pi_{\omega_0}$ can be identified with $\R^{d-1}$.
Let us also consider the unitary mapping $Z=Z_\varkappa~:
L_2({\Omega})\to L_2(\Sigma)$ defined by
\begin{equation}\label{eq:U}
\left(Zu\right)(\zeta)=
(1-|\zeta|^2)^{-1/4}u(\omega),~~\zeta=\varkappa(\omega).
\end{equation}
The next result (borrowed from \cite{Y4}) gives conditions of
the existence of the operator ${\bf A}^\flat(\lambda)$.
\begin{proposition}\label{LY}
Let ${\bf a}\in {\cal S}^m_{\rho,\delta,\delta} $ for some $\rho>0$,
$\delta <1$ with
$\rho+\delta\leq 1$. Suppose that there exists
$\varepsilon>0$ such that ${\bf a}(x, \xi,\xi')=0 $ if the following two
estimates
\begin{equation}\label{eq:conds}
|\xi-\xi'| <\varepsilon,\; |<\hat{x},\hat{\xi}>|>1-\varepsilon
\end{equation}
are satisfied. Then the operator ${\bf A}^{\flat}(\lambda)$ is
well-defined in the sense of Definition~$\ref{PDO11}$ for all $\lambda>0$.
Moreover,
the operator ${\bf A}_{\varkappa}^\flat(\lambda)=Z_\varkappa {\bf
A}^{\flat}(\lambda)Z_\varkappa^*$ is the PDO with sesquilinear form
\begin{equation}\label{eq:PDO5}
({\bf A}^\flat_\varkappa(\lambda)u_1,u_2) =(2\pi)^{-d+1}\int_{\R^{d-1}}
\int_{\Sigma}\int_{\Sigma} e^{i<\zeta-\zeta^\prime ,y>} {\bf
a}^\flat_\varkappa (y,\zeta,\zeta';\lambda) u_1(\zeta')
\overline{u_2(\zeta)}d\zeta
d\zeta' dy
\end{equation}
for all $u_1,u_2 \in{\cal C}^\infty_0(\Sigma)$. The amplitude
$ {\bf a}^\flat_\varkappa \in{\cal
S}^{m+1}_{\rho,\delta,\delta}(\R^{d-1}\times \Sigma\times\Sigma)$ is
given by the formula
\begin{equation}\label{eq:akappa}
{\bf a}^\flat_\varkappa (y,\zeta,\zeta';\lambda)=
(2\pi k)^{-1}\alpha(\zeta,\zeta')\int
_{-\infty}^\infty {\bf a}\left((\omega+\omega') z
-y/k,k\omega,k\omega'\right) dz
\end{equation}
$($this integral is
taken over a finite interval due to condition $(\ref{eq:conds}))$,
where $k=\lambda^{1/2},~\zeta=\varkappa(\omega),
~\zeta'=\varkappa(\omega')$
and
\begin{equation}\label{eq:alpha}
\alpha(\zeta,\zeta')=2^{-1}\left(
\left({1-|\zeta|^2\over1-|\zeta'|^2}\right)^{1/4}
+\left({1-|\zeta'|^2\over1-|\zeta|^2}\right)^{1/4}
\right).
\end{equation}
Consequently, $(\ref{eq:PDO5})$ is a smooth function of $\lambda>0$ for all
$u_1,u_2 \in{\cal
C}^\infty_0(\Sigma)$.
\end{proposition}
\begin{definition}\label{amplch}
The function ${\bf a}^\flat_\varkappa (y,\zeta,\zeta';\lambda)$ is called
the amplitude of the operator ${\bf A}^\flat(\lambda)$ in the chart coordinates
$(\omega_0,\varkappa)$.
\end{definition}
We emphasize that, from the point of view of PDO theory, in the formula
(\ref{eq:PDO5}) $\zeta$ plays the role of the space variable and $y$ is the
dual one.
A spectral information on PDO with oscillating amplitudes is given
in the following assertion (see \cite{Y4}).
\begin{proposition}\label{sp}
Let ${\bf A} : C_0^\infty (\Sigma)\rightarrow C^\infty (\Sigma)$,
$\Sigma\subset\R^{d-1}$, be a PDO with
amplitude
\begin{equation}\label{eq:sp3}
{\bf a}(y,\zeta,\zeta')=e^{i\Theta(y,\zeta,\zeta')}{\bf
b}(y,\zeta,\zeta'),
\end{equation}
where $\Theta\in {\cal S}^r $, $r\in (0,1)$, ${\bf b} \in {\cal S}^0 $.
Suppose that for some points
$y_0\neq 0,\zeta_0\in \Sigma$
\begin{equation}\label{eq:sp1}
|\Theta (\tau y_0,\zeta_0,\zeta_0)|\geq c \tau^r,
\quad |\nabla_y\Theta (\tau y_0,\zeta_0,\zeta_0)|\geq c
\tau^{r-1},~~ c>0,
\end{equation}
for sufficiently large $\tau>0$ and that
\begin{equation}\label{eq:sp2}
\lim_{\tau\rightarrow\infty}{\bf b}(\tau y_0,\zeta_0,\zeta_0)=1.
\end{equation}
Then for each $\mu\in{\Bbb T}$ and arbitrary small neighbourhood
$\Sigma_0$ of $\zeta_0$ there exists a $($Weyl$)$ sequence of functions
$u_n\in C^\infty_0(\Sigma_0)$ such that
\[
\|u_n\|=1,~~ w-\lim_{n\to\infty}u_n=0,
~~\lim_{n\to\infty}\|{\bf A}u_n-\mu u_n\|=0.
\]
In particular, the essential spectrum of the operator ${\bf A}$ in
the space $L_2(\Sigma)$ covers the unit circle ${\Bbb T}$.
\end{proposition}
\begin{Remark}\label{sprem}
A simple version of Proposition~\ref{sp} was proven and used in \cite{Y3}.
Namely, let ${\bf a}\in{\cal S}^0_{\rho,\delta,\delta}$ with $\rho>1/2>\delta$,
and let representation (\ref{eq:sp3}) hold. Then the conclusion of
Proposition~\ref{sp} remains true if, for some $y_0\neq 0, \zeta_0\in\Sigma$,
the condition (\ref{eq:sp2}) is satisfied and
\begin{eqnarray}\label{eq:sprem}
\lim_{\tau\rightarrow\infty}\sup \Theta(\tau y_0,\zeta_0,\zeta_0)=\infty
\quad{\rm or}\quad
\lim_{\tau\rightarrow\infty}\inf \Theta(\tau y_0,\zeta_0,\zeta_0)=-\infty.
\end{eqnarray}
\end{Remark}
\section{Limiting absorption principle and
\newline radiations estimates}
{\bf 3.1.}
Let us recall some basic notions of the theory of smooth
perturbations (see, e.g., \cite{RS,YMST}).
\begin{definition}\label{PR1}
Let $H$ be a self-adjoint operator in a Hilbert space $\cal H$,
$R(z)=(H-z)^{-1}$ be the
resolvent of $H$ and $K$ be an $H$-bounded operator. The operator
$K$ is called $H$-smooth $($in the sense of Kato$)$ if one of the two
equivalent conditions is
satisfied
\begin{equation}\label{eq:PR1}
\sup_{f\in{\cal D}({\cal H}),\|f\|=1}\int_{-\infty}^\infty
\|Ke^{-itH}f\|^2dt<\infty,
\end{equation}
\begin{equation}\label{eq:PR2}
\sup_{\lambda\in\R,\varepsilon>0}\left\|K(R(\lambda+i\varepsilon)-
R(\lambda-i\varepsilon))K^*\right\|<\infty.
\end{equation}
\end{definition}
The following definition is essentially more flexible.
\begin{definition}\label{PR1L}
Let $E(\cdot)$ be the spectral measure of $H$.
Suppose that, for an $H$-bounded operator $K$, and intervals $\Lambda_n$
such that
$\R\setminus\bigcup_{n=1}^\infty \Lambda_n$ has the Lebesgue measure zero,
the operators $KE(\Lambda_n)$ are
$H$-smooth. Then we say that $K$ is locally $H$-smooth.
\end{definition}
Note that condition (\ref{eq:PR2}), satisfied for $\lambda\in \Lambda $
only, implies that the
operator
$KE(\Lambda )$ is $H$-smooth.
The theory of $H$-smooth perturbations gives a sufficient condition for the
existence of wave operators (which can easily be obtained from (\ref{eq:PR1})).
\begin{proposition}\label{PR3}
Let $H_0$, $H$ be a couple of self-adjoint operators, and let $J$ be a
bounded operator.
Suppose
that $T=H J-JH_0$ admits the factorization
\[
T=\sum_{j=1}^NK^*_{ j}K_{0,j},
\]
where all operators $K_{0,j}$ are locally $H_0$-smooth and $K_{j}$ are
locally $H$-smooth.
Denote by $P_0$ and $P$ the orthogonal projections on the absolutely
continuous subspaces of
the operators $H_0$ and $H$, respectively. Then the wave operators
\[
W_\pm(H ,H_0;J) = s-\lim_{t\to\pm\infty}e^{itH }Je^{-itH_0}P_0
\]
and
\[
W_\pm(H_0,H;J^\ast ) =s-\lim_{t\rightarrow\pm\infty}
e^{iH_0t} J^\ast e^{-iHt}P
\]
exist.
\end{proposition}
Note, finally, that for an arbitrary self-adjoint
operator $H$ and a compact operator $K$
\begin{equation}\label{eq:WK}
s-\lim_{|t|\rightarrow \infty}
K e^{-iHt}P =0.
\end{equation}
\bigskip
{\bf 3.2.}
Let us return to the Schr\"odinger operator
(\ref{eq:H0}). Recall first of all that, although it is really
unimportant for our results, under assumption (\ref{eq:H1}) the operator
$H$ does not have positive eigenvalues (see \cite{IU,UCH} where the proof of
\cite{RS} was extended to magnetic potentials). The following well-known
\cite{CFKS,M1} result (the limiting absorption principle)
can be easily obtained by the Mourre method.
\begin{proposition}\label{PR6}
Let assumption $(\ref{eq:H1})$ hold, and let $p>1/2$. Then the
operator-function $\left<x\right>^{-p}R(z)\left<x\right>^{-p}$ is
continuous in norm with respect to the parameter $z$ in the closed
complex plane cut along $[0,\infty)$ with exception of the point $0$. In
particular, the operator $\langle x\rangle^{-p} E(\Lambda)$ is $H$-smooth for
any compact interval
$\Lambda\subset (0,\infty)$. The positive spectrum of $H$ is absolutely
continuous.
\end{proposition}
The following resolvent estimates borrowed from \cite{Y5} are called
radiation estimates.
\begin{proposition}\label{PR7}
Let assumption $(\ref{eq:H1})$ hold, and let the operators $\nabla_j^\bot$
be defined
by $(\ref{eq:GRADBOT})$. Set $G_j=\left<x\right>^{-1/2} \nabla_j^\bot$.
Then for all $j=1,\dots, d $ the operators $G_j E(\Lambda)$ are $H$-smooth
for any
compact interval $\Lambda\subset(0,\infty)$.
\end{proposition}
Propositions \ref{PR6} and \ref{PR7} are sufficient for the proof
of existence and completeness of wave operators. However, our study of the
SM requires additional resolvent estimates called usually
propagation estimates.
\begin{proposition}\label{PR8}
Let assumption $(\ref{eq:H1})$ be fulfilled. Let $Q_\pm$ be the PDO with
symbol $q_\pm (x,\xi)\in{\cal C}^{m}(\Phi_\pm)$ for some $\Phi_\pm\in{\cal
S}^r$ with $r\in [0,1)$. Suppose that $q_\pm (x,\xi)=0$ for
$|\xi|\leq \varepsilon$, $|x|\leq \varepsilon$ and that the support of
$q_\pm (x,\xi)$ is contained in the cone
$$
\mp < \hat{\xi},\hat{x}>\; \geq \varepsilon,\quad
\hat{\xi}=\xi/|\xi|,\; \hat{x}=x/|x|,
$$
for some $\varepsilon\in(0,1)$.Then the operator-functions
\[
\left< x\right>^{p-\sigma}Q_+^\ast R(z)\left< x\right>^{-p},
\quad \left< x\right>^{-p} R(z)Q_-\left< x\right>^{p-\sigma},
\quad p>1/2,\; \sigma> m+1,
\]
are bounded and continuous in norm with respect to the parameter $z$ in the
region $\Re z \in(\lambda_0,\infty),\lambda_0 > 0,\; \Im z \geq 0$.
\end{proposition}
\begin{proposition}\label{PR9}
Under the assumptions of Proposition~$\ref{PR8}$ the operator-function
\[
\left< x\right>^l Q_+^\ast R(z)Q_-\left< x\right>^l,
\quad\forall l,
\]
is bounded and continuous in norm with respect to the parameter $z$ in
the region $\Re z \in(\lambda_0,\infty),\lambda_0 > 0,\;
\Im z \geq 0$.
\end{proposition}
These two assertions were proven in
\cite{J,JMP,M2} for PDO $Q_\pm\in{\cal S}^m$. In the case $Q_\pm\in{\cal
C}^m (\Phi_\pm)$ the
proofs are quite similar. In particular, they rely on the Mourre estimate
\cite{M1}.
\section {The eikonal equation}
In this section our goal is to construct approximate eigenfunctions of
the Schr\"odinger operator with long-range electric and magnetic
potentials. It is natural to seek these eigenfunctions in the form
$\Psi=e^{i\varphi}$ with a real function $\varphi$. A simple calculation
shows that
\begin{eqnarray}\label{eq:E1}
((i\nabla+A)^2+V-|\xi|^2)\Psi
\nonumber\\
=e^{i\varphi} (|\nabla \varphi|^2-2<A,\nabla \varphi>
-i\Delta \varphi+ V+|A|^2+i{\rm div}A-|\xi|^2),~~\nabla=\nabla_x.
\end{eqnarray}
Neglecting here the imaginary terms, which turn out to be
short-range, we see that the Schr\"odinger equation reduces to
the eikonal equation
(\ref{eq:eikonal}) for
$\varphi=\varphi_\pm$. Considering this equation, we always remove a
conical neighbourhood of the direction $\hat{x}=\mp\hat{\xi}$
and require that its right-hand side be short-range (not
necessarily zero). We assume that
$\varphi_\pm$ has the form (\ref{eq:E3}) where $ \Phi_\pm=o(|x|)$
as $|x|\to\infty$. Then equation (\ref{eq:eikonal}) for
$\varphi_\pm $ yields the equation
\begin{equation}\label{eq:E4}
2 <\!\xi,\nabla \Phi_\pm(x,\xi)\!> + |\nabla\Phi_\pm(x,\xi)|^2
-2<\!A(x),\xi+\nabla\Phi_\pm(x,\xi)\!>+ V(x)+|A(x)|^2
=q_\pm(x,\xi)
\end{equation}
for $\Phi_\pm$ with a short-range term $ q_\pm$. Thus, according to
(\ref{eq:E1})
\begin{equation}\label{eq:E16}
((i\nabla+A)^2 +V -|\xi|^2)(e^{i\varphi_\pm})
=e^{i\varphi_\pm}{\rm q}_\pm,
\end{equation}
where
\begin{equation}\label{eq:E17}
{\rm q}_\pm = q_\pm+i{\rm div}A-i\Delta\Phi_\pm
\end{equation}
is again a short-range term.
Equation (\ref{eq:E4}) can be easily solved by iterations. Let us first
consider an auxiliary linear equation
\begin{equation}\label{eq:E5}
< \xi,\nabla\phi (x,\xi) > + F(x,\xi)=0.
\end{equation}
All estimates below are uniform in $\xi$ if $\lambda_0\leq |\xi|\leq
\lambda_1$ for some $0<\lambda_0<\lambda_1<\infty$.
\begin{lemma}\label{E1}
Suppose that $F=F_\pm$ satisfies for all multi-indices $\alpha, \beta$ the
estimates
\[
|\partial^\alpha_x\partial^\beta_\xi F_\pm(x,\xi)|\leq
C_{\alpha,\beta}(\kappa) \left(1+|x|\right)^{-\rho-|\alpha|},
\quad \pm< \hat{x}, \hat{\xi}>\; \geq\kappa,
\]
for some $\rho\in(0,1)$ and any $\kappa>-1$. Then the function
\begin{equation}\label{eq:E7}
\phi_\pm(x,\xi)= \pm \int_0^\infty
\Bigl( F_\pm(x\pm t\xi,\xi) -F_\pm(\pm t\xi,\xi)\Bigr) dt
\end{equation}
is a solution of equation $(\ref{eq:E5})$ which satisfies for all
$\alpha,\beta$ and $\kappa >-1 $ the estimates
\[
|\partial^\alpha_x\partial^\beta_\xi \phi_\pm(x,\xi)|\leq
C_{\alpha,\beta}(\kappa) \left(1+|x|\right)^{1-\rho-|\alpha|},
\quad \pm< \hat{x}, \hat{\xi}>\; \geq\kappa.
\]
\end{lemma}
The proof can be obtained by a direct differentiation of (\ref{eq:E7}),
see \cite{Y3} for details.
Let us seek $\Phi_\pm=\Phi^{(N)}_\pm$ in the form
\begin{equation}\label{eq:E9}
\Phi_\pm(x,\xi)=\sum_{n=1}^{N } \phi^{(n)}_\pm (x,\xi),
\end{equation}
where the functions $\phi^{(n)}_\pm$ are solutions of equations
\begin{eqnarray}
\label{eq:E10a}
2 < \xi,\nabla\phi^{(1)}_\pm >+V-2<A,\xi>&=&0,\\
\label{eq:E10b}
2 < \xi,\nabla\phi^{(2)}_\pm >+|\nabla\phi^{(1)}_\pm|^2
-2<\!A,\nabla\phi^{(1)}_\pm\!>+|A|^2&=&0,\\
\label{eq:E10c}
2 < \xi,\nabla\phi^{(n)}_\pm>
+\sum_{m+p=n} <\!\nabla\phi^{(m)}_\pm
,\nabla\phi^{(p)}_\pm\!>
-2<\!A,\nabla\phi^{(n-1)}_\pm\!>&=&0, ~n\geq 3.
\end{eqnarray}
Then the remainder
$q_\pm(x,\xi)=q_\pm^{(N)}(x,\xi)$ defined by (\ref{eq:E4}) satisfies
the equations
\begin{equation}\label{eq:E121}
q_\pm^{(1)} =
|\nabla\phi^{(1)}_\pm |^2
-2<\!A ,\nabla\phi^{(1)}_\pm \!>+|A |^2,
\end{equation}
\[
q_\pm^{(N)} =
\sum_{m+p\geq N+1}< \nabla\phi^{(m)}_\pm ,\nabla\phi^{(p)}_\pm >
-2<\!A ,\nabla\phi^{(N)}_\pm \!>,\quad N\geq 2.
\]
Using Lemma~\ref{E1}, we derive inductively estimates for functions
$\phi^{(n)}_\pm$, which gives also estimates for $\Phi_\pm$ and $q_\pm$.
\begin{proposition}\label{E2}
Let assumption $(\ref{eq:H1})$ hold for some $\rho\in(0,1)$
such that $\rho^{-1}$ is not integer and
set $N =\left[\rho^{-1}\right]$. Then for all multi-indices $\alpha, \beta$
we have in the region
\newline
$\pm<\hat{x},\hat{\xi}>\geq\kappa$ $($for any $\kappa > -1) $
\begin{eqnarray}
\label{eq:E13}
|\partial^\alpha_x\partial^\beta_\xi
\phi^{(n)}_\pm(x,\xi)|&\leq
&C_{\alpha,\beta}(\kappa)\left(1+|x|\right)^{1-n\rho-|\alpha|}\\
\label{eq:E14}
|\partial^\alpha_x\partial^\beta_\xi \Phi_\pm(x,\xi)|&\leq
&C_{\alpha,\beta}(\kappa) \left(1+|x|\right)^{1-\rho-|\alpha|}\\
\label{eq:E15}
|\partial^\alpha_x \partial^\beta_\xi q_\pm(x,\xi)|&\leq&
C_{\alpha,\beta}(\kappa) \left(1+|x|\right)^{-1-\epsilon-|\alpha|},\quad
\epsilon>0.
\end{eqnarray}
\end{proposition}
Equality (\ref{eq:E17}) and estimates (\ref{eq:E14}) imply that the
function ${\rm q}_\pm$ in the
right-hand side of (\ref{eq:E16}) obeys the same bound (\ref{eq:E15}) as $
q_\pm$.
We note that all assertions of Proposition~\ref{E2} remain true for $\rho=1$,
except that in this case the function $\Phi_\pm(x,\xi)=\phi_\pm^{(1)}(x,\xi)$
may have a logarithmic growth as $|x|\rightarrow\infty$. Similarly, if
$\rho^{-1}$ is integer,
then $N=\rho^{-1}$ and the function $\phi_\pm^{(N)}(x,\xi)$ has a
logarithmic growth. The assumption that $\rho^{-1}$ is not integer does
not of course reduce
the generality.
Let us finally give an explicit expression for $\Phi_\pm=\phi_\pm^{(1)}$ in
the case $\rho>1/2$
\begin{equation}\label{eq:EAB}
\Phi_\pm(x,\xi)= \pm 2^{-1} \int_0^\infty
\Bigl( V(x\pm t\xi)-V(\pm t\xi) -2 <A(x\pm t\xi)-A(\pm t\xi),\xi>\Bigr) dt.
\end{equation}
\bigskip
\section { Wave operators}
{\bf 5.1.}
Here we consider wave operators for the pair of Hamiltonians
$H_0=-\Delta, H=(i\nabla+A)^2+ V$, acting in the space ${\cal
H}=L_2(\R^d)$. We always assume condition (\ref{eq:H1}) on $A$ and $V$.
Below we fix a spectral interval $\Lambda=[\lambda_0,\lambda_1]\subset
\R_+=(0,\infty)$.
Let $\Phi_\pm$ be the function constructed in Proposition \ref{E2}. We
define the identification $J_\pm$ by the formula
\begin{equation}\label{eq:W1}
(J_\pm f)(x)=(2\pi)^{-d/2}\int_{{\R}^d}e^{i <x,\xi>+i\Phi_\pm (x,\xi) }
\zeta_\pm(x,\xi) \hat{f}(\xi) d\xi,
\end{equation}
where the cut-off function
\begin{equation}\label{eq:W2}
\zeta_\pm(x,\xi)= \sigma_\pm ( < \hat{\xi},\hat{x}>)\eta(x)
\psi (|\xi|^2),\quad
\hat{\xi}=\xi/|\xi|,\; \hat{x}=x/|x|.
\end{equation}
Here $\sigma_\pm\in C^\infty $
is such that $\sigma_\pm(\tau)=1$ near $\pm 1$ and
$\sigma_\pm(\tau)=0$ near $\mp 1$,
so that it ``kills" a conical neibourhood of the bad direction
$\hat{x}=\mp\hat{\xi}$ where estimates
(\ref{eq:E14}) are violated.
The function $\eta\in C^\infty ({\R}^d)$, such that
$\eta (x)=0$ near zero and $\eta(x)=1$ for large $|x|$,
is introduced only to get rid of the singularity of the function $\hat{x}$
at the point $x=0$. Finally, $\psi\in C_0^\infty ({\R}_+)$ and
$\psi(\lambda)=1$ for
$\lambda\in\Lambda$.
Thus, our considerations are localized on a bounded disjoint from zero
energy interval. Since the function $\Phi_\pm$ satisfies estimates
(\ref{eq:E14}) on the support of $\zeta_\pm$, the operator $J_\pm$ fits
into the framework of PDO with oscillating symbols (see subsection
2.1). In particular, by Proposition~\ref{PDO3}, $J_\pm$ is a bounded
operator on $\cal H$. Abusing somewhat notation, we write
$J_\pm\in{\cal C}^0 ({\Phi}_\pm)$.
Our first goal in this section is to
show that the pair $H_0,H,$ with identifications $J_+$ and $J_-$, fits
into the framework of the theory of smooth perturbations, so the wave
operators $W_\pm(H,H_0;J_\gamma )$ and $W_\pm(H_0,H ;J_\gamma^\ast )$ exist
both for
$\gamma=``+" $ and $\gamma=``-" $. The structure of the operators
$T_\pm=HJ_\pm-J_\pm H_0$
is described in the following
\begin{lemma}\label{W2}
The operator $T_\pm$ admits the decomposition
$T_\pm=T_\pm^{(s)}+T_\pm^{(r)}$ where $T_\pm^{(s)},T_\pm^{(r)}$ are,
respectively, PDO with symbols
\begin{eqnarray}\label{eq:W6} t^{(s)}_\pm(x,\xi)=-2 i
\eta(x)e^{i\Phi_\pm(x,\xi)}<\xi, \nabla
\sigma_\pm( <\hat{\xi},\hat{x}>)> \psi (|\xi|^2)
\nonumber\\ =-2 i \eta(x) |x|^{-1} e^{i\Phi_\pm(x,\xi)}
(1- <\hat{\xi},\hat{x}>^2)
\sigma_\pm^\prime( <\hat{\xi},\hat{x}>) |\xi| \psi (|\xi|^2)
\in{\cal C}^{-1} ({\Phi}_\pm)
\end{eqnarray} and $t^{(r)}_\pm\in {\cal C}^{-1-\epsilon} ({\Phi}_\pm)$ for
some
$\epsilon>0$.
\end{lemma}
{\it Proof.} --
According to (\ref{eq:E16}) and (\ref{eq:W1}), we have that
$$
\left(T_\pm f\right)(x)=(2\pi)^{-d/2}\int_{{\R}^d} e^{i <x,\xi>+i\Phi_\pm
(x,\xi) } \tau_\pm
(x,\xi) \hat{f}(\xi) d\xi,
$$ where
\begin{equation}\label{eq:W7}
\tau_\pm (x,\xi)= {\rm q}_\pm (x,\xi) \zeta_\pm (x,\xi) -2i<
\xi+\nabla\Phi_\pm (x,\xi)-A(x),
\nabla \zeta_\pm (x,\xi)> - \Delta \zeta_\pm (x,\xi).
\end{equation}
We single out here the term
$$
\tau_\pm^{(s)} (x,\xi)=-2 i \eta(x)<\xi,\nabla
\sigma_\pm(<\hat{\xi},\hat{x}>)>\psi (|\xi|^2)
$$ decaying as $|x|^{-1}$. According to (\ref{eq:H1}), (\ref{eq:E14}) and
(\ref{eq:E15}) all other
terms belong to the class ${\cal S}^{-1-\epsilon}$. Thus, we define
$t_\pm^{(s)}$ and $t_\pm^{(r)}$
by the equalities
$$
t_\pm^{(s)}(x,\xi)=e^{i\Phi_\pm (x,\xi) }
\tau_\pm^{(s)}(x,\xi),~~
\tau_\pm^{(r)} (x,\xi)=\tau_\pm (x,\xi)-\tau_\pm^{(s)}
(x,\xi),~~t_\pm^{(r)}(x,\xi)=e^{i\Phi_\pm
(x,\xi) }
\tau_\pm^{(r)}(x,\xi).
$$ Then $t_\pm =t_\pm^{(s)}+t_\pm^{(r)}.\quad\Box$
Our study of the singular part $T_\pm^{(s)}$ relies on
\begin{lemma}\label{W1}
Let $T$ be a PDO with symbol
$$t(x,\xi)= g(x,\xi)w (< \hat{x}, \hat{\xi}>) \eta(x)\psi(|\xi|^2),$$
where $g\in {\cal C}^{-1}(\Phi), \Phi\in {\cal S}^{1-\rho},\; \rho>0$,
$w\in C^\infty $ and
$w(\pm 1)=0$. Let $G_j, j=1,\dots, d,$ be the operators defined in
Proposition $\ref{PR7}$. Then $T$ admits the representation $(\ref{eq:W5})$,
where $p = (1+\rho)/2$ and the operators $B^{(s)} ,B^{(r)} $ are bounded.
\end{lemma}
{\it Proof.} --
Let $B^{(s)}$ and $T_j, j=1,\dots, d,$ be
the PDO with symbols
\begin{eqnarray*}
b^{(s)} (x,\xi)&=&\left< x\right>\,|\xi|^{-2}
(1- <\hat{\xi},\hat{x}> ^2 )^{-1}t(x,\xi),
\\
t_j(x,\xi)&=&\left< x\right>^{-1}(\xi_j-|x|^{-2}
x_j <\xi,x >)^2b^{(s)} (x,\xi).
\end{eqnarray*}
The function $(1-\tau^2)^{-1}w(\tau)$ is $C^\infty$, so that $b^{(s)}\in
{\cal C}^0
({\Phi})$ and hence, by Proposition~\ref{PDO3}, the operator
$B^{(s)}$ is bounded. Since $G_j $ is the PDO with symbol
\[
g_j(x,\xi)=i \left< x\right>^{-1/2}(\xi_j-|x|^{-2}x_j <\xi,x >)
\]
and $t_j=|g_j|^2 b^{(s)}$,
we get, by Proposition~\ref{PDO6} where $m=0$, $n=-1/2$, $r=1-\rho$, that
the operator
\[
B^{(r)}=\sum_{j=1}^d\left<x\right>^p
\left(G_j^\ast B^{(s)} G_j-T_j\right)\left< x\right>^p
\]
is bounded for $2p = \rho+1$. It remains to remark that
$t =\sum_{j=1}^d t_j$. $\quad\Box$
Now it is easy to obtain representation (\ref{eq:W5}).
\begin{proposition}\label{W3}
The operators $T_\pm$ admit representation $(\ref{eq:W5})$ for
$p >1/2$ and some bounded operators $B_\pm^{(r)},B_\pm^{(s)}$.
\end{proposition}
{\it Proof.} --
Let us proceed from Lemma~\ref{W2}.
Since $t_\pm^{(s)}\in {\cal C}^{-1}
({\Phi}_\pm)$ and $\sigma^\prime_\pm (\tau)=0$ in neighbourhoods of
the points $-1$ and $1$, Lemma~\ref{W1} can be directly applied to
the operators $T_\pm^{(s)}$ for $p_s=(1+\rho)/2$. Since $t_\pm^{(r)}\in {\cal
C}^{-1-\epsilon} ({\Phi}_\pm)$, the operator $\left< x\right>^p
T_\pm^{(r)}\left< x\right>^p$ is bounded for $p_r = (1+\epsilon)/2$ by
Proposition \ref{PDO5}. This leads to (\ref{eq:W5}) with
$p=\min\{p_s,p_r\}>1/2.\quad\Box$
It follows from Propositions~\ref{PR6} and
\ref{PR7} that the triples $\{H_0,H,J_+\}$ and
$\{H_0,H,J_-\}$ satisfy the assumptions of
Proposition~\ref{PR3}. This yields
\begin{theorem}\label{W4}
Suppose that $A$ and $V$ satisfy $(\ref{eq:H1})$. Let $J_\pm=J_\pm
(\zeta_\pm )$ be defined by $(\ref{eq:W1})$. Then all wave operators
\begin{equation}\label{eq:W9}
W_\pm(H,H_0;J_\pm ),\quad W_\pm(H_0,H;J_\pm^\ast )
\end{equation}
and
\begin{equation}\label{eq:W10}
W_\pm(H,H_0;J_\mp ),\quad W_\pm(H_0,H;J_\mp^\ast )
\end{equation}
exist. Operators $(\ref{eq:W9})$ as well as $(\ref{eq:W10})$ are adjoint to
each other.
\end{theorem}
\begin{corollary}\label{W4C}
The wave operators satisfy the intertwining property, that is
\[
W_\pm(H,H_0;J_\gamma )E_0(X)= E(X) W_\pm(H,H_0;J_\gamma )
\]
for all Borel sets $X\subset\R$ and both signs of $\gamma$. In particular,
\begin{equation}\label{eq:Wint1}
{\rm Ran}\:(W_\pm(H,H_0;J_\gamma )E_0(X))\subset E(X){\cal H}.
\end{equation}
\end{corollary}
\bigskip
{\bf 5.2.}
Now we are able to prove
the isometricity and completeness of the wave operators
$W_\pm(H,H_0;J_\pm )$.
\begin{lemma}\label{WCaux}
Let $A$ be a PDO with symbol $a\in{\cal S}^0$ such that
$a(x,\xi)=0$ in some conical neighbourhood of the direction
$\hat{x}=\pm\hat{\xi}$ at least for sufficiently large $|x|$. Then
\[
s-\lim_{t\rightarrow\pm\infty}
A e^{-iH_0t} =0.
\]
\end{lemma}
{\it Proof.} --
The stationary point $\xi=x/(2t)$ of the integral
\begin{equation}
(A e^{-iH_0t}f)(x)=(2\pi)^{-d/2}\int_{{\R}^d}e^{i < \xi,x> -
i|\xi|^2t}a(x,\xi)
\psi^2(|\xi|^2))\hat{f}(\xi) d\xi
\label{eq:WC3aux}\end{equation}
does not belong to the support of the function $a(x,\xi) $
if $t\rightarrow\pm\infty$.
Here we have taken into account that according to (\ref{eq:WK})
values of $a(x,\xi) $ for bounded $x$ can be neglected.
Therefore supposing that $\hat{f}\in C_0^\infty({\R}^d)$ and integrating
by parts,
we estimate integral (\ref{eq:WC3aux}) by $C_N (1+|x|+|t|) ^{-N}$ for
arbitrary $N$.
$\quad\Box$
\begin{lemma}\label{WC1}
The following relations hold
\begin{equation}\label{eq:WC1}
s-\lim_{t\rightarrow\pm\infty} ( J_\pm^\ast J_\pm -\psi^2(H_0)) e^{-iH_0t}=0,
\end{equation}
\begin{equation}\label{eq:WC2}
s-\lim_{t\rightarrow\pm\infty} J_\mp^\ast J_\mp e^{-iH_0t} =0.
\end{equation}
\end{lemma}
{\it Proof.} --
By Proposition \ref{PDO4}, up to compact
terms (which are negligible according to (\ref{eq:WK})),
$A_1=J_\pm^\ast J_\pm -\psi^2(H_0)$ and
$A_2=J_\mp^\ast J_\mp$ are PDO with symbols
$ \zeta_\pm^2(x,\xi)- \psi^2(|\xi|^2)$ and $\zeta_\mp^2(x,\xi)$,
respectively. Therefore Lemma~\ref{WCaux} can be applied
to both operators $A_1$ and $A_2$.
$ \quad\Box$
\begin{proposition}\label{WC2}
Under the assumptions of Theorem $\ref{W4}$, the operators
$W_\pm(H,H_0;J_\pm )$ are isometric on the subspace $E_0(\Lambda){\cal H}$
and
\begin{equation}\label{eq:WC4}
W_\pm(H,H_0;J_\mp )=0,\quad W_\pm(H_0,H;J_\mp^\ast)=0.
\end{equation}
\end{proposition}
{\it Proof.} --
The results on the operators
$W_\pm(H,H_0;J_\pm )$ and $W_\pm(H,H_0;J_\mp )$ are immediate
consequences of (\ref{eq:WC1}) and (\ref{eq:WC2}), respectively. The
second equality (\ref{eq:WC4})
is a consequence of the first because
$W_\pm(H_0,H;J_\mp^\ast)=W_\pm^\ast (H,H_0;J_\mp ).\quad\Box$
\begin{proposition}\label{WC2a}
The operators $W_\pm(H,H_0;J_\pm( \zeta_\pm) )$ do not depend on the choice
of functions
$\sigma_\pm$ and $\eta$ in the definition $(\ref{eq:W2})$
provided they satisfy the assumptions formulated at the beginning of this
section.
\end{proposition}
{\it Proof.} --
Let $\sigma_\pm, \eta$ and $\tilde{\sigma}_\pm, \tilde{\eta}$ be a couple
of such functions,
and let $ \zeta_\pm, \tilde{\zeta}$ be defined by (\ref{eq:W2}). Set $L_\pm=
J_\pm( \zeta_\pm)-J_\pm( \tilde{\zeta}_\pm)$. It suffices to check that
$L_\pm e^{-H_0 t}\rightarrow 0$ strongly as $t\rightarrow\pm\infty$ or that
\[
s-\lim_{t\rightarrow\pm\infty} L_\pm^* L_\pm e^{-iH_0t} =0.
\]
By Proposition \ref{PDO4}, up to a compact term, $A_\pm=L_\pm^* L_\pm $
is the PDO with symbol $ (\zeta_\pm (x,\xi)- \tilde{\zeta}_\pm (x,\xi) )^2$,
and hence Lemma~\ref{WCaux} can be applied to both operators $A_\pm$.
$\quad\Box$
Our main result in this section is the following
\begin{theorem}\label{WC3}
Under the assumptions of Theorem $\ref{W4}$, the asymptotic
completeness holds$:$
\[
{\rm Ran}\:(W_\pm(H,H_0;J_\pm )E_0(\Lambda))=E(\Lambda){\cal H}.
\]
\end{theorem}
{\it Proof.} --
By virtue of $(\ref{eq:Wint1})$ for $X=\Lambda$, it suffices to check that
for any $f\in
E(\Lambda){\cal H}$ there exists $f_0^{(\pm)} \in E_0(\Lambda){\cal H} $
such that $f=W_\pm(H
,H_0;J_\pm )f_0^{(\pm)}$ or, to put it
differently, that
\begin{equation}\label{eq:WC6}
\lim_{t\rightarrow\pm\infty} || e^{-iHt}f- J_\pm e^{-iH_0t}f_0^{(\pm)}||=0.
\end{equation}
Let us set $f_0^{(\pm)}=W_\pm(H_0,H;J_\pm^\ast )f$. Then, by the definition
of this
wave operator,
\[
\lim_{t\rightarrow\pm\infty} ||J_\pm^\ast e^{-iHt}f- e^{-iH_0t}f_0^{(\pm)}||=0
\]
and hence
\begin{equation}\label{eq:WC7}
\lim_{t\rightarrow\pm\infty} ||J_\pm J_\pm^\ast e^{-iHt}f- J_\pm
e^{-iH_0t}f_0^{(\pm)}||=0.
\end{equation}
The second equality (\ref{eq:WC4}) implies that $
\displaystyle\lim_{t\rightarrow\pm\infty}||J_\mp^\ast e^{-iHt}f||=0$ and,
consequently,
\begin{equation}\label{eq:WC8}
\lim_{t\rightarrow\pm\infty}|| J_\mp J_\mp^\ast e^{-iHt}f||=0.
\end{equation}
By Proposition~\ref{PDO4}, up to a compact term, $J_\pm J_\pm^\ast+J_\mp
J_\mp^\ast$ is the PDO with symbol $ \zeta_\pm^2(x,\xi)
+\zeta_\mp^2(x,\xi) $. According to Proposition~\ref{WC2a},
we may assume that the functions $\sigma_\pm$
in (\ref{eq:W2}) satisfy the condition
$\sigma_+^2(\tau)+\sigma_-^2(\tau)=1$. Then it follows from (\ref{eq:WC7}) and
(\ref{eq:WC8}) that
$$
\lim_{t\rightarrow\pm\infty} ||\psi^2(H_0) e^{-iHt}f- J_\pm
e^{-iH_0t}f_0^{(\pm)}||=0.
$$
Since the operator $\psi^2(H)-\psi^2(H_0)$ is compact and $\psi^2(H)f=f$,
this yields
(\ref{eq:WC6}).$\quad\Box$
\bigskip
{\bf 5.3.}
Here we find the asymptotics of the function
\begin{equation}\label{eq:WO1}
(J_\pm e^{-iH_0t}f)(x)=(2\pi)^{-d/2}\int_{{\R}^d}
e^{i<x,\xi>+i\Phi_\pm(x,\xi)- i|\xi|^2t}
\zeta_\pm (x,\xi) \hat{f}(\xi) d\xi,
\quad f\in {\cal S}({\R}^d),
\end{equation}
as $t\rightarrow\pm\infty$. This will allow us to show that
$W_\pm(H,H_0;J_\pm )$ coincide with wave operators
defined (see \cite{Y5}) in terms of a time-dependent modification
of the free dynamics $e^{-iH_0t}$.
Stationary points $\omega(x, t)$
of the phase function in (\ref{eq:WO1}) are determined by the equation
\begin{equation}\label{eq:WO2}
x + (\nabla_\xi\Phi_\pm)(x, \omega(x, t)) - 2\omega(x, t)t=0,~~~\pm t>0.
\end{equation}
Due to the function $\zeta_\pm (x,\xi) $ we are interested
only in points $\omega=\omega(x, t)$ such that $ |\omega|^2\in{\rm
supp}\,\psi$
and $\pm < \hat{\omega}, \hat{x}> \geq \kappa $ for some $\kappa >
-1 $. Using estimate (\ref{eq:E14}) on $\nabla_\xi\Phi_\pm$, we see
that for large $|t|$ equation (\ref{eq:WO2}) has a unique solution
$\omega(x, t)$ and
\begin{equation}\label{eq:WO3}
\omega(x, t)= (2t)^{-1} x + O(|t|^{-\rho})
\end{equation}
uniformly in $x$ such that
\begin{equation}\label{eq:txt}
c_1|t|\leq |x|\leq c_2|t|,\quad 0<c_1<c_2<\infty.
\end{equation}
Let us set
\begin{equation}\label{eq:WO4}
\Xi (x, t) = < \omega(x, t),x> + \Phi_\pm(x, \omega(x, t))
- |\omega(x, t)|^2t,\quad \pm t >0.
\end{equation}
Applying the stationary phase method to integral (\ref{eq:WO1}) and taking
into account the equality
$\sigma_\pm ( <\hat{\omega}(x,t) ,\hat{x}>)=1$
for sufficiently large $\pm t$, we find
that
\begin{equation}\label{eq:WO5}
(J_\pm e^{-iH_0t}f)(x) = e^{\mp \pi id/4} e^{i\Xi (x, t) } (2|t|)^{-d/2}
\psi(|\omega(x,t)|^2) \hat{f}(\omega(x,t)) + {\rm r}_\pm(x,t),
\end{equation}
where ${\rm r}_\pm(x,t)$ tends to zero in $L_2({\R}^d)$ as
$t\rightarrow\pm \infty$. Using equation (\ref{eq:WO2}), we can rewrite
expression (\ref{eq:WO4}) as
\begin{equation}\label{eq:WO6}
\Xi (x, t) = |x|^2/(4t) + \Omega(x, t),
\end{equation}
where
\begin{equation} \label{eq:WO7}
\Omega(x, t) =\Phi_\pm(x, \omega(x,t))
-(4t)^{-1} |(\nabla_\xi \Phi_\pm)(x,\omega(x, t))|^2,~~~\pm t>0.
\end{equation}
It follows from (\ref{eq:WO3}) that in equation (\ref{eq:WO5}) $
\omega(x,t)$ can be replaced by $x/(2t)$. This gives us the following
\begin{lemma}\label{WO2}
Suppose that $|t|$ is sufficiently large.
Let $ \omega(x, t)$ satisfy equation $(\ref{eq:WO2})$, and let $\Xi (x, t)
$ be defined by formulas $(\ref{eq:WO6})$, $(\ref{eq:WO7})$. Define a
family of unitary operators by the equality
\begin{equation}\label{eq:WO8}
(U_0(t)f)(x)= e^{\mp\pi di /4 } e^{i\Xi(x, t) } (2|t|)^{-d/2}
\hat{f}((2t)^{-1}x),\quad \pm t >0.
\end{equation}
Then for any function $\zeta_\pm$ defined by $(\ref{eq:W2})$
$$
\lim_{t\rightarrow\pm\infty} ||J_\pm( \zeta_\pm) e^{-iH_0t}f -U_0(t)
\psi(H_0)f||=0,\quad
\forall f\in L_2({\R}^d).
$$
\end{lemma}
Lemma~\ref{WO2} allows us to reformulate the results of Theorems \ref{W4}
and \ref{WC3} as
\begin{proposition}\label{WO1}
Suppose that $A$ and $V$ satisfy $(\ref{eq:H1})$. Define $U_0(t)$ by
equality $(\ref{eq:WO8})$ for sufficiently large $|t|$. Then the wave
operators
\begin{equation}\label{eq:WO9}
{\bf W}_\pm=s-\lim_{t\rightarrow\pm\infty} e^{iHt}U_0(t)
\end{equation}
exist, are isometric and ${\rm Ran}\; {\bf W}_\pm=P{\cal H}$.
Furthermore, for any function $(\ref{eq:W2})$ satisfying the assumptions
formulated at the
beginning of this section
$$
{\bf W}_\pm \psi(H_0)= W_\pm(H,H_0;J_\pm( \zeta_\pm) ).
$$
\end{proposition}
Proposition~\ref{WO1} shows again that the operators $W_\pm(H,H_0;J_\pm(
\zeta_\pm)
)$ do not depend on the choice of functions $\sigma_\pm$ and $\eta$ in the
definition (\ref{eq:W2}).
\begin{Remark}\label{WOP}
If $\Xi (x, t) = |x|^2/(4t)$ in (\ref{eq:WO8}), then
\[
\lim_{t\rightarrow\pm\infty}
||e^{-iH_0t}f -U_0(t)f||=0, \quad\forall f\in L_2({\R}^d),
\]
and hence the wave operators (\ref{eq:WO9}) coincide with
\[
W_\pm(H,H_0)= s-\lim_{t\rightarrow\pm\infty} e^{iHt} e^{-iH_0t}.
\]
\end{Remark}
If $\rho>1/2$ then the function (\ref{eq:WO7}) can be replaced by a
simpler expression. Recall first of all that in this case $\Phi_\pm $ is
defined by formula
(\ref{eq:EAB}). It
follows from (\ref{eq:E14}) and (\ref{eq:WO3})
that in the region (\ref{eq:txt}) the functions
$$
(4t)^{-1}|\nabla_\xi\Phi_\pm(x, \omega(x,t))|^2
=O\left(|t|^{1-2\rho}\right),~~
\Phi_\pm(x, \omega(x,t))-\Phi_\pm(x,x/(2t))
=O\left(|t|^{1-2\rho}\right)
$$
tend to zero as $|t|\rightarrow\infty$.
Thus, in place of (\ref{eq:WO7}) we can set
$\Omega(x,t)=\Phi_\pm(x,x/(2t))$
which, according to (\ref{eq:EAB}), yields the expression
\[
\Omega(x,t)=-t\int_0^1 V( sx) ds +
\int_0^1 <\! A(sx),x\!>ds.
\]
This allows us to simplify considerably the expression for the operators
$J_\pm$ in the case $V=0$.
\begin{proposition}\label{CWO}
Suppose that $V=0$ and $A$
satisfies assumption $(\ref{eq:H1})$ with
$\rho>1/2$. Set
\[
(Jf)(x)=\exp\Bigl(i\int_0^1<A(sx),x>ds\Bigr) f(x).
\]
Then the wave operators $ W_\pm(H,H_0;J)$
exist and coincide $($up to the factor $\psi(H_0))$ with operators
$(\ref{eq:MWO})$.
If additionally the transversal gauge condition $(\ref{eq:H3})$
is satisfied, then $J=I$, so that the same conclusions hold for the usual
wave operators
$W_\pm(H,H_0)$.
\end{proposition}
\begin{Remark}\label{CWOrem}
All the results of this section remain true if $V=V_0+V_1$ and $A=A_0+A_1$
where $V_0$ and $A_0$ satisfy assumption $(\ref{eq:H1})$ and
\begin{equation} \left.\begin{array}{lcl}
|V_1(x)|&\leq & C(1+|x|)^{-\rho_1},
\\
|A_1(x)|+|{\rm div}\, A_1(x)|&\leq & C(1+|x|)^{-\rho_1}
\end{array}\right\}
\label{eq:AV1}\end{equation}
for some $\rho_1>1$. In this case the identifications
$J_\pm$ can be constructed in terms of the functions $V_0$ and $A_0$
only.
\end{Remark}
Indeed, by multiplication theorem for wave operators,
it suffices to check that the usual wave operators
for the pair $H(V_0,A_0)$, $H(V ,A )$ exist and are complete. Under condition
(\ref{eq:AV1}) this follows from the limiting absorption principle
(Proposition~\ref{PR6})
satisfied by both operators $H(V_0,A_0)$ and $H(V ,A )$.
\bigskip
{\bf 5.4.}
The direct definition of wave operators (\ref{eq:WO9}) in \cite{Y5} used
the function (\ref{eq:WO6}) with $\Omega(x,t)$ such that
\begin{eqnarray}
\Omega_t(x,t)+ t^{-1}< x, (\nabla \Omega)(x,t)> + |(\nabla
\Omega)(x,t)|^2
\nonumber\\
- <A(x),x/ t + 2\nabla\Omega(x,t)>+V(x)+|A(x)|^2=O
(|t|^{-1-\varepsilon}),~~\varepsilon>0,
\label{eq:TWO}\end{eqnarray}
and
\begin{equation}\label{eq:TWOb}
\partial_x^\alpha\Omega(x,t)=
O(|t|^{1-\varepsilon-|\alpha|}),~~
|\alpha|=1,2,
\end{equation}
in the region (\ref{eq:txt}). These conditions allow to verify
with the help of the Cook method the existence of wave operators
(\ref{eq:WO9}).
Of course, it is natural to expect that the functions
$\Omega(x,t)$ defined in the previous subsection and in \cite{Y5} coincide.
Let us check it by a direct calculation.
\begin{proposition}\label{TWO}
Let $ \omega(x, t)$ satisfy equation $(\ref{eq:WO2})$ and let $\Omega (x,
t) $ be defined by formula $(\ref{eq:WO7})$. Then $\Omega (x, t) $ satisfies
the conditions $(\ref{eq:TWO})$ and $(\ref{eq:TWOb})$.
\end{proposition}
{\it Proof.}--
To simplify notation, we omit variables
$(x,t)$ and indices $``\pm"$. Differentiating (\ref{eq:WO7}), we find that
\begin{equation}\label{eq:TWO2}
\Omega_t = (2t)^{-2} |\nabla_\xi\Phi|^2 +\sum_j\Phi_{\xi_j}
\bigg(\partial\omega_j/\partial t -(2t)^{-1}
\sum_k\Phi_{\xi_j\xi_k}\partial\omega_k/\partial t\bigg) ,
\end{equation}
\begin{equation}\label{eq:TWO3}
\Omega_{x_i} = \Phi_{x_i}+
\sum_j\Phi_{\xi_j} \bigg(\partial\omega_j/\partial x_i -(2t)^{-1}
(\Phi_{\xi_j x_i}+\sum_k\Phi_{\xi_j\xi_k}\partial\omega_k/\partial
x_i)\bigg).
\end{equation}
Differentiating equation (\ref{eq:WO2}), we see that
\begin{equation}\label{eq:TWO4}
\partial\omega_j/\partial
t-(2t)^{-1}\sum_k\Phi_{\xi_j\xi_k}\partial\omega_k/\partial t
= -2^{-1}t^{-2}x_j -2^{-1}t^{-2}\Phi_{\xi_j}
\end{equation}
and
\begin{equation}
\partial\omega_j/\partial x_i -(2t)^{-1}(\Phi_{\xi_jx_i}+
\sum_k\Phi_{\xi_j\xi_k}\partial\omega_k/\partial x_i)
= (2t)^{-1}\delta_{ij},
\label{eq:TWO5}\end{equation}
where $\delta_{ii}=1$ and $\delta_{ij}=0$ if $i\neq j$. Comparing
(\ref{eq:TWO2}) and (\ref{eq:TWO4}) we obtain that
\[
\Omega_t =- 2^{-1}t^{-2}<x,\nabla_\xi\Phi> -
(2t)^{-2}|\nabla_\xi\Phi|^2.
\]
Similarly, comparing (\ref{eq:TWO3}) and (\ref{eq:TWO5}), we obtain that
\begin{equation}
\nabla_x\Omega = \nabla_x\Phi + (2t)^{-1} \nabla_\xi\Phi.
\label{eq:TWO7}\end{equation}
These equalities imply that
\begin{eqnarray*}
\Omega_t+ t^{-1}< x,\nabla_x \Omega>
+|\nabla_x \Omega|^2= t^{-1}< x+\nabla_\xi\Phi,\nabla_x\Phi> +
|\nabla_x\Phi|^2
\\
=2< \omega,\nabla_x\Phi> + |\nabla_x\Phi|^2,
\end{eqnarray*}
where at the last step we have again used equation (\ref{eq:WO2}).
Comparing (\ref{eq:WO2}) and (\ref{eq:TWO7}), we see also that
\[
(2t)^{-1}x+\nabla_x\Omega=\omega +\nabla_x\Phi.
\]
Thus, the sum (\ref{eq:TWO}) can be written as
\[
2< \omega,\nabla_x\Phi> + |\nabla_x\Phi|^2
-2<A,\omega+\nabla_x\Phi>+V+|A|^2.
\]
It follows from equation (\ref{eq:E4}) that this expression equals
$ q(x,\omega(x,t))$ which,
by estimate (\ref{eq:E15}), is of order
$|t|^{-1-\epsilon}$ in the region considered. The condition
(\ref{eq:TWOb}) is a consequence of estimates (\ref{eq:E14}) and
(\ref{eq:WO3}).$\quad\Box$
\section {The scattering matrix }
{\bf 6.1.}
It follows from Theorems~\ref{W4}, \ref{WC3} and Proposition~\ref{WC2}
that the scattering operator
$${\bf S}=W_+^\ast (H,H_0; J_+) W_- (H,H_0; J_-)$$
commutes with $H_0$ and is unitary on the subspace $E_0(\Lambda){\cal
H}$. Thus, in the diagonal representation of $H_0$ (discussed in
subsection {2.2}) $\bf S$ reduces to the operator of multiplication by the
operator-function $S(\lambda):{\goth N}\rightarrow {\goth N}$ called the SM.
It is defined for almost all $\lambda\in (0,\infty)$ and
is unitary for almost
all $\lambda\in \Lambda $. We suppose that $\lambda\in \Lambda $.
We need a stationary formula for the SM in the case when
identifications $J_+$ and $J_-$ for $t\rightarrow +\infty$ and
$t\rightarrow -\infty$ are different.
Below we always assume that
the functions $\sigma_\pm$ in definition (\ref{eq:W1}) of the
operators $J_\pm$ obey the conditions
\begin{equation}\label{eq:S7}
\sigma_+(\tau)=1\; {\rm for}\; \tau\in [-\varepsilon,1],\quad
\sigma_+(\tau)=0\; {\rm for}\; \tau\in [-1,-2\varepsilon]\quad {\rm and}\quad
\sigma_-(\tau)=\sigma_+(-\tau)
\end{equation}
for some $\varepsilon\in(0,1/2)$. Formally, the SM admits
(see, e.g., \cite{Y5}) the representation
(\ref{eq:S2}) with $T_\pm=H J_\pm - J_\pm H_0$.
According to Lemma~\ref{W2}, $T_\pm=T_\pm^{(s)}+T_\pm^{(r)}$,
where $T_\pm^{(s)}$ has symbol
$t_\pm^{(s)}$ defined by (\ref{eq:W6}) and
$T_\pm^{(r)}\in{\cal
C}^{-1-\epsilon}(\Phi_\pm),~\epsilon>0$.
It follows from (\ref{eq:WC2}) that in our case
$W_+(H_0,H_0;J_+^*J_-)=0$ and hence ${\cal
W} (\lambda)=0$. We shall show that other terms
in (\ref{eq:S2}) satisfy Definition \ref{PDO11}.
Let us set
\begin{equation}\label{eq:S5}
S_0(\lambda) =
-2\pi i \Gamma_0(\lambda) J_+^\ast T_-^{(s)}\Gamma_0^\ast (\lambda),
\end{equation}
\[
S_1(\lambda) =
-2\pi i \Gamma_0(\lambda) J_+^\ast T_-^{(r)}\Gamma_0^\ast (\lambda),
\]
\[
S_2(\lambda) = 2\pi i \Gamma_0(\lambda)T_+^\ast
R(\lambda + i0) T_- \Gamma_0^\ast (\lambda).
\]
Then $S(\lambda)=S_0(\lambda)+S_1(\lambda)+S_2(\lambda)$.
We emphasize that these operators depend on the choice of the cut-off
functions $\sigma_\pm$ and $\eta$ in the definition of
$J_\pm$, but their sum does not
depend on it (see Proposition~\ref{WC2a}).
For the study of the operator $S_2(\lambda)$, we have to
consider previously the operator-function
\[
B (z)=\left< x\right>^l T_+^* R(z)T_- \left< x\right> ^l,\quad
l<(1+\epsilon)/2.
\]
\begin{lemma}\label{PRBB}
The operator-function $B(z):{\cal H}\rightarrow{\cal H}$
is bounded and continuous in norm with respect to $z$ in the region
$\Re z \in(\lambda_0,\infty),\lambda_0 > 0,\;
\Im z \geq 0$.
\end{lemma}
{\it Proof.} --
Set $p=1+\epsilon-l$. Then $p>l$ and $p>1/2$. Clearly,
$B =B_1 +B_2 +B_3$,
where
\begin{equation}
B_1(z)= \left(\left< x\right>^p{T}_+^{(r)}\left< x\right>^{l}\right)^*
\left(\left< x\right>^{-p}R(z)\left< x\right>^{-p}\right)\left(\left<
x\right>^p{T}_-^{(r)}\left< x\right>^{l}\right),
\label{eq:SMd1}\end{equation}
\begin{eqnarray*}
B_2(z)&=&\left(\left< x\right>^p{T}_+^{(r)}
\left< x\right>^{l}\right)^*\left(\left< x\right>^{-p} R(z)T_-^{(s)}\left<
x\right>^l\right)
\\
&+& \left(\left< x\right>^l {T_+^{(s)}}^* R(z)\left<
x\right>^{-p}\right)\left(\left< x\right>^p{T}_-^{(r)}\left<
x\right>^{l}\right),
\end{eqnarray*}
\[
B_3(z)=\left< x\right>^l {T_+^{(s)}}^* R(z)T_-^{(s)}\left< x\right> ^l.
\]
Since ${T}_\pm^{(r)}\in{\cal C}^{-1-\epsilon}(\Phi_\pm)$, it follows from
Proposition~\ref{PDO5} that the operators
$\left< x\right>^{p}T_\pm^{(r)}\left< x\right>^{l}$ are bounded.
The second factor in (\ref{eq:SMd1}) satisfies the assumptions of
Proposition~\ref{PR6}. According to
(\ref{eq:W6}) and (\ref{eq:S7}), the operator
${T}_\pm^{(s)}\in{\cal C}^{-1}(\Phi_\pm)$ and its symbol is contained in
the cone $\mp<
\hat{x},\hat{\xi}>\: \geq \varepsilon >0$. Therefore we can apply
Proposition~\ref{PR8} to the
operators
$$\left< x\right>^{-p} R(z)T_-^{(s)}\left< x\right>^l,~\left< x\right>^l
{T_+^{(s)}}^*
R(z)\left< x\right>^{-p} $$
and Proposition~\ref{PR9} to the operator $B_3(z)$. $\quad\Box$
Now it is easy to check
\begin{proposition}\label{S4}
The operators $S_1(\lambda)$ and
$S_2(\lambda)$ are compact and norm-continuous in $\lambda > 0$.
\end{proposition}
{\it Proof.} --
Let $ l\in(1/2,(1+\epsilon)/2)$. The operator
$S_1(\lambda)$ factorizes as
\[
S_1(\lambda)= 2\pi i \Bigl(\Gamma_0(\lambda)\left< x\right>^{-l}\Bigr)
\left(\left< x\right>^{-l}J_+\left< x\right>^{l}\right)^*
\left(\left< x\right>^{l}{T}_-^{(r)}\left< x\right>^{l}\right)
\Bigl(\Gamma_0(\lambda)\left< x\right>^{-l}\Bigr)^*,
\]
%\label{eq:SMd0}\end{equation}
where the operators
$\left< x\right>^{-l}J_+\left< x\right>^{l}$ and $\left<
x\right>^{l}{T}_-^{(r)}\left<
x\right>^{l}$ are bounded according to Proposition~\ref{PDO5} and
the operators $\Gamma_0(\lambda)\left< x\right>^{-l}$
are compact and norm-continuous according to Proposition~\ref{DV1}.
The operator
\[
S_2(\lambda) = 2\pi i \Bigl(\Gamma_0(\lambda)\left< x\right>^{-l}\Bigr) B
(\lambda+i0)\Bigl(\Gamma_0(\lambda)\left< x\right>^{-l}\Bigr)^*
\]
%\label{eq:SM}\end{equation}
is well defined, compact and norm-continuous according to Proposition~\ref{DV1}
and Lemma~\ref{PRBB}. $\quad\Box$
\bigskip
{\bf 6.2.}
Let us now consider the singular term (\ref{eq:S5}).
The PDO ${\bf A}_0=-2\pi iJ_+^*T_-^{(s)}$ is defined by formula
(\ref{eq:PDO5b}) with amplitude
$${\bf a}_0(x,\xi,\xi')=-2\pi i\overline{j_+(x,\xi)}t_-^{(s)}(x,\xi').$$
Therefore, by equations (\ref{eq:W1}) -- (\ref{eq:W6}),
\begin{equation}\label{eq:S0}
\!\!\!\!\!{\bf a}_0(x,\xi,\xi')=-4\pi
e^{i\Theta\left(x,\xi,\xi'\right)}
\sigma_+(\!<\!\widehat{x},\widehat{\xi}\!>\!)
<\!\xi',\nabla\sigma_-(\!<\!\widehat{x},\widehat{\xi'}\!>\!)\!>
\eta^2(x)\psi(|\xi|^2)\psi(|\xi'|^2),
\end{equation}
where
\begin{equation}\label{eq:Theta}
\Theta(x,\xi,\xi') = \Phi_-(x,\xi')-\Phi_+(x,\xi)
\end{equation}
and the functions $\Phi_\pm$ are defined in Proposition \ref{E2}.
Estimates (\ref{eq:E14}) imply
\begin{lemma}\label{phase1}
The function $\Theta(x,\xi,\xi')$ satisfies the estimates
\begin{equation}\label{eq:Heth}
|\partial_x^\alpha\partial_{\xi,\xi'}^\beta
\Theta (x,\xi,\xi')|\leq C_{\alpha,\beta}(\kappa)(1+|x|)^{1-\rho-|\alpha|}
\end{equation}
in the region $<\hat{x},\hat{\xi}>\geq
\kappa,~-<\hat{x},\hat{\xi'}>\geq\kappa $
for any $\kappa >-1$ and all $\alpha,\beta$.
\end{lemma}
Since $\Theta$ satisfies the estimates of the class ${\cal
S}^{1-\rho}$ on the support of ${\bf a}_0$, (\ref{eq:S0}) has the form
(\ref{eq:PDO6}) and hence the operator ${\bf A}_0$
fits into the framework of PDO with oscillating amplitudes (see
subsection 2.1).
Abusing somewhat notation, we say that ${\bf A}_0$ belongs to the class
${\cal C}^{-1}({\Theta})$. Moreover,
due to the function $\nabla\sigma_-(<\hat{x},\hat{\xi}'>)$, the operator
${\bf A}_0$ satisfies the assumptions of Proposition~\ref{LY}.
Below we use the notation and the chart coordinates
$(\omega_0,\varkappa)$ introduced in subsection~2.2.
Thus, we have the following
\begin{proposition}\label{LYappl}
The operator $S_0(\lambda)={\bf A}^{\flat}_0(\lambda)$ is well-defined
in the sense of
Definition~$\ref{PDO11}$ for all $\lambda>0$. Moreover, in the chart
coordinates
$(\omega_0,\varkappa)$,
$ {\bf A}^{\flat}_0 (\lambda) $
is the PDO with amplitude
%\begin{equation}\label{eq:so}
\[
{\bf a}_0^\flat (y,\zeta,\zeta';\lambda)=(2\pi
k)^{-1}\alpha(\zeta,\zeta')\int _{-\infty}^\infty {\bf
a}_0\left(x,k\omega,k\omega'\right) dz,
\]
where $\alpha$ is the function $(\ref{eq:alpha})$, $\zeta=\varkappa(\omega),
\zeta'=\varkappa(\omega')$ and
\begin{equation}\label{eq:x}
x=(\omega+\omega')z - y/k,~~<y,\omega_0>=0.
\end{equation}
\end{proposition}
It follows from Propositions~\ref{PDO12} and \ref{LY}
that $(S_0(\lambda)g_1,g_2)$ is a smooth function of
$\lambda$ for $g_j\in C^\infty({\S}^{d-1})$.
Below we shall see that the operator $S_0(\lambda)$
is bounded in the space ${\goth N}$.
Our next goal is to find a simple expression for a genuinely
non-compact part of the operator $S_0(\lambda)$.
First, we transform expression (\ref{eq:S0}) for
${\bf a}_0$ to a more convenient form.
\begin{proposition}\label{S5}
Let ${\bf A}_1$ be the PDO with amplitude
\begin{equation}\label{eq:A}
\!\!\!\!{\bf a}_1(x,\xi,\xi')=-2\pi e^{i\Theta\left(x,\xi,\xi'\right)}
\sigma_+(\!<\!\widehat{x},\widehat{\xi}\!>\!)
<\!\xi+\xi',\nabla\sigma_-(\!<\!\widehat{x},\widehat{\xi'}\!>\!)\!\!>
\eta^2(x)\psi(|\xi|^2)\psi(|\xi'|^2)
\end{equation}
where $\Theta$ is given by $(\ref{eq:Theta})$. Then the operator
${\bf A}_1^\flat(\lambda)$ exists and the operator
$S_0(\lambda)-{\bf A}_1^\flat(\lambda)$ is compact on ${\goth N}$.
Moreover, in the chart coordinates
$(\omega_0,\varkappa)$,
$ {\bf A}^{\flat}_1 (\lambda) $ is the PDO with amplitude
\begin{equation}\label{eq:a0b}
{\bf a}^\flat_1 (y,\zeta,\zeta';\lambda)=-\alpha(\zeta,\zeta')\int
_{0}^\infty e^{i\Theta(x,k\omega,k\omega')}< \omega+\omega' ,
\nabla\sigma_-(<\hat{x},\omega'>)>\eta^2(x) dz,
\end{equation}
where $x$ and $y,z$ are related by formula $(\ref{eq:x})$.
\end{proposition}
{\it Proof.} --
Comparing (\ref{eq:S0}) and (\ref{eq:A}), we see
that the difference ${\bf B}={\bf A}_0-{\bf A}_1$ is a PDO with amplitude
$${\bf b}(x,\xi,\xi')=-2\pi e^{i\Theta\left(x,\xi,\xi'\right)}
\sigma_+(<\!\widehat{x},\widehat{\xi}\!>)
<\xi'-\xi,\nabla\sigma_-(<\!\widehat{x},\widehat{\xi'}\!>)>
\eta^2(x)\psi(|\xi|^2)\psi(|\xi'|^2).$$
Since ${\bf b}(x,\xi,\xi)=0$, it follows from Proposition \ref{PDO7}
that the operator ${\bf B}$ belongs to the
class ${\cal C}^{-1-\rho}(\tilde{\Theta})$ for some
$\tilde{\Theta}\in{\cal S}^{1-\rho}$. Thus, by Proposition \ref{PDO10},
${\bf B}^\flat(\lambda) $
is a compact operator on ${\goth N}$.
It follows from conditions (\ref{eq:S7}) that for $\omega'$ sufficiently
close to
$\omega$ the function
$\sigma_+(<\hat{x},\\ \omega>)=1$ on the support of
$\nabla \sigma_-(<\hat{x},\omega'>)$. Hence $\sigma_+$ may be omitted
in (\ref{eq:A}). We also take into account that,
due to $\nabla \sigma_-(<\hat{x},\omega'>)$, the function ${\bf
a}_1( (\omega+\omega')z- y/k,k\omega,k\omega')$ is supported in the region
$z\geq 0$ and $\psi(\lambda)=1$ for $\lambda\in\Lambda$. Thus,
applying Proposition~\ref{LY} to the PDO ${\bf A}_1$,
we obtain formula (\ref{eq:a0b}).$\quad\Box$
An obvious drawback of this assertion is that the amplitude
${\bf a}^\flat_1$ contains the cut-off function $\sigma_-
$ although the SM does not depend on it.
\bigskip
{\bf 6.3.}
Let us show that, up to a compact term, the operator ${\bf A}_1^\flat(\lambda)$
does not actually depend on $\sigma_-$.
Below we always work in fixed chart coordinates $(\omega_0,\varkappa)$
and denote by $\chi$ a function from the class $C_0(\Omega)$.
Recall, that for fixed $\omega,\omega'\in\Omega(\omega_0,\gamma)$, we
always use
in $\R^d$ the coordinates
$(y,z)\in\R^{d-1}\times\R$ defined by (\ref{eq:x}). Then
\begin{equation}\label{eq:dxa}
k<\omega'-\omega,x>= <\omega-\omega',y>= <\zeta-\zeta',y>,
\end{equation}
\begin{equation}\label{eq:dx}
dx= k^{-d+1}<\omega+\omega',\omega_0> dzdy
\end{equation}
and
$$< \omega+\omega' ,\nabla f(x)>=\partial
_{z}f(x)$$
for any differentiable function $f$.
Integrating by parts in (\ref{eq:a0b}) and
taking into account that $\sigma_-(<\hat{x},\omega'>)$
varies from 1 to 0 as $z$ varies from 0 to $\infty$,
we get that
\begin{equation}\label{eq:a0b2}
{\bf a}^\flat_1
(y,\zeta,\zeta';\lambda)=\alpha(\zeta,\zeta')
e^{i\Theta(-y/k,k\omega,k\omega')} \eta^2(-y/k)
+{\bf b} (y,\zeta,\zeta';\lambda),
\end{equation}
where
\begin{equation}\label{eq:a1b}
{\bf b} (y,\zeta,\zeta';\lambda)=
\alpha(\zeta,\zeta') \int_{0}^\infty \!\!\! e^{i\Theta(x,k\omega,k\omega')}
\Bigl( i\partial_z \Theta(x,k\omega,k\omega') \eta^2(x)+
\partial_z\eta^2(x)\Bigr)
\sigma_-(<\hat{x},\omega'>) dz.
\end{equation}
By Lemma~\ref{phase1} and Proposition~\ref{PDO3AA}, the first term in the
right-hand side of
(\ref{eq:a0b2}) is the amplitude of a bounded operator in
$L_2(\S^{d-1})$.
We shall show that ${\bf b}$ is the
amplitude of a compact operator ${\bf B}$.
This is obvious for the part of ${\bf b}$ which contains $\partial_z\eta^2$
since it is compactly supported in $y$. To consider
the part of ${\bf b}$ which contains $\partial_z\Theta$, we
use the following
\begin{lemma}\label{phase}
The function $(\ref{eq:Theta})$ satisfies the
equality
\begin{equation}\label{eq:phase}
<\xi+\xi',\nabla\Theta(x,\xi,\xi')> = <\nabla G(x,\xi,\xi')
, F(x,\xi,\xi')>+ q_0(x,\xi,\xi'),
\end{equation}
where the functions $G,F$ and $ q_0$ are defined by
\begin{eqnarray}
G(x,\xi,\xi')&=&<\xi'-\xi,x>+\Theta(x,\xi,\xi'),
\nonumber\\
F(x,\xi,\xi')&=&2A(x)-\nabla\left(\Phi_-(x,\xi')+\Phi_+(x,\xi)\right),
\nonumber\\
q_0(x,\xi,\xi')&=&q_-(x,\xi')-q_+(x,\xi)
\label{eq:g}\end{eqnarray}
and $q_\pm$ are functions $(\ref{eq:E4})$. The functions $F$ and $ q_0$
satisfy in the region
$<\hat{x},\hat{\xi}>\geq \kappa,~ -<\hat{x},\hat{\xi'}>\geq\kappa$, for
any $\kappa >-1 $ and all $\alpha,\beta$, the estimates
\begin{eqnarray}\label{eq:He}
|\partial_x^\alpha\partial_{\xi,\xi'}^\beta
F(x,\xi,\xi')|&\leq&C_{\alpha,\beta}(\kappa)(1+|x|)^{-\rho-|\alpha|}\\
\label{eq:ge}
|\partial_x^\alpha\partial_{\xi,\xi'}^\beta
q_0 (x,\xi,\xi')|&\leq&C_{\alpha,\beta}(\kappa)(1+|x|)^{-1-\epsilon-|\alpha|},
\quad\epsilon>0.
\end{eqnarray}
\end{lemma}
{\it Proof.} --
One proceeds from eikonal equation (\ref{eq:E4}) for
$\Phi_+(x,\xi)$ and $\Phi_-(x,\xi')$ and takes their difference. This
yields the equality (\ref{eq:phase}). Estimates (\ref{eq:He}) and
(\ref{eq:ge}) are direct
consequences of (\ref{eq:E14}) and (\ref{eq:E15}),
respectively. $\quad\Box$
Let us plug expression (\ref{eq:phase}) into (\ref{eq:a1b})
and consider the amplitude
\begin{equation}\label{eq:p2b}
{\bf b}_0(y,\zeta,\zeta';\lambda) =
i \alpha(\zeta,\zeta') k^{-1}
\int_0^\infty e^{i\Theta(x,k\omega,k\omega')} <\nabla G(x,k\omega,k\omega'),
F(x,k\omega,k\omega')>\eta^2(x) dz
\end{equation}
corresponding to the first term in the right-side of (\ref{eq:phase}).
\begin{lemma}\label{Ssing}
The PDO ${\bf B}_0$ with amplitude $(\ref{eq:p2b})$ admits the
representation
${\bf B}_0={\bf B}_1+{\bf B}_2$ where ${\bf B}_1$, ${\bf B}_2$ are PDO
with amplitudes
\begin{equation}\label{eq:a2b}
{\bf b}_1(y,\zeta,\zeta';\lambda)= - k^{-1}\alpha_1(\zeta,\zeta')
e^{i\Theta(-y/k,k\omega,k\omega')}<
\!\omega_0, F(-y/k,k\omega,k\omega')\!>\eta^2(-y/k),
\end{equation}
\begin{equation}\label{eq:kb}
{\bf b}_2(y,\zeta,\zeta';\lambda)= \alpha(\zeta,\zeta')\int_0^\infty
e^{i\Theta(x,k\omega,k\omega')} q (x,k\omega,k\omega')dz.
\end{equation}
Here
%\begin{equation}\label{eq:alpha1}
\[
\alpha_1(\zeta,\zeta')= <\omega+\omega',\omega_0>^{-1}\alpha(\zeta,\zeta')
\]
and
\begin{equation}\label{eq:gt}
q (x,\xi,\xi')=- k^{-1}{\rm div}_x\left(
F(x,\xi,\xi')\sigma_-(<\hat{x},\hat{\xi'}>)\eta^2(x)
\right).
\end{equation}
\end{lemma}
{\it Proof.} --
According to (\ref{eq:dxa}), (\ref{eq:dx}), the PDO
${\bf B}_0$ has integral kernel
%\begin{eqnarray}\label{eq:p2}
\begin{eqnarray*}
{\rm p}_0(\zeta,\zeta';\lambda)& =&
(2\pi)^{-d+1}\int_{\R^{d-1}}e^{i<\zeta-\zeta',y>}
{\bf b}_0 (y,\zeta,\zeta';\lambda)dy
\nonumber\\
&=& i(2\pi)^{-d+1} k^{d-2}
\alpha_1(\zeta,\zeta')
\int_{<x,\omega_0>\geq 0}\!\!\!\!\!\!\!\!
\exp\Bigl(iG(x,k\omega,k\omega')\Bigr)
\\
&\times& <\nabla G(x,k\omega,k\omega'), F(x,k\omega,k\omega')>
\sigma_-(<\hat{x},\omega'>)\eta^2(x) dx.
\end{eqnarray*}
Integrating here by parts, we find that
${\rm p}_0={\rm p}_1+{\rm p}_2$ where
\begin{eqnarray*}
{\rm p}_1 (\zeta,\zeta';\lambda) =
- \alpha_1(\zeta,\zeta') (2\pi)^{-d+1}
k^{-1}\int_{{\R}^{d-1}}\!\! e^{iG(-y/k,k\omega,k\omega')}\!\!
\\
\times <\!\omega_0,F (-y/k,k\omega,k\omega')\!>\eta^2(-y/k)dy,
\end{eqnarray*}
\[
{\rm p}_2 (\zeta,\zeta';\lambda) =
\alpha_1(\zeta,\zeta') (2\pi)^{-d+1} k^{d-1}
\int_{<x,\omega_0>\geq 0} e^{iG(x,k\omega,k\omega')} q
(x,k\omega,k\omega')dx.
\]
The amplitudes of PDO with kernels ${\rm p}_1,{\rm p}_2$ equal ${\bf b}_1,
{\bf b}_2$,
respectively. $\quad\Box$
Let us consider the operators ${\bf B}_1$ and ${\bf B}_2$
separately.
\begin{lemma}\label{S8}
The PDO ${\bf B}_1$ with amplitude $(\ref{eq:a2b})$ belongs to the
class ${\cal C}^{-\rho}(\Theta_0)$, where
$$\Theta_0(y,\zeta,\zeta';\lambda)=\Theta_0(-k^{-1}y,k\varkappa(\zeta),
k\varkappa(\zeta'))$$
is given
by $(\ref{eq:Theta})$. In particular, $\chi{\bf B}_1 \chi$ is a compact
operator in
$L_2(\Sigma)$.
\end{lemma}
{\it Proof.} --
Since $<y,\omega_0>=0$, we have that
$|<\hat{y},\omega>|\leq \varepsilon <1$ and $|<\hat{y},\omega'>|\leq
\varepsilon <1$ for $\omega,\omega'\in{\Omega}$.
According to (\ref{eq:Heth}), (\ref{eq:He})
this implies that functions $\Theta$ and $F$ in (\ref{eq:a2b})
belong to the classes ${\cal S}^{1-\rho}(\R^{d-1})$ and
${\cal S}^{-\rho}(\R^{d-1})$, respectively.
Thus, ${\bf b}_1$ belongs to the class ${\cal C}^{-\rho}(\Theta_0)$,
and hence ${\bf B}_1$
is a compact operator by Proposition~\ref{PDO3AA}.$\quad\Box$
\begin{lemma}\label{reste}
Suppose that a function $q(x,\xi,\xi')$ equals zero in a conical
neighbourhood of the set $\hat{x}=\hat{\xi}'$ and $q(x,\xi,\xi')$
satisfies the estimates $(\ref{eq:ge})$ for $<\hat{x},\hat{\xi}>\geq \kappa>-1$
and all $\alpha,\beta$. Let ${\bf B}_2$
be PDO with amplitude $(\ref{eq:kb})$. Then the operator
$\chi{\bf B}_2 \chi$ is compact in $L_2(\Sigma)$.
\end{lemma}
{\it Proof.} --
Let $\vartheta_0\in C^\infty(\R)$ be such that
$\vartheta_0(z)=0$ for $z\leq1/2$ and $\vartheta_0(z)=1$ for $z\geq1$
and $ \vartheta_1=1-\vartheta_0$. We first consider
the operator ${\bf B}_{2,0}$ with amplitude
\begin{equation}\label{eq:Bb2}
{\bf b}_{2,0}(y,\zeta,\zeta';\lambda)
=\alpha (\zeta,\zeta')\int_{-\infty}^{\infty}
e^{i\Theta(x,k\omega,k\omega')}q(x,k\omega,k\omega')
\vartheta_0 (<\omega+\omega',\omega_0>z) dz.
\end{equation}
Let $f\in C^\infty({\R}^d)$, $f(\xi)=1$ for $\xi\in\Omega$ and
$f(\xi)=0$ off a small neighbourhood of $\Omega$.
We introduce an auxiliary PDO ${\bf G}$ with amplitude
$$
{\bf g} (x,\xi,\xi')=f(\xi)f(\xi')\exp({i\Theta(x,\xi,\xi')}) q(x,\xi,\xi')
\vartheta_0 (<x,\omega_0> ).
$$
The function $q\vartheta_0$ equals zero in conical neighbourhoods
of the sets $\hat{x}=\hat{\xi}'$ and $\hat{x}=-\hat{\xi}$,
so that, by Lemma~\ref{phase1}, $\Theta$ satisfies estimates
(\ref{eq:Heth}) on the support of $q\vartheta_0$. Thus,
${\bf g}\in C^{-1-\epsilon}(\Theta)$. Comparing (\ref{eq:akappa})
and (\ref{eq:Bb2}), we see that
${\bf B}_{2,0}(\lambda)=2\pi k {\bf G}^\flat(\lambda)$.
Therefore the operator ${\bf B}_{2,0}$ is compact by Proposition \ref{PDO10}.
Next we consider the PDO ${\bf B}_{2,1}$ with
amplitude
\begin{eqnarray*}
{\bf b}_{2,1}(y,\zeta,\zeta';\lambda)=\alpha(\zeta,\zeta')
e^{i\Theta(-y/k,k\omega,k\omega')}
\nonumber\\
\times
\int_0^\infty e^{i(\Theta(x,k\omega,k\omega')-\Theta(-y/k,k\omega,k\omega'))}
q (x,k\omega,k\omega')\vartheta_1 (<\omega+\omega',\omega_0>z)dz,
\end{eqnarray*}
where, due to the function $\vartheta_1$, the integral is actually taken
over a finite interval. Therefore it follows from Lemma~\ref{phase1} that
for $\omega,\omega'\in{\Omega}$
and sufficiently large $|y|$
$$
\left|\partial_{y}^\alpha\partial_{\zeta,\zeta'}^\beta
e^{i(\Theta(x,k\omega,k\omega')-\Theta(-y/k,k\omega,k\omega'))}\right|
=O\left(\left<y \right>^{-\rho-|\alpha|}\right).
$$
Taking also into account that
$q\vartheta_1$ satisfies
estimates (\ref{eq:ge}), we obtain that ${\bf b}_{2,1}\in{\cal
C}^{-1-\rho-\epsilon}(\Theta_0)$. Hence the operator $\chi{\bf
B}_{2,1}\chi$ is also
compact.$\quad\Box$
Since the function (\ref{eq:gt}) satisfies the
assumptions of this lemma, it applies directly to the operator
with amplitude (\ref{eq:kb}). Moreover, the same conclusion is true
if the role of $q(x,\xi,\xi^\prime)$ is played
by the function
$
q_0(x,\xi,\xi^\prime) \sigma_-(<\hat{x},\omega^\prime>),
$
where $q_0$ is defined by (\ref{eq:g}). This yields
\begin{proposition}\label{S7xx}
The PDO ${\bf B}$ with amplitude $(\ref{eq:a1b})$ is compact in $L_2(\Sigma)$.
\end{proposition}
Thus, we have verified that all terms in the right-hand side of
(\ref{eq:S2}) are well defined as bounded operators in the space $\goth N$.
As shown in \cite{Y5}, this justifies the representation (\ref{eq:S2}) for
the SM $S(\lambda)$. Since $(S(\lambda)g_1,g_2)$ is a smooth function of
$\lambda$ for $g_j\in C^\infty({\S}^{d-1})$, it follows from unitarity of
$S(\lambda)$ that actually $S(\lambda)$ is a strongly
continuous operator-function of $\lambda>0$.
Moreover, comparing Propositions~\ref{S5} and \ref{S7xx},
we see that, modulo compact operators, the SM
$S(\lambda)$ can be considered as a PDO with amplitude
given by the first term in the right-hand side of (\ref{eq:a0b2}).
Finally, neglecting again compact operators, we can omit in this term
$\alpha(\zeta,\zeta')$ because $\alpha(\zeta,\zeta)=1$ and $\eta^2(-y/k)$
because it is $1$ for sufficiently large $|y|$.
Let us
summarize the results obtained in the following theorem.
\begin{theorem}\label{S7}
Let condition $(\ref{eq:H1})$ hold and let $J_\pm$ be defined by
$(\ref{eq:W1})$ where the function
$(\ref{eq:W2})$ satisfies the assumption $(\ref{eq:S7})$. Then the SM
$S(\lambda)$ for the pair $H_0,\; H$ with identifications $J_\pm$ admits
representation
$(\ref{eq:S2})$ where ${\cal W}(\lambda)=0$. The function
$S(\lambda):{\goth N}\rightarrow {\goth N}$ is strongly continuous in
$\lambda>0$.
If $\chi_1$ and $\chi_2$ are multiplications by
$C^\infty(\S^{d-1})$-functions with disjoint
supports, then the operator $\chi_1 S(\lambda)\chi_2$ is compact. Finally,
up to a compact term,
$S(\lambda)$ is the PDO on $\S^{d-1}$ with amplitude given in arbitrary
chart coordinates
$(\omega_0,\varkappa)$ by the formula
\begin{equation}\label{eq:s0b}
{\bf s}(y,\zeta,\zeta';\lambda)=
\exp\left(i\Theta
(-\lambda^{-1/2}y,\lambda^{1/2}\omega,\lambda^{1/2}\omega' )\right).
\end{equation}
\end{theorem}
{\bf 6.4.}
Using Theorem~\ref{S7}, we can now describe the spectrum of the SM.
Recall that the function $\Theta(x,\xi,\xi')$ is defined by formula
(\ref{eq:Theta}) where $\Phi_\pm$ are
constructed in Proposition~\ref{E2}. Let us consider the first approximation
${\bf V}(x,\xi)=\phi_-^{(1)}(x,\xi)-\phi_+^{(1)}(x,\xi)$
to the function $\Theta(x,\xi,\xi)$. According to (\ref{eq:EAB})
\begin{equation}\label{eq:V}
{\bf V}(x,\xi)=2^{-1}\int_{-\infty}^{\infty}\Bigl(V(t\xi)-V(x+t\xi)
+2<A(x+t\xi)-A(t\xi),\xi>\Bigr)dt.
\end{equation}
Note that the function ${\bf V}$
does not depend on the projection of $x$ on the direction of $\xi$.
Typically, for asymptotically homogeneous functions $V(x)$ and $A(x)$
of order $-\rho$, the function ${\bf V}(x,\xi)$ is asymptotically
homogeneous function of $x$ as $|x|\rightarrow\infty$ of order $1-\rho$
if $\rho\in(0,1)$ and it has a logarithmic growth if $\rho=1$.
\begin{theorem}\label{SP}
Let condition $(\ref{eq:H1})$ hold and suppose that for some
$x_0\neq 0$, $\omega_0\in\S^{d-1}$, $<x_0,\omega_0>=0$, and $k>0$ the function
$(\ref{eq:V})$ satisfies the conditions
\begin{equation}\label{eq:SP1xx}
\lim_{\tau\rightarrow\infty}\sup {\bf V}(\tau x_0,k\omega_0)=\infty
\quad{\rm or}\quad
\lim_{\tau\rightarrow\infty}\inf {\bf V}(\tau x_0,k\omega_0)=-\infty
\end{equation}
if $\rho>1/2$ or
\begin{equation}\label{eq:SP1}
|{\bf V}(\tau x_0,k\omega_0))|\geq c \tau^{1-\rho},~~~|\nabla{\bf
V}(\tau x_0,k\omega_0))|\geq c\tau^{-\rho},\quad c>0,
\end{equation}
for sufficiently large $\tau>0$ if $\rho\in(0,1/2]$.
Then the spectrum of the SM $S(\lambda)$ coincides for $\lambda=k^2$
with the unit circle ${\Bbb T}$.
\end{theorem}
{\it Proof.} --
It follows from definition (\ref{eq:E9})
and estimates (\ref{eq:E13}) for $n\geq 2$ that
$$
|\partial_x^\alpha\left(\Theta(x,\xi,\xi)-{\bf V}(x,\xi)\right)|
\leq C_\alpha (1+|x|)^{1-2\rho-|\alpha|},\quad <x, \xi >=0,\quad |\alpha|=0,1.
$$
Thus, the function $\Theta(\tau x_0,k\omega_0,k\omega_0)$ where
$<x_0,\omega_0>=0$ also satisfies
conditions (\ref{eq:SP1xx}) or (\ref{eq:SP1}).
Let us consider the chart diffeomormism $(\omega_0,\varkappa)$
and the PDO
${S}_0^{\varkappa}(\lambda)$ with amplitude (\ref{eq:s0b}).
We apply Proposition \ref{sp} to the operator
$\chi_0^{\varkappa}S_0^{\varkappa}(\lambda)\chi_0^{\varkappa}$
where $\chi_0^{\varkappa}\in C_0^\infty(\Sigma)$ and
$\chi_0^{\varkappa}(\zeta)=1$
in a neighbourhood of the point $\zeta_0=0$.
Conditions (\ref{eq:sp1}) (or (\ref{eq:sprem})) for $\zeta_0=0$
and $y_0=-x_0$ are satisfied according to
(\ref{eq:SP1}) (or (\ref{eq:SP1xx})). Therefore
for each $\mu\in{\Bbb T}$ there exists a Weyl
sequence $u_n$ such that
$||u_n||=1$, $u_n\rightarrow 0$ weakly and
\[
\chi_0^{\varkappa}S_0^{\varkappa}(\lambda)\chi_0^{\varkappa}u_n
-\mu u_n\rightarrow 0
\]
strongly as $n\rightarrow\infty$. Moreover, we may assume that supports
of $u_n$ are contained in an arbitrary
neighbourhood of the point $0\in\Pi_{\omega_0}$.
Let the operator $Z$ be defined by formula (\ref{eq:U})
and $\chi_0(\omega)=\chi_0^\varkappa(\zeta)$.
It follows from
Theorem~\ref{S7} that $f_n=Z^*u_n$ is a Weyl sequence for
the operator $\chi_0S(\lambda)\chi_0$. Let $\chi_1\in
C^\infty(\S^{d-1})$ be supported on the set where $\chi_0(\omega)=1$.
Then ${\rm supp}~(1-\chi_0) \cap {\rm supp}~\chi_1=\emptyset$ and
hence, by Theorem~\ref{S7}, the operator $(1-\chi_0)S(\lambda)\chi_1$
is compact. Without loosing generality, we assume that
$\chi_0f_n=\chi_1f_n=f_n$. Since both
terms in the right-hand side
of the estimate
\[
\|S(\lambda)f_n-\mu f_n\|\leq \|\chi_0S(\lambda)\chi_0f_n-\mu
f_n\|+\|(1-\chi_0)S(\lambda)\chi_1f_n\|
\]
tend to zero as $n\to\infty$, the spectrum of the SM
$S(\lambda)$ covers the unit circle. Finally, we take into
account that $S(\lambda)$ is unitary, so that its
spectrum actually coincides with ${\Bbb T}$. $\quad\Box$
We emphasize that, at least in the cases $V=0$ or $A=0$,
the conditions (\ref{eq:SP1xx}) and (\ref{eq:SP1}) are fulfilled
for all points $k$ at the same time.
According to Proposition~\ref{CWO} and Theorem~\ref{SP},
the following result is true for
the SM defined in terms of the usual wave operators.
\begin{proposition}\label{SP2}
Let $V=0$ and let $A$ satisfy estimates $(\ref{eq:H1})$ for
$\rho\in(1/2,1)$ and the transversal condition $(\ref{eq:H3})$
$($at least for large $|x|)$.
Suppose that the corresponding function
\[
{\bf V}(x,\xi)= \int_{-\infty}^{\infty}
<A(x+t\xi),\xi> dt
\]
satisfies condition $(\ref{eq:SP1xx})$ for some point
$(x_0,\omega_0),~~\omega_0\in\S^{d-1},~~<x_0,\omega_0>=0$. Then the
spectrum of the SM $S(\lambda)$ covers the unit circle ${\Bbb T}$
for all $\lambda>0$.
\end{proposition}
As an example of a
potential satisfying the assumptions of Proposition \ref{SP2} we note
(for $d=2$) the potential $A(x)=\gamma|x|^{-1-\rho}(-x_2,x_1),~|x|\geq
R,~\rho\in(1/2,1),\gamma\neq0.$ In this case for any
$(x,\xi)\in\R^{2d},~<x,\xi>=0,~|x|\geq R,$
$$
{\bf V}(x,\xi)=\pm \gamma v_0 |x|^{1-\rho},~~v_0=\int_{-\infty}^\infty
\left<
u\right>^{-1-\rho }du>0,
$$
if $\hat{\xi}$ is obtained from $\hat{x}$ by rotation at the angle
$\pm\pi/2$. Thus, condition (\ref{eq:SP1xx}) is satisfied.
Of course, Proposition~\ref{SP2} remains true for all $\rho>0$, but,
if $\rho\leq 1/2$, then the SM is defined in terms of modified
wave operators and condition (\ref{eq:SP1xx}) should be replaced by
(\ref{eq:SP1}). On the
contrary, if
$\rho=1$, then under transversal condition (\ref{eq:H3}) ${\bf V}(x,\xi)$
has typically the
finite limits as
$|x|\rightarrow\infty$, so that the essential spectrum of $S(\lambda)$
might be a subset of ${\Bbb T}$. This is the case for the Aharonov-Bohm
potential
$A(x)=\gamma|x|^{-2}(-x_2,x_1)$; for more general potentials of this type, see
\cite{RY}.
Proposition~\ref{SP2} contradicts a preceding result of F. Nicoleau.
It is claimed in \cite{NICO1} that under the assumptions of
Proposition \ref{SP2} the operator $S(\lambda)-I$ is compact. This is
incompatible with the assertion that the essential spectrum of
$S(\lambda)$ covers the unit circle.
\begin{thebibliography}{99}
\bibitem{CFKS}{H. Cycon, R. Froese, W. Kirsch, B. Simon,} {\it Schr\"odinger
operators with application to quantum mechanics and global geometry},
{Springer-Verlag}, {1987}.
\bibitem {Hor3} L. H\"ormander, {\it The Analysis of Linear Partial
Differential Operators} III, Springer-Verlag, 1985.
\bibitem {IK3}H. Isozaki, H. Kitada, Modified wave operators with
time-independent modifies, J. Fac. Sci. Univ. Tokyo {\bf 32} (1985),
77-104.
\bibitem {IK4} H. Isozaki, H. Kitada, Scattering matrices for two-body
{S}chr\"odinger operators, Sci. Papers College Arts Sci. Univ. Tokyo
{\bf 35} (1986), 81-107.
\bibitem {IU}T. Ikebe, J. Uchiyama, On the asymptotic behavior of
eigenfunctions of second-order elliptic operators, J. Math. Kyoto Univ.
{\bf 11} (1971), 425--448.
\bibitem {J}A. Jensen, Propagation estimates for Schr\"odinger-type
operators, Trans. Amer. Math. Soc. {\bf 291} (1985), 129-144.
\bibitem {JMP}A. Jensen, E. Mourre, P. Perry, Multiple commutator
estimates and resolvent smoothness in quantum scattering theory, Ann. Inst.
Henri Poincar\'e, phys. th\'eor. {\bf 41} (1984), 207-225.
\bibitem {LY} N. Lerner, D. R. Yafaev, Trace theorems for
pseudo-differential operators, J. Analyse Math. {\bf 74} (1998), 113-164.
\bibitem {LOSTHA}M. Loss, B. Thaller, Scattering of particles by
long-range magnetic fields, Ann. Phys. {\bf 176} (1987), 159-180.
\bibitem {M1}E. Mourre, Absence of singular continuous spectrum for certain
selfadjoint operators, Comm. Math. Phys. {\bf 78} (1980/81), 391-408.
\bibitem {M2}E. Mourre, Op\'erateurs conjugu\'es et propri\'et\'es de
propagation, Comm. Math. Phys. {\bf 91} (1983), 279-300.
\bibitem{NICO1}F. Nicoleau, Matrices de diffusion pour l'op\'erateur de
Schr\"odinger en pr\'esence d'un champ magn\'etique. Ph\'enom\`ene de
Aharonov-Bohm, Ann. Inst. H. Poincar\'e, phys.
th\'eor. {\bf 61} (1994), 329-346.
\bibitem{NICO2}F. Nicoleau, D. Robert, Th\'eorie de la diffusion pour des
perturbations longues et courtes port\'ees du champs magn\'etique, Ann. Fac.
Sci. Toulouse Math. {\bf 12} (1991), 185-194.
\bibitem{PeSiSi} P. Perry, I. M. Sigal, B. Simon, Spectral analysis of
N-body Schr\"odinger operators, Ann. Math. {\bf 114} (1981), 519-567.
\bibitem {RS} M. Reed, B. Simon, {\it Methods of Modern Mathematical
Physics} IV, Academic Press, 1978.
\bibitem {RY}P. Roux, D. Yafaev, On the mathematical theory of the
Aharonov-Bohm effect,
J. Phys. A {\bf 35} (2002).
\bibitem {Sh} M. A. Shubin, {\it Pseudodifferential Operators and Spectral
Theory}, Springer-Verlag, 1987.
\bibitem {UCH}J. Uchiyama, Polynomial growth or decay of eigenfunctions
of second order elliptic operators, Publ. RIMS {\bf 23} (1987), 975-1006.
\bibitem {YMST}D. R. Yafaev, {\it Mathematical Scattering Theory}, Amer.
Math. Soc., 1992.
\bibitem {Y3}D. R. Yafaev, The scattering amplitude for the Schr\"odinger
equation with a long-range potential, Comm. Math. Phys. {\bf 191} (1998),
183-218.
\bibitem {Y4}D. R. Yafaev, A class of pseudo-differential operators with
oscillating symbols, St. Petersburg Math. J. {\bf 11} (2000), 218--256.
\bibitem {Y5}D. R. Yafaev, {\it Scattering theory: some old and new problems},
Lect. Notes Math. {\bf 1735} , Springer-Verlag, 2000.
\bibitem {Y1}D. R. Yafaev, High energy and smoothness asymptotic expansion
of the scattering
amplitude, J. Funct. Anal., to be printed.
\end{thebibliography}
\end{document}
|
http://ctan.imsc.res.in/graphics/pgf/contrib/milsymb/milsymb.tex
|
imsc.res.in
|
CC-MAIN-2022-21
|
text/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2022-21/segments/1652662530066.45/warc/CC-MAIN-20220519204127-20220519234127-00263.warc.gz
| 11,446,817
| 20,789
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% MilSymb Manual File %%
%%-------------------- %%
%% Version: 1.02 %%
%% Last Updated: 2020-03-15 %%
%% Github: https://github.com/ralphieraccoon/MilSymb %%
%% Copyright: Damian Crosby 2018 %%
%% Licence: Creative Commons Attribution-ShareAlike 4.0 International License %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% WARNING! Typesetting tables can cause memory overflow. Set --extra-mem-top=10000000 in Typesetting or texmf.cnf %
% Table typesetting also takes a very long time. Consider commenting out \input commands when editing the rest of the document. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper, titlepage]{article}
\usepackage{milsymb, arev, ltablex, makecell, multirow, tikzpagenodes, vhistory, titlesec, float, forest, tocloft, alltt, array, tikz-dimline, threeparttable, textcomp, pifont, colortbl, caption, enumitem, graphicx, pdflscape, adjustbox, graphicx}
\keepXColumns
\usepackage[a4paper, margin=1.75cm]{geometry}
\usepackage[colorlinks=true, urlcolor=blue]{hyperref}
\usetikzlibrary{calc, arrows.meta, matrix}
\newcolumntype{n}{>{\raggedright\arraybackslash}m{5cm}}
\newcolumntype{s}{>{\centering\arraybackslash}m{1.75cm}}
\newcommand\MilSymb{\textbf{\texttt{MilSymb}}}
\newcommand\DocLink{\href{https://www.awl.edu.pl/images/en/APP_6_C.pdf}{APP6-(C)}}
\renewcommand\theadfont{\bfseries}
\newenvironment{writett}{\ttfamily}{\par}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\setlength{\cftsubsecnumwidth}{3em}
\setlength{\cftsubsubsecnumwidth}{4em}
\setlength{\cftparanumwidth}{5em}
\DeclareGraphicsExtensions{.png}
\title{MilSymb}
\author{Damian Crosby}
\begin{document}
\thispagestyle{empty}
\begin{center}
\begin{tikzpicture}[remember picture]
\coordinate (NE) at ($(current page text area.north east)-(1.5, 1.5)$);
\coordinate (NW) at ($(current page text area.north west)-(-1.5, 1.5)$);
\coordinate (SE) at ($(current page text area.south east)-(1.5, -1.5)$);
\coordinate (SW) at ($(current page text area.south west)-(-1.5, -1.5)$);
\MilLand[faction=hostile, echelon=team, main=infantry, scale=2](NE)
\MilAir[faction=friendly, main=military fixed wing, upper=jammer, lower=light, scale=2](NW)
\MilSeaSurface[faction=neutral, main=hazardous material transport ship, lower=fast, scale=2](SE)
\MilActivity[faction=unknown, main=searching, upper=house to house, scale=2](SW)
\MilLand[faction=unknown, echelon=battalion, main=armoured, upper=missile, lower=long range, scale=2]($(NE)!0.33!(NW)$)
\MilEquipment[faction=neutral, main=heavy machine gun, mobility=pack animal, scale=2]($(NE)!0.66!(NW)$)
\MilSpace[faction=hostile, main=military earth observation satellite, upper=low earth orbit, lower=radar, scale=2]($(SE)!0.33!(SW)$)
\MilInstallation[faction=friendly, main=electric power, upper=nuclear energy, scale=2]($(SE)!0.66!(SW)$)
\MilSeaSubsurface[faction=friendly, main=snorkelling submarine, upper=auxiliary, lower=nuclear type 5, scale=2]($(NE)!0.2!(SE)$)
\MilLand[faction=neutral, echelon=platoon, main=supply, supply={2}{4}, scale=2]($(NE)!0.4!(SE)$)
\MilActivity[faction=hostile, main=attempted criminal activity, upper=rape, scale=2]($(NE)!0.6!(SE)$)
\MilEquipment[faction=unknown, main=tank recovery vehicle, mobility=wheeled semi trailer, scale=2]($(NE)!0.8!(SE)$)
\MilMissile[faction=hostile, left=sub surface, right=launched, scale=2]($(NW)!0.2!(SW)$)
\MilInstallation[faction=unknown, main=civilian telecommunications, upper=television, scale=2]($(NW)!0.4!(SW)$)
\MilSpace[faction=friendly, main=civilian space station, upper=geosynchronous orbit, scale=2]($(NW)!0.6!(SW)$)
\MilLand[faction=neutral, echelon=corps, main=armoured, upper=missile, lower=long range, scale=2]($(NW)!0.8!(SW)$)
\pgfresetboundingbox
\path[use as bounding box] (0,0);
\end{tikzpicture}
{\let\newpage\relax\maketitle}
\end{center}
\clearpage
\begin{versionhistory}
\renewcommand \vhAuthorColWidth{6cm}
\vhEntry{1.0}{2018-04-29}{Damian Crosby}{Creation.}
\vhEntry{1.01}{2019-05-07}{Damian Crosby}{Added clarification on DVI output, added clarification that multiple class symbols are found in \texttt{multi}.}
\vhEntry{1.02}{2020-03-15}{Damian Crosby}{Fixed scaling and placement errors in the \texttt{speed leader} key code, added note to define \texttt{scale} first in manual when using \texttt{speed leader}, fixed compilation issues in \texttt{landgroup} and \texttt{landheadqurters} to account for updated \texttt{xparse} package, fixed issue with \texttt{frame status} and \texttt{scale} keys not always being updated between commands, changed datestamps to be ISO 8601 compliant as per CTAN request.}
\end{versionhistory}
\clearpage
\section*{Acknowledgments}
The author would particularly like to thank the following members of the \TeX\ stack exchange community for their solutions to problems during this package\rq{}s development:
\begin{itemize}
\item \href{https://tex.stackexchange.com/users/39222}{cfr}
\item \href{https://tex.stackexchange.com/users/9335}{Kpym}
\item \href{https://tex.stackexchange.com/users/586}{Torbj\o rn T.}
\item \href{https://tex.stackexchange.com/users/2388}{Ulrike Fischer}
\end{itemize}
\section*{Attributions}
\begin{itemize}
\item The \texttt{combatant} icon in the \textbf{\texttt{MilSeaSurface}} command has been adapated from a \href{https://commons.wikimedia.org/wiki/File:Small_battle_symbol.svg}{work} on Wikimedia Commons by \href{https://commons.wikimedia.org/wiki/User:Kathovo}{Kathovo} under the \href{https://creativecommons.org/licenses/by-sa/3.0/}{CC BY-SA 3.0} licence.
\item The Structure of 1\textsuperscript{st} Marine Division (Figure \ref{org}) receration is based on an \href{https://commons.wikimedia.org/wiki/File:1st_US_Marine_Division.png}{image} created by \href{https://commons.wikimedia.org/wiki/User:Noclador}{Noclador} under the \href{https://creativecommons.org/licenses/by-sa/3.0/}{CC BY-SA 3.0} licence.
\end{itemize}
\section*{Licence}
In order to comply with the attributions listed above, this package is licenced under \href{https://creativecommons.org/licenses/by-sa/4.0/}{CC BY-SA 4.0}.
\clearpage
\tableofcontents
\clearpage
\section{Introduction}
\subsection{Package Summary}
This package allows for the drawing of symbols from the \textit{NATO Joint Military Symbology} library, as detailed in the document \DocLink. It is designed to replicate the \lq\lq{}building block\rq\rq{} nature of the symbols in its command syntax using \texttt{pgf} keys, allowing the user to generate the entire symbol, including additional text fields, in one compact command.
\subsection{Package Dependencies}
The \MilSymb\ package uses the following packages as dependencies:
\begin{itemize}
\item \texttt{tikz}
\item \texttt{fontenc}
\item \texttt{fix-cm}
\item \texttt{arevmath}
\item \texttt{marvosym}
\item \texttt{acronym}
\item \texttt{amssymb}
\item \texttt{xifthen}
\item \texttt{xparse}
\end{itemize}
\subsection{Using \MilSymb}
To use \MilSymb\ in your document, just include \texttt{\textbackslash usepackage\{milsymb\}} in your preamble. \MilSymb\ has only been tested on \LaTeX, other \TeX\ flavours will probably not work. All \MilSymb\ symbols must be placed inside a TikZ environment, either as part of an inline \texttt{tikz} command or an \texttt{tikzpicture} enviroment. As with other packages that use TikZ or other postscript based drawing programs, DVI format is not directly supported, though some DVI viewers are able to display TikZ images by embedding postscript.
\subsubsection{Package Options}
Currently, there are no package options specified for \MilSymb.
\subsubsection{Symbol Construction}
\textit{NATO Joint Military Symbology} uses a \lq\lq{}building block\rq\rq{} philosophy when constructing military symbols, so each symbol can be broken into individual components. Only a brief overview will be given here, more information can be found in \DocLink. These components are shown in Figure \ref{Annotate}.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\MilLand[faction=friendly, main=armoured engineer, upper=survey, lower=bicycle equipped, frame status=normal, echelon=platoon, scale=2, movement={2}{2,-3}, unique designation=EX1, country indicator=GBR, altitude value=150, evaluation rating=A1, staff comments=EXAMPLE, higher formation=ENG 21]
\draw [red, {Circle[length=5pt]}-] (-1,-0.75) -- ++(225:1) -- ++(180:2) node[anchor=east]{Frame};
\draw [red, {Circle[length=5pt]}-] (0.1,0) -- ++(180:2) node[anchor=east]{Icon};
\draw [red, {Circle[length=5pt]}-] (0.05,0.62) -- ++(135:1) -- ++(180:2.7) node[anchor=east]{Modifier};
\draw [red, {Circle[length=5pt]}-] (0.05,-0.62) -- ++(225:2) -- ++(180:2) node[anchor=east]{Modifier};
\draw [red, {Circle[length=5pt]}-{Circle[length=5pt]}] (-2,-0.6) -- ++(180:1) -- ++(135:0.9) coordinate(A) -- ++(45:0.9) -- ++(0:1);
\draw [red, {Circle[length=5pt]}-{Circle[length=5pt]}] (3,0.65) -- ++(0:1) -- ++(315:0.9) coordinate(B) -- ++(225:0.9) -- ++(180:1.5);
\draw [shift={(-1,0.7)}, red, {Circle[length=5pt]}-] (3,0.65) -- ++(0:1.3) -- ++(315:1);
\draw [shift={(-1,-0.67)}, red, {Circle[length=5pt]}-] (3,-0.65) -- ++(0:1.3) -- ++(45:1);
\draw [red] (A) -- ++(180:1) node[anchor=east]{Amplifiers};
\draw [red] (B) -- ++(0:1) node[anchor=west]{Amplifiers};
\draw [red, {Circle[length=5pt]}-] (0,1.2) -- ++(90:1) node[anchor=south]{Amplifier};
\draw [red, {Circle[length=5pt]}-] (0,-1.9) -- ++(270:1) node[anchor=north]{Amplifier};
\end{tikzpicture}
\caption{Annotation of symbol components.}
\label{Annotate}
\end{figure}
\begin{itemize}
\item The \textbf{Frame} consists of a filled shape encompassing the icon and modifiers, denoting the type (land, sea surface, air, etc.) and faction (friendly, hostile, neutral, unknown) of the symbol. In some situations this is optional.
\item The \textbf{Icon} denotes the entity the symbol represents (infantry, tank, mine, etc.). It is always placed in the centre of the symbol.
\item The \textbf{Modifiers} are symbols that go above and below the icon (or to the left and right in the case of missile symbols, and just below the frame in the case of equipment symbols). These \lq\lq{}modify\rq\rq{} the entity with additional features or information (equipped with rocket launchers, extra heavy, etc.) These are usually optional.
\item The \textbf{Amplifiers} are text and symbols that go outside the frame, and denote additional attributes of the symbol (country of origin, military echelon, speed and direction, etc.). These are always optional.
\end{itemize}
\section{Symbol Commands}
\subsection{General Command Structure}
The general structure of a \MilSymb\ command is as follows. Syntax in \textit{italics} is optional:\\
\texttt{\textbackslash command[key, key=value]\textit{(location)(name)\{label\}}}
\begin{itemize}
\item \texttt{command} is the name of the command. All are prefixed with \texttt{Mil}-, and end with \texttt{Air}, \texttt{Missile}, \texttt{Land}, \texttt{Equipment}, \texttt{Installation}, \texttt{SeaSurface}, \texttt{SeaSubsurface}, \texttt{Mine}, \texttt{Space}, \texttt{Debris} and\\ \texttt{Activity}. These mostly correspond to the categories found in \DocLink, except for \texttt{Missile}, \texttt{Mine} and \texttt{Debris}, which have been broken off from \texttt{Air}, \texttt{SeaSubsurface} and \texttt{Space} for convenience. The \texttt{OwnShip} command is an exception to this rule, and does not have the \texttt{Mil}- prefix.
\item \texttt{key} and \texttt{key=value} are the options used to build the symbol, such as faction, icons, modifiers, and amplifiers. Keys with no value define boolean switches, such as \texttt{unclear}. Keys with values can have one parameter, such as \texttt{faction}, or two parameters, such as \texttt{speed leader}. In the latter case, the syntax is \texttt{key=\{value1\}\{value2\}}.
\item \texttt{location} is an optional coordinate or coordinate reference to place the symbol. This is generally needed when placing multiple symbols in one \texttt{tikzpicture}.
\item \texttt{name} is an optional reference label that acts just like the \texttt{name} property of a node in TikZ. It exposes standard rectangle node anchors such as \texttt{north} and \texttt{south}, allowing connectors to be drawn between symbols. This is useful when drawing organisation charts and similar (see Example \ref{org}).
\item \texttt{label} is an optional text label that is added to the right of the symbol.
\end{itemize}
\subsubsection{Shared Keys}
These are all the keys that are shared by multiple \MilSymb\ commands. Not all keys are shared by all commands, please see Table \ref{shared} for details about which keys are used by which commands.
\begin{table}[H]
\centering
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
\multirow{10}{*}{\thead{Command}} & \multicolumn{12}{c|}{\thead{Shared Key}} \\ \cline{2-13}
& \rotatebox{90}{\thead{\texttt{faction}}} & \rotatebox{90}{\thead{\texttt{main}}} & \rotatebox{90}{\thead{\texttt{upper}}} & \rotatebox{90}{\thead{\texttt{lower}}} & \rotatebox{90}{\thead{\texttt{frame status}}} & \rotatebox{90}{\thead{\texttt{monochrome}}} & \rotatebox{90}{\thead{\texttt{scale}}} & \rotatebox{90}{\thead{\texttt{no frame}}} & \rotatebox{90}{\thead{\texttt{speed leader}}} & \rotatebox{90}{\thead{\texttt{offset, movement}}~} & \rotatebox{90}{\thead{\texttt{feint or dummy}}} & \rotatebox{90}{\thead{\texttt{headquarters}}}\\ \hline
\texttt{MilAir} & & & & & & & & \cellcolor{black} & & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} \\ \hline
\texttt{MilMissile} & & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & & & & \cellcolor{black} & & \cellcolor{black} & \cellcolor{black} & \cellcolor{black}\\ \hline
\texttt{MilLand} & & & & & & & & \cellcolor{black} & \cellcolor{black} & & & 2 \\ \hline
\texttt{MilEquipment} & & & \cellcolor{black} & \cellcolor{black} & 1 & & & & \cellcolor{black} & & & \cellcolor{black} \\ \hline
\texttt{MilInstallation} & & & & \cellcolor{black} & & & & \cellcolor{black} & \cellcolor{black} & & & 2\\ \hline
\texttt{MilSeaSurface} & & & & & & & & \cellcolor{black} & & \cellcolor{black} & \cellcolor{black}& \cellcolor{black}\\ \hline
\texttt{MilSeaSubSurface} & & & & & & & & \cellcolor{black} & & \cellcolor{black} & \cellcolor{black} & \cellcolor{black}\\ \hline
\texttt{MilMine} & & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & 1 & & & & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} \\ \hline
\texttt{MilSpace} & & & & & & & & \cellcolor{black} & & \cellcolor{black} & \cellcolor{black} & \cellcolor{black}\\ \hline
\texttt{MilActivity} & & & & \cellcolor{black} & & & & \cellcolor{black} & \cellcolor{black} & & \cellcolor{black} & \cellcolor{black}\\ \hline
\texttt{MilDebris} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black}\\ \hline
\texttt{OwnShip} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black}\\ \hline
\end{tabular}
\begin{tablenotes}
\item \textsuperscript{1}Not functional when the \texttt{no frame} option is used.
\item \textsuperscript{2}Only functional when \texttt{faction=friendly}.
\end{tablenotes}
\caption{Table of which keys are used in which commands.}
\label{shared}
\end{table}
\paragraph{\texttt{main}}
This key defines the icon to use in the centre of the frame. See the individual command icon and modifier tables for the list of available values.
\paragraph{\texttt{upper}}
This key defines the modifier to use above the icon defined by \texttt{main}. See the individual command icon and modifier tables for the list of available values.
\paragraph{\texttt{lower}}
This key defines the modifier to use below the icon defined by \texttt{main}. See the individual command icon and modifier tables for the list of available values.
\paragraph{\texttt{frame status}}
This key modifies the border of the frame to allow for the expression of both the full set of \lq\lq{}standard identities\rq\rq{}, and the planned status as seen in \DocLink. The \texttt{unclear} value creates a black and white dotted line to display the alternate identities of each faction (assumed friend for friendly, suspect for hostile and pending for unknown, neutral should not use this value). The \texttt{anticipated} value create a longer dashed line to display the planned status. If the \texttt{frame status} key is not set, a standard solid border is used.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilLand[faction=friendly, main=signal radio teletype centre, frame status=normal, scale=2] & \MilLand[faction=friendly, main=signal radio teletype centre, frame status=uncertain, scale=2] & \MilLand[faction=friendly, main=signal radio teletype centre, frame status=anticipated, scale=2]\\
\node{normal}; & \node{\texttt{frame status=unclear}}; & \node{\texttt{frame status=anticipated}}; \\
};
\end{tikzpicture}
\caption{Example of the \texttt{frame status} key in use.}
\end{figure}
\paragraph{\texttt{faction}}
This key selects the military faction of the symbol relative to the user, which determines the colour and shape of the frame, or the colour of the icon and modifiers if \texttt{no frame} is specified. The values available are \texttt{friendly}, \texttt{hostile}, \texttt{neutral} and \texttt{unknown}.
\begin{table}[H]
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
\multirow{2.5}{*}{\thead{Command}} & \multicolumn{4}{c|}{\thead{Faction Frame}} \\ \cline{2-5}
& \thead{Friendly} & \thead{Hostile} & \thead{Neutral} & \thead{Unknown}\\
\hline
\texttt{MilAir} + \texttt{MilMissile} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilAir[faction=friendly]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilAir[faction=hostile]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilAir[faction=neutral]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilAir[faction=unknown]}}\\
\hline
\texttt{MilLand} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown]}}\\
\hline
\texttt{MilEquipment}* + \texttt{MilSeaSurface} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilEquipment[faction=friendly]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilEquipment[faction=hostile]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilEquipment[faction=neutral]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown]}}\\
\hline
\texttt{MilInstallation} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilInstallation[faction=friendly]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilInstallation[faction=hostile]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilInstallation[faction=neutral]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilInstallation[faction=unknown]}}\\
\hline
\texttt{MilSeaSubsurface} + \texttt{MilMine}* & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilSeaSubsurface[faction=friendly]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilSeaSubsurface[faction=hostile]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilSeaSubsurface[faction=neutral]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilSeaSubsurface[faction=unknown]}}\\
\hline
\texttt{MilSpace} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilSpace[faction=friendly]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilSpace[faction=hostile]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilSpace[faction=neutral]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilSpace[faction=unknown]}}\\
\hline
\texttt{MilActivity} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilActivity[faction=friendly]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilActivity[faction=hostile]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilActivity[faction=neutral]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilActivity[faction=unknown]}}\\
\hline
\end{tabular}
\begin{tablenotes}
\item \qquad \quad *Can be used without a frame using the \texttt{no frame} option.
\end{tablenotes}
\caption{Table of all the \MilSymb\ command frames.}
\end{table}
\paragraph{\texttt{monochrome}}
This boolean switch key allows the symbol to be generated in a monochrome format. All faction colours are instead rendered as an off-white colour as specified in \DocLink.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilLand[faction=friendly, main=signal radio teletype centre, scale=2] & \MilLand[faction=friendly, main=signal radio teletype centre, monochrome, scale=2]\\
\node{normal}; & \node{\texttt{monochrome}}; \\
};
\end{tikzpicture}
\caption{Example of the \texttt{monochrome} key in use.}
\end{figure}
\paragraph{\texttt{scale}}
This key allows you to scale the resulting symbol by a multiple. By default (\texttt{scale=1}) the boundary octagon is precisely 1cm in diameter.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilLand[faction=friendly, main=signal radio teletype centre, scale=0.5] & \MilLand[faction=friendly, main=signal radio teletype centre, scale=1] & \MilLand[faction=friendly, main=signal radio teletype centre, scale=2]\\
\node{\texttt{scale=0.5}}; & \node{\texttt{scale=1}}; & \node{\texttt{scale=2}}; \\
};
\end{tikzpicture}
\caption{Example of the \texttt{scale} key in use.}
\end{figure}
\paragraph{\texttt{no frame}}
This boolean switch key allows for specific commands (namely \textbf{\texttt{MilEquipment}} and \textbf{\texttt{MilMine}}) to be used without a faction frame. Instead, the icon and modifiers are recoloured with a fluorescent version of the faction colour, as per \DocLink.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilEquipment[faction=friendly, main=mine clearing vehicle, mobility=wheeled and tracked, scale=2] & \MilEquipment[faction=friendly, main=mine clearing vehicle, mobility=wheeled and tracked, scale=2, no frame]\\
\node{normal}; & \node{\texttt{no frame}}; \\
};
\end{tikzpicture}
\caption{Example of the \texttt{no frame} key in use.}
\end{figure}
\paragraph{\texttt{speed leader} (Amplifier)}
This key draws a line from the centre of the symbol at a specified heading for a specified length. This is used to denote the speed (length) and direction (heading) of the symbol. This key takes two arguments, the first is the length and the second is the heading, as shown below:\\
\texttt{speed leader=\{\textit{heading}\}\{\textit{length}\}}
\textit{When using this key along with the \texttt{scale} key, the \texttt{scale} key should be defined first. This is because the \texttt{speed leader} key immediately executes code that uses the \texttt{scale} key.}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilAir[faction=friendly, main=military rotary wing, speed leader={35}{3}, scale=2] & \MilAir[faction=friendly, main=military rotary wing, speed leader={118}{4}, scale=2] & \MilAir[faction=friendly, main=military rotary wing, speed leader={335}{2}, scale=2] \\
\node{\texttt{speed leader=\{35\}\{3\}}}; & \node{\texttt{speed leader=\{118\}\{4\}}}; & \node{\texttt{speed leader=\{335\}\{2\}}}; \\
};
\end{tikzpicture}
\caption{Example of the \texttt{speed leader} key in use.}
\end{figure}
\paragraph{\texttt{offset}, \texttt{movement} (Amplifier)}
This key draws a \lq\lq{}leader line\rq\rq{} down from the centre of the symbol, then another to a specified position \textit{offset} from the centre of the symbol. The \texttt{offset} key should be used to denote precise location, and the \texttt{movement} key should be used to indicate direction of movement (in the case of the \texttt{movement} key, the line is tipped by an arrow). \textit{They should not be used simultaneously.} This key takes two arguments, each enclosed in curly braces, the first is the length of the \lq\lq{}leader line\rq\rq{} extending below the symbol, then the second is a pair of TikZ coordinates (with no brackets) indicating the specified position \textit{offset} from the centre of the symbol, as shown below:\\
\texttt{offset=\{\textit{leader length}\}\{\textit{offset}\}}\\
\indent\texttt{movement=\{\textit{leader length}\}\{\textit{offset}\}}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilLand[faction=friendly, main=signal radio teletype centre, scale=2, offset={3}{2,-4}] & \MilLand[faction=friendly, main=signal radio teletype centre, scale=2, movement={4}{2,-2}] & \MilLand[faction=friendly, main=signal radio teletype centre, scale=2, offset={2}{-2,-2}] \\
\node{\texttt{offset=\{3\}\{2,-4\}}}; & \node{\texttt{ movement=\{4\}\{2,-2\}}}; & \node{\texttt{offset=\{2\}\{-2,-2\}}}; \\
};
\end{tikzpicture}
\caption{Example of the \texttt{offset} and \texttt{movement} key in use.}
\end{figure}
\paragraph{\texttt{feint or dummy} (Amplifier)}
This boolean switch key draws the \textit{feint or dummy} amplifier on the symbol. See \DocLink\ for further information about its use.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilLand[faction=friendly, main=signal radio teletype centre, scale=2] & \MilLand[faction=friendly, main=signal radio teletype centre, scale=2, feint or dummy] \\
\node{normal}; & \node{\texttt{feint or dummy}}; \\
};
\end{tikzpicture}
\caption{Example of the \texttt{feint or dummy} key in use.}
\end{figure}
\paragraph{\texttt{headquarters} (Amplifier)}
This key draws a line down from the south east corner of a \texttt{friendly} \textbf{\texttt{MilLand}} or \textbf{\texttt{MilInstallation}} frame, and then an optional text field below the frame. This is used to denote if the symbol is stationed at a headquarters or some other kind of military base. The key can be provided with no value, which will produce a blank headquaters amplifer, which is a line drawn downwards from the south-west of the symbol frame, or with a set of values that insert acronyms next to the line. Table \ref{headquarters} lists all the options available.
\begin{table}[H]
\centering
\begin{tabular}{|l|c|}
\hline
\thead{Value} & \thead{Acronym} \\ \hline
\texttt{assault command post} & ASLT \\ \hline
\texttt{command group} & CMD \\ \hline
\texttt{forward command post} & FWD \\ \hline
\texttt{main command post} & MAIN \\ \hline
\texttt{rear command post} & REAR \\ \hline
\texttt{tactical operations centre} & TOC \\ \hline
\texttt{tactical command post} & TAC \\ \hline
\end{tabular}
\caption{Headquarters acronyms.}
\label{headquarters}
\end{table}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilLand[faction=friendly, main=signal radio teletype centre, scale=2, headquarters] & \MilLand[faction=friendly, main=signal radio teletype centre, scale=2, headquarters=tactical operations centre] \\
\node{\texttt{headquarters} (no value)}; & \node{\texttt{headquarters=tactical operations centre}};\\
};
\end{tikzpicture}
\caption{Example of the \texttt{headquarters} key in use.}
\end{figure}
\subsubsection{Text Fields}
Most \MilSymb\ commands (apart from \textbf{\texttt{MilDebris}} and \textbf{\texttt{OwnShip}}) have a set of text amplifiers that go around the edge of the symbol. These are set by individually named keys specified in the \textbf{Text Fields} subheading of each command entry. Some symbols have multiple text fields in the same location, be default no spaces are inserted between these fields, so spaces must be entered manually as appropriate.
\subsubsection{Full Frame Icons}
In some commands (\textbf{\texttt{MilLand}}, \textbf{\texttt{MilInstallation}} and \textbf{\texttt{MilActivity}}) some icons (as set by \texttt{main}) will take up the entire frame. These are referred to as \lq\lq{}full frame\rq\rq{} icons. Modifiers (as set by \texttt{upper} and \texttt{lower}) should not be used when a full frame icon has been selected.
\subsubsection{Grouping}
For \textbf{\texttt{MilLand}} and \textbf{\texttt{MilInstallation}} symbols with the \texttt{faction} key set to \texttt{friendly}, there is the option to group several commands together to indicate several entities in one location. \MilSymb\ provides two \LaTeX\ environments to achieve this, \textbf{\texttt{landgroup}} and \textbf{\texttt{landheadquarters}}. \textbf{\texttt{landgroup}} is designed to be used with normal \textbf{\texttt{MilLand}} symbols, and \textbf{\texttt{landheadquarters}} is designed to be used with symbols that have a headquarters amplifier. Within the environments, each command should be the argument inside an \texttt{\textbackslash item\{...\}} command (note that it is not the same as the \texttt{\textbackslash item} that is used in bulleted and numbered lists in \LaTeX\ , it has an argument in curly braces rather than just a command). \textit{Do not use the \texttt{scale} key within a \MilSymb\ command when grouping them. Instead, use the \texttt{scale} key at the environment level.} See this example:\\
\begin{writett}
\begin{verbatim}
\begin{landgroup}[scale=2]
\item{\MilLand[faction=friendly,
main=signal radio teletype centre,
echelon=section]}
\item{\MilLand[faction=friendly,
main=diving,
upper=video imagery,
echelon=brigade,
status=reduced]}
\item{\MilLand[faction=friendly,
main=sensor,
upper=large extension node,
lower=single channel]}
\end{landgroup}
\end{verbatim}
\end{writett}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\begin{landgroup}[scale=2]
\item{\MilLand[faction=friendly, main=signal radio teletype centre, echelon=section]}
\item{\MilLand[faction=friendly, main=diving, upper=video imagery, echelon=brigade, status=reduced]}
\item{\MilLand[faction=friendly, main=sensor, upper=large extension node, lower=single channel]}
\end{landgroup}
&
\begin{landheadquarters}[scale=2]
\item{\MilLand[faction=friendly, main=signal radio teletype centre, echelon=section, headquarters=command group]}
\item{\MilLand[faction=friendly, main=diving, upper=video imagery, echelon=brigade, status=reduced, headquarters=command group]}
\item{\MilLand[faction=friendly, main=sensor, upper=large extension node, lower=single channel, headquarters=command group]}
\end{landheadquarters} \\
\node {\textbf{\texttt{landgroup}}}; & \node{\textbf{\texttt{landheadquarters}}}; \\
};
\end{tikzpicture}
\caption{Example of \textbf{\texttt{landgroup}} and \textbf{\texttt{landheadquarters}} grouping.}
\end{figure}
\newpage\subsection{Air Command (\textbf{\texttt{MilAir}})}
This command covers symbols for air assets and their activities. Refer to \textit{Chapter 2, Section 2 and 3} in \DocLink\ for further information.
\subsubsection{Icons and Modifiers}
\paragraph{\texttt{main}}\quad
\input{manual_scripts/Air_Main_table.tex}
\newpage\paragraph{\texttt{upper}}\quad
\input{manual_scripts/Air_Upper_table.tex}
\newpage\paragraph{\texttt{lower}}\quad
\input{manual_scripts/Air_Lower_table.tex}
\subsubsection{Amplifiers}
\paragraph{Text Fields}
\textbf{\texttt{MilAir}} has 5 text field amplifiers, as shown in Figure \ref{airtext}. Table \ref{airtexttable} gives the key and description of each field, along with the standard prefixes to use. This table is mostly identical to the one found in \DocLink.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\MilAir[faction=friendly, main=military rotary wing, scale=2, track number=\qquad A, call sign=\qquad B, position and movement=\qquad C, nation=\qquad D, additional information=\qquad E]
\end{tikzpicture}
\caption{Location of \textbf{\texttt{MilAir}} text field amplifiers.}
\label{airtext}
\end{figure}
\begin{table}[H]
\centering
\begin{tabularx}{\textwidth}{|c|l|X|c|}
\hline
\thead{Location} & \thead{Key} & \thead{Description} & \thead{Prefix*}\\ \hline
\textbf{A} & \texttt{track number} & System Track Number. & TN \\ \hline
\textbf{B} & \texttt{call sign} & Airframe Number or Mission Call Sign. & \\ \hline
\textbf{C} & \texttt{position and movement} & Course [degrees]/Speed [knots] or Bearing [degrees]/Distance [nautical miles] Height [feet/flight level]. & C/S, B/D \\ \hline
\textbf{D} & \texttt{nation} & Nation\rq{}s Name: A 3-letter code indicating the object\rq{}s country of origin (STANAG 1059). & \\ \hline
\textbf{E} & \texttt{additional information} & For friendly units: Sensor or Weapon load, endurance, etc. For other Units: Credibility of Information. & \\ \hline
\end{tabularx}
\begin{tablenotes}
\item *when applicable.
\end{tablenotes}
\caption{Description of \textbf{\texttt{MilAir}} text field amplifiers.}
\label{airtexttable}
\end{table}
\newpage\subsection{Missile Command (\textbf{\texttt{MilMissile}})}
This command is a special application of \textbf{\texttt{MilAir}} for missiles. \textit{Instead of setting an icon using \texttt{main}, a predefined \lq\lq{}missile\rq\rq{} icon is used. Modifiers are then added to the left and right instead of above and below.} Refer to \textit{Chapter 2, Section 4} in \DocLink\ for further information.
\subsubsection{Modifiers}
\textit{Instead of using \texttt{upper} and \texttt{lower} keys to define the modifiers, \texttt{left} and \texttt{right} keys are used to reflect the position of the modifier.}
\paragraph{\texttt{left}}\quad
\input{manual_scripts/Missile_Left_table.tex}
\newpage\paragraph{\texttt{right}}\quad
\input{manual_scripts/Missile_Right_table.tex}
\subsubsection{Amplifiers}
\paragraph{Text Fields}
Text fields for \textbf{\texttt{MilMissile}} are identical to \textbf{\texttt{MilAir}}.
\newpage\subsection{Land Command (\textbf{\texttt{MilLand}})}
This command covers symbols for land units, individuals, and organizations. Refer to \textit{Chapter 3, Section 2} in \DocLink\ for further information.
\subsubsection{Icons and Modifiers}
\paragraph{\texttt{main}}\quad
\input{manual_scripts/Land_Main_table.tex}
\newpage\paragraph{\texttt{upper}}\quad
\input{manual_scripts/Land_Upper_table.tex}
\newpage\paragraph{\texttt{lower}}\quad
\input{manual_scripts/Land_Lower_table.tex}
\subsubsection{Amplifiers}
\paragraph{Echelon}
This amplifier denotes the \lq\lq{}level of command\rq\rq{} of the symbol (in the case of infantry this usually denotes the size of the unit). Table \ref{echelon} lists all the options available.
\begin{table}[H]
\centering
\begin{tabular}{|l|c|}
\hline
\thead{Value} & \thead{Symbol} \\ \hline
\texttt{team} & $\varnothing$ \\ \hline
\texttt{squad} & \textbullet \\ \hline
\texttt{section} & \textbullet \ \textbullet \\ \hline
\texttt{platoon} & \textbullet \ \textbullet \ \textbullet \\ \hline
\texttt{company} & \textbar \\ \hline
\texttt{battalion} & \textbar \ \textbar \\ \hline
\texttt{regiment} & \textbar \ \textbar \ \textbar \\ \hline
\texttt{brigade} & X \\ \hline
\texttt{division} & XX \\ \hline
\texttt{corps} & XXX \\ \hline
\texttt{army} & XXXX\\ \hline
\texttt{army group} & XXXXX \\ \hline
\texttt{theatre} & XXXXXX \\ \hline
\texttt{command} & \raisebox{1pt}{+ \ +} \\ \hline
\end{tabular}
\caption{Echelon levels and corresponding symbols.}
\label{echelon}
\end{table}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilLand[faction=friendly, main=signal radio teletype centre, scale=2, echelon=section] & \MilLand[faction=friendly, main=signal radio teletype centre, scale=2, echelon=regiment] & \MilLand[faction=friendly, main=signal radio teletype centre, scale=2, echelon=army] \\
\node{\texttt{echelon=section}}; & \node{\texttt{echelon=regiment}}; & \node{\texttt{echelon=army}}; \\
};
\end{tikzpicture}
\caption{Example of the \texttt{echelon} key in use.}
\end{figure}
\paragraph{Task Force}
This amplifier denotes a temporary unit for a specific task or objective. If the \texttt{echelon} key is set, it will automatically size to enclose the echelon amplifier.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilLand[faction=friendly, main=signal radio teletype centre, echelon=platoon, scale=2] & \MilLand[faction=friendly, main=signal radio teletype centre, scale=2, echelon=platoon, task force] \\
\node{normal}; & \node{\texttt{task force}}; \\
};
\end{tikzpicture}
\caption{Example of the \texttt{task force} key in use.}
\end{figure}
\paragraph{Status}
This amplifier denotes the condition of the of the symbol. There are 3 options, \texttt{reinforced} indicates part of another unit is augmenting the capability of this unit, \texttt{reduced} means part of the unit has been detached to augment another unit, and \texttt{reinforced and reduced} means both situations have occurred. If this key is specified, the text field adjacent to it will be shifted right in order to accommodate the amplifier.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilLand[faction=friendly, main=signal radio teletype centre, scale=2, status=reinforced] & \MilLand[faction=friendly, main=signal radio teletype centre, scale=2, status=reduced] & \MilLand[faction=friendly, main=signal radio teletype centre, scale=2, status=reinforced and reduced] \\
\node{\texttt{status=reinforced}}; & \node{\texttt{status=reduced}}; & \node{\texttt{status=reinforced and reduced}}; \\
};
\end{tikzpicture}
\caption{Example of the \texttt{status} key in use.}
\end{figure}
\paragraph{Text Fields}
\textbf{\texttt{MilLand}} has 14 text field amplifiers, as shown in Figure \ref{equiptext}. \textit{Some of these amplifiers are placed adjacent to each other, spaces are not automatically inserted between them.} Table \ref{landtexttable} gives the key and description of each field, along with the standard prefixes to use. This table is mostly identical to the one found in \DocLink.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\MilLand[faction=friendly, main=signal radio teletype centre, scale=2, staff comments=\qquad G, additional information=\qquad H, higher formation=\qquad M, evaluation rating=\qquad J, country indicator=\qquad AC, combat effectiveness=\textbackslash K, identification=\textbackslash P, unique designation=T\qquad~, type of equipment=\qquad V, date-time group=W\qquad~, altitude value=X, location=\textbackslash Y\qquad~, common identifier=\textbackslash AF\qquad~, speed=Z\qquad~]
\end{tikzpicture}
\caption{Location of \textbf{\texttt{MilLand}} text field amplifiers.}
\label{landtext}
\end{figure}
\begin{center}
\begin{tabularx}{\textwidth}{|c|l|X|}
\hline
\thead{Location} & \thead{Key} & \thead{Description} \\ \hline
\textbf{AC} & \texttt{country indicator} & A three-letter code that indicates the country of origin of the unit (STANAG 1059). In stability activities, this field can be used for factions or groups.\\ \hline
\textbf{G} & \texttt{staff comments} & Free text. Can be used by staff for information required by commander.\\ \hline
\textbf{H} & \texttt{additional information} & Free Text.\\ \hline
\textbf{M} & \texttt{higher formation} & Number or title of higher echelon command of unit being displayed. \\ \hline
\textbf{J} & \texttt{evaluation rating} & Degree of confidence that may be placed on the information represented by the symbol. It is shown as one letter and one number made up of Reliability of Source and Credibility of Information. (STANAG 2511). \newline
Reliability of Source:
\begin{enumerate}[label=\Alph*., align=left]
\item Completely reliable.
\item Usually reliable.
\item Fairly reliable.
\item Not usually reliable.
\item Unreliable.
\item Reliability cannot be judged.
\end{enumerate}
Credibility of Information:
\begin{enumerate}[label=\arabic*., align=left]
\item Confirmed by other sources.
\item Probably true.
\item Possibly true.
\item Doubtful.
\item Improbable.
\item Truth cannot be judged.
\end{enumerate}
\\ \hline
\textbf{K} & \texttt{combat effectiveness} & Effectiveness of unit or equipment displayed.
\begin{enumerate}[label=\arabic*., align=left]
\item Fully operational.
\item Substantially operational.
\item Marginally operational.
\item Not operational.
\end{enumerate} \\ \hline
\textbf{P} & \texttt{identification} & Identification modes and codes.\\ \hline
\textbf{W} & \texttt{date-time group} & An alphanumeric designator for displaying a date-time group (DDHHMMSSZMONYY) or \lq\lq{}O/O\rq\rq{} for on order. The date-time group is composed of a group of six numeric digits with a time zone suffix and the standardized three-letter abbreviation for the month followed by two digits. The first pair of digits represents the day; the second pair, the hour; the third pair, the minutes. The last two digits of the year are after the month. For automated systems, two digits may be added before the time zone suffix and after the minutes to designate seconds.\\ \hline
\textbf{X} & \texttt{altitude value} & Altitude as displayed on the global positioning system (GPS). \\ \hline
\textbf{Y} & \texttt{location} & Latitude and longitude; grid coordinates. \\ \hline
\textbf{AF} & \texttt{common identifier} & Example: Paladin for the M109A6 howitzer or Leopard for the KPz-70 tank. (Use NATO code name for hostile common identifiers.) \\ \hline
\textbf{Z} & \texttt{speed} & Displays speed in nautical miles per hour or kilometres per hour. \\ \hline
\multicolumn{3}{c}{}\\
\caption{Description of \textbf{\texttt{MilLand}} text field amplifiers.}
\label{landtexttable}
\end{tabularx}
\end{center}
\subsubsection{Supply Icons}
An additional set of fullframe \textbf{\texttt{MilLand}} icons are used to denote classes of supply. \MilSymb\ uses an additional \texttt{supply} key to construct these icons, which takes up to two values each enclosed in curly braces.\textit{If only one value is used, then there must be a set of empty curly braces (\{\}) after the first value}. Each value is a supply class number, as listed in Table \ref{supply}. The US uses different symbols and designations for their supply classes, their supply class numbers are prefixed with \texttt{US } (including the space). When one value is set, the symbol from the table will be used, and when two values are set, the roman numeral for the supply class is used, with an ampersand (\&) inserted between the numerals. \textit{This key should be used in place of the \texttt{main} key.}
\begin{center}
\begin{longtable}{|l|c|c|c|c|c|c|}
\hline
\thead{Value} & \rotatebox{90}{\thead{Roman Numeral}~} & \thead{Glyph} & \multicolumn{4}{c|}{\thead{Examples}}\\ \hline
\texttt{all}* & N/A & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={all}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={all}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={all}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={all}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={all}{}]}}\\ \hline
\multicolumn{7}{|c|}{\thead{NATO Supply Classes}}\\ \hline
\texttt{1} & I & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={1}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={1}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={1}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={1}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={1}{}]}}\\ \hline
\texttt{2} & II & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={2}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={2}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={2}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={2}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={2}{}]}}\\ \hline
\texttt{3} & III & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={3}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={3}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={3}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={3}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={3}{}]}}\\ \hline
\texttt{4} & IV & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={4}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={4}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={4}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={4}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={4}{}]}}\\ \hline
\texttt{5} & V & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={5}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={5}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={5}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={5}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={5}{}]}}\\ \hline
\multicolumn{7}{|c|}{\thead{US Supply Classes}} \\ \hline
\texttt{US 1} & I & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={US 1}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={US 1}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={US 1}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={US 1}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={US 1}{}]}}\\ \hline
\texttt{US 2} & II & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={US 2}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={US 2}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={US 2}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={US 2}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={US 2}{}]}}\\ \hline
\texttt{US 3} & III & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={US 3}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={US 3}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={US 3}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={US 3}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={US 3}{}]}}\\ \hline
\texttt{US 4} & IV & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={US 4}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={US 4}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={US 4}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={US 4}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={US 4}{}]}}\\ \hline
\texttt{US 5} & V & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={US 5}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={US 5}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={US 5}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={US 5}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={US 5}{}]}}\\ \hline
\texttt{US 6} & VI & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={US 6}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={US 6}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={US 6}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={US 6}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={US 6}{}]}}\\ \hline
\texttt{US 7} & VII & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={US 7}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={US 7}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={US 7}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={US 7}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={US 7}{}]}}\\ \hline
\texttt{US 8} & VIII & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={US 8}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={US 8}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={US 8}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={US 8}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={US 8}{}]}}\\ \hline
\texttt{US 9} & IX & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={US 9}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={US 9}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={US 9}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={US 9}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={US 9}{}]}}\\ \hline
\texttt{US 10} & X & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=none, supply={US 10}{}]}}& \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=friendly, supply={US 10}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=hostile, supply={US 10}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=neutral, supply={US 10}{}]}}&\adjustbox{valign=m,margin=0.25cm}{\tikz{\MilLand[faction=unknown, supply={US 10}{}]}}\\\hline
\multicolumn{7}{c}{}\\
\caption{Table of Supply Icons.}
\label{supply}
\end{longtable}
\begin{tablenotes}
\item *can only be used as a single value.
\end{tablenotes}
\end{center}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilLand[faction=friendly, supply={1}{5}, scale=2] & \MilLand[faction=friendly, supply={US 8}{}, scale=2] & \MilLand[faction=friendly, supply={3}{}, scale=2] \\
\node{\texttt{supply=\{1\}\{5\}}}; & \node{\texttt{supply=\{US 8\}\{\}}}; & \node{\texttt{supply=\{3\}\{\}}}; \\
};
\end{tikzpicture}
\caption{Example of Supply symbols.}
\end{figure}
\subsubsection{Altitude Modifier}
\textbf{\texttt{MilLand}} defines a special lower modifier for altitude, which takes up to two values each enclosed in curly braces.\textit{If only one value is used, then there must be a set of empty curly braces (\{\}) after the first value}. Each value is an altitude designation, \texttt{high} (HA), \texttt{medium} (MA) and \texttt{low} (LA), which inserts the acronym. Having two values will insert a slash (/) between them and removes the \lq\lq{}A\rq\rq{} suffix from the first acronym. \textit{This key should be used in place of the \texttt{lower} key.}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\MilLand[faction=friendly, main=unmanned systems, scale=2, altitude={high}{}] & \MilLand[faction=friendly, main=unmanned systems, scale=2, altitude={medium}{low}] & \MilLand[faction=friendly, main=unmanned systems, scale=2, altitude={low}{}] \\
\node{\texttt{altitude=\{high\}\{\}}}; & \node{\texttt{altitude=\{medium\}\{low\}}}; & \node{\texttt{altitude=\{low\}\{\}}}; \\
};
\end{tikzpicture}
\caption{Example of the \texttt{altitude} key in use.}
\end{figure}
\newpage\subsection{Equipment Command (\textbf{\texttt{MilEquipment}})}
This command covers symbols for land equipment. \textit{The are no \texttt{upper} and \texttt{lower} keys, instead a \texttt{mobility} key sets a modifier to be displayed below the frame (or when the \texttt{no frame} key is set, adjacent to the bottom of the icon)}. This command also accepts the \texttt{no frame} key. See \textit{Chapter 3, Section 3} in \DocLink.
\subsubsection{Icons and Modifiers}
\paragraph{\texttt{Main}}\quad
\input{manual_scripts/Equipment_Main_table.tex}
\newpage\paragraph{\texttt{Mobility}}\quad
\input{manual_scripts/Equipment_Mobility_table.tex}
\subsubsection{Amplifiers}
\paragraph{Text Fields}
\textbf{\texttt{MilEquipment}} has 16 text field amplifiers, as shown in Figure \ref{equiptext}. \textit{Some of these amplifiers are placed adjacent to each other, spaces are not automatically inserted between them.} Table \ref{equiptexttable} gives the key and description of each field, along with the standard prefixes to use. This table is mostly identical to the one found in \DocLink.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\MilEquipment[faction=friendly, main=mine clearing vehicle, mobility=wheeled and tracked, scale=2, quantity=Q, staff comments=\qquad G, additional information=\qquad H, evaluation rating=\qquad J, combat effectiveness=\textbackslash K, signature equipment=\textbackslash SE, higher formation=\qquad M, identification=\textbackslash P, unique designation=T\qquad~, type of equipment=V, date-time group=W\qquad~, altitude value=X, location=\textbackslash Y\qquad~, country indicator=\qquad AC, platform type=\textbackslash AD, equipment teardown time=\textbackslash AE, common identifier=\textbackslash AF\qquad~, speed=Z\qquad~]
\end{tikzpicture}
\caption{Location of \textbf{\texttt{MilEquipment}} text field amplifiers.}
\label{equiptext}
\end{figure}
\begin{center}
\begin{tabularx}{\textwidth}{|c|l|X|}
\hline
\thead{Location} & \thead{Key} & \thead{Description} \\ \hline
\textbf{Q} & \texttt{quantity} & Identifies the number of items present.\\ \hline
\textbf{AC} & \texttt{country indicator} & A three-letter code that indicates the country of origin of the unit (STANAG 1059). In stability activities, this field can be used for factions or groups.\\ \hline
\textbf{G} & \texttt{staff comments} & Free text. Can be used by staff for information required by commander.\\ \hline
\textbf{H} & \texttt{additional information} & Free Text.\\ \hline
\textbf{M} & \texttt{higher formation} & Number or title of higher echelon command of unit being displayed. \\ \hline
\textbf{J} & \texttt{evaluation rating} & Degree of confidence that may be placed on the information represented by the symbol. It is shown as one letter and one number made up of Reliability of Source and Credibility of Information. (STANAG 2511). \newline
Reliability of Source:
\begin{enumerate}[label=\Alph*., align=left]
\item Completely reliable.
\item Usually reliable.
\item Fairly reliable.
\item Not usually reliable.
\item Unreliable.
\item Reliability cannot be judged.
\end{enumerate}
Credibility of Information:
\begin{enumerate}[label=\arabic*., align=left]
\item Confirmed by other sources.
\item Probably true.
\item Possibly true.
\item Doubtful.
\item Improbable.
\item Truth cannot be judged.
\end{enumerate}
\\ \hline
\textbf{K} & \texttt{combat effectiveness} & Effectiveness of unit or equipment displayed.
\begin{enumerate}[label=\arabic*., align=left]
\item Fully operational.
\item Substantially operational.
\item Marginally operational.
\item Not operational.
\end{enumerate} \\ \hline
\textbf{SE} & \texttt{signature equipment} & Identifies a detectable electronic signature \lq\lq{}!\rq\rq{} for hostile equipment. \\ \hline
\textbf{P} & \texttt{identification} & Identification modes and codes.\\ \hline
\textbf{T} & \texttt{unique designation} & An alphanumeric designator that uniquely identifies a particular model of equipment (number).\\ \hline
\textbf{V} & \texttt{type of equipment} & Identifies unique designation (such as AH-64 for attack helicopter).\\ \hline
\textbf{W} & \texttt{date-time group} & An alphanumeric designator for displaying a date-time group (DDHHMMSSZMONYY) or \lq\lq{}O/O\rq\rq{} for on order. The date-time group is composed of a group of six numeric digits with a time zone suffix and the standardized three-letter abbreviation for the month followed by two digits. The first pair of digits represents the day; the second pair, the hour; the third pair, the minutes. The last two digits of the year are after the month. For automated systems, two digits may be added before the time zone suffix and after the minutes to designate seconds.\\ \hline
\textbf{X} & \texttt{altitude value} & Altitude as displayed on the global positioning system (GPS). \\ \hline
\textbf{Y} & \texttt{location} & Latitude and longitude; grid coordinates. \\ \hline
\textbf{AF} & \texttt{common identifier} & Example: Paladin for the M109A6 howitzer or Leopard for the KPz-70 tank. (Use NATO code name for hostile common identifiers.) \\ \hline
\textbf{Z} & \texttt{speed} & Displays speed in nautical miles per hour or kilometres per hour. \\ \hline
\textbf{AD} & \texttt{platform type} & Electronic intelligence notation (ELNOT) or communications intelligence notation (CENOT).\\ \hline
\textbf{AE} & \texttt{equipment teardown time} & Equipment teardown time in minutes.\\ \hline
\multicolumn{3}{c}{}\\
\caption{Description of \textbf{\texttt{MilLand}} text field amplifiers.}
\label{equiptexttable}
\end{tabularx}
\end{center}
\newpage\subsection{Installation Command (\textbf{\texttt{MilInstallation}})}
This command covers symbols for land installations, sites that incorporate permanent, semi-permanent, and temporary structures. \textit{The \texttt{lower} key is not used as there are no lower modifiers.} See \textit{Chapter 3, Section 4} in \DocLink.
\subsubsection{Icons and Modifiers}
\paragraph{\texttt{Main}}\quad
\input{manual_scripts/Installation_Main_table.tex}
\newpage\paragraph{\texttt{Upper}}\quad
\input{manual_scripts/Installation_Upper_table.tex}
\subsubsection{Amplifiers}
\paragraph{Text Fields}
\textbf{\texttt{MilInstallation}} has 12 text field amplifiers, as shown in Figure \ref{installtext}. \textit{Some of these amplifiers are placed adjacent to each other, spaces are not automatically inserted between them.} Table \ref{installtexttable} gives the key and description of each field, along with the standard prefixes to use. This table is mostly identical to the one found in \DocLink.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\MilInstallation[faction=friendly, main=civilian telecommunications, upper=radio, staff comments=\qquad G, additional information= \qquad H, higher formation= \qquad M, evaluation rating=\qquad J, capacity of installation=\textbackslash K, unique designation=T \qquad~, country indicator=\qquad AC, installation composition=AI \qquad~, date-time group=W \qquad~, altitude value=X, location=\textbackslash Y \qquad~, speed=Z \qquad~, installation composition=AI \qquad~, scale=2]
\end{tikzpicture}
\caption{Location of \textbf{\texttt{MilInstallation}} text field amplifiers.}
\label{installtext}
\end{figure}
\begin{center}
\begin{tabularx}{\textwidth}{|c|l|X|}
\hline
\thead{Location} & \thead{Key} & \thead{Description} \\ \hline
\textbf{AC} & \texttt{country indicator} & A three-letter code that indicates the country of origin of the unit (STANAG 1059). In stability activities, this field can be used for factions or groups.\\ \hline
\textbf{G} & \texttt{staff comments} & Free text. Can be used by staff for information required by commander.\\ \hline
\textbf{H} & \texttt{additional information} & Free Text.\\ \hline
\textbf{M} & \texttt{higher formation} & Number or title of higher echelon command of unit being displayed. \\ \hline
\textbf{J} & \texttt{evaluation rating} & Degree of confidence that may be placed on the information represented by the symbol. It is shown as one letter and one number made up of Reliability of Source and Credibility of Information. (STANAG 2511). \newline
Reliability of Source:
\begin{enumerate}[label=\Alph*., align=left]
\item Completely reliable.
\item Usually reliable.
\item Fairly reliable.
\item Not usually reliable.
\item Unreliable.
\item Reliability cannot be judged.
\end{enumerate}
Credibility of Information:
\begin{enumerate}[label=\arabic*., align=left]
\item Confirmed by other sources.
\item Probably true.
\item Possibly true.
\item Doubtful.
\item Improbable.
\item Truth cannot be judged.
\end{enumerate}
\\ \hline
\textbf{K} & \texttt{capacity of installation} & Capacity of installation displayed. \\ \hline
\textbf{T} & \texttt{unique designation} & An alphanumeric designator that uniquely identifies a particular installation (name).\\ \hline
\textbf{W} & \texttt{date-time group} & An alphanumeric designator for displaying a date-time group (DDHHMMSSZMONYY) or \lq\lq{}O/O\rq\rq{} for on order. The date-time group is composed of a group of six numeric digits with a time zone suffix and the standardized three-letter abbreviation for the month followed by two digits. The first pair of digits represents the day; the second pair, the hour; the third pair, the minutes. The last two digits of the year are after the month. For automated systems, two digits may be added before the time zone suffix and after the minutes to designate seconds.\\ \hline
\textbf{X} & \texttt{altitude value} & Height in feet of equipment or structure on the ground. \\ \hline
\textbf{Y} & \texttt{location} & Latitude and longitude; grid coordinates. \\ \hline
\textbf{Z} & \texttt{speed} & Displays speed in nautical miles per hour or kilometres per hour. \\ \hline
\textbf{AI} & \texttt{installation composition} & Indicates the component type of the installation:
\begin{itemize}
\item Development.
\item Research.
\item Production.
\item Service.
\item Storage.
\item Utility.
\end{itemize}\\ \hline
\multicolumn{3}{c}{}\\
\caption{Description of \textbf{\texttt{MilInstallation}} text field amplifiers.}
\label{installtexttable}
\end{tabularx}
\end{center}
\newpage\subsection{Sea Surface Command (\textbf{\texttt{MilSeaSurface}})}
This command covers symbols for units, equipment, and objects of maritime surface operations. See \textit{Chapter 4, Section 1} in \DocLink.
\subsubsection{Icons and Modifiers}
\paragraph{\texttt{Main}}\quad
\input{manual_scripts/SeaSurface_Main_table.tex}
\newpage\paragraph{\texttt{Upper}}\quad
\input{manual_scripts/SeaSurface_Upper_table.tex}
\newpage\paragraph{\texttt{Lower}}\quad
\input{manual_scripts/SeaSurface_Lower_table.tex}
\subsubsection{Amplifiers}
\paragraph{Text Fields}
\textbf{\texttt{MilSeaSurface}} has 6 text field amplifiers, as shown in Figure \ref{seasurfacetext}. \textit{Some of these amplifiers are placed adjacent to each other, spaces are not automatically inserted between them.} Table \ref{seasurfacetexttable} gives the key and description of each field, along with the standard prefixes to use. This table is mostly identical to the one found in \DocLink.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\MilSeaSurface[faction=friendly, main=law enforcement vessel, scale=2, track number=\qquad A, name=\qquad B, position and movement=\qquad C, identification=\qquad D, additional information=\qquad E, date-time group=\textbackslash F]
\end{tikzpicture}
\caption{Location of \textbf{\texttt{MilSeaSurface}} text field amplifiers.}
\label{seasurfacetext}
\end{figure}
\begin{table}[H]
\centering
\begin{tabularx}{\textwidth}{|c|l|X|c|}
\hline
\thead{Location} & \thead{Key} & \thead{Description} & \thead{Prefix*}\\ \hline
\textbf{A} & \texttt{track number} & System Track Number. & TN \\ \hline
\textbf{B} & \texttt{name} & Ships Name, Hull Number or Task Organization Designator (military only), Mission / International call sign. & \\ \hline
\textbf{C} & \texttt{position and movement} & Course [degrees]/Speed [knots] or Bearing [degrees]/Distance [nautical miles]. & C/S, B/D \\ \hline
\textbf{D} & \texttt{identification} & Country of origin (STANAG 1059 - 3-letter code) or Organization (e.g. UN, NATO, EU), Any other information (e.g. IFF / AIS). & \\ \hline
\textbf{E} & \texttt{additional information} & For friendly units: Sensor or Weapon load, endurance, etc. For other Units: Credibility of Information. & \\ \hline
\textbf{F} & \texttt{date-time group} & An alphanumeric designator for displaying a date-time group (DDHHMMSSZMONYY) or \lq\lq{}O/O\rq\rq{} for on order. The date-time group is composed of a group of six numeric digits with a time zone suffix and the standardized three-letter abbreviation for the month followed by two digits. The first pair of digits represents the day; the second pair, the hour; the third pair, the minutes. The last two digits of the year are after the month. For automated systems, two digits may be added before the time zone suffix and after the minutes to designate seconds. & \\ \hline
\end{tabularx}
\begin{tablenotes}
\item *when applicable.
\end{tablenotes}
\caption{Description of \textbf{\texttt{MilSeaSurface}} text field amplifiers.}
\label{seasurfacetexttable}
\end{table}
\subsection{Own Ship Command (\textbf{\texttt{OwnShip}})}
This command places a marker indicating the position of the vessel the user is on, if they are at sea. No keys are available other than \texttt{scale}. See \textit{Chapter 4, Section 1, Table 4-7} in \DocLink.
\begin{figure}[H]
\centering
\tikz{\OwnShip[scale=2]}
\caption{\textbf{\texttt{OwnShip}} command symbol.}
\end{figure}
\newpage\subsection{Sea Subsurface Command (\textbf{\texttt{MilSeaSubsurface}})}
This command covers symbols for units, equipment, and objects of maritime sub surface operations. See \textit{Chapter 4, Section 2} in \DocLink.
\subsubsection{Icons and Modifiers}
\paragraph{\texttt{Main}}\quad
\input{manual_scripts/SeaSubsurface_Main_table.tex}
\newpage\paragraph{\texttt{Upper}}\quad
\input{manual_scripts/SeaSubsurface_Upper_table.tex}
\newpage\paragraph{\texttt{Lower}}\quad
\input{manual_scripts/SeaSubsurface_Lower_table.tex}
\subsubsection{Amplifiers}
\paragraph{Text Fields}
\textbf{\texttt{MilSeaSuburface}} has 6 text field amplifiers, as shown in Figure \ref{seasubsurfacetext}. \textit{Some of these amplifiers are placed adjacent to each other, spaces are not automatically inserted between them.} Table \ref{seasubsurfacetexttable} gives the key and description of each field, along with the standard prefixes to use. This table is mostly identical to the one found in \DocLink.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\MilSeaSubsurface[faction=friendly, main=torpedo, scale=2, track number=\qquad A, name=\qquad B, position and movement=\qquad C, identification=\qquad D, additional information=\qquad E, date-time group=\textbackslash F]
\end{tikzpicture}
\caption{Location of \textbf{\texttt{MilSeaSubsurface}} text field amplifiers.}
\label{seasubsurfacetext}
\end{figure}
\begin{table}[H]
\centering
\begin{tabularx}{\textwidth}{|c|l|X|c|}
\hline
\thead{Location} & \thead{Key} & \thead{Description} & \thead{Prefix*}\\ \hline
\textbf{A} & \texttt{track number} & System Track Number. & TN \\ \hline
\textbf{B} & \texttt{name} & Ships Name, Hull Number or Task Organization Designator (military only), Mission / International call sign. & \\ \hline
\textbf{C} & \texttt{position and movement} & Course [degrees]/Speed [knots] or Bearing [degrees]/Distance [nautical miles] Height [feet/metres]. & C/S, B/D \\ \hline
\textbf{D} & \texttt{identification} & Country of origin (STANAG 1059 - 3-letter code) or Organization (e.g. UN, NATO, EU), Any other information (e.g. IFF / AIS). & \\ \hline
\textbf{E} & \texttt{additional information} & For friendly units: Sensor or Weapon load, endurance, etc. For other Units: Credibility of Information. For submarine contacts: Classification:
\begin{itemize}
\item NONSUB
\item POSSUB LOW 1 or 2
\item POSSUB HIGH 3 or 4
\item PROBSUB
\item CERTSUB
\end{itemize}
& \\ \hline
\textbf{F} & \texttt{date-time group} & An alphanumeric designator for displaying a date-time group (DDHHMMSSZMONYY) or \lq\lq{}O/O\rq\rq{} for on order. The date-time group is composed of a group of six numeric digits with a time zone suffix and the standardized three-letter abbreviation for the month followed by two digits. The first pair of digits represents the day; the second pair, the hour; the third pair, the minutes. The last two digits of the year are after the month. For automated systems, two digits may be added before the time zone suffix and after the minutes to designate seconds. & \\ \hline
\end{tabularx}
\begin{tablenotes}
\item *when applicable.
\end{tablenotes}
\caption{Description of \textbf{\texttt{MilSeaSubsurface}} text field amplifiers.}
\label{seasubsurfacetexttable}
\end{table}
\subsection{Sea Mine Command (\textbf{\texttt{MilMine}})}
This command is used to construct sea mine symbols. Instead of using the \texttt{main} key, this command uses the key \texttt{mine} to define the mine type, and the boolean switch \texttt{neutralised} to display the neutralised variant, as shown in Table \ref{mine}. No modifiers are used. This command also accepts the \texttt{no frame} key. See \textit{Chapter 4, Section 2, Table 4-17} in \DocLink.
\begin{table}[H]
\centering
\begin{tabular}{|l|c|c|c|c|c|c|}
\hline
\multirow{3}{*}{\thead{Value}} & \multicolumn{2}{c|}{\thead{Glyph}} & \multicolumn{4}{c|}{\multirow{3}{*}{\thead{Examples}}}\\ \cline{2-3}
& \thead{Normal} & \thead{\texttt{neutralised}} & \multicolumn{4}{c|}{}\\
\hline
\texttt{free} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=none, mine=free]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=none, mine=free, neutralised]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=friendly, mine=free]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=hostile, mine=free]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=neutral, mine=free]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=unknown, mine=free]}}\\ \hline
\texttt{bottomed} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=none, mine=bottomed]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=none, mine=bottomed, neutralised]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=friendly, mine=bottomed]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=hostile, mine=bottomed]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=neutral, mine=bottomed]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=unknown, mine=bottomed]}}\\ \hline
\texttt{moored} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=none, mine=moored]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=none, mine=moored, neutralised]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=friendly, mine=moored]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=hostile, mine=moored]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=neutral, mine=moored]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=unknown, mine=moored]}}\\ \hline
\texttt{floating} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=none, mine=floating]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=none, mine=floating, neutralised]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=friendly, mine=floating]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=hostile, mine=floating]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=neutral, mine=floating]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=unknown, mine=floating]}}\\ \hline
\texttt{in other position} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=none, mine=in other position]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=none, mine=in other position, neutralised]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=friendly, mine=in other position]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=hostile, mine=in other position]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=neutral, mine=in other position]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=unknown, mine=in other position]}}\\ \hline
\texttt{rising} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=none, mine=rising]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=none, mine=rising, neutralised]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=friendly, mine=rising]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=hostile, mine=rising]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=neutral, mine=rising]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilMine[faction=unknown, mine=rising]}}\\ \hline
\end{tabular}
\caption{Table of \textbf{\texttt{MilMine}} icons.}
\label{mine}
\end{table}
\subsubsection{Amplifiers}
\paragraph{Text Fields}
Text fields for \textbf{\texttt{MilMine}} are identical to \textbf{\texttt{MilSeaSubsurface}}.
\newpage\subsection{Space Command (\textbf{\texttt{MilSpace}})}
This command covers symbols for space assets, related activities and other relevant objects (debris) within earth orbit. See \textit{Chapter 5, Section 1 and 2} in \DocLink.
\subsubsection{Icons and Modifiers}
\paragraph{\texttt{Main}}\quad
\input{manual_scripts/Space_Main_table.tex}
\newpage\paragraph{\texttt{Upper}}\quad
\input{manual_scripts/Space_Upper_table.tex}
\newpage\paragraph{\texttt{Lower}}\quad
\input{manual_scripts/Space_Lower_table.tex}
\subsubsection{Amplifiers}
\paragraph{Text Fields}
\textbf{\texttt{MilSpace}} has 5 text field amplifiers, as shown in Figure \ref{spacetext}. \textit{Some of these amplifiers are placed adjacent to each other, spaces are not automatically inserted between them.} Table \ref{spacetexttable} gives the key and description of each field, along with the standard prefixes to use. This table is mostly identical to the one found in \DocLink.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\MilSpace[faction=friendly, main=military space station, scale=2, track number=\qquad A, name=\qquad B, position and movement=\qquad C, nation=\qquad D, additional information=\qquad E]
\end{tikzpicture}
\caption{Location of \textbf{\texttt{MilSpace}} text field amplifiers.}
\label{spacetext}
\end{figure}
\begin{table}[H]
\centering
\begin{tabularx}{\textwidth}{|c|l|X|c|}
\hline
\thead{Location} & \thead{Key} & \thead{Description} & \thead{Prefix*}\\ \hline
\textbf{A} & \texttt{track number} & Space System Track Number. & SSTN \\ \hline
\textbf{B} & \texttt{name} & Space System Name or Mission call sign. & \\ \hline
\textbf{C} & \texttt{position and movement} & Georef Position [degrees]/Inclination] or Trajectory, Height [feet/orbit]. &\\ \hline
\textbf{D} & \texttt{nation} & Nation\rq{}s Name: A 3-letter code indicating the object\rq{}s country of origin (STANAG 1059). & \\ \hline
\textbf{E} & \texttt{additional information} & For friendly units: Sensor or Weapon load, specific orbit, footprint etc. For other Units: Credibility of Information. & \\ \hline
\end{tabularx}
\begin{tablenotes}
\item *when applicable.
\end{tablenotes}
\caption{Description of \textbf{\texttt{MilSpace}} text field amplifiers.}
\label{spacetexttable}
\end{table}
\subsection{Space Debris Command (\textbf{\texttt{MilDebris}})}
This command is used to construct symbols that represent space debris. No shared keys are used other than \texttt{scale}. This command uses the key \texttt{size} to define the debris size, and the boolean switch \texttt{man made} to display the variant for artificial debris, as shown in Table \ref{debris}. See \textit{Chapter 5, Section 3, Table 5-7} in \DocLink.
\begin{table}[H]
\centering
\begin{tabular}{|l|c|c|}
\hline
\multirow{3}{*}{\thead{Value}} & \multicolumn{2}{c|}{\thead{Glyph}} \\ \cline{2-3}
& \thead{Normal} & \thead{\texttt{man made}}\\ \hline
\texttt{small} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilDebris[size=small]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilDebris[size=small, man made]}}\\ \hline
\texttt{medium} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilDebris[size=medium]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilDebris[size=medium, man made]}}\\ \hline
\texttt{large} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilDebris[size=large]}} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\MilDebris[size=large, man made]}}\\ \hline
\end{tabular}
\caption{Table of \textbf{\texttt{MilDebris}} symbols.}
\label{debris}
\end{table}
\newpage\subsection{Activity Command (\textbf{\texttt{MilActivity}})}
This command covers symbols that provide the capability to depict stability activities and civil support activities across the continuum of operations. \textit{The \texttt{lower} key is not used as there are no lower modifiers.} See \textit{Chapter 6} in \DocLink.
\subsubsection{Icons and Modifiers}
\paragraph{\texttt{Main}}\quad
\input{manual_scripts/Activity_Main_table.tex}
\newpage\paragraph{\texttt{Upper}}\quad
\input{manual_scripts/Activity_Upper_table.tex}
\subsubsection{Amplifiers}
\paragraph{Text Fields}
\textbf{\texttt{MilActivity}} has 6 text field amplifiers, as shown in Figure \ref{activitytext}. \textit{Some of these amplifiers are placed adjacent to each other, spaces are not automatically inserted between them.} Table \ref{activitytexttable} gives the key and description of each field, along with the standard prefixes to use. This table is mostly identical to the one found in \DocLink.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\MilActivity[faction=friendly, main=explosion, staff comments=\qquad G, additional information=\qquad H, evaluation rating=\qquad J, date-time group=W \qquad~, location=Y \qquad~, country indicator=\qquad AC, scale=2]
\end{tikzpicture}
\caption{Location of \textbf{\texttt{MilActivity}} text field amplifiers.}
\label{activitytext}
\end{figure}
\begin{center}
\begin{tabularx}{\textwidth}{|c|l|X|}
\hline
\thead{Location} & \thead{Key} & \thead{Description} \\ \hline
\textbf{AC} & \texttt{country indicator} & A three-letter code that indicates the country of origin of the unit (STANAG 1059). In stability activities, this field can be used for factions or groups.\\ \hline
\textbf{G} & \texttt{staff comments} & Free text. Can be used by staff for information required by commander.\\ \hline
\textbf{H} & \texttt{additional information} & Free Text.\\ \hline
\textbf{J} & \texttt{evaluation rating} & Degree of confidence that may be placed on the information represented by the symbol. It is shown as one letter and one number made up of Reliability of Source and Credibility of Information. (STANAG 2511). \newline
Reliability of Source:
\begin{enumerate}[label=\Alph*., align=left]
\item Completely reliable.
\item Usually reliable.
\item Fairly reliable.
\item Not usually reliable.
\item Unreliable.
\item Reliability cannot be judged.
\end{enumerate}
Credibility of Information:
\begin{enumerate}[label=\arabic*., align=left]
\item Confirmed by other sources
\item Probably true
\item Possibly true
\item Doubtful
\item Improbable
\item Truth cannot be judged.
\end{enumerate}
\\ \hline
\textbf{W} & \texttt{date-time group} & An alphanumeric designator for displaying a date-time group (DDHHMMSSZMONYY) or \lq\lq{}O/O\rq\rq{} for on order. The date-time group is composed of a group of six numeric digits with a time zone suffix and the standardized three-letter abbreviation for the month followed by two digits. The first pair of digits represents the day; the second pair, the hour; the third pair, the minutes. The last two digits of the year are after the month. For automated systems, two digits may be added before the time zone suffix and after the minutes to designate seconds.\\ \hline
\textbf{Y} & \texttt{location} & Latitude and longitude; grid coordinates.\\ \hline
\multicolumn{3}{c}{}\\
\caption{Description of \textbf{\texttt{MilActivity}} text field amplifiers.}
\label{activitytexttable}
\end{tabularx}
\end{center}
\section{Custom Icons and Modifiers}
\subsection{\MilSymb\ TikZ Picture Directory Structure}
\begin{figure}[H]
\begin{forest}
for tree={
font=\ttfamily\footnotesize,
grow'=0,
child anchor=west,
parent anchor=south,
inner sep=0pt,
anchor=west,
calign=first,
edge path={
\noexpand\path [draw, \forestoption{edge}]
(!u.south west) +(7.5pt,0) |- node[] {} (.child anchor)\forestoption{edge label};
},
before typesetting nodes={
if n=1
{insert before={[,phantom]}}
{}
},
fit=band,
before computing xy={l=15pt},
}
[MilSymb
[text
[normal]
[squashed]
[small]
[smallsquashed]
]
[air
[main\ldots]
[upper\ldots]
[lower\ldots]
]
[land
[main\ldots]
[upper\ldots]
[lower\ldots]
]
[equipment
[main\ldots]
[mobility\ldots]
]
[installation
[main\ldots]
[upper\ldots]
]
[seasurface
[main\ldots]
[upper\ldots]
[lower\ldots]
]
[seasubsurface
[main\ldots]
[upper\ldots]
[lower\ldots]
[mine\ldots]
]
[space
[main\ldots]
[upper\ldots]
[lower\ldots]
]
[activity
[main\ldots]
[upper\ldots]
]
[multi
[main\ldots]
[upper\ldots]
[lower\ldots]
[upperlower\ldots]
]
[supply\ldots]
[custom\ldots]
]
\end{forest}
\caption{\MilSymb TikZ Picture Directory Structure.}
\label{directory}
\end{figure}
To add a custom icon or modifier, create a TikZ \texttt{.pic} in the \texttt{custom} directory using \texttt{tikzset}:
\begin{writett}
\begin{verbatim}
\makeatletter %required if using MilSymb@selectedfaction
\tikzset{
MilSymb custom/user icon/.pic={
custom TikZ drawing commands go here...
} %comma after bracket is needed if defining multiple .pic.
}
\makeatother %required if using MilSymb@selectedfaction
\begin{tikzpicture}
\MilLand[faction=hostile, main=user icon]
\end{tikzpicture}
\end{verbatim}
\end{writett}
You can also create your own sub directories, such as \texttt{custom/land/main/user icon}. This is recommended if you want to organise your custom shapes by symbol type and position.To use your icon or modifier in a command, simply use the path as the value for a icon or modifier key \texttt{\textbackslash MilLand[faction=friendly, main=path/to/user icon]}. The \texttt{main}, \texttt{upper} and \texttt{lower} keys all accept custom values, as well as the \texttt{left}, \texttt{right} and \texttt{mobility} keys where applicable.
\subsection{Drawing Bounds}
As specified in \DocLink, most icons and modifiers should fit within a template comprising of a regular octagon exactly \textbf{1} unit in width and \textbf{1} unit in height (with the exception of \textit{fullframe} icons and a few others). In commands that specify upper and lower modifiers, the \textbf{main} icon should not exceed a height of \textbf{0.2} units above and below its origin (the two horizontal dotted line in Figure \ref{octagon}). Similarly, the modifiers should also not extend into the area \textbf{0.2} units above and below the origin of the \textbf{main} icon. The key value \texttt{faction=none} on any \MilSymb command (apart from \texttt{OwnShip} or \texttt{MilDebris}, which do not have faction keys) will output this template instead of a frame.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\MilLand[faction=none, scale=4](0,0)(frame)
\dimline[line style={arrows={Triangle}-{Triangle}}, extension start length=0.75, extension end length=0.75, extension end style={thin, black}, extension start style={thin, black}]{($(frame.north) + (3, 0)$)}{($(frame.south) + (3, 0)$)}{1}
\dimline[line style={arrows={Triangle}-{Triangle}}, extension start length=0.5, extension end length=0.5, extension end style={thin, black}, extension start style={thin, black}]{($(frame.north) + (2.5, -1.2)$)}{($(frame.south) + (2.5, 1.2)$)}{0.4}
\dimline[line style={arrows={Triangle}-{Triangle}}, extension start length=0.55, extension end length=0.55, extension end style={thin, black}, extension start style={thin, black}]{($(frame.north) + (2.5, 0)$)}{($(frame.center) + (2.5, 0.8)$)}{0.3}
\dimline[line style={arrows={Triangle}-{Triangle}}, extension start length=0.55, extension end length=0.55, extension end style={thin, black}, extension start style={thin, black}]{($(frame.center) + (2.5, -0.8)$)}{($(frame.south) + (2.5, 0)$)}{0.3}
%\node {Main Anchor};
\draw[red] plot[only marks, mark=*] coordinates{(0,0) (0, 1.36) (0,-1.36)};
\node[anchor=east, inner sep=5pt, color=red] at (0,0) {Main Origin (0,0)};
\node[anchor=east, inner sep=5pt, color=red] at (0,1.36) {Upper Origin (0,0.34)};
\node[anchor=east, inner sep=5pt, color=red] at (0,-1.36) {Lower Origin (0,-0.34)};
\end{tikzpicture}
\caption{Dimensions of the octagon and origins of the icon and modifiers.}
\label{octagon}
\end{figure}
For the \texttt{\textbf{MilMissile}} command, the template is rotated 90\textdegree anticlockwise, and the \texttt{left} and \texttt{right} keys correspond to the \texttt{upper} and \texttt{lower} keys respectively. The \texttt{mobility} origin is located \textbf{0.1} units below the \texttt{south} anchor of the frame.
\subsection{Border Anchors}
\MilSymb\ defines an anchored bounding box named \textbf{\texttt{M}} around all frames. This has anchor points identical to the \texttt{rectangle} node in TikZ. These can be used as coordinates for drawing icons and modifiers relative to the edge of the frame.
\subsection{Faction Variants}
Most \textit{fullframe} icons have slight variations depending on the faction frame that is being used. To facilitate this, you can create a set of four TikZ \texttt{.pic} in faction sub directories, like so:\\
\noindent\texttt{custom/user icon/friendly/.pic}\\
\texttt{custom/user icon/hostile/.pic}\\
\texttt{custom/user icon/neutral/.pic}\\
\texttt{custom/user icon/unknown/.pic}\\
\subsection{Clipping}
For \textbf{\texttt{MilLand}} symbols, clipping commands are available to trim any icon or modfier to the inside of the frame. Use \texttt{\textbackslash clip \textbackslash clip<faction>} within the drawing commands to clip anything specified after the command to the frame.
Then, insert \texttt{/\textbackslash MilSymb@selectedfaction} directly after the \texttt{path/to/user icon} (so it forms \texttt{path/to/user icon/\textbackslash MilSymb@selectedfaction}). \texttt{\textbackslash MilSymb@selectedfaction} will be replaced by the name of the faction, and complete the path to the icon.
\subsection{Using Existing Icons and Modifiers}
To insert an existing icon or modifier into your custom icon use a nested \texttt{.pic} as so: \texttt{\textbackslash pic\{MilSymb category/position/name\}}, where \texttt{command} generally refers to the \MilSymb\ command it is used in as displayed in Figure \ref{directory}, and \texttt{position} refers to . The exceptions are \texttt{supply}, which contains supply icons detailed in \ref{supply}, \texttt{text} which provides common text templates as detailed in \ref{text}, and \texttt{multi} which is detailed in \ref{multi}. \texttt{mine} is also contained in a sub-directory of \texttt{seasubsurface}, instead of its own directory. \texttt{\textbf{MilDebris}} does not use any icons or modifiers, all drawing syntax is contained within the command.
\subsubsection{Text Templates}
\label{text}
\MilSymb\ uses 4 standard text templates for commonly used text in icons and modifiers. Use regular TikZ text syntax for any variations. You can use them by nesting a \texttt{.pic} as before, but adding \texttt{=\{text to display\}} as a suffix, as in \texttt{\textbackslash pic\{MilSymb text/type=\{text to display\}\}}. Note that conventionally up to 3 characters are designed to be used with normal text, and up to 4 with \lq\lq{}squashed\rq\rq{} versions, in order to appear similar to \DocLink guidelines. Any more characters should use a smaller font.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\matrix[column sep=5mm, row sep=5mm]{
\begin{scope}[scale=2, transform shape]
\MilLand[faction=none]
\pic{MilSymb text/normal={Text}};
\end{scope}
&
\begin{scope}[scale=2, transform shape]
\MilLand[faction=none]
\pic{MilSymb text/squashed={Text}};
\end{scope}
&
\begin{scope}[scale=2, transform shape]
\MilLand[faction=none]
\pic at (0, 0.34) {MilSymb text/small={Text}};
\end{scope}
&
\begin{scope}[scale=2, transform shape]
\MilLand[faction=none]
\pic at (0, 0.34) {MilSymb text/smallsquashed={Text}};
\end{scope}
\\
\node{\texttt{text/normal}}; & \node{\texttt{text/squashed}}; & \node{\texttt{text/small}}; & \node{\texttt{text/smallsquashed}}; \\
};
\end{tikzpicture}
\caption{\MilSymb\ text templates.}
\end{figure}
\subsubsection{Multiple Class}
\label{multi}
Some \MilSymb\ icons and modifiers are used in more than one command. In order to avoid code duplication, these are put in their own directory named \texttt{multi} with a single name, even though different aliases may be used in each command. The \texttt{upperlower} sub-directory is used to store modifier glyphs that are used in both the \texttt{upper} and \texttt{lower} positions.
\begin{tabularx}{\linewidth}{|c|c|}
\hline
\thead{Name} & \thead{Glyph}\\ \hline
\texttt{multi/main/amphibious} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/amphibious}}}\\ \hline
\texttt{multi/main/antenna} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/antenna}}}\\ \hline
\texttt{multi/main/ammunition} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/ammunition}}}\\ \hline
\texttt{multi/main/armoured} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/armoured}}}\\ \hline
\texttt{multi/main/aviation fixed wing} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/aviation fixed wing}}}\\ \hline
\texttt{multi/main/aviation rotary wing} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/aviation rotary wing}}}\\ \hline
\texttt{multi/main/bridge} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/bridge}}}\\ \hline
\texttt{multi/main/chemical biological radiological nuclear} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/chemical biological radiological nuclear}}}\\ \hline
\texttt{multi/main/drill} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/drill}}}\\ \hline
\texttt{multi/main/decoy} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/decoy}}}\\ \hline
\texttt{multi/main/diver} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/diver}}}\\ \hline
\texttt{multi/main/engineer} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/engineer}}}\\ \hline
\texttt{multi/main/field artillery} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/field artillery}}}\\ \hline
\texttt{multi/main/individual} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/individual}}}\\ \hline
\texttt{multi/main/killing victim} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/killing victim}}}\\ \hline
\texttt{multi/main/maintenance} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/maintenance}}}\\ \hline
\texttt{multi/main/major end} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\path[local bounding box=M] (-0.5, -0.5) rectangle (0.5, 0.5); \pic{MilSymb multi/main/major end}}}\\ \hline
\texttt{multi/main/medic} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/medic}}}\\ \hline
\texttt{multi/main/medical} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\path[local bounding box=M] (-0.5, -0.5) rectangle (0.5, 0.5); \pic{MilSymb multi/main/medical}}}\\ \hline
\texttt{multi/main/medical treatment facility} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\path[local bounding box=M] (-0.5, -0.5) rectangle (0.5, 0.5); \pic{MilSymb multi/main/medical treatment facility}}}\\ \hline
\texttt{multi/main/missile} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/missile}}}\\ \hline
\texttt{multi/main/naval} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/naval}}}\\ \hline
\texttt{multi/main/person} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/person}}}\\ \hline
\texttt{multi/main/petroleum oil and lubricants} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/petroleum oil and lubricants}}}\\ \hline
\texttt{multi/main/psychological operations} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/psychological operations}}}\\ \hline
\texttt{multi/main/psychological operations filled} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/psychological operations filled}}}\\ \hline
\texttt{multi/main/radar} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/radar}}}\\ \hline
\texttt{multi/main/repair parts} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/repair parts}}}\\ \hline
\texttt{multi/main/sailing boat} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/sailing boat}}}\\ \hline
\texttt{multi/main/sensor} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/sensor}}}\\ \hline
\texttt{multi/main/signal} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/signal/neutral}}}\\ \hline
\texttt{multi/main/transportation} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/transportation}}}\\ \hline
\texttt{multi/main/victim of an attempted crime} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/victim of an attempted crime}}}\\ \hline
\texttt{multi/main/water} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/water}}}\\ \hline
\texttt{multi/main/water purification} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/main/water purification}}}\\ \hline
\texttt{multi/upper/naval} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/upper/naval}}}\\ \hline
\texttt{multi/upper/medic} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/upper/medic}}}\\ \hline
\texttt{multi/upper/runway} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/upper/runway}}}\\ \hline
\texttt{multi/lower/pack animal} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/lower/pack animal}}}\\ \hline
\texttt{multi/upperlower/maintenance} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/upperlower/maintenance}}}\\ \hline
\texttt{multi/upperlower/railroad} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb multi/upperlower/railroad}}}\\ \hline
\multicolumn{2}{c}{}\\
\caption{Table of Multiple Class Icons and Modifiers}
\end{tabularx}
\subsubsection{Hidden Glyphs}
There are some \texttt{.pic} that are not used as an icon or modifier directly, but are used to construct other icons or modifiers because they are used multiple times.
\begin{table}[H]
\centering
\begin{tabular}{|c|c|}
\hline
\thead{Name} & \thead{Glyph}\\ \hline
\texttt{equipment/main/weapon} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb equipment/main/weapon}}}\\ \hline
\texttt{equipment/main/air defence} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb equipment/main/air defence}}}\\ \hline
\texttt{equipment/main/anti tank} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb equipment/main/anti tank}}}\\ \hline
\texttt{equipment/main/high trajectory indirect fire weapons system} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb equipment/main/high trajectory indirect fire weapons system}}}\\ \hline
\texttt{equipment/main/side bands} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb equipment/main/side bands}}}\\ \hline
\texttt{equipment/main/single band} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb equipment/main/single band}}}\\ \hline
\texttt{equipment/main/double band} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb equipment/main/double band}}}\\ \hline
\texttt{equipment/main/triple band} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb equipment/main/triple band}}}\\ \hline
\texttt{seasubsurface/main/half sea mine} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb seasubsurface/main/half sea mine}}}\\ \hline
\texttt{seasubsurface/main/sea surface} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb seasubsurface/main/sea surface}}}\\ \hline
\texttt{supply/medicalbar} & \adjustbox{valign=m,margin=0.25cm}{\tikz{\pic{MilSymb supply/medicalbar/neutral}}}\\ \hline
\end{tabular}
\caption{Table of Hidden Glyphs}
\end{table}
\begin{landscape}
\section{Examples}
\subsection{Front Cover}
\begin{writett}
\fontsize{6}{0}\selectfont
\begin{verbatim}
\thispagestyle{empty}
\begin{center}
\begin{tikzpicture}[remember picture]
\coordinate (NE) at ($(current page text area.north east)-(1.5, 1.5)$);
\coordinate (NW) at ($(current page text area.north west)-(-1.5, 1.5)$);
\coordinate (SE) at ($(current page text area.south east)-(1.5, -1.5)$);
\coordinate (SW) at ($(current page text area.south west)-(-1.5, -1.5)$);
\MilLand[faction=hostile, echelon=team, main=infantry, scale=2](NE)
\MilAir[faction=friendly, main=military fixed wing, upper=jammer, lower=light, scale=2](NW)
\MilSeaSurface[faction=neutral, main=hazardous material transport ship, lower=fast, scale=2](SE)
\MilActivity[faction=unknown, main=searching, upper=house to house, scale=2](SW)
\MilLand[faction=unknown, echelon=battalion, main=armoured, upper=missile, lower=long range, scale=2]($(NE)!0.33!(NW)$)
\MilEquipment[faction=neutral, main=heavy machine gun, mobility=pack animal, scale=2]($(NE)!0.66!(NW)$)
\MilSpace[faction=hostile, main=military earth observation satellite, upper=low earth orbit, lower=radar, scale=2]($(SE)!0.33!(SW)$)
\MilInstallation[faction=friendly, main=electric power, upper=nuclear energy, scale=2]($(SE)!0.66!(SW)$)
\MilSeaSubsurface[faction=friendly, main=snorkelling submarine, upper=auxiliary, lower=nuclear type 5, scale=2]($(NE)!0.2!(SE)$)
\MilLand[faction=neutral, echelon=platoon, main=supply, supply={2}{4}, scale=2]($(NE)!0.4!(SE)$)
\MilActivity[faction=hostile, main=attempted criminal activity, upper=rape, scale=2]($(NE)!0.6!(SE)$)
\MilEquipment[faction=unknown, main=tank recovery vehicle, mobility=wheeled semi trailer, scale=2]($(NE)!0.8!(SE)$)
\MilMissile[faction=hostile, left=sub surface, right=launched, scale=2]($(NW)!0.2!(SW)$)
\MilInstallation[faction=unknown, main=civilian telecommunications, upper=television, scale=2]($(NW)!0.4!(SW)$)
\MilSpace[faction=friendly, main=civilian space station, upper=geosynchronous orbit, scale=2]($(NW)!0.6!(SW)$)
\MilLand[faction=neutral, echelon=corps, main=armoured, upper=missile, lower=long range, scale=2]($(NW)!0.8!(SW)$)
\pgfresetboundingbox
\path[use as bounding box] (0,0);
\end{tikzpicture}
{\let\newpage\relax\maketitle}
\end{center}
\end{verbatim}
\end{writett}
\end{landscape}
\subsection{1\textsuperscript{st} Marine Division (USA)}
\begin{figure}[H]
\centering
\input{manual_examples/mef.tex}
\caption{Recreation of Structure of 1\textsuperscript{st} US Marine Division. Sourced from \href{https://commons.wikimedia.org/wiki/File:1st_US_Marine_Division.png}{Wikipedia}}.
\label{org}
\end{figure}
\begin{landscape}
\begin{writett}
\fontsize{6}{0}\selectfont
\begin{verbatim}
\definecolor{salmon}{HTML}{F69289} %custom tank symbol colour
%custom icons
\makeatletter
\tikzset{
MilSymb custom/marine/.pic={
\pic{MilSymb land/main/infantry/\MilSymb@selectedfaction};
\clip \clipfriendly;
\pic[yshift=-10.75]{MilSymb land/main/amphibious/\MilSymb@selectedfaction};
},
MilSymb custom/tank/.pic={
\filldraw[fill=salmon]circle(0.5 and 0.15);
},
MilSymb custom/reconnaissance tank/.pic={
\pic{MilSymb custom/tank};
\pic{MilSymb land/main/reconnaissance/\MilSymb@selectedfaction};
},
MilSymb custom/amphibious tank/.pic={
\pic{MilSymb custom/tank};
\clip \clipfriendly;
\pic[yshift=-10.75]{MilSymb land/main/amphibious/\MilSymb@selectedfaction};
}
}
\makeatother
\fontsize{6}{0}\selectfont
\begin{tikzpicture}
% grid of symbols
\node(H) at (7,0){\includegraphics[width=1.5cm]{manual_examples/772px-1st_Marine_Division_insignia}};
\node[right of=H, node distance=1.85cm, align=left](HT){1\textsuperscript{st} Marine Division\\ CAMP PENDLETON};
\node[above of=H, star,star points=5, star point ratio=0.5, rotate=180, xshift=-3, fill=yellow, draw] {};
\node[above of=H, star,star points=5, star point ratio=0.5, rotate=180, xshift=3, fill=yellow, draw] {};
\MilLand[scale=0.75, faction=friendly, echelon=regiment, main=marine](3.5, -2)(C11){1\textsuperscript{st} Marine Rgt. \\ CAMP PENDLETON}
\MilLand[scale=0.75, faction=friendly, echelon=regiment, main=marine](7, -2)(C21){5\textsuperscript{th} Marine Rgt. \\ CAMP PENDLETON}
\MilLand[scale=0.75, faction=friendly, echelon=regiment, main=marine](10.5, -2)(C31){7\textsuperscript{th} Marine Rgt. \\ CAMP PENDLETON}
\MilLand[scale=0.75, faction=friendly, echelon=regiment, main=field artillery](14, -2)(C41){11\textsuperscript{th} Marine Rgt. \\ CAMP PENDLETON}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=headquarters](0, -3)(C02){Headquarters \\ Battalion}
\MilLand[scale=0.75, faction=friendly, echelon=company, main=headquarters](3.75, -3)(C12){~\\ HQ Coy.}
\MilLand[scale=0.75, faction=friendly, echelon=company, main=headquarters](7.25, -3)(C22){~\\ HQ Coy.}
\MilLand[scale=0.75, faction=friendly, echelon=company, main=headquarters](10.75, -3)(C32){~\\ HQ Coy.}
\MilLand[scale=0.75, faction=friendly, echelon=company, main=headquarters](14.25, -3)(C42){~\\ HQ Battery}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=tank](0, -4)(C03){1\textsuperscript{st} Tank \\ Battalion}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=marine](3.75, -4)(C13){1\textsuperscript{st} Btn. \\ 1\textsuperscript{st} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=marine](7.25, -4)(C23){1\textsuperscript{st} Btn. \\ 5\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=marine](10.75, -4)(C33){1\textsuperscript{st} Btn. \\ 7\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=field artillery](14.25, -4)(C43){1\textsuperscript{st} Btn. \\ 11\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=reconnaissance tank, lower=wheeled](0, -5)(C04){1\textsuperscript{st} Light Armoured \\ Reconnaissance Btn.}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=marine](3.75, -5)(C14){2\textsuperscript{nd} Btn. \\ 1\textsuperscript{st} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=marine](7.25, -5)(C24){2\textsuperscript{nd} Btn. \\ 5\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=marine](10.75, -5)(C34){2\textsuperscript{nd} Btn. \\ 7\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=field artillery](14.25, -5)(C44){2\textsuperscript{nd} Btn. \\ 11\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=reconnaissance tank, lower=wheeled](0, -6)(C05){3\textsuperscript{rd} Light Armoured \\ Reconnaissance Btn.}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=marine](3.75, -6)(C15){3\textsuperscript{rd} Btn. \\ 1\textsuperscript{st} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=marine](7.25, -6)(C25){3\textsuperscript{rd} Btn. \\ 5\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=marine](10.75, -6)(C35){3\textsuperscript{rd} Btn. \\ 7\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=field artillery](14.25, -6)(C45){3\textsuperscript{rd} Btn. \\ 11\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=reconnaissance](0, -7)(C06){1\textsuperscript{st} Reconnaissance \\ Battalion}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=marine](3.75, -7)(C16){1\textsuperscript{st} Btn. \\ 4\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=marine](7.25, -7)(C26){2\textsuperscript{nd} Btn. \\ 4\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=marine](10.75, -7)(C36){3\textsuperscript{rd} Btn. \\ 4\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=field artillery, upper=multiple rocket launcher, lower=wheeled](14.25, -7)(C46){5\textsuperscript{rd} Btn. 11\textsuperscript{th} Marines}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=engineer](0, -8)(C07){1\textsuperscript{st} Combat \\ Engineer Battalion}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=engineer](0, -9)(C08){3\textsuperscript{rd} Combat \\ Engineer Battalion}
\MilLand[scale=0.75, faction=friendly, echelon=battalion, main=amphibious tank](0, -10)(C09){3\textsuperscript{rd} Assault \\ Amphibian Battalion}
%connecting lines
\draw [shorten >=0.25cm] (H.south) |- ($(H.south)!0.5!(C11.north)$) -| (C11.north);
\draw [shorten >=0.25cm] (H.south) |- ($(H.south)!0.5!(C11.north)$) -| (C21.north);
\draw [shorten >=0.25cm] (H.south) |- ($(H.south)!0.5!(C11.north)$) -| (C31.north);
\draw [shorten >=0.25cm] (H.south) |- ($(H.south)!0.5!(C11.north)$) -| (C41.north);
\draw (H.south) |- ($(H.south)!0.5!(C11.north)$) -| ($(C02.west)+(-0.25, 0)$) -| (C02.west);
\draw (C11.south west) |- (C12.west);
\draw (C11.south west) |- (C13.west);
\draw (C11.south west) |- (C14.west);
\draw (C11.south west) |- (C15.west);
\draw (C11.south west) |- (C16.west);
\draw (C21.south west) |- (C22.west);
\draw (C21.south west) |- (C23.west);
\draw (C21.south west) |- (C24.west);
\draw (C21.south west) |- (C25.west);
\draw (C21.south west) |- (C26.west);
\draw (C31.south west) |- (C32.west);
\draw (C31.south west) |- (C33.west);
\draw (C31.south west) |- (C34.west);
\draw (C31.south west) |- (C35.west);
\draw (C31.south west) |- (C36.west);
\draw (C41.south west) |- (C42.west);
\draw (C41.south west) |- (C43.west);
\draw (C41.south west) |- (C44.west);
\draw (C41.south west) |- (C45.west);
\draw (C41.south west) |- (C46.west);
\draw (C02.west) -| ($(C02.west)+(-0.25, 0)$) |- (C03.west);
\draw (C03.west) -| ($(C02.west)+(-0.25, 0)$) |- (C04.west);
\draw (C04.west) -| ($(C02.west)+(-0.25, 0)$) |- (C05.west);
\draw (C05.west) -| ($(C02.west)+(-0.25, 0)$) |- (C06.west);
\draw (C06.west) -| ($(C02.west)+(-0.25, 0)$) |- (C07.west);
\draw (C07.west) -| ($(C02.west)+(-0.25, 0)$) |- (C08.west);
\draw (C08.west) -| ($(C02.west)+(-0.25, 0)$) |- (C09.west);
\end{tikzpicture}
\end{verbatim}
\end{writett}
\end{landscape}
\section{Control Measures}
Control Measures are planned to be included in the next major version of \MilSymb. Please see the \href{https://github.com/ralphieraccoon/MilSymb}{GitHub} repository for further information.
\end{document}
|
http://dlmf.nist.gov/11.6.E8e.tex
|
nist.gov
|
CC-MAIN-2018-05
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2018-05/segments/1516084892802.73/warc/CC-MAIN-20180123231023-20180124011023-00732.warc.gz
| 93,831,258
| 628
|
$c_{4}(\lambda)=70\lambda^{-8}-\tfrac{45}{2}\lambda^{-6}+\tfrac{3}{8}\lambda^{-%
4}.$
|
https://mirrorservice.org/sites/netlib.bell-labs.com/netlib/bibnet/authors/s/stenger-frank.ltx
|
mirrorservice.org
|
CC-MAIN-2022-40
|
text/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2022-40/segments/1664030334915.59/warc/CC-MAIN-20220926175816-20220926205816-00620.warc.gz
| 448,153,025
| 1,867
|
%%% -*-LaTeX-*-
%%% ====================================================================
%%% @LaTeX-file{
%%% author = "Nelson H. F. Beebe",
%%% version = "1.50",
%%% date = "07 April 2022",
%%% time = "07:46:06 MDT",
%%% filename = "stenger-frank.ltx",
%%% address = "University of Utah
%%% Department of Mathematics, 110 LCB
%%% 155 S 1400 E RM 233
%%% Salt Lake City, UT 84112-0090
%%% USA",
%%% telephone = "+1 801 581 5254",
%%% FAX = "+1 801 581 4148",
%%% URL = "http://www.math.utah.edu/~beebe",
%%% checksum = "28452 98 314 3611",
%%% email = "[email protected], [email protected],
%%% [email protected] (Internet)",
%%% codetable = "ISO/ASCII",
%%% keywords = "bibliography; BibTeX; Green's functions;
%%% integral equations; multigrid sync methods;
%%% numerical approximation; numerical
%%% integration; numerical quadrature; ordinary
%%% differential equations; partial differential
%%% equations; rational approximation; Sinc
%%% functions",
%%% license = "public domain",
%%% supported = "yes",
%%% docstring = "The checksum field above contains a CRC-16
%%% checksum as the first value, followed by the
%%% equivalent of the standard UNIX wc (word
%%% count) utility output of lines, words, and
%%% characters. This is produced by Robert
%%% Solovay's checksum utility.",
%%% }
%%% ====================================================================
\documentstyle[bibmods,bibnames,path,showtags]{article}
\ifx \undefined \booktitle \def \booktitle#1{{{\em #1}}} \fi
\ifx \undefined \Dbar \def \Dbar {\leavevmode\raise0.2ex\hbox{--}\kern-0.5emD} \fi
\ifx \undefined \hckudot
\def \hckudot#1{\ifmmode
\setbox7 \hbox{\accent20#1}%
\else
\setbox7 \hbox{\accent20#1}\penalty 10000 \relax
\fi
\raise 1\ht7 \hbox{\raise.2ex\hbox to 1\wd7{\hss.\hss}}%
\penalty 10000
\hskip -1\wd7 \penalty 10000\box7}
\fi
\pagestyle{headings}
\title{A Bibliography of Publications of Frank Stenger}
\author{%
Nelson H. F. Beebe\\
University of Utah\\
Department of Mathematics, 110 LCB\\
155 S 1400 E RM 233\\
Salt Lake City, UT 84112-0090\\
USA\\[\medskipamount]
Tel: +1 801 581 5254\\
FAX: +1 801 581 4148\\[\medskipamount]
E-mail: \protect\[email protected]=,
\protect\[email protected]=,\\
\hphantom{E-mail:\ }
\protect\[email protected]=,
\protect\[email protected]= (Internet)\\
WWW URL: \protect\path=http://www.math.utah.edu/~beebe/=
}
\date{07 April 2022 \\
Version 1.50}
\begin{document}
\nocite{*}
\bibliographystyle{is-unsrt}
\maketitle
\begin{abstract}
This bibliography records publications of Frank Stenger.
\end{abstract}
\section*{Title word cross-reference}
\begin{raggedright}
\parskip = \baselineskip
\input{\jobname.twx}
\end{raggedright}
\bibliography{\jobname}
\end{document}
|
http://dlmf.nist.gov/20.5.E5.tex
|
nist.gov
|
CC-MAIN-2017-17
|
application/x-tex
| null |
crawl-data/CC-MAIN-2017-17/segments/1492917120001.0/warc/CC-MAIN-20170423031200-00544-ip-10-145-167-34.ec2.internal.warc.gz
| 104,177,231
| 699
|
\[\mathop{\theta_{1}\/}\nolimits\!\left(z\middle|\tau\right)=\mathop{\theta_{1}%
\/}\nolimits'\!\left(0\middle|\tau\right)\mathop{\sin\/}\nolimits z\prod_{n=1}%
^{\infty}\frac{\mathop{\sin\/}\nolimits\!\left(n\pi\tau+z\right)\mathop{\sin\/%
}\nolimits\!\left(n\pi\tau-z\right)}{{\mathop{\sin\/}\nolimits^{2}}\!\left(n%
\pi\tau\right)},\]
|
https://unilab.gbb60166.jp/prekou/tex/ma-tama-20-8.tex
|
gbb60166.jp
|
CC-MAIN-2020-10
|
application/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2020-10/segments/1581875146714.29/warc/CC-MAIN-20200227125512-20200227155512-00018.warc.gz
| 561,696,496
| 3,724
|
%
% [email protected] https://unilab.gbb60166.jp/prekou/prekou.htm
%
% aspectratio= は 1610, 169, 149, 54, 32 の中から選べる(省略時は 43)
% C:\w32tex\share\texmf\tex\latex\beamer\beamer.cls
%\documentclass[20pt,dvipdfmx,hyperref={pdfpagemode=FullScreen},aspectratio=169]{beamer}
\documentclass[20pt,dvipdfmx,aspectratio=169]{beamer}
% pdfの栞の字化けを防ぐ
%\AtBeginDvi{\special{pdf:tounicode EUC-UCS2}}
% テーマ
\usetheme{Copenhagen}
% navi. symbolsは目立たないが,dvipdfmxを使うと機能しないので非表示に
\setbeamertemplate{navigation symbols}{}
\usepackage{bxdpx-beamer,pxjahyper,minijs}
%\usepackage{graphicx}
%\usepackage{amsmath}
%\usepackage{amssymb}
%\usepackage{tkokugo,furikana,tsayusen,shiika,sfkanbun,jdkintou,plext}
\usepackage{furikana,utf,bm,type1cm}
%\usepackage{tikzsymbols}
%\usepackage[dvipdfmx]{graphicx}%
\def\pgfsysdriver{pgfsys-dvipdfmx.def}%(graphicxパッケージを使用しない場合はこの行を有効に)
%\def\pgfsysdriver{pgfsys-dvips.def}%デフォルト
\usepackage{tikz}%(これで、pgfとpgfforが読み込まれます。)
%\usepackage{tikz-3dplot}
%\usetikzlibrary{calc}
%\usepackage{pgfplots}
%\usetikzlibrary{patterns,arrows.meta,intersections,through,backgrounds}
%\usepackage{animate}
%\usepackage{pgfplots}
%\pgfplotsset{compat=newest}
%\pgfplotsset{compat=newest, every axis/.append style={line width=1pt}}
%\PassOptionsToPackage{dvipdfmx}{graphicx}
%\PassOptionsToPackage{dvipdfmx}{color}
\nofiles
% フォントはお好みで
%\usepackage{txfonts}
\mathversion{bold}
\renewcommand{\familydefault}{\sfdefault}
% ■ 以前は{\bf }とかしてましたが \seriesdefault で一気に
% 変更出来ることがわかりました。2017/3/3
% ソースも書き換えるつもりですが、見落として{\bf }が
% 残ったままになるかもしれません。
\renewcommand{\seriesdefault}{bx}
\renewcommand{\kanjifamilydefault}{\gtdefault}
\setbeamerfont{title}{size=\normalsize,series=\bfseries}
\setbeamerfont{frametitle}{size=\normalsize,series=\bfseries}
\setbeamertemplate{frametitle}[default][center]
\usefonttheme{professionalfonts}
% 参考にしたURL
% http://windom.phys.hirosaki-u.ac.jp/fswiki/wiki.cgi?page=LaTeX+Beamer%A4%C7%A5%D7%A5%EC%A5%BC%A5%F3%A5%C6%A1%BC%A5%B7%A5%E7%A5%F3
\newcommand{\Slash}[1]{\ooalign{\hfil\kern-3pt/\hfil\crcr$#1$}}
\everymath{\displaystyle}
\def\maruwaku#1{\begin{tikzpicture}[scale=0.7, baseline={([yshift=-22pt] current bounding box.north)}]
\filldraw[color=CUDBlue, line width=1pt, rounded corners=2pt] (-0.1,0)--(2.1,0)--(2.1,1.1)--(-0.1,1.1)--cycle;
\draw(1,0.5) node[white]{#1};
\end{tikzpicture}
}
\setbeamersize{text margin left=5mm,text margin right=5mm}
\fboxrule=0.8pt
\makeatletter
\def\hooklen#1#2{\settowidth{\@tempdima}{\(#1\)}
%\advance\@tempdima by.3ex
% ↑ 数式モードで式の前後に入るスペースを制御したかったが、
% 難しいのでやめた。段々難解なコードになっているのでやめた方がよい?
\hbox to\@tempdima{\hfil \(#2\)\hfil}}
\makeatother
% カラーユニバーサルデザインを調べたつもりだがあまり自信がありません
% http://www.fukushihoken.metro.tokyo.jp/kiban/machizukuri/kanren/color.files/colorudguideline.pdf
% http://jfly.iam.u-tokyo.ac.jp/colorset/
% ■ アクセントカラー小面積を目立たせる高彩度色
\definecolor{CUDRed}{rgb}{1,0.2941,0}% RGB 255,75,0
\definecolor{CUDGreen}{rgb}{0.0118,0.6863,0.4784}% RGB 3,175,122
\definecolor{CUDBlue}{rgb}{0,0.3529,1}% RGB 0,90,255
\definecolor{CUDCyan}{rgb}{0.3020,0.7686,1}% RGB 77,196,255
\definecolor{CUDMagenta}{rgb}{0.6,0,0.6}% RGB 153,0,153
\definecolor{CUDYellow}{rgb}{1,0.9451,0}% RGB 255,241,0
\definecolor{CUDBrown}{rgb}{0.502,0.251,0}% RGB 128,64,0
\definecolor{CUDOrange}{rgb}{0.9647,0.6667,0}% RGB 246,170,0
% ■ ベースカラー広い面積の塗り分けに用いる低・中彩度色
\definecolor{CUDPink}{rgb}{1,0.7922,0.7490}% RGB 255,202,191
\definecolor{CUDBrightGreen}{rgb}{0.4667,0.8510,0.6588}%RGB 119,217,168
\definecolor{CUDLime}{rgb}{0.8471,0.9490,0.3333}% RGB 216,242,85
\definecolor{CUDCream}{rgb}{1,1,0.502}% RGB 255,255,128
\definecolor{CUDBrightCyan}{rgb}{0.7490,0.8941,1}% RGB 191,228,255
%\definecolor{CUD}{rgb}{}% RGB
\setbeamercolor{CUDBrightGreen}{fg=black,bg=CUDBrightGreen}
\setbeamercolor{CUDCream}{fg=black,bg=CUDCream}
\begin{document}
\title{プレ高数学科}\author{gbb60166}
%■■■■■■■■■■■■■ テスト領域 ■■■■■■■■■■■■■■
%\end{document}
%■■■■■■■■■■■■■ 完成品 ■■■■■■■■■■■■■■
\begin{frame}[t]
\frametitle{\small 白$7$\textcolor{CUDRed}{赤$3$}から$5$個取る
とき白の数が多い確率?\#$20$\ajKaku{8}}
\pause
\only<2>{$5$個取るときは、全部で$6$パターンある。\\ \text{}\\}
\only<3>{このうち\ \textcolor{CUDBlue}{白の個数\ \(>\)\ 赤の個数}\ は
次の$3$パターンだ!
}
\hspace*{5em}
\begin{minipage}[t]{10zw}
\small
\temporal<2>{}{\ajMaru{1} 白$5$個、赤$0$個}
{\textcolor{CUDBlue}{\ajMaru{1} 白$5$個、赤$0$個}}
\temporal<2>{}{\ajMaru{2} 白$4$個、赤$1$個}
{\textcolor{CUDBlue}{\ajMaru{2} 白$4$個、赤$1$個}}
\temporal<2>{}{\ajMaru{3} 白$3$個、赤$2$個}
{\textcolor{CUDBlue}{\ajMaru{3} 白$3$個、赤$2$個}}
\ajMaru{4} 白$2$個、赤$3$個
\ajMaru{5} 白$1$個、赤$4$個
\ajMaru{6} 白$0$個、赤$5$個
\end{minipage}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[t]
\frametitle{白$7$\textcolor{CUDRed}{赤$3$}から$5$個取るとき白の数が多い確率?}
\vskip-5ex
\begin{eqnarray*}
& & \colorbox{CUDBrightCyan}{白$5$}
+ \colorbox{CUDBrightCyan}{白$4$\textcolor{CUDRed}{赤$1$}}
+ \colorbox{CUDBrightCyan}{白$3$\textcolor{CUDRed}{赤$2$}}\\[1ex]
\pause
&=& { {}_{7} {\rm C}_5 \over {}_{10} {\rm C}_5}
+ {{}_{7} {\rm C}_4 \times \textcolor{CUDRed}{{}_{3} {\rm C}_1}
\over {}_{10} {\rm C}_5} %
+ {{}_{7} {\rm C}_3 \times \textcolor{CUDRed}{{}_{3} {\rm C}_2}
\over {}_{10} {\rm C}_5}\\[1ex]\pause
&=& { {}_{7} {\rm C}_5 \ + \ {}_{7} {\rm C}_4 \!\times\!
\textcolor{CUDRed}{{}_{3} {\rm C}_1}\ + \ {}_{7} {\rm C}_3 \!\times\!
\textcolor{CUDRed}{{}_{3} {\rm C}_2} %
\over {}_{10} {\rm C}_5}
\end{eqnarray*}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[t]
\frametitle{白$7$\textcolor{CUDRed}{赤$3$}から$5$個取るとき白の数が多い確率?}
\vskip-4ex
\begin{eqnarray*}
&=& { {}_{7} {\rm C}_5 \ + \ {}_{7} {\rm C}_4 \!\times\!
\textcolor{CUDRed}{{}_{3} {\rm C}_1}\
+ \ {}_{7} {\rm C}_3 \!\times\! \textcolor{CUDRed}{{}_{3} {\rm C}_2}
\over {}_{10} {\rm C}_5}\\[1ex] \pause
&=& {\ 21 + 105 + 105 \ \over 2\times9\times2\times7} \\[1ex] \pause
&=& { 231 \over\ 2\times9\times2\times7\ }
\end{eqnarray*}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[t]
\frametitle{白$7$\textcolor{CUDRed}{赤$3$}から$5$個取るとき白の数が多い確率?}
\vskip-4ex
\begin{eqnarray*}
&=& { 231 \over 2\times9\times2\times7}\quad
\colorbox{CUDCream}{\footnotesize\shortstack{
\( 2\!+\!3\!+\!1=6 \)が$3$で割り切れるので\\
\( 231 \)は$3$で割り切れる}} \\[1ex] \pause
&=& {77\over 2\times3\times2\times7} \\[1ex]
&=&{11\over 2\times3\times2} \quad ={11\over\,12\,}\ \text{\□答}
\end{eqnarray*}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
\textcolor{CUDRed}{
|
https://www.apmep.fr/IMG/tex/BTSgrB2mai2011.tex
|
apmep.fr
|
CC-MAIN-2021-10
|
text/x-tex
|
application/postscript
|
crawl-data/CC-MAIN-2021-10/segments/1614178357935.29/warc/CC-MAIN-20210226175238-20210226205238-00059.warc.gz
| 668,529,043
| 4,250
|
%!TEX encoding = UTF-8 Unicode
\documentclass[10pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{fourier}
\usepackage[scaled=0.875]{helvet}
\renewcommand{\ttdefault}{lmtt}
\usepackage{pgf,tikz,ifthen}
\usetikzlibrary{trees,calc}
\usepackage{amsfonts}
\usepackage{amstext,array}
\usepackage{t1enc,amsmath,amssymb}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{pstricks-add}
\usepackage{eurosym}
\usepackage{multicol}
\usepackage{rotate}
%Tapuscrit Emmanuel Vasse
\usepackage{epic}
\usepackage{eepic}
%\usepackage{latexcad}
\usepackage[latin1]{inputenc}%
\usepackage[french]{babel}
\usepackage[francais]{layout}
\usepackage{enumerate}
\usepackage{rotating}
\usepackage{tkz-tab}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\textwidth}{16cm}
\setlength{\hoffset}{-2cm}
\setlength{\headwidth}{\textwidth}
\setlength{\headheight}{15pt}
\setlength{\voffset}{-2cm}
\setlength{\textheight}{24.5cm}
\newcommand{\Oij}{$\left(O;\vec{\imath},\vec{\jmath}\right)$}
\newcommand{\R}{\text{$\mathbb{R}$}}
\everymath{\displaystyle}
\begin{document}
\marginpar{\rotatebox{90}{\textbf{A. P. M. E. P.}}}
\setlength\parindent{0mm}
\chead{Brevet de technicien supérieur}
\rhead{Session 2011}
\lfoot{Groupement B2 : conception et \\industrialisation en microtechniques}
%\cfoot{Page \thepage / \pageref{lastpage}}
\thispagestyle{empty}
\begin{center} {\Large \textbf{\decofourleft~Brevet de technicien supérieur~\decofourright\\session 10 mai 2011 - groupement B2}}
\end{center}
\vspace{0,25cm}
\textbf{EXERCICE 1 \hfill 12 points}
\begin{center}
\textbf{\emph{Les deux parties de cet exercice peuvent être traitées de façon indépendante.}}
\end{center}
\emph{A. Résolution d'une équation différentielle}
\medskip
On considère l'équation différentielle $(E) :~~ y^{\prime\prime} - 3y^{\prime} +2y = -2\text{e}^x + 6$ où $y$ est une fonction inconnue de la variable réelle $x$, définie et deux fois dérivable sur \R, $y^{\prime}$ la fonction dérivée de $y$ et $y^{\prime\prime} $ sa fonction dérivée seconde.
\medskip
\begin{enumerate}
\item
\begin{enumerate}
\item Résoudre dans \R~l'équation : $r^2 - 3r + 2 = 0$.
\item En déduire les solutions définies sur \R~de l'équation différentielle:
\[(E_0):~~y^{\prime\prime} - 3y^{\prime} + 2y = 0.\]
\end{enumerate}
\item Soit $g$ la fonction définie sur \R~par $g(x) = 2x \text{e}^x + 3$.
\begin{enumerate}
\item \emph{Cette question est une question à choix multiples. Une seule réponse est exacte.\\
Recopier sur la copie la réponse qui vous paraît exacte. On ne demande aucune
justification.\\
La réponse juste rapporte un point. Une réponse fausse ou une absence de réponse ne
rapporte ni n'enlève de point.}
La fonction dérivée $g^{\prime}$ de la fonction $g$ est définie sur \R{} par :
\begin{center}
\begin{tikzpicture}
\foreach \i/\texte in {1/$g^{\prime}(x) = 2 \text{e}^x$,2/$g^{\prime}(x) = 2x \text{e}^x$, 3/$g^{\prime}(x) = (2x + 2) \text{e}^x$}{
\node[draw,minimum width=5cm]()at(5*\i,0){\texte};}
\end{tikzpicture}
\end{center}
\item Démontrer que la fonction $g$ est une solution particulière de l'équation différentielle $(E)$.
\end{enumerate}
\item En déduire l'ensemble des solutions de l'équation différentielle $(E)$.
\item Déterminer la solution $f$ de l'équation différentielle $(E)$ qui vérifie les conditions initiales $f(0)=2$ et $f^{\prime}(0)=1$.
\end{enumerate}
\bigskip
\emph{B. Étude d'une fonction et calcul intégral}
\medskip
Soit $f$ la fonction définie sur \R~par $f(x) = (2x - 1) \text{e}^x + 3$. On note $\mathcal{C}$ sa courbe représentative dans le plan muni d'un repère orthogonal.
\medskip
\begin{enumerate}
\item
\begin{enumerate}
\item On admet le résultat suivant : $\lim_{x\to-\infty} xe^x=0$.
Calculer $\displaystyle\lim_{x\to-\infty} f(x)$.
\item En déduire que la courbe $\mathcal{C}$ admet une droite asymptote dont on donnera une équation.
\end{enumerate}
\item
\begin{enumerate}
\item Démontrer que le développement limité, à l'ordre 2, au voisinage de 0, de la fonction $f$ est : $f(x) = 2 + x + \frac{3}{2} x^2 + x^2 \varepsilon(x)$ avec $\lim_{x\to 0} \varepsilon(x) = 0$.
\item En déduire une équation de la tangente $T$ à la courbe $\mathcal{C}$ au point d'abscisse 0.
\item \emph{Cette question est une question à choix multiples. Une seule réponse est exacte.\\
Recopier sur la copie la réponse qui vous paraît exacte. On ne demande aucune
justification.\\
La réponse juste rapporte un point. Une réponse fausse ou une absence de réponse ne
rapporte ni n'enlève de point.}
On veut justifier qu'au voisinage du point d'abscisse 0, la courbe $\mathcal{C}$ est au-dessus de la droite $T$. Recopier sur votre copie la justification exacte.
\begin{center}
\begin{tikzpicture}
\foreach \i/\texte in {1/\begin{minipage}{3.1cm}{$\frac{3}{2}x^2$ est positif au voisinage de 0.}\end{minipage},2/\begin{minipage}{3.1cm}{$x^2 \varepsilon(x)$ est positif au voisinage de 0.}\end{minipage},3/\begin{minipage}{3.1cm}{$2 + x$ est positif au voisinage de 0.}\end{minipage}}{
\node[draw,minimum width=5cm,minimum height=1.6cm]()at(5*\i,0){\texte};}
\end{tikzpicture}
\end{center}
\end{enumerate}
\item On admet que la fonction dérivée de $f$ est donnée, pour tout $x$ réel, par: $f'(x) = (2x+1)e^x$.
\begin{enumerate}
\item Étudier sur \R~le signe de $f'(x)$ puis en déduire le sens de variation de $f$ sur \R.
\item Donner la valeur approchée arrondie à 0,01 du minimum de la fonction $f$.
\end{enumerate}
\item
\begin{enumerate}
\item On note $I=\int_0^{0,5}\left(2+x+\frac{3}{2}x^2\right)\text{d}x$.
Démontrer que $I= 1,1875$.
\item On note $K=\int_0^{0,5} (2x- 1)\text{e}^x\text{d}x$.
Démontrer, à l'aide d'une intégration par parties, que $K = 3 - 2\text{e}^{0,5}$.
\item On note $J= \int_0^{0,5} f(x) \text{d}x$.
En utilisant la question précédente, déterminer la valeur exacte de $J$.
\item Vérifier que $J - I$ est inférieur à $2 \times 10^{-2}$.
\end{enumerate}
\end{enumerate}
\vspace{0,5cm}
\textbf{EXERCICE 2}\hfill 8 points
\medskip
On considère un signal périodique correspondant à la fonction $f$ définie sur $\R$ et représentée sur le graphique fourni en annexe, pour tout réel $x$ de l'intervalle $[- 2\pi~;~2\pi]$.
\medskip
\emph{Les questions $1.$ et $2.$ sont des questions à choix multiples. Pour chaque question, une seule ~ réponse est exacte. Recopier sur la copie la réponse qui vous paraît exacte. On ne demande {}
aucune justification.\\
La réponse juste rapporte un point. Une réponse fausse ou une absence de réponsse ne rapporte ni n'enlève de point.}
\medskip
\begin{enumerate}
\item La fonction $f$ est :
\medskip
\begin{tabularx}{\linewidth}{|*{3}{>{\centering \arraybackslash}X|}}\hline
paire de période $\pi$& paire de période $2\pi$&impaire de p\'eriode $\pi$\\ \hline
\end{tabularx}
\medskip
\item Pour tout nombre réel $x$ de l'intervalle $[0~;~\pi], f(x) = \pi - x$.
Si $x$ appartient à l'intervalle $[- \pi~;~ 0], f(x)$ s'écrit :
\medskip
\begin{tabularx}{\linewidth}{|*{3}{>{\centering \arraybackslash}X|}}\hline
$f(x) =- x$& $f(x) = \pi + x$& $\rule[-3mm]{0mm}{9mm}f(x) = \dfrac{\pi}{2} + x$\\ \hline
\end{tabularx}
\medskip
\item On note $a_{0}$, et, pour tout entier naturel non nul $n, a_{n}$ et $b_{n}$ les coefficients de Fourier de la fonction $f$.
\begin{enumerate}
\item Justifier que pour tout $n$ non nul, $b_{n} = 0$.
\item Calculer l'intégrale $I = \displaystyle\int_{0}^{\pi} (\pi - x)\:\text{d}x$.
\item Montrer que $a_{0} = \dfrac{\pi}{2}$.
\end{enumerate}
\item
\begin{enumerate}
\item Un logiciel de calcul formel donne le résultat suivant :
$a_{n} = \dfrac{2}{\pi n^2} \left[1 - (- 1)^n\right]$ pour tout $n \geqslant 1$.
\textbf{Le résultat précédent n'est pas à démontrer.}
Déterminer les valeurs exactes de $a_{1}, a_{2}$ et $a_{3}$.
\item On note $s_{3}$ la fonction correspondant au développement en série de Fourier de la fonction $f$, dans lequel on ne conserve que les termes d'indice $n$ inférieur ou égal à 3.
Écrire l'expression de $s_{3}(x)$.
\end{enumerate}
\item On considère la fonction $g$ définie sur $\R$ par : $g(x) = \dfrac{\pi}{2}+ \dfrac{4}{\pi}\left(\cos x + \dfrac{1}{9}\cos (3x)\right)$.
\begin{enumerate}
\item Compléter, à l'aide de la calculatrice, le tableau figurant sur la feuille annexe, avec les valeurs approchées de $f(x)$ et $g(x)$ arrondies à $0,01$.
\item On admet que la fonction $g$ est décroissante sur $[0~;~\pi]$. Tracer, dans le repère donné en annexe, l'allure de la courbe représentative de la fonction $g$ sur l'intervalle $[0~;~\pi]$.
\item Compléter le graphique sur l'intervalle $[- \pi~;~0]$ sachant que la fonction $g$ est paire.
\end{enumerate}
\end{enumerate}
\newpage
\begin{center}
\textbf{ANNEXE À COMPLÉTER PUIS À RENDRE AVEC LA COPIE }
\vspace{0,5cm}
\begin{flushleft}
\textbf{EXERCICE 2}
Questions 1., 2. et 5.
\vspace{0,5cm}
Repr\'esentation graphique de $f$. Graphique \`a compl\'eter aux questions 5. b. et 5. c.
\end{flushleft}
\bigskip
\psset{xunit=1cm,yunit=1.75cm}
\begin{pspicture}(-7,-1)(7,4)
\multido{\n=-7.0+0.5}{29}{\psline[linewidth=0.2pt,linecolor=orange](\n,-1)(\n,4)}
\multido{\n=-1.0+0.1}{51}{\psline[linewidth=0.2pt,linecolor=orange](-7,\n)(7,\n)}
\psaxes[linewidth=1.5pt](0,0)(-7,-1)(7,4)
\uput[l](0,3.14159){$\pi$}
\psline[linewidth=1.5pt](-6.283,3.14159)(-3.14159,0)(0,3.14159)(3.14159,0)(6.283,3.14159)
\psline[linestyle=dashed](-6.283,0)(-6.283,3.14159)
\psline[linestyle=dashed](6.283,0)(6.283,3.14159)
\uput[d](-6.283,0){$- 2\pi$}\uput[d](6.283,0){$2\pi$}
\uput[d](-3.14159,0){$- \pi$}\uput[d](3.14159,0){$\pi$}
\end{pspicture}
\vspace{1cm}
\begin{flushleft}
Tableaux de valeurs à compléter à la question 5. a. :
\end{flushleft}
\bigskip
\renewcommand\arraystretch{2}
\begin{tabularx}{\linewidth}{|*{10}{>{\centering \arraybackslash}X|}}\hline
\rule[-3mm]{0mm}{10mm}$x$ &0 &0,5 & 1 &1,5 &$\frac{\pi}{2}$ & 2 &2,5 &3 &$\pi$\\ \hline
$f(x)$ & & &2,14 & & & & & &\\ \hline
$g(x)$ & & &2,12 & & & & & &\\ \hline
\end{tabularx}
\end{center}
\end{document}
|
https://ctan.math.washington.edu/tex-archive/info/examples/lb2/3-2-9.ltx
|
washington.edu
|
CC-MAIN-2022-27
|
text/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2022-27/segments/1656103943339.53/warc/CC-MAIN-20220701155803-20220701185803-00554.warc.gz
| 244,295,668
| 1,167
|
%%
%% Der LaTeX-Begleiter, zweite Auflage (September 2005)
%%
%% Beispiel 3-2-9 von Seite 125.
%%
%% Copyright (C) 2005 Frank Mittelbach, Michel Goossens,
%% Johannes Braams, David Carlisle, and Chris Rowley
%%
%% Uebersetzung: Copyright (C) 2005 Claudia Krysztofiak,
%% Rebecca Stiels und Frank Mittelbach
%%
%% It may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%%
%% See http://www.latex-project.org/lppl.txt for details.
%%
\documentclass{lb2exa}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{173.4372pt}
\setlength\textheight{3.5\baselineskip}
\sloppy
\StartShownPreambleCommands
\usepackage[para]{footmisc}
\StopShownPreambleCommands
\begin{document}
Etwas Text mit einer Fu▀note.\footnote{Erstens.}
Mehr\footnote{Zweitens.} Text. Noch mehr
Text.\footnote{Drittens.} Ein letzter Text.
\end{document}
|
https://authorea.com/users/364165/articles/484666/download_latex
|
authorea.com
|
CC-MAIN-2021-31
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-31/segments/1627046149929.88/warc/CC-MAIN-20210723143921-20210723173921-00598.warc.gz
| 130,161,248
| 17,105
|
\documentclass[10pt]{article}
\usepackage{fullpage}
\usepackage{setspace}
\usepackage{parskip}
\usepackage{titlesec}
\usepackage[section]{placeins}
\usepackage{xcolor}
\usepackage{breakcites}
\usepackage{lineno}
\usepackage{hyphenat}
\PassOptionsToPackage{hyphens}{url}
\usepackage[colorlinks = true,
linkcolor = blue,
urlcolor = blue,
citecolor = blue,
anchorcolor = blue]{hyperref}
\usepackage{etoolbox}
\makeatletter
\patchcmd\@combinedblfloats{\box\@outputbox}{\unvbox\@outputbox}{}{%
\errmessage{\noexpand\@combinedblfloats could not be patched}%
}%
\makeatother
\usepackage{natbib}
\renewenvironment{abstract}
{{\bfseries\noindent{\abstractname}\par\nobreak}\footnotesize}
{\bigskip}
\titlespacing{\section}{0pt}{*3}{*1}
\titlespacing{\subsection}{0pt}{*2}{*0.5}
\titlespacing{\subsubsection}{0pt}{*1.5}{0pt}
\usepackage{authblk}
\usepackage{graphicx}
\usepackage[space]{grffile}
\usepackage{latexsym}
\usepackage{textcomp}
\usepackage{longtable}
\usepackage{tabulary}
\usepackage{booktabs,array,multirow}
\usepackage{amsfonts,amsmath,amssymb}
\providecommand\citet{\cite}
\providecommand\citep{\cite}
\providecommand\citealt{\cite}
% You can conditionalize code for latexml or normal latex using this.
\newif\iflatexml\latexmlfalse
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}%
\AtBeginDocument{\DeclareGraphicsExtensions{.pdf,.PDF,.eps,.EPS,.png,.PNG,.tif,.TIF,.jpg,.JPG,.jpeg,.JPEG}}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
\usepackage{float}
\begin{document}
\title{Molecular based detection, genetic characterization and phylogenetic
analysis of porcine circovirus 4 from Korean domestic swine farms}
\author[1]{Giap Nguyen}%
\author[2]{Hai-Quynh Do}%
\author[1]{Le Huynh}%
\author[3]{Yong Ho Park}%
\author[3]{Bong Kyun Park}%
\author[4]{Heechun Chung}%
\affil[1]{Vietnam National University of Agriculture}%
\affil[2]{Affiliation not available}%
\affil[3]{Seoul National University}%
\affil[4]{Seoul Nationational University}%
\vspace{-1em}
\date{\today}
\begingroup
\let\center\flushleft
\let\endcenter\endflushleft
\maketitle
\endgroup
\selectlanguage{english}
\begin{abstract}
Porcine circovirus 4 (PCV4), a novel and unclassified member of the
genus Circovirus, was first reported in China in 2019. Aimed at
providing more evidence about the active circulation of PCV4, this study
screened 335 pooled internal organs and detected the virus (i) at the
rates of 3.28\%, (ii) from both clinical healthy and clinical sick pigs
of various age groups, and (iii) in six out of nice provinces of Korea.
The complete genomic sequence of a Korean PCV4 strain (E115) was 1,770
nucleotides in length and had 98.5\% to 98.9\% identity to three PCV4
strains available at GenBank up to date. Utilizing a set of
bioinformatic programs, it was revealed that the Korean PCV4 strain
contained several genomic features of (i) a palindrome stem-loop
structure with conserved nonanucleotide, (ii) packed overlapping ORFs
oriented in different directions, and (iii) two intergenic regions in
between genes encoding putative replication- associated protein (Rep)
and capsid (Cap) proteins. This study also predicted the presence of
essential elements known so far for the replication of circoviruses, for
example, the origin of DNA replication, endonuclease and helicase
domains of Rep, the nuclear localization signal on the putative Cap
protein. Finally, based on the phylogeny inferred from sequences of the
putative Rep protein, it was suggested that PCV4 belong to genus
Circovirus of family Circoviridae and losely related to three previous
known porcine circoviruses of PCV1, PCV2 and PCV3.%
\end{abstract}%
\sloppy
\textbf{{[}Transboundary and Emerging Diseases{]}}
\textbf{(Original Article)}
\textbf{Molecular based detection, genetic characterization and
phylogenetic analysis of porcine circovirus 4 from Korean domestic swine
farms}
Author: Van-Giap Nguyen\textsuperscript{1}, Hai-Quynh
Do\textsuperscript{2}, Thi-My-Le Huynh\textsuperscript{1}, Yong-Ho
Park\textsuperscript{3}, Bong-Kyun Park\textsuperscript{4}, Hee-Chun
Chung\textsuperscript{4*}
\emph{Affiliations:} \textsuperscript{1}Department of Veterinary
Microbiology and Infectious Diseases, Faculty of Veterinary Medicine,
Vietnam National University of Agriculture, Hanoi,
Vietnam;\textsuperscript{2}Institute of Genome Research, Vietnam Academy
of Science and Technology, Hanoi, Vietnam. \textsuperscript{3}Department
of Veterinary Microbiology, College of Veterinary Medicine and Research
Institute for Veterinary Science, Seoul National University, Seoul
151-742, Republic of Korea; \textsuperscript{4}Department of Veterinary
Medicine Virology Lab, College of Veterinary Medicine and Research
Institute for Veterinary Science, Seoul National University GwanAk-Ro 1,
GwanAk-Gu, Seoul 151-742, Korea.
\emph{\textbf{Correspondences}:} [email protected] (H.-C.C)
*\textbf{Correspondence} : [email protected] (H.-C.C)
\textbf{Addresses for correspondence} : H. C. Chung, Department of
Veterinary Medicine Virology Lab, College of Veterinary Medicine and
Research Institute for Veterinary Science, Seoul National University
DaeHakRo 1, GwanAk-Gu, Seoul 151-742, Korea.
Tel.: +82-2-880-1255, Fax: +82-2-885-0263
\textbf{Running title} : Identification of porcine circovirus 4 in Korea
\textbf{Summary}
\emph{Porcine circovirus 4}(PCV4), a novel and unclassified member of
the genus \emph{Circovirus} , was first reported in China in 2019. Aimed
at providing more evidence about the active circulation of PCV4, this
study screened 335 pooled internal organs and detected the virus (i) at
the rates of 3.28\%, (ii) from both clinical healthy and clinical sick
pigs of various age groups, and (iii) in six out of nice provinces of
Korea. The complete genomic sequence of a Korean PCV4 strain (E115) was
1,770 nucleotides in length and had 98.5\% to 98.9\% identity to three
PCV4 strains available at GenBank up to date. Utilizing a set of
bioinformatic programs, it was revealed that the Korean PCV4 strain
contained several genomic features of (i) a palindrome stem-loop
structure with conserved nonanucleotide, (ii) packed overlapping ORFs
oriented in different directions, and (iii) two intergenic regions in
between genes encoding putative replication- associated protein (Rep)
and capsid (Cap) proteins. This study also predicted the presence of
essential elements known so far for the replication of circoviruses, for
example, the origin of DNA replication, endonuclease and helicase
domains of Rep, the nuclear localization signal on the putative Cap
protein. Finally, based on the phylogeny inferred from sequences of the
putative Rep protein, it was suggested that PCV4 belong to genus
\emph{Circovirus} of family\emph{Circoviridae} and losely related to
three previous known porcine circoviruses of PCV1, PCV2 and PCV3.
\emph{\textbf{Keywords:} porcine circovirus 4, detection, genome
organisation, phylogenetic analysis}
\textbf{1. Introduction}
With the explosion of sequencing technology and development of
bioinformatic tools, an eruption in the number of novel microorganisms,
especially viruses, were discovered in a variety of sample types
(Mokili, Rohwer, \& Dutilh, 2012; Tisza et al., 2020). In the field of
veterinary medicine, since the detection of a closed circular
single-stranded DNA virus (porcine circovirus, PCV) (Tischer,
Gelderblom, Vettermann, \& Koch, 1982), four circular DNA viruses were
detected from clinically diseased pigs, including PCV2 (Meehan et al.,
1998), P1 (Wen et al., 2012), PCV3 (Palinski et al., 2017) and the most
recent PCV4 (Zhang et al., 2020). Up to date, by reverse genetics, the
genomic clones of PCV2, P1 and PCV3 were demonstrated to be infectious
and were able to induce gross and histopathological lesions in
experiment specific pathogen free or conventional pigs (Fenaux et al.,
2002; Jiang et al., 2019; Wen et al., 2012). Despite that, only PCV2 is
widely acknowledged as an primary causative agent of porcine
circovirus-associated diseases (Opriessnig, Meng, \& Halbur, 2007;
Segales, 2012).
Of the 2 viruses most recently described, PCV3 and PCV4 viruses, PCV3
was widely detected in Asia (Kedkovid et al., 2018; D. Zhao et al.,
2018), Europe (Faccini et al., 2017; Franzo et al., 2018) and America
(Arruda et al., 2019; Tochetto et al., 2018). In contrast, to date, PCV4
were reported in China (Tian et al., 2020; Zhang et al., 2020) but none
were detected in retrospective samples collected from 1997- 2018 in
Spain and Italy (Franzo et al., 2020). In order to contribute to the
understanding of geographic distribution and genomic structure of this
novel virus, this study firstly performed molecular based screening for
the presence of PCV4 in Korea from tissue samples collected from August
2019 to August 2020. Upon having complete genomic sequence of PCV4, a
wide range of bioinformatic tools were utilized to investigate the
potential biological important proteins encoded by PCV4 which might play
roles in the replication process and/or pathogenesis of PCV4 in pigs.
\textbf{2. Materials \& Method}
2.1. Sample collection and nucleic acid extraction
The screening for PCV4 was done on 335 samples which were divided into
six groups including aborted fetuses (n = 86), suckling (n = 43), weaner
(n = 135), grower (n = 23), finisher (n = 20) and sow (n = 28). Except
testicles of healthy suckling pigs, which were submitted for herd
monitoring of PRRSV, the other pooled internal organs (lungs, spleen,
heart, kidneys) of dead pigs/ aborted fetuses were sent for detection of
common pathogens of swine. The sampling period was from August- December
2019 and January- August 2020, and covered 36 farms in nine provinces in
South Korea. The samples were homogenized, diluted 10-fold with
phosphate-buffered saline (PBS 0.1M, pH 7.4), then stored at -70. The
extraction of total nucleic acid was done using DNA/RNA extraction kit
(iNtRON Biotechnology, Inc. Korea). Afterward, extracted nucleic acid
samples were again stored at -70.
2.2. The detection of PCV4
The detection of PCV4 was based on PCR assay utilizing specific primers
designed in the previous study (Tian et al., 2020). The upstream primer
(PCV4F) was 5'-GTTTTTCCCTTCCCCCACATAG-3', located at nucleotide (nt)
1347-1368, and the downstream primer (PCV4R) was
5'-ACAGATGCCAATCAGATCTAGGTAC-3', located at nt 1713-1737. All primers
used in this study were synthesized by Macrogen Co., Ltd., Korea.
The PCR reaction mixture consisted of 2\selectlanguage{greek}µ\selectlanguage{english}L of template DNA, 1\selectlanguage{greek}µ\selectlanguage{english}L of each
primer (10\selectlanguage{greek}µ\selectlanguage{english}M) and 16\selectlanguage{greek}µ\selectlanguage{english}L of Master mix solution (iNtRON Biotechnology,
Inc. Korea). The PCR thermal profile was an initial denaturation for 5
min at 95, followed by 40 cycles of 95 for 30 sec, 58 for 30 sec, 72
for 30 sec, and a final extension for 7 min at 72. The PCR products
were analyzed through electrophoresis on 1\% agarose gel with Red Safe
DNA nucleic acid staining solution (iNtRON Biotechnology, Inc. Korea).
2.3. Complete genome amplification and sequencing
We amplified the complete PCV4 genome from the positive samples. For the
genomic sequence analysis, two pairs of primers (first forward,
5'-CCGTGAGTTCCCGTCTGTAT-3', located at nt 464-483; first reverse,
5'-TGGAGACTATGTGGGGGAAG-3', located at nt 1355-1374; second forward,
5'-GCTGGAAGTGGAGGGTGTG-3', located at nt 1220-1238; second reverse,
5'-CCCCTTCTCTTGTACATGTCT-3', located at nt 600-620) were designed in
this study. The designed primer sequences are based on the genomic
sequence of PCV4 strain HNU-AHG1-2019 (accession number: MK986820). The
PCR thermal profile was initially denatured for 5 min at 95, followed
by 40 cycles of 30 sec at 95, 2 min at 55, 1 min 20 sec at 72 for,
and final extension for 7 min at 72. After screening, positive samples
were sent to a commercial facility (Macrogen Co., Ltd. Korea) for
sequencing.
2.4. Genomic characterization of PCV4
The putative ORFs of E115 strain (GenBank no. MT882344) and the other
three PCV4 genomes available from GenBank (MT015686, MK986820, MK948416)
were predicted using ORF Finder tool
(https://www.ncbi.nlm.nih.gov/orffinder/, last accessed on August 2020)
with the minimum length of 50 amino acids and the start codon was
strictly selected as ATG. The function of the putative proteins of PCV4
were analyzed by BLAST (Johnson et al., 2008) and InterPro (Mitchell et
al., 2019). Other motifs appeared in the putative encoding genes and
were identified using ScanProsite (de Castro et al., 2006), using the
PROSITE databases and other publication functional motifs, reviewed by
Sobhy (2016). The putative nuclear localization signal (NLS) was
predicted by cNLS Mapper (Kosugi, Hasebe, Tomita, \& Yanagawa, 2009).
Sequence alignment was done by MAFFT using the L-INS-i method (Katoh \&
Standley, 2013). Conserved regions from aligned sequences were further
analyzed and represented by MEME-suit programs (Bailey et al., 2009).
The conserved motifs were identified as short peptides with at least 4
residues in length which were mostly unchanged among input sequences or
substituted by ones with similar biochemical properties. The
protein-peptide interaction function of the conserved motifs was
anticipated by LMDIPred web server which predicts short linear peptides
that might bind to SH3, WW or PDZ modules (Sarkar, Jana, \& Saha, 2018).
2.5. Phylogenetic analyses
Because of its novelty, the taxonomy status of PCV4 has not been
determined. Additionally, with the extreme diversity of CRESS DNA
viruses (a group of circular, single-stranded DNA viruses encoding
replication- associated protein) (Rosario, Duffy, \& Breitbart, 2012; L.
Zhao, Rosario, Breitbart, \& Duffy, 2019), it was our curiosity to have
a broad visualization of the genetic relationship of PCV4 with others
CRESS DNA viruses. As a result, the phylogenetic analyses were done
based on amino acid alignments of replication- associated protein (Rep),
utilizing reference sequences described in the previous studies
(Kazlauskas, Varsani, \& Krupovic, 2018; Krupovic et al., 2020; Rosario
et al., 2017). The alignment of the putative Rep sequences was done by
COBALT tool (Papadopoulos \& Agarwala, 2007). Complete lists of Rep
sequences were given in Supplementary data S1- S2.
Using IQ-TREE v2.1.1 (Minh et al., 2020), the genetic relationships
between CRESS DNA viruses were inferred by maximum likelihood method.
The `-m MFP' option was invoked which helps selecting the data best-fit
amino acid substitution model. The branch support values were estimated
by ultrafast bootstrap approximation (Hoang, Chernomor, von Haeseler,
Minh, \& Vinh, 2018) via ``-bb 1000'' option. All phylogenies were
midpoint rooted and displayed by FigTree v1.4.3
(http://tree.bio.ed.ac.uk/software/figtree/).
\textbf{3. Results}
3.1. PCR- based detection of PCV4
Among 335 samples, 11 (3.28\%) were positive using PCV4F and PCV4R.
Though the detection rates seemed quite low, two notices were obvious.
It was the wide distribution of PCV4 in six out of nine sampling sites
(Figures 1A- 1B). And the virus appeared to be present in all age groups
and aborted fetuses (Figure 1C). There were no PCV4 positive samples in
the finisher group, which was highly likely due to small sample size.
Noteworthy, PCV4 was both found in clinically healthy (testicles of
piglets) and clinical sick pigs (pooled internal organs).
3.2. Genome organization and viral proteins functional analysis
The full genome of a Korean PCV4 strain (E115) was 1,770 nucleotides in
length, showing 98.5\% to 98.9\% similarity to three PCV4 strains
available at GenBank (MT015686, MK986820, MK948416). Based on the
ORFfinder results, the genome of E115 strain generated in this study was
predicted to contain two common ORFs encoding for putative
replication-associated protein (Rep) and putative capsid (Cap) protein
and four other short ORFs oriented in the different directions (Figure
2A). All of the putative ORFs identified in E115 strain were also
detected in the genome of previous known PCV4 strains (Supplementary
Figure S1). A palindrome stem-loop structure with the conserved
nonanucleotide (CAGTATTAC) was observed (Figures 2B- 2C). In detail, a
11- nucleotide of loop structure was flanked by two reversed complement
regions of 16 nucleotides each (Figure 2B). Additionally, the putative
Rep and Cap genes were separated by two intergenic regions of 111 and 81
nucleotides in length at the 5' and 3', respectively (Figure 2A and
Supplementary Table S1).
Further analysis results (Figure 3) indicated that the putative Rep of
E115 strain contained (i) the endonuclease domain with three motifs,
(ii) the helicase domain of superfamily 3 (SF3) containing three Walker
motifs and (iii) other unknown conserved motifs which are normally
observed in \emph{Circoviridae} in particular and in CRESS DNA viruses
in general as previously described (Delwart \& Li, 2012; Kazlauskas et
al., 2018; Krupovic et al., 2020; Ye, Berg, Fossum, Wallgren, \&
Blomstrom, 2018).
Of the putative Cap, a nuclear localization signal (NLS) was predicted
in the N-terminus of the putative Cap of E115 strain (Figure 4). Based
on the alignment with other members of \emph{Circovirus} genus, Figure 4
showed that the arginine-rich region of E115 strain was aligned with the
basic motifs of the experimentally confirmed NLS of PCV1, PCV2 and PCV3
(Liu, Tikoo, \& Babiuk, 2001; Mou, Wang, Pan, \& Chen, 2019; Shuai et
al., 2008). Additionally, motif screening (Figure 5) indicated that the
putative Cap of E115 strain contained several tyrosine-based Y-x-x-\selectlanguage{greek}φ
\selectlanguage{english}motifs and P-x-x-P motifs (x represents any amino acid and \selectlanguage{greek}φ \selectlanguage{english}denotes a
large hydrophobic residue of either F, I, L or V) which were related to
clathrin-mediated endocytosis (Sobhy, 2016).
Of the other four putative ORF3- ORF6 of E115 strain, only ORF3 protein
contained homologous regions with a recently identified ORF5 protein of
PCV2 (Lv, Guo, Xu, Wang, \& Zhang, 2015). Widely comparing with
homologous putative proteins of some members of genus \emph{Circovirus}
, it was found that they shared some short, conserved linear peptides of
W-A-S-{[}PL{]}-{[}DG{]}-M, G-G-M-x-{[}TI{]}, W-M-{[}TI{]}-{[}IF{]}-M-A-G
and {[}MG{]}-M-{[}TI{]}-C (Figure 6). Interestingly, based on LMDIPrep
results, the above last three linear peptides at the C-terminal region
were predicted to interact with PDZ domain (Supplementary data S3-S4).
3.3. Phylogenetic analysis
For precise phylogenetic classification, the relationship of PCV4 with 7
families of CRESS DNA viruses (Rosario et al., 2012; L. Zhao et al.,
2019) was inferred. The phylogenetic tree (inserted panel, Figure 7)
revealed a similar tree topology between 7 families as in the previous
publications (Kazlauskas et al., 2018; Krupovic et al., 2020). Based on
that result, four PCV4 sequences (including E115 strain) were clustered
within family \emph{Circoviridae} . Using reference Rep sequences of
genera \emph{Circovirus} and \emph{Cyclovirus} of the
family\emph{Circoviridae} , all PCV4 strains were seen belonging to
genus\emph{Circovirus} (Figure 7). In consistency with the early
classification (Tian et al., 2020; Zhang et al., 2020), this study
confirmed that PCV4 is distantly related to previously known PCV1, PCV2
and PCV3.
\textbf{4. Discussion}
4.1. The detection of PCV4
After the first report of PCV4 in the Hunan province, China (Zhang et
al., 2020), the virus was also detected in other provinces of China
(Tian et al., 2020). The presence of PCV4 in different geographic
locations implied the active circulation of the virus. However, a
preliminary screening failed to detect PCV4 in two European countries
(Franzo et al., 2020). With the detection rates of 3.28\% in six out of
nine provinces in Korea (Figures 1A- 1B), this study provided further
evidence for the prevalence of PCV4 in pigs. Combining the detection
results of the first two publications (Tian et al., 2020; Zhang et al.,
2020) and this report (Figure 1C), it was noteworthy to observe that
PCV4 was present in pigs of all age groups and in both clinically
healthy and different clinically diseased pigs. That fact was similar to
PCV2 and PCV3 infections which were found in pigs with different
clinical presentations (Segales, 2012; Zhai et al., 2017). Further
studies are required to elucidate any association with diseases in pigs
of this novel PCV4.
4.2. The genomic characterization and genetic relationships of PCV4
Upon detection of a novel virus in animals suffering from a certain
illness, it is common to urge epidemiological and pathological studies
(Faccini et al., 2017; Franzo et al., 2018). In this study, in addition
to providing supportive evidence for the active circulation of PCV4,
attempts were made to describe the genetic structure as well as to
investigate the potential biological important proteins encoded by PCV4
which might play roles in the replication process and/or pathogenesis of
PCV4 in pigs.
Of the genomic organization, the previous study described in brief that
PCV4 represents a new circovirus species, having a typical origin of
replication of conserved nonanucleotide stem-loop motif (Zhang et al.,
2020). In this study, besides the palindrome stem-loop structure of the
origin of replication in the 5'- intergenic region (Figure 2B), more
genetic features were elucidated from the nucleotide sequences of E115
strain as well as three previous PCV4 strains so far. It was found that
the circular genome contains several overlapping ORFs in different
orientations and the existence of two intergenic regions in between
genes encoding the Rep and Cap proteins (Figure 2A, Supplementary Figure
S1). These features were also observed in viruses belonging
to\emph{Circovirus} genus (Li et al., 2010). Combining the results of
genetic structure analyses (Figure 2) and phylogenetic classification
(Figure 7), the study agreed with the results obtained in previous
publications (Tian et al., 2020; Zhang et al., 2020) and that E115 and
other three strains of PCV4 belonged to the genus \emph{Circovirus} but
phylogenetically differed from three porcine circoviruses of PCV1, PCV2
and PCV3.
Of the functional analysis, this study found essential elements known so
far for DNA replication of circoviruses (Figures 2B, 3, 4), such as: the
NLS mediating nuclear targeting of the viral genome (Heath, Williamson,
\& Rybicki, 2006), the structure at the origin of DNA replication
(Cheung, 2004), endonuclease and helicase domains of Rep (Faurez, Dory,
Grasland, \& Jestin, 2009; Mankertz \& Hillenbrand, 2001). Additionally,
the presence of tyrosine-based Y-x-x-\selectlanguage{greek}φ \selectlanguage{english}and P-x-x-P motifs in the Cap of
PCV4 (Figure 5) might be involved in the entry process of this virus
into the host cell. That inference was made by evidence that the Y-x-x-\selectlanguage{greek}φ
\selectlanguage{english}were observed in a variety of viruses including SARS-CoV, HCV, EBV or
SIV viruses that contribute to the viral penetration (Hraber et al.,
2020; Karamichali et al., 2017; Minakshi \& Padhan, 2014). Another
effect of P-x-x-P motif in Nef protein of HIV was demonstrated to
interact with SH3-domains that related to the increase of virus
replication (Saksela, Cheng, \& Baltimore, 1995). Lastly, in this study,
several linear peptides in the putative ORF3 protein of PCV4 were
observed that are likely conserved in other putative homologous proteins
of viruses belonging to family \emph{Circoviridae} (Figure 5).
Functional analysis predicted that these peptides might interact with
the PDZ domains, an important regions associated with cell signaling
pathways (Lee \& Zheng, 2010). Proteins containing PDZ domains were
demonstrated as target of several different viruses (James \& Roberts,
2016; Javier \& Rice, 2011). Therefore, it was possible to imply that
the putative ORF3 protein of PCV4 could alter the cell signaling pathway
during the virus replication. All of the above-mentioned results of
genetic analyses provided not only details about genomic structure and
organization of a newly described PCV4, but also supported that the
virus contains essential elements for the replication process.
\textbf{5. Conclusion}
The presence of PCV4 in different geographic locations in Korea provided
additional evidence for active circulation of PCV4 in pigs in different
swine producing countries. The result of genetic characterizations and
phylogenetic classification supported that PCV4 is an unclassified
member of genus \emph{Circovirus,} containing essential elements for
viral replication.
\textbf{Funding}
This work was supported by the Korea Science and Engineering Foundation
(KOSEF) grant funded by the Korea government (No. 2020R1I1A1A01054539).
\textbf{Ethics approval and consent to participate}
All samples used in this study were received from Boehringer Ingelheim
Vetmedica Korea Ltd. according to a Nondisclosure Agreement (No.
20190037 and 20200009) of ``Diagnostic Tests for Development of Domestic
Livestock Industry'' signed with College of Veterinary Medicine, Seoul
National University. All protocols related to samples collection were
approved by Seoul National University Research and Development Business
Foundation (SNU-200626-2). This article does not contain any studies
with alive animals performed by any of the authors.
\textbf{Data availability statement}
Not available
\textbf{Acknowledgments}
The authors would like to thank Eun Ok Kim and Jung Ah Kim for their
excellent technical assistance. Also, we sincerely thank Boehringer
Ingelheim Vetmedica Korea Ltd. for providing samples for this study.
\textbf{Conflicts of Interest}
The authors declare that there is no conflict of interest.
\textbf{Figure Legends}
\textbf{Figure 1.} The detection results of PCV4. The detection rates
(positive/ total samples) were shown according to sampling year and
geographic locations (A, B). Provinces having PCV4 positive farms are
indicated with red color. The positive rates were also summarized by age
groups (C) which the samples were sorted into, including aborted fetus,
suckling ([?] 30 days), weaned (30 to 60 days), grower (60 to 90 days),
finisher ([?] 90 days) and sow.
\textbf{Figure 2.} Genomic characterization of E115 strain. It was
illustrated that E115 has a circular genome, containing 6 putative
overlapping open reading frames (ORFs) oriented in different directions
(A). The stem- loop structure with conserved nonanucleotide
(highlighted) was observed (B). Comparison of the nonanucleotide
sequences, (T/n)A(G/t)TATTAC, between PCV4 and the viruses of the
genus\emph{Circovirus} (C). The scissors represented the nicking
position in the nonanucleotide motif.
\textbf{Figure 3.} Functional domains of putative replication-
associated protein (Rep). E115 strain (arrow) was predicted containing
two domains of endonuclease and helicase which were well conserved for
different viruses of \emph{Circovirus} genus (highlighted). In each
motif, the capital letters indicated conserved amino acid, `x' was any
amino acid and square brackets indicate the list of acceptable amino
acids in the given position.
\textbf{Figure 4.} Prediction of nuclear localization signal (NLS) at
the N-terminus of the putative Cap. This arginine-rich region was shown
based on the alignment with other members of \emph{Circovirus} genus.
Sequence analysis revealed that the arginine-rich region of E115 strain
was aligned with the basic motifs of the NLS of PCV1, PCV2 and PCV3
which were experimentally confirmed (highlights).
\textbf{Figure 5.} The P-x-x-P and Y-x-x-\selectlanguage{greek}ϕ \selectlanguage{english}motifs located in the
putative capsid proteins. Capsid proteins of PCV4 were detected
containing several P-x-x-P and Y-x-x-\selectlanguage{greek}ϕ \selectlanguage{english}motifs. Y-x-x-\selectlanguage{greek}ϕ \selectlanguage{english}motifs and the
first P-x-x-P motif were observed in other viruses belonging to
genus\emph{Circovirus} . On the other hand, the second P-x-x-P only
detected in PCV4 which were highlighted in a box. In each motif ``x''
denoted as any amino acid, while \selectlanguage{greek}ϕ \selectlanguage{english}represented any of F (phenylalanine),
I (isoleucine), L (leucine) or V (valine). The brackets show the
conserved amino acid in given position. The number indicated the
location of each motif based on the capsid protein of E115 strain.
\textbf{Figure 6.} Prediction of conserved regions of the putative ORF3
protein. Based on the alignment with some members of genus Circovirus,
four conserved regions in the putative ORF3 protein of E115 strain
(indicated as arrow) were observed. All putative ORF3s of PCV4 were
shown as in dash box. The well conserved amino acids were also
highlighted. In each short linear motif, the capital letters indicated
conserved amino acid, `x' was any amino acid and square brackets
indicate the list of acceptable amino acids in the given positions.
C-terminal regions of the putative PCV4 ORF3 protein were predicted as
containing PDZ binding peptides. The number showed the position
corresponding in E115 strain.
\textbf{Figure 7.} Phylogenetic tree of circoviruses based on amino acid
sequence of Rep. Inserted panel was the phylogeny inferred from a data
containing seven assigned families of CRESS DNA viruses. It was observed
that the newly identified PCV4 (arrows) was grouped within
family\emph{Circoviridae} . Focused on that family, two well supported
genus of\emph{Cyclovirus} and \emph{Circovirus} were observed. Of which,
PCV4 was within genus \emph{Circovirus} , distantly related to previous
known PCV1, PCV2 and PCV3 (indicated by filled circles). Numbers on
branches were bootstrap support values. Bar showed number of amino acid
substitutions per site.
\textbf{Supplementary Legends}
\textbf{Supplementary data S1.} List of the putative Rep sequences used
for phylogenetic inference of CRESS DNA viruses
\textbf{Supplementary data S2.} List of the putative Rep sequences used
for phylogenetic inference of family Circoviridae
\textbf{Supplementary data-S3.} ORF3\_motif1-PDZdomain
\textbf{Supplementary data-S4.} ORF3\_motif234-PDZdomain
\textbf{Supplementary Table S1.} Summary of characteristics of the
predicted ORFs of E115 strain
\textbf{Supplementary Figure S1.} Genomic structure and organisation of
PCV4. Three completed genomic sequences of PCV4 were available from
GenBank. All elements of genome were similar between isolates and with
the Korean PCV4 strain shown in Figure 1A.
\textbf{References}
Arruda, B., Pineyro, P., Derscheid, R., Hause, B., Byers, E., Dion, K.,
. . . Schwartz, K. (2019). PCV3-associated disease in the United States
swine herd. \emph{Emerging microbes \& infections, 8} (1), 684-698.
doi:10.1080/22221751.2019.1613176
Bailey, T. L., Boden, M., Buske, F. A., Frith, M., Grant, C. E.,
Clementi, L., . . . Noble, W. S. (2009). MEME SUITE: tools for motif
discovery and searching. \emph{Nucleic Acids Res, 37} (Web Server
issue), W202-208. doi:10.1093/nar/gkp335
Cheung, A. K. (2004). Identification of an octanucleotide motif sequence
essential for viral protein, DNA, and progeny virus biosynthesis at the
origin of DNA replication of porcine circovirus type 2. \emph{Virology,
324} (1), 28-36. doi:10.1016/j.virol.2004.03.037
de Castro, E., Sigrist, C. J., Gattiker, A., Bulliard, V.,
Langendijk-Genevaux, P. S., Gasteiger, E., . . . Hulo, N. (2006).
ScanProsite: detection of PROSITE signature matches and
ProRule-associated functional and structural residues in
proteins.\emph{Nucleic Acids Res, 34} (Web Server issue), W362-365.
doi:10.1093/nar/gkl124
Delwart, E., \& Li, L. (2012). Rapidly expanding genetic diversity and
host range of the Circoviridae viral family and other Rep encoding small
circular ssDNA genomes. \emph{Virus Res, 164} (1-2), 114-121.
doi:10.1016/j.virusres.2011.11.021
Faccini, S., Barbieri, I., Gilioli, A., Sala, G., Gibelli, L. R.,
Moreno, A., . . . Nigrelli, A. (2017). Detection and genetic
characterization of porcine circovirus type 3 in Italy. \emph{Transbound
Emerg Dis, 64} (6), 1661-1664. doi:10.1111/tbed.12714
Faurez, F., Dory, D., Grasland, B., \& Jestin, A. (2009). Replication of
porcine circoviruses. \emph{Virol J, 6} (1), 60.
doi:10.1186/1743-422X-6-60
Fenaux, M., Halbur, P. G., Haqshenas, G., Royer, R., Thomas, P.,
Nawagitgul, P., . . . Meng, X. J. (2002). Cloned genomic DNA of type 2
porcine circovirus is infectious when injected directly into the liver
and lymph nodes of pigs: characterization of clinical disease, virus
distribution, and pathologic lesions. \emph{J Virol, 76} (2), 541-551.
doi:10.1128/jvi.76.2.541-551.2002
Franzo, G., Legnardi, M., Hjulsager, C. K., Klaumann, F., Larsen, L. E.,
Segales, J., \& Drigo, M. (2018). Full-genome sequencing of porcine
circovirus 3 field strains from Denmark, Italy and Spain demonstrates a
high within-Europe genetic heterogeneity. \emph{Transbound Emerg Dis,
65} (3), 602-606. doi:10.1111/tbed.12836
Franzo, G., Ruiz, A., Grassi, L., Sibila, M., Drigo, M., \& Segales, J.
(2020). Lack of porcine circovirus 4 genome detection in pig samples
from Italy and Spain. \emph{Pathogens, 9} (6), 433.
doi:10.3390/pathogens9060433
Heath, L., Williamson, A. L., \& Rybicki, E. P. (2006). The capsid
protein of beak and feather disease virus binds to the viral DNA and is
responsible for transporting the replication-associated protein into the
nucleus. \emph{J Virol, 80} (14), 7219-7225. doi:10.1128/JVI.02559-05
Hoang, D. T., Chernomor, O., von Haeseler, A., Minh, B. Q., \& Vinh, L.
S. (2018). UFBoot2: improving the ultrafast bootstrap
approximation.\emph{Mol Biol Evol, 35} (2), 518-522.
doi:10.1093/molbev/msx281
Hraber, P., O'Maille, P. E., Silberfarb, A., Davis-Anderson, K.,
Generous, N., McMahon, B. H., \& Fair, J. M. (2020). Resources to
discover and use short linear motifs in viral proteins. \emph{Trends
Biotechnol, 38} (1), 113-127. doi:10.1016/j.tibtech.2019.07.004
James, C. D., \& Roberts, S. (2016). Viral interactions with PDZ
domain-containing proteins-an oncogenic trait? \emph{Pathogens, 5} (1),
8. doi:10.3390/pathogens5010008
Javier, R. T., \& Rice, A. P. (2011). Emerging theme: cellular PDZ
proteins as common targets of pathogenic viruses. \emph{J Virol, 85}
(22), 11544-11556. doi:10.1128/JVI.05410-11
Jiang, H., Wang, D., Wang, J., Zhu, S., She, R., Ren, X., . . . Liu, J.
(2019). Induction of porcine dermatitis and nephropathy syndrome in
piglets by infection with porcine circovirus type 3. \emph{J Virol, 93}
(4), e02045-02018. doi:10.1128/JVI.02045-18
Johnson, M., Zaretskaya, I., Raytselis, Y., Merezhuk, Y., McGinnis, S.,
\& Madden, T. L. (2008). NCBI BLAST: a better web
interface.\emph{Nucleic Acids Res, 36} (Web Server issue), W5-9.
doi:10.1093/nar/gkn201
Karamichali, E., Serti, E., Gianneli, A., Papaefthymiou, A., Kakkanas,
A., Foka, P., . . . Georgopoulou, U. (2017). The unexpected function of
a highly conserved YXXPhi motif in HCV core protein. \emph{Infect Genet
Evol, 54} , 251-262. doi:10.1016/j.meegid.2017.07.001
Katoh, K., \& Standley, D. M. (2013). MAFFT multiple sequence alignment
software version 7: improvements in performance and usability. \emph{Mol
Biol Evol, 30} (4), 772-780. doi:10.1093/molbev/mst010
Kazlauskas, D., Varsani, A., \& Krupovic, M. (2018). Pervasive chimerism
in the replication-associated proteins of uncultured single-stranded DNA
viruses. \emph{Viruses, 10} (4), 187. doi:10.3390/v10040187
Kedkovid, R., Woonwong, Y., Arunorat, J., Sirisereewan, C., Sangpratum,
N., Lumyai, M., . . . Thanawongnuwech, R. (2018). Porcine circovirus
type 3 (PCV3) infection in grower pigs from a Thai farm suffering from
porcine respiratory disease complex (PRDC). \emph{Vet Microbiol, 215} ,
71-76. doi:10.1016/j.vetmic.2018.01.004
Kosugi, S., Hasebe, M., Tomita, M., \& Yanagawa, H. (2009). Systematic
identification of cell cycle-dependent yeast nucleocytoplasmic shuttling
proteins by prediction of composite motifs. \emph{Proc Natl Acad Sci U S
A, 106} (25), 10171-10176. doi:10.1073/pnas.0900604106
Krupovic, M., Varsani, A., Kazlauskas, D., Breitbart, M., Delwart, E.,
Rosario, K., . . . Koonin, E. V. (2020). Cressdnaviricota: a virus
phylum unifying seven families of rep-encoding viruses with
single-stranded, circular DNA genomes. \emph{J Virol, 94} (12),
e00582-00520. doi:10.1128/JVI.00582-20
Lee, H. J., \& Zheng, J. J. (2010). PDZ domains and their binding
partners: structure, specificity, and modification. \emph{Cell Commun
Signal, 8} (1), 8. doi:10.1186/1478-811X-8-8
Li, L., Kapoor, A., Slikas, B., Bamidele, O. S., Wang, C., Shaukat, S.,
. . . Delwart, E. (2010). Multiple diverse circoviruses infect farm
animals and are commonly found in human and chimpanzee feces. \emph{J
Virol, 84} (4), 1674-1682. doi:10.1128/JVI.02109-09
Liu, Q., Tikoo, S. K., \& Babiuk, L. A. (2001). Nuclear localization of
the ORF2 protein encoded by porcine circovirus type 2. \emph{Virology,
285} (1), 91-99. doi:10.1006/viro.2001.0922
Lv, Q., Guo, K., Xu, H., Wang, T., \& Zhang, Y. (2015). Identification
of putative ORF5 protein of porcine circovirus type 2 and functional
analysis of GFP-fused ORF5 protein. \emph{PLOS ONE, 10} (6), e0127859.
doi:10.1371/journal.pone.0127859
Mankertz, A., \& Hillenbrand, B. (2001). Replication of porcine
circovirus type 1 requires two proteins encoded by the viral rep
gene.\emph{Virology, 279} (2), 429-438. doi:10.1006/viro.2000.0730
Meehan, B. M., McNeilly, F., Todd, D., Kennedy, S., Jewhurst, V. A.,
Ellis, J. A., . . . Allan, G. M. (1998). Characterization of novel
circovirus DNAs associated with wasting syndromes in pigs. \emph{J Gen
Virol, 79 ( Pt 9)} (9), 2171-2179. doi:10.1099/0022-1317-79-9-2171
Minakshi, R., \& Padhan, K. (2014). The YXXPhi motif within the severe
acute respiratory syndrome coronavirus (SARS-CoV) 3a protein is crucial
for its intracellular transport. \emph{Virol J, 11} (1), 75.
doi:10.1186/1743-422X-11-75
Minh, B. Q., Schmidt, H. A., Chernomor, O., Schrempf, D., Woodhams, M.
D., von Haeseler, A., \& Lanfear, R. (2020). IQ-TREE 2: new models and
efficient methods for phylogenetic inference in the genomic
era.\emph{Mol Biol Evol, 37} (5), 1530-1534. doi:10.1093/molbev/msaa015
Mitchell, A. L., Attwood, T. K., Babbitt, P. C., Blum, M., Bork, P.,
Bridge, A., . . . Finn, R. D. (2019). InterPro in 2019: improving
coverage, classification and access to protein sequence
annotations.\emph{Nucleic Acids Res, 47} (D1), D351-D360.
doi:10.1093/nar/gky1100
Mokili, J. L., Rohwer, F., \& Dutilh, B. E. (2012). Metagenomics and
future perspectives in virus discovery. \emph{Current opinion in
virology, 2} (1), 63-77. doi:10.1016/j.coviro.2011.12.004
Mou, C., Wang, M., Pan, S., \& Chen, Z. (2019). Identification of
nuclear localization signals in the ORF2 protein of porcine circovirus
type 3. \emph{Viruses, 11} (12), 1086. doi:10.3390/v11121086
Opriessnig, T., Meng, X. J., \& Halbur, P. G. (2007). Porcine circovirus
type 2 associated disease: update on current terminology, clinical
manifestations, pathogenesis, diagnosis, and intervention
strategies.\emph{J Vet Diagn Invest, 19} (6), 591-615.
doi:10.1177/104063870701900601
Palinski, R., Pineyro, P., Shang, P., Yuan, F., Guo, R., Fang, Y., . . .
Hause, B. M. (2017). A novel porcine circovirus distantly related to
known circoviruses is associated with porcine dermatitis and nephropathy
syndrome and reproductive failure. \emph{J Virol, 91} (1).
doi:10.1128/JVI.01879-16
Papadopoulos, J. S., \& Agarwala, R. (2007). COBALT: constraint-based
alignment tool for multiple protein sequences. \emph{Bioinformatics, 23}
(9), 1073-1079. doi:10.1093/bioinformatics/btm076
Rosario, K., Breitbart, M., Harrach, B., Segales, J., Delwart, E.,
Biagini, P., \& Varsani, A. (2017). Revisiting the taxonomy of the
family Circoviridae: establishment of the genus Cyclovirus and removal
of the genus Gyrovirus. \emph{Arch Virol, 162} (5), 1447-1463.
doi:10.1007/s00705-017-3247-y
Rosario, K., Duffy, S., \& Breitbart, M. (2012). A field guide to
eukaryotic circular single-stranded DNA viruses: insights gained from
metagenomics. \emph{Arch Virol, 157} (10), 1851-1871.
doi:10.1007/s00705-012-1391-y
Saksela, K., Cheng, G., \& Baltimore, D. (1995). Proline-rich (PxxP)
motifs in HIV-1 Nef bind to SH3 domains of a subset of Src kinases and
are required for the enhanced growth of Nef+ viruses but not for
down-regulation of CD4. \emph{The EMBO Journal, 14} (3), 484-491.
doi:10.1002/j.1460-2075.1995.tb07024.x
Sarkar, D., Jana, T., \& Saha, S. (2018). LMDIPred: A web-server for
prediction of linear peptide sequences binding to SH3, WW and PDZ
domains. \emph{PLOS ONE, 13} (7), e0200430.
doi:10.1371/journal.pone.0200430
Segales, J. (2012). Porcine circovirus type 2 (PCV2) infections:
clinical signs, pathology and laboratory diagnosis. \emph{Virus Res,
164} (1-2), 10-19. doi:10.1016/j.virusres.2011.10.007
Shuai, J., Wei, W., Jiang, L., Li, X., Chen, N., \& Fang, W. (2008).
Mapping of the nuclear localization signals in open reading frame 2
protein from porcine circovirus type 1. \emph{Acta Biochim Biophys Sin
(Shanghai), 40} (1), 71-77. doi:10.1111/j.1745-7270.2008.00377.x
Sobhy, H. (2016). A review of functional motifs utilized by
viruses.\emph{Proteomes, 4} (1), 3. doi:10.3390/proteomes4010003
Tian, R. B., Zhao, Y., Cui, J. T., Zheng, H. H., Xu, T., Hou, C. Y., . .
. Chen, H. Y. (2020). Molecular detection and phylogenetic analysis of
porcine circovirus 4 in Henan and Shanxi provinces of
China.\emph{Transbound Emerg Dis} . doi:10.1111/tbed.13714
Tischer, I., Gelderblom, H., Vettermann, W., \& Koch, M. A. (1982). A
very small porcine virus with circular single-stranded DNA.\emph{Nature,
295} (5844), 64-66. doi:10.1038/295064a0
Tisza, M. J., Pastrana, D. V., Welch, N. L., Stewart, B., Peretti, A.,
Starrett, G. J., . . . Buck, C. B. (2020). Discovery of several thousand
highly diverse circular DNA viruses. \emph{eLife, 9} , e51971.
doi:10.7554/eLife.51971
Tochetto, C., Lima, D. A., Varela, A. P. M., Loiko, M. R., Paim, W. P.,
Scheffer, C. M., . . . Roehe, P. M. (2018). Full-genome sequence of
porcine circovirus type 3 recovered from serum of sows with stillbirths
in Brazil. \emph{Transbound Emerg Dis, 65} (1), 5-9.
doi:10.1111/tbed.12735
Wen, L., He, K., Xiao, Q., Yu, Z., Mao, A., Ni, Y., . . . Jiang, J.
(2012). A novel porcine circovirus-like agent P1 is associated with
wasting syndromes in pigs. \emph{PLOS ONE, 7} (8), e41565.
doi:10.1371/journal.pone.0041565
Ye, X., Berg, M., Fossum, C., Wallgren, P., \& Blomstrom, A. L. (2018).
Detection and genetic characterisation of porcine circovirus 3 from pigs
in Sweden. \emph{Virus Genes, 54} (3), 466-469.
doi:10.1007/s11262-018-1553-4
Zhai, S. L., Zhou, X., Zhang, H., Hause, B. M., Lin, T., Liu, R., . . .
Wang, D. (2017). Comparative epidemiology of porcine circovirus type 3
in pigs with different clinical presentations. \emph{Virol J, 14} (1),
222. doi:10.1186/s12985-017-0892-4
Zhang, H. H., Hu, W. Q., Li, J. Y., Liu, T. N., Zhou, J. Y., Opriessnig,
T., \& Xiao, C. T. (2020). Novel circovirus species identified in farmed
pigs designated as porcine circovirus 4, Hunan province,
China.\emph{Transbound Emerg Dis, 67} (3), 1057-1061.
doi:10.1111/tbed.13446
Zhao, D., Wang, X., Gao, Q., Huan, C., Wang, W., Gao, S., \& Liu, X.
(2018). Retrospective survey and phylogenetic analysis of porcine
circovirus type 3 in Jiangsu province, China, 2008 to 2017. \emph{Arch
Virol, 163} (9), 2531-2538. doi:10.1007/s00705-018-3870-2
Zhao, L., Rosario, K., Breitbart, M., \& Duffy, S. (2019). Chapter three
- Eukaryotic circular rep-encoding single-stranded DNA (CRESS DNA)
viruses: ubiquitous viruses with small genomes and a diverse host range.
In M. Kielian, T. C. Mettenleiter, \& M. J. Roossinck
(Eds.),\emph{Advances in Virus Research} (Vol. 103, pp. 71-133):
Academic Press.\selectlanguage{english}
\begin{figure}[H]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/Figure-1/Figure-1}
\end{center}
\end{figure}\selectlanguage{english}
\begin{figure}[H]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/Figure-2/Figure-2}
\end{center}
\end{figure}\selectlanguage{english}
\begin{figure}[H]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/Figure-3/Figure-3}
\end{center}
\end{figure}\selectlanguage{english}
\begin{figure}[H]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/Figure-4/Figure-4}
\end{center}
\end{figure}\selectlanguage{english}
\begin{figure}[H]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/Figure-5/Figure-5}
\end{center}
\end{figure}\selectlanguage{english}
\begin{figure}[H]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/Figure-6/Figure-6}
\end{center}
\end{figure}\selectlanguage{english}
\begin{figure}[H]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/Figure-7/Figure-7}
\end{center}
\end{figure}
\selectlanguage{english}
\FloatBarrier
\end{document}
|
http://mymath.info/math/republic/results/republic-math-2017-results.tex
|
mymath.info
|
CC-MAIN-2021-49
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-49/segments/1637964363405.77/warc/CC-MAIN-20211207170825-20211207200825-00119.warc.gz
| 46,279,075
| 1,694
|
\documentclass[11pt, a4paper]{article}
\usepackage[T2A]{fontenc} %cyrillic output
\usepackage[utf8]{inputenc} %cyrillic output
\usepackage[english, russian]{babel} %word wrap
\usepackage{amssymb, amsfonts, amsmath} %math symbols
\usepackage{mathtext} %text in formulas
\usepackage{geometry} %paper format attributes
\usepackage{fancyhdr} %header
\usepackage{graphicx} %input pictures
\usepackage{tabularx} %smart table
\usepackage{tikz} %draw pictures
\usetikzlibrary{patterns} %draw pictures: fill
\usetikzlibrary{positioning} %draw pictures: below of
\usetikzlibrary{calc} %draw pictures: $\i$
\usepackage{enumitem} %enumarate parameters
\geometry{left=2cm, right=2cm, top=2cm, bottom=2cm, headheight=15pt}
\setlist[enumerate]{leftmargin=*} %remove enumarate indenttion
\sloppy %correct overfull
\pagestyle{empty} %no page numbers
\newcommand{\head}[4]
{
\thispagestyle{fancy}
\fancyhf{}
\chead{#3, #4}
\begin{center}
\begin{large}
#1 \\
\textit{#2}\\
\end{large}
\end{center}
}
\DeclareMathOperator*{\argmin}{Arg\,min}
\begin{document}
\head{IX Республиканская студенческая предметная олимпиада по~направлению~<<Математика>>}{13 апреля 2017}{Казахстанский филиал МГУ имени М. В. Ломоносова}{г. Астана}
\begin{center}
\begin{tabular}{|l|l|l|c|c|c|c|c|c|c|c|c|}
\hline
№ & Участник & ВУЗ & Курс & 1 & 2 & 3 & 4 & 5 & 6 & $\Sigma$ & Диплом \\
\hline
1 & Жанбырбаев Есеналы & КБТУ & 2 & 10 & 10 & 10 & 3 & 0 & 10 & 43 & 1 \\
\hline
2 & Бекмаганбетов Бекарыс & КФ МГУ & 1 & 10 & 10 & 10 & 2 & 10 & 0 & 42 & 2 \\
\hline
3 & Сайланбаев Алибек & НУ & 4 & 10 & 10 & 10 & 2 & 0 & 8 & 40 & 2 \\
\hline
4 & Аманкелды Акежан & НУ & 4 & 9 & 9 & 10 & 5 & 0 & 0 & 33 & 3 \\
\hline
5 & Жанахметов Султан & НУ & 3 & 10 & 10 & 10 & 2 & 0 & 0 & 32 & 3 \\
\hline
6 & Шакиев Александр & МУИТ & 2 & 10 & 9 & 10 & 0 & 0 & 0 & 39 & 3 \\
\hline
\end{tabular}
\end{center}
\end{document}
|
https://www3.nd.edu/~ndjfl/typesetting/Guide2Authors.tex
|
nd.edu
|
CC-MAIN-2019-26
|
application/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2019-26/segments/1560627998475.92/warc/CC-MAIN-20190617123027-20190617145027-00430.warc.gz
| 967,610,112
| 11,720
|
%%% Template for the submission to %%%
%%% Notre Dame Journal of Formal Logic (ndjfl)
%%%
%%% Usage summary %%%
%%% Mostly, the information
%%% required is obvious, but some explanations are given.
%%% All other lines should be ignored.
\documentclass{ndjflart}
%%% HIGHLY RECOMMENDED PACKAGES AND SETTINGS
%\usepackage{pdfsync} %% if you know what this is use it or not.
\usepackage[T1]{fontenc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% If your tex system is less than 2 years old (in 2012) the following
%% font options are available. If not comment them out.
\usepackage{tgtermes}
% otherwise use alternative journal fonts
%\renewcommand{\rmdefault}{ptm} % system default Times font
\usepackage{mathptmx}
%%% additional fonts
\usepackage[scaled=.92]{helvet}
%\setoptfont{enc={T1},fam={pop}} % if You have Optima font, uncomment this line
%%% MATH
\usepackage{amsthm,amsmath,amssymb}
\usepackage{mathrsfs}
%%% BIBLIOGRAPHY
\usepackage[numbers]{natbib} %% numbers is required.
%%% LINKS
\usepackage[colorlinks,citecolor=blue,urlcolor=blue]{hyperref} %%check
\usepackage{enumerate}
\artstatus{am} %%% leave this alone!! That means you, too!!
%%%%%%%%theorems%%%%%
%%%% feel free to changes these%%%%%%%
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{condition}[theorem]{Condition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{question}[theorem]{Question}
\newtheorem{corollary}[theorem]{Corollary}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{statement}[theorem]{Statement}
\newtheorem{notation}[theorem]{Notation}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
%%%DATE enter the date of your submission here- best%%%
%%%If \date{} is not used, the current date will be used%%%
%%%Warning:This will be lost if your paper is recompiled on another day though%%%
%%%\date{May 30, 2012}%%%%
\date{June 22, 2012}
%%%PUT YOUR DEFINITIONS HERE%%%
%NDJFL uses \varphi by default; redefine only if you want \phi%%%
\startlocaldefs
%%% our macros for this article only %%%%
\newcommand{\NDJFL}{\emph{NDJFL}}
\newcommand{\Jo}{\emph{Journal}}
\newcommand{\EM}{Editorial Manager}
\newcommand{\origphi}{\phi}
\newcommand{\CMS}{\emph{CMS}}
\newcommand{\mn}{\medskip\noindent}
\newcommand{\tietilde}{\char126\relax}
\endlocaldefs
\begin{document}
\begin{frontmatter}
%% TITLE OF YOUR PAPER%%%
%% Words in title should begin with uppercase, except%%%
%%% articles (and, the, a), conjunctions (and, for, nor, but),
%%% prepositions (by, with, for, over, and so on)
\title{\emph{Style Guide for Submission of Manuscripts to}\\
\emph{Notre Dame Journal of Formal Logic}}
%%% Choose a short title to be used as the running head on
%%% odd-numbered pages%%%
%%% Use this same title as "short title" when you submit MS to
%%% EM%%%%
\runtitle{NDJFL Style Guide}
\author{\fnms{Martha} %first name
\snm{Kummerer}%last name
\corref{}%to denote who is the corresponding author
\ead[label=e1]{[email protected]}%author email, leave this [label] as is
\ead[label=u1,url]{http://ndjfl.nd.edu/}%%web page, leave this [label] as is
}
%%% ADDRESS NOTES
%%% Dept listed first, University/company second, street or PO box
%%% third%%%
%%% U.S. Postal Service guidelines request no punctuation in the
%%% street...country lines%%%
%%% Country should be all uppercase%%%%
\address{Department of Leisure\\
University of the World\\
123 Paradise Lane\\
Lost Island LI 45678\\
THE CARIBBEAN\\
\printead{e1}\\
\printead{u1} }%
\and%
\author{\fnms{Peter}
\snm{Cholak}\ead[label=e2]{[email protected]}}%increase label by
% % one for each
% % author
\address{Department of Mathematics\\
University of Notre Dame\\
Notre Dame IN 46556\\
USA\\
\printead{e2} }
% \and \author{\fnms{???} \snm{???}\ead[label=e3]{???}}
% \address{\printead{e3}} \affiliation{???}
%%%% INSERT EACH AUTHOR'S FIRST INITIAL AND SURNAME%%%%
\runauthor{M.~Kummerer and P.~Cholak}
\begin{abstract}
This document and its \LaTeX\ source are meant as a guide to the
\emph{Notre Dame Journal of Formal Logic's (NDJFL)} style and the
style files \emph{ndjflart} and \emph{jflnat.bst}. The files will
explain the formatting of an article in ndjflart and will address
the style issues the \Jo\ prefers in the articles it publishes. The
abstract should be a very brief summary of the article, that is, no
more than 150 words. It is lifted from the paper by indexing
services and therefore should not contain citations to works in the
\emph{References} nor should it contain author-created macros.
Limit maths and symbols to those that can be easily converted for
web reading. The abstract should be in one block and not separated
into paragraphs.
\end{abstract}
\begin{keyword}[class=AMS]
\kwd[Primary ]{X001} \kwd{Y002} \kwd[; Secondary ]{Z003}
\end{keyword}
\begin{keyword}
\kwd{typesetting} \kwd{guide for authors}
\end{keyword}
\end{frontmatter}
% main matter with bibliography goes here
\section{How Should You Use This Style Guide?}\label{intro}
The \emph{Notre Dame Journal of Formal Logic} welcomes your
submission. We publish original and significant work in all areas of
logic and the foundations of mathematics. Your prepared manuscript
will be submitted and processed through
\href{http://www.editorialmanager.com/ndjfl}{Editorial Manager}.
Throughout the review process you can log in at any time and follow
the progress of your manuscript.
\begin{enumerate}
\item[(i)] ha
\item[(ii)] haha
\item[(iii)] hahaha
\end{enumerate}
\begin{enumerate}
\item[(a)] G\"odel
\item[(b)] Tarski
\item[(c)] Mostowski
\end{enumerate}
This guide will cover the preparation of your manuscript and details
on our particular style. Our hope is that you will use this style
guide to help you typeset your paper. No matter which documentclass
you use in composing your paper, you can easily convert it to ndjflart
using the suggestions in the template. Hopefully this guide will
prove useful whether you are converting a finished document to use
ndjflart.cls, are in the middle of writing the paper, or are just
beginning.
At the very least, this guide describes the \NDJFL\ style. We reserve
the right to edit your paper so it conforms to our style. If you read
this, you will not be surprised when you receive your page proofs.
\section{Frontmatter}\label{front}
This guide uses the documentclass ``ndjflart'' which you can download
from the\linebreak \href{http://ndjfl.nd.edu}{\NDJFL} website. It
also requires the artstatus argument ``am'' meaning ``author
manuscript.'' When your paper is typeset, this term will be changed
to incorporate the \Jo's fonts and settings. You should not change
this.
\subsection{Fonts}\label{fonts}
Various options appear in the code at the beginning of this template
which you can switch on or off for the fonts available to you. The
\NDJFL\ uses the MathTime{\tiny\texttrademark} Professional 2
(MTPro2)%
%
\endnote{MathTime{\tiny\texttrademark} Professional 2 (MTPro2) fonts
are the product of Personal TeX, Inc., San Francisco, CA and
trademarked by them.}
%
fonts for publishing. If you have them, you will know how to use them
in this template.
We have available the math alphabets mathcal, mathfrak, mathscr, and
mathbb (e.g., $\mathcal{A}, \mathfrak{A}, \mathscr{A}, \mathbb{A}$).
We use $\varphi$ by default so you do not need to redefine
\verb=\phi=. However, if you do need this $\origphi$ symbol
throughout your paper, you will need to \verb=\renewcommand=.
%%%% NOTA BENE %%%%%
Developing your own font symbol is \emph{strongly discouraged}. If
you cannot find a symbol among the standard \LaTeX, amssymb, and
mathrsfs symbols, try the packages stmaryrd, wasy2, or others found at
\href{http://www.ctan.org}{ctan.org}.
Our titles and section headings are in optima font. Since most users
do not have optima, your system will use helvetica. When you have
axioms or other items that need a list heading, you can use
\verb=\subsection*= to create a nice flush left heading that will
naturally occur in optima bold when we typeset your paper. The
following is an example of using this for a list heading.
\subsection*{List of Our Axioms}
\begin{tabbing}
A1\quad \= ABC\\
A2\> DEF
\end{tabbing}
\subsection{Author macros}\label{macros} Load your macros in the
special area between
\mn \verb=\startlocaldefs= and
\mn \verb=\endlocaldefs=.
\mn If you ``input'' a special file containing your macros, be sure to
include it when you are asked for source files upon acceptance of your
paper.
\subsection{Article data}
\subsubsection{Title and runtitle}\label{tandr} The title of your paper should be
printed in headline-style capitalization. In general, this means that
the first and last word and all major words in the title and subtitle
should be uppercase. Articles (an, the, a), conjunctions (and, nor,
or, but), and prepositions (by, with, for, over) should be lowercase.
See \emph{Chicago Manual of Style (CMS)}~\cite{CMS}, especially
Chapter~8.157, ``Principles of headline-style capitalization,'' for
more specific information and exceptional situations such as
hyphenated words. Keep maths to a minimum in titles.
The \verb=\runtitle= should be your preferred shortened version of
your title. This is requested when you upload your paper to \EM\ (in
the field called ``short title''). The editors may change this during
the final stages of publishing. Keep it short; it should not take up
the whole width of the page. This runtitle will appear on
even-numbered pages.
\subsubsection{Author(s)}\label{authordata} The \verb=\author{}= line
includes the author's name (divided into first name (\verb=\fnms{}=)
with middle initial, if desired, and surname (\verb=\snm{}=) and
e-mail address. It can also contain a web address, if desired. A
separate \verb=\author{}= is used for each additional author, but the
\verb=\ead= label is changed to e2,u2 or e3,u3, as appropriate.
On a separate line, the command \verb=\runauthor= contains the data
that will appear as the running head on odd-numbered pages in the
article. Enter the initial(s) and surname of each author separated by
``and.'' In a series of three or more authors the ``and'' is preceded
by a comma. (e.g., J.~A.~Smith, S.~Jones, and R.~Miller).
The \verb=\address= line contains the affiliation and address of each
author. The\linebreak \NDJFL\ uses the U.S. Postal Service format for
addresses, that is, affiliation first, university/company second,
street address third, city, state/province fourth, country last.
Country is printed in all uppercase. No punctuation should be used in
the street, city, state lines except for the hyphen used in some
countries' city codes.
\subsection{Mathematics Subject Classification}\label{msc}
The \NDJFL\ prints primary and, if provided, secondary, classification
codes for each article. You can find the classification(s) for your
article at
\href{http://www.ams.org/mathscinet/freeTools.html}{ams.org}. Choose
one or more and divide them into primary and secondary, as
appropriate. You will be asked to list these codes when you upload
your submission to
\href{http://www.editorialmanager.com/ndjfl}{Editorial Manager}.
\subsection{Keywords}\label{kwd} Please list several keywords
representing the content of your article. Be cautious when using
symbols since they can be represented only as text in a search. Don't
use macros here. They won't mean anything when separated from the
manuscript.
\section{Sectioning}\label{secs} All sections in \NDJFL\ articles are
numbered. The opening of your article should be the first
\verb=\section= and, if nothing else is appropriate, titled
``Introduction.'' Section titles should be in headline-style capitalization (see Section~\ref{tandr}). All sections should be labeled in the source code;
that is, use ``\verb=\label{}='' with a selected key term. You might
have referred to ``the previous section'' or ``the final section'' in
your text. The copyeditors/typesetters may, however, want to set a
link to those sections to facilitate the online edition. It helps to
have labels already keyed to these sections.
\subsection{Acknowledgments}\label{ssecacks} The \Jo\ places
acknowledgments in a special section at the end of the article
following the References section. It is an environment
\verb=\begin{acks}...\end{acks}= and may contain any thanks you want
to extend to individuals. It is also the place to include information
about grants and research data. Whereas we don't use first names in
the text of our articles, you may use full names here to thank people
or to cite personal conversations that were used in the paper. This
environment is the last code in the \LaTeX\ file before the
\verb=\end{document}=.
\subsection{Endnotes}\label{ssecnotes} The \NDJFL\ uses
endnotes%
%
\endnote{This is an endnote.}
rather than footnotes.%
%
\footnote{This is another.}
%
\kern.5ex There is nothing special you
need to do because your footnotes will automatically be placed in a
section at the end of the article before the References section. You
should just be aware of this placement in case you refer to the
location by page or direction in the text of your article. Notes are
also an appropriate place to cite personal conversations and thus full
names of individuals can be used.
Most of the time the note number should follow any punctuation,
including closing quotation marks and closing parenthesis. The
exceptions are that it should precede an em dash, and it \emph{may}
precede a closing parenthesis if the endnote applies to something in
the parenthetical note.
\section{Style Issues}\label{style}
The \NDJFL\ follows the \CMS\ for most style and grammatical issues.
The \Jo\ also uses American English for publication so spellings and
capitalization will be changed to reflect this style. For copyediting
issues we refer to \emph{Butcher's {C}opyediting}~\cite{copy}. Some of the other styles issues that
you should address, so they need not be changed in your manuscript
during copyediting, follow.
\subsection{Boldface}\label{ssecbf} We try to avoid the heaviness of excessive
boldface, and thus we limit its use to titles and headings. Instead
of boldface for emphasizing text, any of the italic commands should be
used. For the same reasoning, we prefer any of the enumerated list
labels---that is, (i), (ii) or 1., 2. or (a), (b)---instead of
bullets. If enumeration is not appropriate, a leading hyphen is still
preferable to a black dot.
\subsection{Dashes}\label{ssecdash} There are three types of dashes and
each has a specific use. The hyphen~(-), of course, is used to
hyphenate words when compound words are formed. The \Jo\ does not use
hyphens or make open compounds with the most common prefixes, that is,
\emph{anti, co, counter, hyper, meta, mid, multi, neo, non, pro,
pseudo, re, sub, super}. See the \emph{Chicago Manual of
Style}~\cite{CMS}, particularly, Chapter 7, ``Spelling, Distinctive
Treatment of Words, and Compounds'' for an extensive list and
explanation of compounds and hyphenation.
The en dash (formed with two dashes \verb=--=) is used as an ellipsis
would be used to indicate a range or missing elements between the two
ends. Thus, it is used between page numbers (pp.~67--74) and dates
1969--1973. No space is added to either side of the en dash.
The em dash (formed with three dashes \verb=---=) is used just as a
pair of commas or parentheses would be used, that is, to offset text.
No space---not even a tiny \verb=\,=---is left on either side of the em
dash.
\subsection{Latin phrases}\label{ssecLP} Our style does not italicize Latin phrases
that are in general use and easily understood by the general reader of
logic. The phrases prima facie, ad hoc, a priori, et al., and per
se, for example, are not italicized. Phrases not in common usage and also other
foreign language phrases should be italicized.
\subsection{Latin abbreviations}\label{ssecLA}
The Latin terms ``i.e'' (id est, that is), ``e.g.'' (exempli gratia,
for example), and ``viz.'' (videlicit or videre licet; namely, that is
to say, as follows) are handled in specific ways in \NDJFL\
manuscripts. When used in the main text, their English equivalents
should be used and thus are spelled out. The terms are offset by
commas if the phrase following the term is not an independent clause.
If the term is used with two independent clauses, ``that is'' is
preceded by a semicolon and followed by a comma.
In \NDJFL\ manuscripts, the Latin abbreviations should be confined
to parenthetical uses or notes and are always followed by a comma.
However, if the parenthetical note is a complete sentence and the term
is used at the beginning, it should be spelled out. (For example, in
this parenthetical explanation, ``E.g.'' is not used.)
\subsection*{Punctuation of Latin abbreviations and English equivalents}
\begin{tabbing}
\quad\=The day went as expected; that is, the sun rose and the sun set.\\
\>The day went as expected, that is, with the sun rising and setting.\\
\>The day went as expected (i.e., the sun rising and setting).\\
\>The day went as expected. (That is, the sun rose and the sun set.)
\end{tabbing}
\mn The abbreviation etc.\ (et cetera, and others of the same kind) is
preceded and followed by a comma when it is the final item in a
series. The equivalents ``and so forth'' and ``and so on'' are
punctuated in the same way. Of course, if etc.\ ends a sentence, it
would not be followed by any other punctuation. We prefer that you
avoid the abbreviation in the text, or at least overusing it, though
the term is acceptable in lists and tables, in notes, and within
parentheses.
\subsection{Ties}\label{ssecties} Most users of \LaTeX\ know
that a lowercase letter followed by a period needs a space modifier to
prevent \TeX\ from treating it as the end of a sentence and allowing
more space. Mostly, the backslash \verb=\= is used to create this
spacing. In some instances, however, the tilde is more appropriate
because it will tie the two elements together so they cannot be
separated at the end of a line. Thus, it is a good habit always to
use p.\tietilde\ to tie page numbers to their label and
cf.\tietilde\verb=\cite{}= so the citation number doesn't drop down to
a new line. In addition, it is always a good idea to tie \verb=\cite=
and \verb=\ref= to their labels or the previous word (e.g.,
Lemma\tietilde\verb=\ref{}=). \LaTeX\ does a pretty good, but not
perfect, job on this.
\subsection{Serial commas}\label{sseccommas}
When items in a series are separated by commas, with a conjunction
joining the last two elements, the \Jo\ uses a comma before the
conjunction. See \CMS~\cite[Chapter 6.18]{CMS}.
\subsection*{Examples of serial comma use}
\begin{tabbing}
\quad\=``on a construction due to Bishop, Metakides, Nerode, and Shore~[14]...''~\cite{ghma09}\\
\> ``a nonreductionist conception of logicism, a deflationary view of abstraction,\\
\>\qquad and an approach to
formal arithmetic...''~\cite{ant10}\\
\> ``There are thus generators $g_{n_1}$, $g_{n_2}$, $g_{m_1}$, and
$g_{m_2}$...''~\cite{cle09}\\
\>``Then we also
have $k_2 = n_1$, $\sigma_1 = \tau_2$, and $\sigma_2 = \tau_1$.''~\cite{cle09}
\end{tabbing}
\subsection{Labeling and cross-referencing}\label{sseclabel}
Please label and key all sections, equations, and figures as well as
all theorems, lemmas, definitions, corollaries, and so forth, for
possible referencing. When your article becomes part of our online
issue at \href{http://www.projecteuclid.org/ndjfl}{Project Euclid},
readers will appreciate the convenience of following your paper with
easy links.
\section{Graphics and Tables}\label{gandt}
The best graphics, \emph{if} they can be created for your paper, are
with \LaTeX's picture environment. This is because we can incorporate
our fonts in the figure and also because it
``travels'' well. We realize, though, that this is a limited option.
Therefore, the next best choice for a reliable graphic is
\verb=\usepackage{graphicx}= with a PDF file of the graphic for
\verb=\includegraphics{}=. This prints sharply and seamlessly and
allows a scaling option for sizing your graphic to the optimal
proportion for the \NDJFL\ page.
When creating tables keep in mind the size of your table in relation
to a journal-sized page. Large tables must often be scaled to fit a
journal page. When this is done, the font size may be reduced to a
point where the symbol is difficult to read or all the symbols and
text are so close together that they are not distinct.
\section{The AMS Packages}\label{ams}
The style file ndjflart.cls loads amsmath, amsthm, and amssymb. With
amsthm the standard environments, theorem, proof, lemma, corollary,
lemma, and so on, are available.
\verb=\begin{theorem}...\end{theorem}= (and likewise for the others
listed) will typeset your environments in the proper font and spacing.
The \verb=\begin{proof}...\end{proof}= will place %boldface
%\optimabf{Proof}
``Proof'' at the left margin in proper font and spacing, then list the
text of the proof and conclude with our proof-ending symbol~$\square$
at the right margin. The command \verb=\noeop= ends a proof
environment without a $\square$ when necessary. If intermediate
proof-ending symbols are needed (proofs within a proof), the
\verb=$\dashv$= ($\dashv$) should be used.
\begin{definition}
This is a theorem.
\end{definition}
\begin{proof}
Here is the proof.
\end{proof}
\section{References}\label{refs}
Check the References section at the end of this paper for the format
of our references. We use ``works cited'' as our basis so each item
listed in your bibliography should be cited somewhere in the
manuscript. The best way to create a bib file that will work with
jflnat.bst and produce our style of reference page is to enlist the
help of MathSciNet or Zentralblatt MATH. Use the Bib\TeX\ listing from
your search at either site. Go to the alternate site to capture its
number so that you have included both \mbox{MRNUMBER} and ZBLNUMBER.
Then, with \verb=\bibliographystyle{jflnat}=, you can create a
complete set of citations that will greatly speed up the typesetting
process.
Keep in mind that web page citations may not be useful in the long
life of your paper. If you do use them, put the web address in the
reference material and not in the text of the paper nor in endnotes.
We prefer using \verb=\href= rather than \verb=\url=.
\section{White Space}\label{whitesp}
\NDJFL\ uses a block style and eliminates as much white space as
possible. Limiting white space helps in the overall appearance of your
pages if they are published. Avoid using \verb=\bigskip= and
\verb=\vspace= and scattering \verb=\,=s all through your formulas. Trust
\LaTeX\ and the style file you are using. The spacing will change when
the paper is typeset with \NDJFL's fonts, so there is little need to
fix the spacing except in the final version.
\begin{thebibliography}{5}
\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi
\def\docolon{:}
\def\eatcomma#1{}
\def\onlyone#1{\gdef\oneletter{#1}}
\def\sphref#1#2{{\let\#=\docolon\xdef\one{#1}}\href{\one}{#2}}
\def\zhref#1,#2{{\let\#=\docolon\xdef\one{#1}}\href{\one}{#2}}
\expandafter\ifx\csname url\endcsname\relax
\def\url#1{{\tt #1}}\fi
\newcommand{\enquote}[2]{``#1,''}
\bibitem[Antonelli(2010)]{ant10}
Antonelli, G.~A.,
\newblock \enquote{Numerical abstraction via the {F}rege quantifier},
\newblock {\em Notre Dame Journal of Formal Logic}, vol.~51 (2010),
pp.~161--179.\eatcomma.
\zhref{http://www.emis.de/cgi-bin/MATH-item?1205.03055}, {\hbox{Zbl
1205.03055}}.
\sphref{http://www.ams.org/mathscinet-getitem?mr=2667904}{\hbox{MR 2667904}}.
\bibitem[Butcher(1981)]{copy}
Butcher, J.,
\newblock {\em Butcher's {C}opyediting: {T}he {C}ambridge {H}andbook for
{E}ditors, {C}opyeditors and {P}roofreaders}, 4th edition,
\newblock Cambridge University Press, Cambridge, 1981.
\bibitem[Clemens(2009)]{cle09}
Clemens, J.~D.,
\newblock \enquote{Isomorphism of homogeneous structures},
\newblock {\em Notre Dame Journal of Formal Logic}, vol.~50 (2009),
pp.~1--22.\eatcomma. \zhref{http://www.emis.de/cgi-bin/MATH-item?1188.03031},
{\hbox{Zbl 1188.03031}}.
\sphref{http://www.ams.org/mathscinet-getitem?mr=2536697}{\hbox{MR 2536697}}.
\bibitem[Gherardi and Marcone(2009)]{ghma09}
Gherardi, G. \unskip, and A.~Marcone,
``How incomputable is the separable {H}ahn-{B}anach theorem?''
{\em Notre Dame Journal of Formal Logic}, vol.~50 (2009),
pp.~393--425.\eatcomma.
\zhref{http://www.emis.de/cgi-bin/MATH-item?1223.03052}, {\hbox{Zbl
1223.03052}}.
\sphref{http://www.ams.org/mathscinet-getitem?mr=2598871}{\hbox{MR 2598871}}.
\bibitem[of~Chicago Press~Staff(2010)]{CMS}
University of~Chicago Press~Staff, editors,
\newblock {\em The Chicago Manual of Style}, 16th edition,
\newblock The University of Chicago Press, Chicago, 2010.
\end{thebibliography}
%\bibliographystyle{jflnat}
%\bibliography{GTA}
%%% ACKNOWLEDGMENTS= your personal comments and thanks %%%
\begin{acks}
We are grateful to all authors for the advice we are presenting herein which
has been learned through experience over a number of years. In addition, we thank
the editors of the clear and comprehensive \emph{Chicago Manual of
Style}. We also express our thanks to the AMS and Zentralblatt
MATH for the use of their Bib\TeX\ formats in our bibliography
files. Good luck with your submission!
\end{acks}
\end{document}
%%%%%%%%%%%%%GTA.bib%%%%%%%%%%
@book{CMS,
EDITOR = {University of Chicago Press Staff},
TITLE = {The Chicago Manual of Style},
PUBLISHER = {The University of Chicago Press},
ADDRESS = {Chicago},
YEAR = {2010},
EDITION = {16th}
}
@book{copy,
TITLE = {Butcher's {C}opyediting: {T}he {C}ambridge {H}andbook for {E}ditors, {C}opyeditors and {P}roofreaders},
AUTHOR = {Judith Butcher},
PUBLISHER = {Cambridge University Press},
ADDRESS = {Cambridge},
YEAR = {1981},
EDITION = {4th}
}
@article{ghma09,
AUTHOR = {Gherardi, Guido and Marcone, Alberto},
TITLE = {How incomputable is the separable {H}ahn-{B}anach theorem?},
JOURNAL = {Notre Dame Journal of Formal Logic},
VOLUME = {50},
YEAR = {2009},
NUMBER = {4},
PAGES = {393--425},
ISSN = {0029-4527},
MRCLASS = {03F60 (03B30 46A22 46S30)},
MRNUMBER = {2598871},
MRREVIEWER = {Klaus Weihrauch},
ZBLNUMBER = {1223.03052}
}
@article{ant10,
AUTHOR = {Antonelli, G. Aldo},
TITLE = {Numerical abstraction via the {F}rege quantifier},
JOURNAL = {Notre Dame Journal of Formal Logic},
VOLUME = {51},
YEAR = {2010},
NUMBER = {2},
PAGES = {161--179},
ISSN = {0029-4527},
MRCLASS = {03C80},
MRNUMBER = {2667904},
ZBLNUMBER = {1205.03055}
}
@article{cle09,
AUTHOR = {Clemens, John D.},
TITLE = {Isomorphism of homogeneous structures},
JOURNAL = {Notre Dame Journal of Formal Logic},
VOLUME = {50},
YEAR = {2009},
NUMBER = {1},
PAGES = {1--22},
ISSN = {0029-4527},
MRCLASS = {03E15 (03C15 03C50)},
MRNUMBER = {2536697},
MRREVIEWER = {Barbara Majcher-Iwanow},
ZBLNUMBER = {1188.03031}
}
|
https://pharmascope.org/ijrps/article/download/3759/10077
|
pharmascope.org
|
CC-MAIN-2021-04
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-04/segments/1610703497681.4/warc/CC-MAIN-20210115224908-20210116014908-00747.warc.gz
| 511,510,422
| 11,038
|
\documentclass[twocolumn,twoside]{article}
\makeatletter\if@twocolumn\PassOptionsToPackage{switch}{lineno}\else\fi\makeatother
\usepackage{amsfonts,amssymb,amsbsy,latexsym,amsmath,tabulary,graphicx,times,xcolor}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Following additional macros are required to function some
% functions which are not available in the class used.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{url,multirow,morefloats,floatflt,cancel,tfrupee}
\makeatletter
\AtBeginDocument{\@ifpackageloaded{textcomp}{}{\usepackage{textcomp}}}
\makeatother
\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{pifont}
\usepackage[nointegrals]{wasysym}
\urlstyle{rm}
\makeatletter
%%%For Table column width calculation.
\def\mcWidth#1{\csname TY@F#1\endcsname+\tabcolsep}
%%Hacking center and right align for table
\def\cAlignHack{\rightskip\@flushglue\leftskip\@flushglue\parindent\z@\parfillskip\z@skip}
\def\rAlignHack{\rightskip\z@skip\leftskip\@flushglue \parindent\z@\parfillskip\z@skip}
%Etal definition in references
\@ifundefined{etal}{\def\etal{\textit{et~al}}}{}
%\if@twocolumn\usepackage{dblfloatfix}\fi
\usepackage{ifxetex}
\ifxetex\else\if@twocolumn\@ifpackageloaded{stfloats}{}{\usepackage{dblfloatfix}}\fi\fi
\AtBeginDocument{
\expandafter\ifx\csname eqalign\endcsname\relax
\def\eqalign#1{\null\vcenter{\def\\{\cr}\openup\jot\m@th
\ialign{\strut$\displaystyle{##}$\hfil&$\displaystyle{{}##}$\hfil
\crcr#1\crcr}}\,}
\fi
}
%For fixing hardfail when unicode letters appear inside table with endfloat
\AtBeginDocument{%
\@ifpackageloaded{endfloat}%
{\renewcommand\efloat@iwrite[1]{\immediate\expandafter\protected@write\csname efloat@post#1\endcsname{}}}{\newif\ifefloat@tables}%
}%
\def\BreakURLText#1{\@tfor\brk@tempa:=#1\do{\brk@tempa\hskip0pt}}
\let\lt=<
\let\gt=>
\def\processVert{\ifmmode|\else\textbar\fi}
\let\processvert\processVert
\@ifundefined{subparagraph}{
\def\subparagraph{\@startsection{paragraph}{5}{2\parindent}{0ex plus 0.1ex minus 0.1ex}%
{0ex}{\normalfont\small\itshape}}%
}{}
% These are now gobbled, so won't appear in the PDF.
\newcommand\role[1]{\unskip}
\newcommand\aucollab[1]{\unskip}
\@ifundefined{tsGraphicsScaleX}{\gdef\tsGraphicsScaleX{1}}{}
\@ifundefined{tsGraphicsScaleY}{\gdef\tsGraphicsScaleY{.9}}{}
% To automatically resize figures to fit inside the text area
\def\checkGraphicsWidth{\ifdim\Gin@nat@width>\linewidth
\tsGraphicsScaleX\linewidth\else\Gin@nat@width\fi}
\def\checkGraphicsHeight{\ifdim\Gin@nat@height>.9\textheight
\tsGraphicsScaleY\textheight\else\Gin@nat@height\fi}
\def\fixFloatSize#1{}%\@ifundefined{processdelayedfloats}{\setbox0=\hbox{\includegraphics{#1}}\ifnum\wd0<\columnwidth\relax\renewenvironment{figure*}{\begin{figure}}{\end{figure}}\fi}{}}
\let\ts@includegraphics\includegraphics
\def\inlinegraphic[#1]#2{{\edef\@tempa{#1}\edef\baseline@shift{\ifx\@tempa\@empty0\else#1\fi}\edef\tempZ{\the\numexpr(\numexpr(\baseline@shift*\f@size/100))}\protect\raisebox{\tempZ pt}{\ts@includegraphics{#2}}}}
%\renewcommand{\includegraphics}[1]{\ts@includegraphics[width=\checkGraphicsWidth]{#1}}
\AtBeginDocument{\def\includegraphics{\@ifnextchar[{\ts@includegraphics}{\ts@includegraphics[width=\checkGraphicsWidth,height=\checkGraphicsHeight,keepaspectratio]}}}
\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
\def\URL#1#2{\@ifundefined{href}{#2}{\href{#1}{#2}}}
%%For url break
\def\UrlOrds{\do\*\do\-\do\~\do\'\do\"\do\-}%
\g@addto@macro{\UrlBreaks}{\UrlOrds}
\edef\fntEncoding{\f@encoding}
\def\EUoneEnc{EU1}
\makeatother
\def\floatpagefraction{0.8}
\def\dblfloatpagefraction{0.8}
\def\style#1#2{#2}
\def\xxxguillemotleft{\fontencoding{T1}\selectfont\guillemotleft}
\def\xxxguillemotright{\fontencoding{T1}\selectfont\guillemotright}
\newif\ifmultipleabstract\multipleabstractfalse%
\newenvironment{typesetAbstractGroup}{}{}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[authoryear]{natbib}
\newif\ifnokeywords\nokeywordsfalse
\makeatletter\input{size10-pointfive.clo}\makeatother%
\definecolor{kwdboxcolor}{RGB}{242,242,242}
\usepackage[hidelinks,colorlinks=true,allcolors=blue]{hyperref}
\linespread{1}
\def\floatpagefraction{0.8}
\usepackage[paperheight=11.69in,paperwidth=8.26in,top=1in,bottom=1in,left=1in,right=.75in,headsep=24pt]{geometry}
\usepackage{multirow-custom}
\makeatletter
\def\hlinewd#1{%
\noalign{\ifnum0=`}\fi\hrule \@height #1%
\futurelet\reserved@a\@xhline}
\def\tbltoprule{\hlinewd{1pt}\\[-14pt]}
\def\tblbottomrule{\noalign{\vspace*{6pt}}\hline\noalign{\vspace*{2pt}}}
\def\tblmidrule{\hline\noalign{\vspace*{2pt}}}
\let\@articleType\@empty
\let\@journalDoi\@empty
\let\@journalVolume\@empty
\let\@journalIssue\@empty
\let\@crossMarkLink\@empty
\let\@receivedDate\@empty
\let\@acceptedDate\@empty
\let\@revisedDate\@empty
\let\@publishedDate\@empty
\let\@copyrightYear\@empty
\let\@firstPage\@empty
\def\articleType#1{\gdef\@articleType{#1}}
\def\journalDoi#1{\gdef\@journalDoi{#1}}
\def\crossMarkLink#1{\gdef\@crossMarkLink{#1}}
\def\receivedDate#1{\gdef\@receivedDate{#1}}
\def\acceptedDate#1{\gdef\@acceptedDate{#1}}
\def\revisedDate#1{\gdef\@revisedDate{#1}}
\def\publishedDate#1{\gdef\@publishedDate{#1}}
\def\copyrightYear#1{\gdef\@copyrightYear{#1}}
\def\journalVolume#1{\gdef\@journalVolume{#1}}
\def\journalIssue#1{\gdef\@journalIssue{#1}}
\def\firstPage#1{\gdef\@firstPage{#1}}
\def\author#1{%
\gdef\@author{%
\hskip-\dimexpr(\tabcolsep)\hskip5pt%
\parbox{\dimexpr\textwidth-1pt}%
{\fontsize{11}{13}\selectfont\raggedright #1}%
}%
}
\usepackage{pharmascope-abs}
\usepackage{caption}
\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage[noindentafter,explicit]{titlesec}
\usepackage{fontspec}
\setmainfont[%
BoldFont=cambriab.otf,%
ItalicFont=CAMBRIAI.otf,%
BoldItalicFont=CAMBRIAZ.otf]{Cambria.otf}
\lefthyphenmin = 3
\def\title#1{%
\gdef\@title{%
\vspace*{-40pt}%
\ifx\@articleType\@empty\else{\fontsize{10}{12}\scshape\selectfont\hspace{8pt}\@articleType\hfill\mbox{}\par\vspace{2pt}}\fi%
\minipage{\linewidth}
\hrulefill\\[-0.7pt]%
\mbox{~}\hspace{5pt}\parbox{.1\linewidth}{\includegraphics[width=75pt,height=50pt]{ijrps_logo.png}}\hfill
\fcolorbox{kwdboxcolor}{kwdboxcolor}{\parbox{.792\linewidth}{%
\begin{center}\fontsize{17}{17}\selectfont\scshape\vskip-7pt International Journal of Research in Pharmaceutical Sciences\hfill\end{center}%
\vspace*{-10pt}\hspace*{4pt}{\fontsize{8}{9}\selectfont Published by JK Welfare \& Pharmascope Foundation\hfill Journal Home Page: \href{http://www.pharmascope.org/ijrps}{\color{blue}\underline{\smash{www.pharmascope.org/ijrps}}}}\hspace*{4pt}\mbox{}}}%
\par\vspace*{-1pt}\rule{\linewidth}{1.3pt}%
\endminipage%
\par\vspace*{9.2pt}\parbox{.98\linewidth}{\linespread{.9}\raggedright\fontsize{14}{17}\selectfont #1}%
\vspace*{-8pt}%
}
}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0.4pc plus 1pt minus 1pt}
\def\abbrvJournalTitle{Int. J. Res. Pharm. Sci.}
\fancypagestyle{headings}{%
\renewcommand{\headrulewidth}{0pt}%
\renewcommand{\footrulewidth}{0.3pt}
\fancyhf{}%
\fancyhead[R]{%
\fontsize{9.12}{11}\selectfont\RunningAuthor,\ \abbrvJournalTitle,\ \ifx\@journalVolume\@empty X\else\@journalVolume\fi%
\ifx\@journalIssue\@empty\else(\@journalIssue)\fi%
,\ \ifx\@firstPage\@empty 1\else\@firstPage\fi-\pageref*{LastPage}%
}%
\fancyfoot[LO,RE]{\fontsize{9.12}{11}\selectfont\textcopyright\ International Journal of Research in Pharmaceutical Sciences}%
\fancyfoot[RO,LE]{\fontsize{9.12}{11}\selectfont\thepage}
}\pagestyle{headings}
\fancypagestyle{plain}{%
\renewcommand{\headrulewidth}{0pt}%
\renewcommand{\footrulewidth}{0.3pt}%
\fancyhf{}%
\fancyhead[R]{%
\fontsize{9.12}{11}\selectfont\RunningAuthor,\ \abbrvJournalTitle,\ \ifx\@journalVolume\@empty X\else\@journalVolume\fi%
\ifx\@journalIssue\@empty\else(\@journalIssue)\fi%
,\ \ifx\@firstPage\@empty 1\else\@firstPage\fi-\pageref*{LastPage}%
}%
\fancyfoot[LO,RE]{\fontsize{9.12}{11}\selectfont\textcopyright\ International Journal of Research in Pharmaceutical Sciences}%
\fancyfoot[RO,LE]{\fontsize{9.12}{11}\selectfont\thepage}
\ifx\@firstPage\@empty\else\setcounter{page}{\@firstPage}\fi
}
\def\NormalBaseline{\def\baselinestretch{1.1}}
\usepackage{textcase}
\setcounter{secnumdepth}{0}
\titleformat{\section}[block]{\bfseries\boldmath\NormalBaseline\filright\fontsize{10.5}{13}\selectfont}
{\thesection}
{6pt}
{\MakeTextUppercase{#1}}
[]
\titleformat{\subsection}[block]{\bfseries\boldmath\NormalBaseline\filright\fontsize{10.5}{12}\selectfont}
{\thesubsection}
{6pt}
{#1}
[]
\titleformat{\subsubsection}[block]{\NormalBaseline\filright\fontsize{10.5}{12}\selectfont}
{\thesubsubsection}
{6pt}
{#1}
[]
\titleformat{\paragraph}[block]{\NormalBaseline\filright\fontsize{10.5}{10}\selectfont}
{\theparagraph}
{6pt}
{#1}
[]
\titleformat{\subparagraph}[block]{\NormalBaseline\filright\fontsize{10.5}{12}\selectfont}
{\thesubparagraph}
{6pt}
{#1}
[]
\titlespacing{\section}{0pt}{.5\baselineskip}{.5\baselineskip}
\titlespacing{\subsection}{0pt}{.5\baselineskip}{.5\baselineskip}
\titlespacing{\subsubsection}{0pt}{.5\baselineskip}{.5\baselineskip}
\titlespacing{\paragraph}{0pt}{.5\baselineskip}{.5\baselineskip}
\titlespacing{\subparagraph}{0pt}{.5\baselineskip}{.5\baselineskip}
\captionsetup[figure]{skip=1.4pt,font=bf,labelsep=colon,justification=raggedright,singlelinecheck=false}
\captionsetup[table]{skip=1.4pt,font=bf,labelsep=colon,justification=raggedright,singlelinecheck=false}
\def\bibyear#1{#1}
%\def\bibjtitle#1{#1} %%Publisher request
\def\bibauand{}
\setlength\bibsep{3pt}
\setlength\bibhang{8pt}
\makeatother
\date{}
\usepackage{float}
\begin{document}
\def\RunningAuthor{Bhuvaneshwari G et al.}
\firstPage{148}
\articleType{Original Article}
\receivedDate{11 Nov 2020}
\acceptedDate{29 Dec 2020}
\revisedDate{17 Dec 2020}
\journalVolume{2020, 11 (SPL4)}
\journalDoi{ijrps.v11iSPL4.3759}
\copyrightYear{2020}
\def\authorCount{4}
\def\affCount{1}
\def\journalTitle{International Journal of Research in Pharmaceutical Sciences}
\title{\textbf{Effectiveness of Light Pressure Stroking Massage with Sesame Oil in Alleviating Acute Knee Joint Pain among Elderly Adults}}
\author{Bhuvaneshwari~G\textsuperscript{*},
Anju~P,
Pavithra~S,
Thenmozhi~S~\\[5pt]{Department of Community Health Nursing, Saveetha College of Nursing, Saveetha Institute of Medical and Technical Sciences, Chennai, Tamil Nadu, India}}
\begin{abstract}
Osteoarthritis (Acute knee joint pain) is a major health problem in the world. This investigation to assess the impact of lightweight stroking knead with effective sesame oil on torment seriousness of patients with knee joint agony. The main aim to determine the effectiveness of light pressure stroking massage with sesame oil on alleviating acute knee joint pain among elderly adults.\textbf{\space }(Age, Sex, Religion, Marital status, Educational status, Diet habit, Exercise, Body mass index). A pre-test was conducted to assess the WOMAC scale was managed to evaluate the level of pain. A back rub with sesame oil was applied 3weeks period. A post-test was led to evaluate the adequacy of the intercession. The knee pain level was surveyed by Western Ontario MAC Master Scale. The discoveries were most of the older grown-up individuals 46.7\% had moderate pain, 10\% had moderate pain, 31.7\% had serious pain, 11.6\% had extreme pain. After the back rub with sesame oil the knee pain level was diminished to 26.7\% had mild pain, 40\% had moderate pain, 25\% had serious pain, 3\% had extreme pain. The finding of the examination uncovered that knead with sesame oil for Knee joint pain was compelling in a huge decrease of the knee joint pain level at the degree of p{\textless}0.05 in the trial gathering. Thusly, because of ease, simple use and absence of unfriendly impact, it is proposed to utilize this oil on integral medication for relief from discomfort.
\end{abstract}\def\keywordstitle{Keywords}
\begin{keywords}Effectiveness,\newline Light Pressure,\newline Stroking Massage,\newline Sesame Oil,\newline Acute Knee Joint Pain
\end{keywords}
\twocolumn[ \maketitle {\printKwdAbsBox}]
\makeatletter\textsuperscript{*}Corresponding Author\par Name:\ Bhuvaneshwari~G~\\ Phone:\ 9043872624~\\ Email:\ [email protected]
\par\vspace*{-11pt}\hrulefill\par{\fontsize{12}{14}\selectfont ISSN: 0975-7538}\par%
\textsc{DOI:}\ \href{https://doi.org/10.26452/\@journalDoi}{\textcolor{blue}{\underline{\smash{https://doi.org/10.26452/\@journalDoi}}}}\par%
\vspace*{-11pt}\hrulefill\\{\fontsize{9.12}{10.12}\selectfont Production and Hosted by}\par{\fontsize{12}{14}\selectfont Pharmascope.org}\par%
\vspace*{-7pt}{\fontsize{9.12}{10.12}\selectfont\textcopyright\ \@copyrightYear\ $|$ All rights reserved.}\par%
\vspace*{-11pt}\rule{\linewidth}{1.2pt}
\makeatother
\section{Introduction}
The World Health Organization (WHO) report recognized knee torment, as the eighth driving reason for non-lethal weight on the planet in 2000, representing 2.6 percent of the complete year lost because of disability\unskip~\citep{961189:21024598}. Knee torment is an extremely normal event in the older grownup populace. The knee is the biggest and most complex joint in the body. Wounds and illnesses of the knee are regular wellsprings of handicap, agony and lost days from work. Uneasiness might be related to a wide range of infections. The agony can influence the capacity to move around, take an interest in a day by day exercises and rest serenely \unskip~\citep{961189:21024601}. The reasons for torment, for the most part, start in the knee joint. Normal reasons for knee torment are osteoarthritis, A torn meniscus \unskip~\citep{961189:21024602}. Rheumatoid joint inflammation or Inflammatory Arthritis, Gout, Knee joint disease, Tendonitis or Bursitis. Osteoarthritis is the most widely recognized reason for knee torment in the older grown-up. Osteoarthritis is the mileage kind of joint inflammation that we are largely dependent upon \unskip~\citep{961189:21024593}. The rate is marginally higher in ladies than men. Expanding paces of corpulence and diminished paces of activity have brought about a pestilence of osteoarthritis in our general public \unskip~\citep{961189:21024591}. Most patients experience a moderate, steady expansion in agony and expanding. Actually, there is regularly a bandy-legged appearance, particularly with weight-bearing. Inside the knee, a fix like loss of covering ligament on the finish of the bones permits the unresolved issues together. Normally the joint inflammation is additionally connected with a longstanding meniscus tear. Introductory treatment comprises rest, ice, anti-incendiary drugs, weight reduction and low effect practice program. Injectable greases up are accessible for joint inflammation knee and can briefly decrease indications in moderate cases.
Dietary enhancements are regularly supported (glucosamine and chondroitin); however, have never been demonstrated viable in logical examinations. For serious joint pain, knee substitution medical procedure has incredibly high achievement and patient fulfillment rates \unskip~\citep{961189:21024590}. Entanglement of knee torment is not all knee is not kidding. Be that as it may, some knee wounds and ailments, for example, osteoarthritis, can prompt expanded agony, joint harm and incapacity whenever left untreated \unskip~\citep{961189:21024605}. The extract (oil) acquired from the sesame seeds otherwise called sesamumindicum, is an incredible decision for kneading as it is stacked with a wide assortment of supplements, including nutrients and fundamental minerals, for example, calcium, copper and zinc, which advance digestion just as blood course. The sesame oil additionally helps the creation of red platelets in our body \unskip~\citep{961189:21024589}.
The presence of zinc improves the bone mineral thickness, hence upgrading the nature of bones, copper, then again, shows some critical calming properties, in this manner diminishing the torment and decreasing the growing related with joints. Simultaneously, it additionally fortifies the bones and joints. Sesame oil additionally contains omega-3 unsaturated fats, alongside some mono saturated fats, which are particularly useful for the soundness of our bones. Besides, this oil likewise advances the rate at which the bones develop a lot in the body. Not just that, it likewise accelerates the mending of bones, All these properties together make sesame oil very powerful as a skin drug, and an unmistakable fixing in the greater part of the agony is easing rub oils and treatments. In this manner kneading the joint with sesame oils and salves, subsequently rubbing the joint with sesame oil benefits in diminishing the torment just as growing, and furthermore fortifies the bones \unskip~\citep{961189:21024599}.
Likewise, lignans, for example, sesamin have been portrayed to alleviate torment. In this investigation, we utilized the Saman brand of sesame oil, which the past examination \unskip~\citep{961189:21024603}, demonstrated the most noteworthy substance of sesamollignans in this brand. In light of late examination, sesamin is one of the dynamic mixes in sesame oil and legitimize the antinociceptive and mitigating properties of this item \unskip~\citep{961189:21024595}. However, further investigations are important to comprehend the components of activity and correspond pharmacological movement with a compound piece of sesame oil \unskip~\citep{961189:21024604}. The examiner came to realize that numerous older are experiencing joint agony, solidness and force the impact on exercises of day by day living. A high dreariness of knee torment needs reinforcing of geriatric medical care administrations both network and clinic-based. Thus, the investigator felt a need to undertake a study to assess the effectiveness of light pressure stroking massage with sesame oil in alleviating acute knee joint pain among elderly adults.
\section{Materials and Methods}
A quasi-experimental approach and one group pre and post-test research design were used to conduct the study. The investigator obtained formal permission. The data collected from the 30 subjects from rural community area, Kondanchery, Chennai, who met the inclusion criteria through purposive sampling technique. The investigator obtained the written informed consent. Pre and post-test method was adopted. The demographic variable was collected by a structured questionnaire. The pre-test level knee joint pain was assessed with the Western Ontario Mac Master Scale. Followed by that light pressure stroking massage with sesame oil was given for 20 minutes. This intercession was planned for 6 meetings for 3 weeks. After the 3 weeks, the post-test was directed with a similar scale. The gathered information was investigated with descriptive and inferential statistics.
\section{Results and Discussion}
\textbf{Frequency and percentage distribution of } \textbf{demographic variables among elders}
Out of 30 samples, Majority (40\%) of the elderly adult were in the age of 41-45 years; females were 60\%, (100\%) were married, 93.3\% were Christians, 23.3\% had completed their schooling, 83.3\% were non-vegetarian, 96.7\% did not perform the exercise.
\begin{table*}[!htbp]
\caption{\boldmath {Frequency and percentage distribution of pretest knee pain level among elderly adult people at selected Kondanchery (N=30).} }
\label{tw-a7e0bf675d14}
\def\arraystretch{1.1}
\ignorespaces
\centering
\begin{tabulary}{\linewidth}{p{\dimexpr.1934\linewidth-2\tabcolsep}p{\dimexpr.19500000000000004\linewidth-2\tabcolsep}p{\dimexpr.20659999999999997\linewidth-2\tabcolsep}p{\dimexpr.2017\linewidth-2\tabcolsep}p{\dimexpr.2033\linewidth-2\tabcolsep}}
\tbltoprule \rowcolor{kwdboxcolor}{\multirow{2}{*}{\textbf{Level of pain}}} & \multicolumn{2}{p{\dimexpr(.4016\linewidth-2\tabcolsep)}}{\cAlignHack \textbf{Pretest}} & \multicolumn{2}{p{\dimexpr(.405\linewidth-2\tabcolsep)}}{\cAlignHack \textbf{Post-test}}\\
\rowcolor{kwdboxcolor} & \cAlignHack \textbf{Frequency} & \cAlignHack \textbf{Percentage \%} & \cAlignHack \textbf{Frequency} & \cAlignHack \textbf{Percentage \%}\\
\tblmidrule
Mild &
\cAlignHack 5 &
\cAlignHack 16.7 &
\cAlignHack 18 &
\cAlignHack 60\\
Moderate &
\cAlignHack 16 &
\cAlignHack 53.3 &
\cAlignHack 7 &
\cAlignHack 23.3\\
Severe &
\cAlignHack 9 &
\cAlignHack 30 &
\cAlignHack 5 &
\cAlignHack 16.7\\
\tblbottomrule
\end{tabulary}\par
\end{table*}
\begin{table*}[!htbp]
\caption{\boldmath {Effectiveness of light pressure stroking massage with sesame oil on alleviating acute knee joint pain among elderly adult.} }
\label{tw-e4d582edb31d}
\def\arraystretch{1.1}
\ignorespaces
\centering
\begin{tabulary}{\linewidth}{p{\dimexpr.14049999999999999\linewidth-2\tabcolsep}p{\dimexpr.0648\linewidth-2\tabcolsep}p{\dimexpr.08879999999999997\linewidth-2\tabcolsep}p{\dimexpr.11460000000000003\linewidth-2\tabcolsep}p{\dimexpr.10629999999999999\linewidth-2\tabcolsep}p{\dimexpr.12199999999999998\linewidth-2\tabcolsep}p{\dimexpr.13310000000000002\linewidth-2\tabcolsep}p{\dimexpr.0749\linewidth-2\tabcolsep}p{\dimexpr.155\linewidth-2\tabcolsep}}
\tbltoprule \rowcolor{kwdboxcolor}{\multirow{2}{*}{\textbf{Score}}} & {\multirow{2}{*}{\textbf{N}}} & \multicolumn{2}{p{\dimexpr(.2034\linewidth-2\tabcolsep)}}{\cAlignHack \textbf{Pretest}} & \multicolumn{2}{p{\dimexpr(.2283\linewidth-2\tabcolsep)}}{\cAlignHack \textbf{Post-test}} & {\multirow{2}{*}{\textbf{Paired 't'}}} & {\multirow{2}{*}{\textbf{df}}} & {\multirow{2}{*}{\textbf{Significance}}}\\
\rowcolor{kwdboxcolor} & & \cAlignHack \textbf{M} & \cAlignHack \textbf{SD} & \cAlignHack \textbf{M} & \cAlignHack \textbf{SD} & & & \\
\tblmidrule
Level of \mbox{}\protect\newline Knee pain &
30 &
\cAlignHack 1.9 &
\cAlignHack 12.69 &
\cAlignHack 0.59 &
\cAlignHack 17.03 &
6.84 &
29 &
p{\textless}.00001\\
\tblbottomrule
\end{tabulary}\par
\end{table*}
Figure~\ref{f-f85194232aca} The duration of knee joint pain was 66.7\%, 23.3\% and 10\% since 0-1, 1-3 and 3-5 years respectively. Figure~\ref{f-1bda025bad5b} Regarding the type treatment, 20\% had taken alternative. 33.3\% external and 46.7\% oral. Figure~\ref{f-f0ec0bb4e368} In respect of body mass index 26.7\%, 23.3\% and 40\% had {\textless}18.5, 18.5-25 and 25-30 respectively.
\bgroup
\fixFloatSize{images/89f43d97-55b2-40f5-8b86-8efcb3597fef-upicture1.png}
\begin{figure}[!htbp]
\centering \makeatletter\IfFileExists{images/89f43d97-55b2-40f5-8b86-8efcb3597fef-upicture1.png}{\includegraphics{images/89f43d97-55b2-40f5-8b86-8efcb3597fef-upicture1.png}}{}
\makeatother
\caption{\boldmath {Percentage distribution of sample according to exercise.}}
\label{f-f85194232aca}
\end{figure}
\egroup
The above table clarifies that the degree of knee joint pain among old grown-up individuals before knead with sesame oil. The 16.7\% of old grown-up individuals had gentle knee joint pain, 53.3\% of old grown-up had moderate knee joint pain and 30\% of old grown-up individuals had extreme knee joint pain, before use of back rub with sesame oil. Concerning test results show that 60\% of older grownup individuals had none knee joint pain 23.3\% had Mild knee joint pain and 16.7\% had moderate knee joint pain after the utilization of back rub with sesame oil Table~\ref{tw-a7e0bf675d14}. The mean pretest knee pain level was 1.9, with a standard deviation of 12.69 and the post-test mean was 0.59, with a standard deviation of 17.03 individually. The test criticalness of was count utilizing matched t-test. The got t value is 6.84, which was huge p{\textless}.00001. Table~\ref{tw-e4d582edb31d} The relationship between posttest knee pain level decrease score and their demographic factors. Statistical significance determined utilizing chi-square. Age (X\ensuremath{^{2}} =6.075, p{\textless}.047955), Exercise (X\ensuremath{^{2}}=2.9814, p={\textless}.084228), Body max index (X\ensuremath{^{2}}=10.0974, p{\textless}.017756. Were essentially connected with the posttest level of knee pain. Apart from these different factors were not significantly related. Osteoarthritis is the third driving reason for infection trouble and the fourth most significant reason for handicap on the planet. It was as of late assessed that since 1990, the predominance of joint pain has expanded by 750000 cases for every year \unskip~\citep{961189:21024592}.
\bgroup
\fixFloatSize{images/b0cbdac4-ac22-43c0-8783-3f2bfe29c29a-upicture2.png}
\begin{figure}[!htbp]
\centering \makeatletter\IfFileExists{images/b0cbdac4-ac22-43c0-8783-3f2bfe29c29a-upicture2.png}{\includegraphics{images/b0cbdac4-ac22-43c0-8783-3f2bfe29c29a-upicture2.png}}{}
\makeatother
\caption{\boldmath {Percentage distribution of sample according to duration of knee joint pain.}}
\label{f-1bda025bad5b}
\end{figure}
\egroup
The current examination demonstrated that the meantime of considered example was out of 30 samples, Majority (40\%) of the old grown-up ere in the age of 41-45 years. What's more, the excess was above 35-40 years (33.3\%) and having a place with 46-50years (26.6\%). This finding is predictable with \unskip~\citep{961189:21024596} who revealed that the rate of osteoarthritis increases with age and the pervasiveness increments generously after the age of 50 years in lady and 55 years in men. Concerning, Puttini et al. referenced that knee osteoarthritis is regular in a lady than men. This is in accordance with the consequences of the current examination, which expressed that, 75\% of considered example were females. Our examination finding likewise male and females were 40 and 60 rates individually. Present study viability of lightweight with seasame oil knead results shows that the mean pretest knee torment level was 1.9 with a standard deviation of 12.69 and the post-test mean was 0.59 with a standard deviation of 17.03 separately. The test centrality of was estimation utilizing combined t-test. The acquired t esteem is 6.84, which was critical p{\textless}.00001.
\bgroup
\fixFloatSize{images/a29a589d-81e3-4d5b-b153-bbc3d047f4d4-upicture3.png}
\begin{figure}[!htbp]
\centering \makeatletter\IfFileExists{images/a29a589d-81e3-4d5b-b153-bbc3d047f4d4-upicture3.png}{\includegraphics{images/a29a589d-81e3-4d5b-b153-bbc3d047f4d4-upicture3.png}}{}
\makeatother
\caption{\boldmath {Percentage distribution of the sample according to a type of treatment.}}
\label{f-f0ec0bb4e368}
\end{figure}
\egroup
\unskip~\citep{961189:21024591} affirmed that one hundred and four patients were haphazardly selected two arms of the preliminary. Patients were treated by effective sesame oil or diclofenac for about a month. Result measures were knee torment through simple visual scale, Western Ontario and McMaster colleges osteoarthritis record survey, knee joints flexion analgesics. Patients were and a number of utilized analgesics. Patients were assessed at the gauge, 2 and afterwards a month after the mediation. It appears to be that the skin sesame oil was non-mediocre compared to diclofenac gel on the decrease of the knee OA agony and improvement of certain pointers of its function. In connection to the results of the diverse treatment modalities, it was presumed that redness happened in more than 33\% of contemplated test in the wake of applying the warm treatment \unskip~\citep{961189:21024603}.
This outcome corresponds with \unskip~\citep{961189:21024604} who summed up that warm modalities furnish critical relief from discomfort with low results \unskip~\citep{961189:21024597}. The association between posttest knee pain level reduction score and their demographic variables. Statistical significance calculated using chi-square. Age (X\ensuremath{^{2}} =6.075, p{\textless}.047955), Exercise (X\ensuremath{^{2}}=2.9814, p={\textless}.084228), Body max index (X\ensuremath{^{2}}=10.0974, p{\textless}.017756). Were significantly associated with the posttest level of knee pain. It is summed up in an investigation \unskip~\citep{961189:21024594} that, a higher weight file essentially associated with an expanded danger of joint substitution because of osteoarthritis. This is in concurrence with the discoveries of this examination that demonstrated that the mean weight list of the considered example was 37.65\ensuremath{\pm}5.6kg/m \unskip~\citep{961189:21024596}. Likewise, \unskip~\citep{961189:21024600} referenced that the weight record of the example was 36.75\ensuremath{\pm} 5.16k/m \unskip~\citep{961189:21024600}. Hence, there is a critical distinction in the degree of knee torment when lightweight stroking kneads with sesame oil was acknowledged.
\section{Conclusions}
Community health nurse assumes a significant function in wellbeing advancement and avoidance of sicknesses in the geriatric populace. Knee torment is more normal in Geriatric individuals. This problem is very regular and frequently brought about the interference of exercises of day by day living. In inferential measurements, this examination demonstrated that there is a decrease in the Knee torment level after knead with sesame oil among older individuals when contrasted and pretest. This option and corresponding method facilitate that the elderly individual to adapt to the desolate and knee torment decrease in a shorter span. These exploration based proof can be applied in the clinical arrangement the individuals who experienced knee torment.
\textbf{Funding Support}
The authors declare that they have no funding support for this study.
\textbf{Conflict of Interest}
The authors declare that they have no conflict of interest for this study.
\bibliographystyle{pharmascope_apa-custom}
\bibliography{\jobname}
\end{document}
|
http://acutrials.ocom.edu/search.php?sqlQuery=SELECT%20author%2C%20title%2C%20type%2C%20year%2C%20publication%2C%20abbrev_journal%2C%20volume%2C%20issue%2C%20pages%2C%20keywords%2C%20abstract%2C%20thesis%2C%20editor%2C%20publisher%2C%20place%2C%20abbrev_series_title%2C%20series_title%2C%20series_editor%2C%20series_volume%2C%20series_issue%2C%20edition%2C%20language%2C%20author_count%2C%20online_publication%2C%20online_citation%2C%20doi%2C%20serial%2C%20area%20FROM%20refs%20WHERE%20serial%20%3D%20473%20ORDER%20BY%20first_author%2C%20author_count%2C%20author%2C%20year%2C%20title&client=&formType=sqlSearch&submit=Cite&viewType=&showQuery=0&showLinks=1&showRows=20&rowOffset=&wrapResults=1&citeOrder=&citeStyle=APA&exportFormat=RIS&exportType=html&exportStylesheet=&citeType=LaTeX&headerMsg=
|
ocom.edu
|
CC-MAIN-2019-43
|
application/x-latex
|
application/x-latex
|
crawl-data/CC-MAIN-2019-43/segments/1570987823061.83/warc/CC-MAIN-20191022182744-20191022210244-00012.warc.gz
| 7,992,952
| 1,312
|
%&LaTeX
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\begin{document}
\begin{thebibliography}{1}
\bibitem{Hu+Wang2011} Hu, Z., \& Wang, Y. (2011). \textit{Mechanism Study on Acupuncture for Non-insulin Resistant Polycystic Ovary Syndrome} (Vol. 9). 46, 12 Weeks(Polycystic Ovarian Syndrome).
\end{thebibliography}
\end{document}
|
http://mclab.di.uniroma1.it/publications/search.php?sqlQuery=SELECT%20author%2C%20title%2C%20type%2C%20year%2C%20publication%2C%20abbrev_journal%2C%20volume%2C%20issue%2C%20pages%2C%20keywords%2C%20abstract%2C%20thesis%2C%20editor%2C%20publisher%2C%20place%2C%20abbrev_series_title%2C%20series_title%2C%20series_editor%2C%20series_volume%2C%20series_issue%2C%20edition%2C%20language%2C%20author_count%2C%20online_publication%2C%20online_citation%2C%20doi%2C%20serial%20FROM%20refs%20WHERE%20serial%20%3D%2074%20ORDER%20BY%20year%20DESC%2C%20first_author%2C%20author_count%2C%20author%2C%20title&client=&formType=sqlSearch&submit=Cite&viewType=&showQuery=0&showLinks=1&showRows=10&rowOffset=&wrapResults=1&citeOrder=year&citeStyle=Roma&exportFormat=RIS&exportType=html&exportStylesheet=&citeType=LaTeX&headerMsg=
|
uniroma1.it
|
CC-MAIN-2022-33
|
application/x-latex
|
application/x-latex
|
crawl-data/CC-MAIN-2022-33/segments/1659882570868.47/warc/CC-MAIN-20220808152744-20220808182744-00385.warc.gz
| 30,997,624
| 1,296
|
%&LaTeX
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\begin{document}
\section*{2003}
Mario Coppo, Mariangiola Dezani-Ciancaglini, Elio Giovannetti, and Ivano Salvo. "Mobility Types for Mobile Processes in Mobile Ambients." \textit{Electr. Notes Theor. Comput. Sci.} 78 (2003). DOI: 10.1016/S1571-0661(04)81011-9.
\end{document}
|
http://refbase.athabascau.ca/search.php?sqlQuery=SELECT%20author%2C%20title%2C%20type%2C%20year%2C%20publication%2C%20abbrev_journal%2C%20volume%2C%20issue%2C%20pages%2C%20keywords%2C%20abstract%2C%20thesis%2C%20editor%2C%20publisher%2C%20place%2C%20abbrev_series_title%2C%20series_title%2C%20series_editor%2C%20series_volume%2C%20series_issue%2C%20edition%2C%20language%2C%20author_count%2C%20online_publication%2C%20online_citation%2C%20doi%2C%20serial%2C%20notes%20FROM%20refs%20WHERE%20serial%20%3D%20600%20ORDER%20BY%20type%20ASC%2C%20thesis%20DESC%2C%20year%20DESC%2C%20first_author%2C%20author_count%2C%20author%2C%20title&client=&formType=sqlSearch&submit=Cite&viewType=&showQuery=0&showLinks=1&showRows=5&rowOffset=&wrapResults=1&citeOrder=type-year&citeStyle=APA&exportFormat=RIS&exportType=html&exportStylesheet=&citeType=LaTeX&headerMsg=¢er=fst
|
athabascau.ca
|
CC-MAIN-2019-04
|
application/x-latex
|
application/x-latex
|
crawl-data/CC-MAIN-2019-04/segments/1547583681597.51/warc/CC-MAIN-20190119201117-20190119223117-00583.warc.gz
| 184,063,481
| 1,315
|
%&LaTeX
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\begin{document}
\section*{Journal Publications}
\subsection*{2004}
Wang, H., Esmahi, L. \& Wu, J. L. (2004). Proceedings of the 1st International Workshop on Advanced Technologies for E-Learning and E-Science held in conjunction with The IEEE/WIC/ACM International Joint Conference on Web Intelligence (WI-IAT 04).20--24.
\end{document}
|
http://tutex.tug.org/tutorials/tugindia/src/chap11.tex
|
tug.org
|
CC-MAIN-2022-40
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2022-40/segments/1664030337723.23/warc/CC-MAIN-20221006025949-20221006055949-00624.warc.gz
| 59,293,571
| 12,629
|
\renewenvironment{description}[1]
{\list{}{\settowidth\labelwidth{\bf #1}
\itemsep=3pt
\topsep=6pt
\itemindent-\leftmargin
\ifdim\leftmargin>\labelwidth\relax\else
\setlength\leftmargin{1in}
\addtolength\leftmargin{\labelsep}\fi
\let\makelabel\descriptionlabel}}
{\endlist}
\renewcommand\descriptionlabel[1]{\hbox to 1in{\color{red}
\hspace{\labelsep}
\normalfont\bfseries #1\hss}}
\begin{print}
\def\sb#1{{\fboxrule.1pt\fboxsep0pt
\colorbox{y}{\begin{minipage}[c][.15in][c]{.8in}
~~{\textcolor{blue}{\bfseries{#1}}}
\end{minipage}}}}
\end{print}
\begin{screen}
\def\sb#1{{\fboxrule.1pt\fboxsep0pt
\colorbox{lavenderdark}{\begin{minipage}[c][.15in][c]{.8in}
~~{\textcolor{blue}{\bfseries{#1}}}
\end{minipage}}}}
\end{screen}
\makeatletter
\def\oline{\if@print\vspace*{3pt}\else\vspace*{-.1in}\fi\par
{\color{orange}\if@print\noindent\fi\rule{\textwidth}{2pt}}\par
\if@print\vspace*{3pt}\fi}
\makeatother
\chapter{Mathematics}
\section{Introduction}
\TeX{} is at its best while producing mathematical documents.
If you want to test the power of \TeX{}, do typeset some mathematics.
In the foreword of the \TeX{} book, Knuth writes:
``\TeX{} is a new typesetting system intended for the creation of
beautiful books---and especially for books that contain a lot of
\textcolor{red}{mathematics}''.
\LaTeX{} has a special mode for typesetting mathematics. Mathematical
text within a paragraph (in-line) is entered between \verb+\(+ and
\verb+\)+, between \verb+$+ and \verb+$+ or between \verb+\begin{math}+
and \verb+\end{math}+.
Normally larger mathematical equations and formula are typesetted
in separate lines, in display mode. To produce this, we enclose
them between \verb+\[+ and \verb+\]+, between
\verb+$$+ and \verb+$$+ %$
or between \verb+\begin{displaymath}+ and
\verb+\end{displaymath}+. This produces formula, which are not
numbered. If we want to produce equation number, we have to use
{\sf equation} environment.
The spacing for both in-line and displayed mathematics is completely
controlled by \TeX{}.
\begin{print}
\enlargethispage{1\baselineskip}
\end{print}
\begin{screen}
\newpage
\end{screen}
\section{Maths in text}
\vbox{
\oline
\medskip
\noindent\begin{minipage}[t]{.475\linewidth}
\sb{input---file}\\
\begin{verbatim}
Using~(5.64) and the fact that the
$c_n=\langle\psi_n\vert\Psi\rangle$
and $d_n^*=\langle X\psi_n\rangle$,
the scalar product $\langle X\vert
\Psi\rangle$ can be expressed in the
way as $\langle X\vert\Psi\rangle=
\sum_nd_n^*c_n = \mathbf{d}^\dagger
\boldsymbol{\cdot}\mathbf{c}$ where
\(\mathbf{c}\) is a column vector
with elements $c_n$ and row vector
$\mathbf{d}^\dagger$ with elements
$d_n^*$. The inverse $\mathbf{A}^{-1}$
of a matrix $\mathbf{A}$ is such that
$\mathbf{AA}^{-1}=\mathbf{A}^{-1}
\mathbf{A}= \mathbf{I}$.
\end{verbatim}
\end{minipage}\hfill
\fboxsep4pt
\fbox{\begin{minipage}[t]{.475\linewidth}
\sb{output---dvi}\\[15pt]
Using~(5.64) and the fact that the
$c_n=\langle\psi_n\vert\Psi\rangle$
and $d_n^*=\langle X\psi_n\rangle$,
the scalar product $\langle X\vert
\Psi\rangle$ can be expressed in the
way as $\langle X\vert\Psi\rangle=
\sum_nd_n^*c_n = \mathbf{d}^\dagger
\boldsymbol{\cdot}\mathbf{c}$ where
\(\mathbf{c}\) is a column vector
with elements $c_n$ and row vector
$\mathbf{d}^\dagger$ with elements
$d_n^*$. The inverse $\mathbf{A}^{-1}$
of a matrix $\mathbf{A}$ is such that
$\mathbf{AA}^{-1}=\mathbf{A}^{-1}
\mathbf{A}= \mathbf{I}$.\\[-5pt]
Where
$\mathbf{I}$ is the unit matrix,
elements $I_{mn}=\delta_{mn}$.
For a \emph{stationary state}
$\Psi_E=\psi_E\exp(-{\rm i}Et/\hbar)$
and a \emph{time-independent}
operator $A$ it is clear that the
expectation value \begin{math}\langle\Psi_E\vert
A\vert\Psi_E\rangle=\langle\psi_E\vert A\vert\psi_E\rangle\end{math} does
not depend on the time.
\end{minipage}}\\[-15pt]
\begin{verbatim}
Where $\mathbf{I}$ is the unit matrix, elements $I_{mn}=\delta_{mn}$. For a
\emph{stationary state} $\Psi_E=\psi_E\exp(-{\rm i}Et/\hbar)$ and a
\emph{time-independent} operator $A$ it is clear that the expectation value
\begin{math}\langle\Psi_E\vert A\vert\Psi_E\rangle=\langle\psi_E\vert
A\vert\psi_E\rangle\end{math} does not depend on the time.
\end{verbatim}
\oline
}
\begin{screen}
\clearpage
\end{screen}
\section{Fraction}
\noindent\begin{minipage}{.7\linewidth}
\begin{Decl}
|$$|\\
| \frac{{\rm d}\varepsilon}{{\rm d}\varepsilon}\qquad|\\
| \frac{\frac{a}{x-y}+\frac{b}{x+y}}{1+\frac{a-b}{a+b}}|\\
|$$|
\end{Decl}
\end{minipage}
\begin{minipage}{.3\linewidth}
$$\frac{{\rm d}\varepsilon}{{\rm d}\varepsilon}\qquad
\frac{\frac{a}{x-y}+\frac{b}{x+y}}{1+\frac{a-b}{a+b}}
$$
\end{minipage}
\section{Equation}
Don't put blank lines between the dollar signs delimiting the mathematical text.
\TeX{} assumes that all the mathematical text being typeset is in one paragraph,
and a blank line starts a new paragraph; consequently, this will generate an error
message.
\subsection{Equation with numbers}
\def\theequation{\arabic{equation}}
\begin{Decl}
|\begin|\Arg{equation}\\
| \varphi(x,z) = z - \gamma_{10} x - \sum_{m+n\ge2} \gamma{mn} x^m z^n|\\
|\end|\Arg{equation}
\end{Decl}
\begin{equation}
\varphi(x,z) = z - \gamma_{10} x - \sum_{m+n\ge2} \gamma{mn} x^m z^n
\end{equation}
\subsection{Equation without numbers}
\vbox{
\begin{Decl}
|\begin|\Arg{displaymath}\\
| \left(\int_{-\infty}^{\infty} e^{-x^2}\right)|\\
| =\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-(x^2+y^2)}dx\,dy|\\
|\end|\Arg{displaymath}
\end{Decl}
\qquad OR\\
\begin{Decl}
|$$|\\
| \left(\int_{-\infty}^{\infty} e^{-x^2}\right)|\\
| =\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-(x^2+y^2)}dx\,dy|\\
|$$|\\
\end{Decl}}
$$\left(\int_{-\infty}^{\infty} e^{-x^2}\right)
=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-(x^2+y^2)}dx\,dy$$
\begin{Decl}
|\[|\\
| \left(\int_{-\infty}^{\infty} e^{-x^2}\right)|\\
| =\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-(x^2+y^2)}dx\,dy|\\
|\]|
\end{Decl}
\[\left(\int_{-\infty}^{\infty} e^{-x^2}\right)
=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-(x^2+y^2)}dx\,dy\]
\subsection{Subequations\protect\footnotemark[1]}
\footnotetext[1]{subeqn.sty package should be loaded.}
\begin{Decl}
|\begin|\Arg{subequations}\\
|\begin|\Arg{equation}\\
| \langle\Psi_1\vert\Psi_2\rangle\equiv\int\Psi_1^*|\\
| (\mathbf{r})\Psi_2 (\mathbf{r}){\rm d}\mathbf{r}|\\
|\end|\Arg{equation}\\
{and}\\
|\begin|\Arg{equation}\\
| \langle\Psi_1\vert\Psi_2\rangle\equiv\Psi_1^*(\mathbf{r}_1,\ldots,|\\
| \mathbf{r}_N)\Psi_2(\mathbf{r}_1,\ldots,\mathbf{r}_N){\rm d}|\\
| \mathbf{r}_1\ldots{\rm d}\mathbf{r}_N.|\\
|\end|\Arg{equation}\\
|\end|\Arg{subequations}
\end{Decl}
\begin{subequations}
\begin{equation}
\langle\Psi_1\vert\Psi_2\rangle\equiv\int\Psi_1^*(\mathbf{r})\Psi_2(
\mathbf{r}){\rm d}\mathbf{r}
\end{equation}
and
\begin{equation}
\langle\Psi_1\vert\Psi_2\rangle\equiv\Psi_1^*(\mathbf{r}_1,\ldots,
\mathbf{r}_N)\Psi_2(\mathbf{r}_1,\ldots,\mathbf{r}_N){\rm d}
\mathbf{r}_1\ldots{\rm d}\mathbf{r}_N.
\end{equation}
\end{subequations}
\subsection{Framed displayed equation}
\begin{Decl}
|\begin|\Arg{equation}\\
| \fbox{$\displaystyle\int_0^\infty f(x)\,{\rm d}x|\\
| \approx\sum_{i=1}^nw_i{\rm e}^{x_i}f(x_i)$}|\\
|\end|\Arg{equation}
\end{Decl}
\begin{equation}
\fbox{$\displaystyle\int_0^\infty f(x)\,{\rm d}x
\approx\sum_{i=1}^nw_i{\rm e}^{x_i}f(x_i)$}
\end{equation}
\subsection{Multiline equations -- Eqnarray}
\begin{Decl}
|\begin|\Arg{eqnarray}\\
| \bar\varepsilon &=& \frac{\int_0^\infty\varepsilon|\\
| \exp(-\beta\varepsilon)\,{\rm d}\varepsilon}{\int_0^\infty|\\
| \exp(-\beta\varepsilon)\,{\rm d}\varepsilon}\nonumber\\|\\
|&=& -\frac{{\rm d}}{{\rm d}\beta}\log\Biggl[\int_0^\infty\exp|\\
| (-\beta\varepsilon)\,{\rm d}\varepsilon\Biggr]=\frac1\beta=kT.|\\
|\end|\Arg{eqnarray}
\end{Decl}
\begin{eqnarray}
\bar\varepsilon &=&
\frac{\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,{\rm d}
\varepsilon}{\int_0^\infty\exp(-\beta\varepsilon)\,{\rm d}
\varepsilon}\nonumber\\
&=& -\frac{{\rm d}}{{\rm d}\beta}\log\Biggl[\int_0^\infty\exp
(-\beta\varepsilon)\,{\rm d}\varepsilon\Biggr]=\frac1\beta=kT.
\end{eqnarray}
\noindent \verb+\nonumber+ is used for suppressing number.
\subsection{Matrix}
\noindent\begin{minipage}{.7\linewidth}
\begin{Decl}
|$$|\\
| \matrix{1 & 2 & 3\cr 2 & 3 & 4\cr 3 & 4 & 5}\qquad|\\
| \left(\matrix{1 & \cdots & 3\cr 2 & \vdots & 4\cr|\\
| 3 & \ddots & 5}\right)|\\
|$$|
\end{Decl}
\end{minipage}
\begin{minipage}{.3\linewidth}
$$\begin{matrix}
1 & 2 & 3\\
2 & 3 & 4\\
3 & 4 & 5
\end{matrix}\qquad
\begin{pmatrix}
1 & \cdots & 3 \\
2 & \vdots & 4 \\
3 & \ddots & 5
\end{pmatrix}
$$
\end{minipage}
\subsection{Array}
\begin{Decl}
|$$|\\
| \begin|\Arg{array}\Arg{lcll}\\
| \Psi(x,t) &=& A({\rm e}^{{\rm i}kx}-{\rm e}^{-{\rm i}kx})|\\
| {\rm e}^{-{\rm i}\omega t}&\\|\\
| &=& D\sin kx{\rm e}^{-{\rm i}\omega t}, & D=2{\rm i}A|\\
| \end|\Arg{array}\\
|$$|
\end{Decl}
$$\begin{array}{lcll}
\Psi(x,t) &=& A({\rm e}^{{\rm i}kx}-{\rm e}^{-{\rm i}kx})
{\rm e}^{-{\rm i}\omega t}&\\
&=& D\sin kx{\rm e}^{-{\rm i}\omega t},
& D=2{\rm i}A
\end{array}$$
\subsection{Cases}
\begin{Decl}
|$$|\\
| \psi(x)=\cases{A{\rm e}^{{\rm i}kx}+B{\rm e}^{{-\rm i}kx},|\\
| & for $x=0$\cr|\\
| D{\rm e}^-{\kappa x}, & for $x=0$.}|\\
|$$|
\end{Decl}
$$
\psi(x)=\begin{cases}A{\rm e}^{{\rm i}kx}+B{\rm e}^{{-\rm i}kx},
& \mbox{for }x=0\\ D{\rm e}^{-\kappa x}, & \mbox{for }x=0.
\end{cases}
$$
\subsection{Stackrel}
\noindent\begin{minipage}{.7\linewidth}
\begin{Decl}
|$$|\\
| a\stackrel{def}{=} \alpha + \beta\quad|\\
| \stackrel{thermo}{\longrightarrow}|\\
|$$|
\end{Decl}
\end{minipage}
\begin{minipage}{.3\linewidth}
$$
a\stackrel{def}{=} \alpha + \beta\quad \stackrel{thermo}{\longrightarrow}
$$
\end{minipage}
\subsection{Atop}
\noindent\begin{minipage}{.7\linewidth}
\begin{Decl}
|$$|\\
| \sum_{k=1 \atop k=0} \qquad|\\
|\sum_{123 \atop{234 \atop {890 \atop 456}}}|\\
|$$|
\end{Decl}
\end{minipage}
\begin{minipage}{.3\linewidth}
$$
\sum_{k=1 \atop k=0} \qquad \sum_{123 \atop{234 \atop {890 \atop 456}}}
$$
\end{minipage}
\subsection{Square root}
\noindent\begin{minipage}{.7\linewidth}
\begin{Decl}
|$$|\\
| \sqrt[n]{\frac{x^n-y^n}{1+u^{2n}}}|\\
|$$|
\end{Decl}
\end{minipage}
\begin{minipage}{.3\linewidth}
$$
\sqrt[n]{\frac{x^n-y^n}{1+u^{2n}}}
$$
\end{minipage}
\subsection{Choose}
\noindent\begin{minipage}{.7\linewidth}
\begin{Decl}
|$$|\\
| {123 \choose 456}\qquad {x^n-y^n \choose 1+u^{2n}}|\\
|$$|
\end{Decl}
\end{minipage}
\begin{minipage}{.3\linewidth}
$$
{123 \choose 456}\qquad {x^n-y^n \choose 1+u^{2n}}
$$
\end{minipage}
\begin{screen}
\newpage
\end{screen}
\section{Definitions for Theorems}
We should define |\newtheorem|\Arg{thm}\Arg{Theorem} etc in preamble.\\
\noindent\begin{minipage}{.6\linewidth}
\begin{Decl}
|\newtheorem|\Arg{thm}\Arg{Theorem}\\
|\begin|\Arg{thm}\\
|This is body matter for testing this environment.|\\
|\end|\Arg{thm}
\end{Decl}
\end{minipage}\hfill
\begin{minipage}{.35\linewidth}
\newtheorem{thm}{Theorem}
\begin{thm} This is body matter for testing this environment.
\end{thm}
\end{minipage}
\noindent\begin{minipage}{.6\linewidth}
\begin{Decl}
|\newtheorem|\Arg{rmk}\Arg{Remark}\Oarg{section}\\
|\begin|\Arg{rmk}\rm\\
|This is body matter for testing this environment.|\\
|\end|\Arg{rmk}
\end{Decl}
\end{minipage}\hfill
\begin{minipage}{.35\linewidth}
\newtheorem{rmk}{Remark}[section]
\begin{rmk}\rm This is body matter for testing this environment.
\end{rmk}
\end{minipage}
\noindent\begin{minipage}{.6\linewidth}
\begin{Decl}
|\newtheorem|\Arg{col}\Arg{Corollary}\\
|\begin|\Arg{col}\Oarg{Richard, 1987}\\
|This is body matter for testing this environment.|\\
|\end|\Arg{col}
\end{Decl}
\end{minipage}\hfill
\begin{minipage}{.35\linewidth}
\newtheorem{col}{Corollary}
\begin{col}[Richard, 1987]
This is body matter for testing this environment.
\end{col}
\end{minipage}
\noindent\begin{minipage}{.6\linewidth}
\begin{Decl}
|\newtheorem|\Arg{lem}\Arg{Lemma}\Oarg{thm}\\
|\begin|\Arg{lem}\\
|This is body matter for testing this environment.|\\
|\end|\Arg{lem}
\end{Decl}
\end{minipage}\hfill
\begin{minipage}{.35\linewidth}
\newtheorem{lem}{Lemma}[thm]
\begin{lem}
This is body matter for testing this environment.
\end{lem}
\end{minipage}
\noindent\begin{minipage}{.6\linewidth}
\begin{Decl}
|\newtheorem|\Arg{exa}\Arg{Example}\Oarg{lem}\\
|\begin|\Arg{exa}\\
|This is body matter for testing this environment.|\\
|\end|\Arg{exa}
\end{Decl}
\end{minipage}\hfill
\begin{minipage}{.35\linewidth}
\newtheorem{exa}{Example}[lem]
\begin{exa}
This is body matter for testing this environment.
\end{exa}
\end{minipage}
\begin{screen}
\clearpage
\end{screen}
\section[AMS-LaTeX]{\AmS-\LaTeX\protect\footnotemark[2]}
\footnotetext[2]{CTAN: /tex-archive/macros/latex/packages/amslatex}
Following are some of the component parts of the {\sf amsmath} package,
available individually and can be used separately in a \verb+\usepackage+
command:
\begin{description}\small\advance\itemsep6pt
\item[\sb{amsbsy}] defines the {\sf amsmath} \verb+\boldsymbol+ and
(poor man's bold) \verb+\pmb+ commands.
\item[\sb{amscd}] defines some command for easing the generation of
commutative diagrams.
\item[\sb{amsfonts}] defines the \verb+\frak+ and \verb+\Bbb+ commands
and set up the fonts {\sf msam} (extra math symbols A), {\sf msbm}
(extra math symbols B, and blackboard bold), {\sf eufm} (Euler Fraktur),
extra sizes of {\sf cmmib} (bold math italic and bold lowercase Greek),
and {\sf cmbsy} (bold math symbols and bold script), for use in mathematics.
\item[\sb{amssymb}] defines the names of all the math symbols available
with the \AmS{} fonts collection.
\item[\sb{amstext}] defines the {\sf amsmath} \verb+\text+ command.
\end{description}
\subsection{Align environment}
Align environment is used for two or more equations when
vertical alignment is desired (usually binary relations such as
equal signs are aligned).\\
\begin{Decl}
|\begin|\Arg{align}\\
| F_{\rm fer}(k) =& -\frac{16 x_0 ^3 t}{3\pi }\bigg( \sum_{l=1}^\infty|\\
| -\frac{\nu^5}{t^4 (x_0^2-l-\frac{1}{4})^3}\bigg[S|\\
| \bigg(\frac{\sqrt{x_0^2+l^2}}{t};2 \bigg)|\\
| + 2S\bigg(\frac{\nu}{t};2 \bigg)\bigg] \bigg)\\|\\
| F_{\rm red}(t) =& -\frac{16 x_0 ^3 t}{3\pi }\sum_{l=1}^\infty |\\
| \bigg\{ \frac{1}{2\nu (x_0^2+l^2)^2} \nonumber\\|\\
| & -\frac{\nu^5}{t^4 (x_0^2-l-\frac{1}{4})^3}\bigg[S|\\
| \bigg( \frac{\sqrt{x_0^2+l^2}}{t};2 \bigg)|\\
| +2S\bigg(\frac{\nu}{t};2 \bigg)\bigg] \nonumber\\|\\
| & +V(x_e ,x_{\alpha}) -g \delta (x_e - x_{\alpha}) \bigg\}.|\\
|\end|\Arg{align}\ignorespacesafterend\noindent
\end{Decl}
\begin{align}
F_{\rm fer}(k) =& -\frac{16 x_0 ^3 t}{3\pi }
\bigg( \sum_{l=1}^\infty
- \frac{\nu^5}{t^4 (x_0^2-l-\frac{1}{4})^3}\bigg[S
\bigg( \frac{\sqrt{x_0^2+l^2}}{t};2 \bigg)
+ 2S\bigg(\frac{\nu}{t};2 \bigg)\bigg] \bigg)\\
F_{\rm red}(t) =& -\frac{16 x_0 ^3 t}{3\pi }\sum_{l=1}^\infty
\bigg\{ \frac{1}{2\nu (x_0^2+l^2)^2} \nonumber\\
&- \frac{\nu^5}{t^4 (x_0^2-l-\frac{1}{4})^3}\bigg[S
\bigg( \frac{\sqrt{x_0^2+l^2}}{t};2 \bigg)
+ 2S\bigg(\frac{\nu}{t};2 \bigg)\bigg] \nonumber\\
&+ V(x_e ,x_{\alpha}) -g \delta (x_e - x_{\alpha}) \bigg\}.
\end{align}
\subsection{Gather environment}
Gather environment is used for two or more equations, but when
there is no alignment desired among them each one is centered
separately between the left and right margins.\\
\begin{Decl}
|\begin|\Arg{gather}\\
| \frac{\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,{\rm d}|\\
| \varepsilon}{\int_0^\infty\exp(-\beta\varepsilon)\,{\rm d}\varepsilon}|\\
| \frac{\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,{\rm d}\varepsilon}|\\
| {\int_0^\infty\exp(-\beta\varepsilon)}\\|\\
| \int_0^\infty\exp(-\beta\varepsilon)\,{\rm d}\exp(-\beta\varepsilon)\nonumber\\|\\
| \frac{\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,{\rm d}\varepsilon}|\\
| {\int_0^\infty\exp(-\beta\varepsilon)}\\|\\
| \int_0^\infty\exp(-\beta\varepsilon)\,{\rm d}\exp(-\beta\varepsilon)|\\
|\end|\Arg{gather}
\end{Decl}
\begin{gather}
\frac{\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,{\rm
d}\varepsilon}{\int_0^\infty\exp(-\beta\varepsilon)\,{\rm d}
\varepsilon}\frac{\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,{\rm
d}\varepsilon}{\int_0^\infty\exp(-\beta\varepsilon)}\\
\int_0^\infty\exp(-\beta\varepsilon)\,{\rm d}\exp(-\beta\varepsilon)\\
\frac{\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,{\rm
d}\varepsilon}{\int_0^\infty\exp(-\beta\varepsilon)}\\
\int_0^\infty\exp(-\beta\varepsilon)\,{\rm d}\exp(-\beta\varepsilon)
\end{gather}
\subsection{Alignat environment}
The align environment takes up the whole width of a display. If
you want to have several ``align''-type structures side by side,
you can use an alignat environment. It has one required
argument, for specifying the number of ``align'' structures. For
an argument of $n$, the number of ampersand characters per line
is $2n-1$ (one ampersand for alignment within each align
structure, and ampersands to separate the align structures from
one another).
\begin{Decl}
|\begin|\Arg{alignat}\Arg{2}\\
| L_1 & = R_1 &\qquad L_2 & = R_2\\|\\
| L_3 & = R_3 &\qquad L_4 & = R_4|\\
|\end|\Arg{alignat}
\end{Decl}
\begin{alignat}{2}
L_1 & =R_1 & \qquad L_2 & = R_2\\
L_3 & =R_3 & \qquad L_4 & = R_4
\end{alignat}
\subsection{Alignment Environments as Parts of Displays}
There are some other equation alignment environments that do not
constitute an entire display. They are self-contained units that can
be used inside other formulae, or set side by side. The environment names
are: {\sf aligned}, {\sf gathered} and {\sf alignedat}. These environments
take an optional argument to specify their vertical positioning with respect
to the material on either side. The default alignment is centered (\Oarg{c}),
and its effect is seen in the following example.\\
\begin{Decl}
|\begin|\Arg{equation*}\\
|\begin|\Arg{aligned}\\
| x^2 + y^2 & = 1\\|\\
| x & = \sqrt{1-y^2}|\\
|\end|\Arg{aligned}\\
|\qquad|\\
|\begin|\Arg{gathered}\\
| (a+b)^2 = a^2 + 2ab + b^2 \\|\\
| (a+b) \cdot (a-b) = a^2 - b^2|\\
|\end|\Arg{gathered}\\
|\end|\Arg{equation*}
\end{Decl}
\begin{equation*}
\begin{aligned}
x^2 + y^2 & = 1\\
x & = \sqrt{1-y^2}
\end{aligned}
\qquad
\begin{gathered}
(a+b)^2 = a^2 + 2ab + b^2 \\
(a+b) \cdot (a-b) = a^2 - b^2
\end{gathered}
\end{equation*}
The same mathematics can now be typeset using vertical alignments for
the environments.\\
\begin{Decl}
|\begin|\Arg{equation*}\\
|\begin|\Arg{aligned}\Oarg{b}\\
| x^2 + y^2 & = 1\\|\\
| x & = \sqrt{1-y^2}|\\
|\end|\Arg{aligned}\\
|\qquad|\\
|\begin|\Arg{gathered}\Oarg{t}\\
| (a+b)^2 = a^2 + 2ab + b^2 \\|\\
| (a+b) \cdot (a-b) = a^2 - b^2|\\
|\end|\Arg{gathered}\\
|\end|\Arg{equation*}
\end{Decl}
\begin{equation*}
\begin{aligned}[b]
x^2 + y^2 & = 1\\
x & = \sqrt{1-y^2}
\end{aligned}
\qquad
\begin{gathered}[t]
(a+b)^2 = a^2 + 2ab + b^2 \\
(a+b) \cdot (a-b) = a^2 - b^2
\end{gathered}
\end{equation*}
\subsection{Multline environment}
The multline environment is a variation of the equation
environment used for equations that do not fit on a single line.
The first line of a multline will be at the left margin and the
last line at the right margin except for an indentation on both
sides whose amount is equal to multline-gap.\\
\begin{Decl}
|\begin|\Arg{multline}\\
| {\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,{\rm d}|\\
| \varepsilon}{\int_0^\infty\exp(-\beta\varepsilon)\,{\rm d}|\\
| \varepsilon}{\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,|\\
| {\rm d}\varepsilon}{\int_0^\infty\exp(-\beta\varepsilon)}\\|\\
| {\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,{\rm d}|\\
| \varepsilon}{\int_0^\infty\exp(-\beta\varepsilon)\,{\rm d}|\\
| \varepsilon}{\int_0^\infty\varepsilon}|\\
| {\int_0^\infty\exp(-\beta\varepsilon)}|\\
|\end|\Arg{multline}
\end{Decl}
\begin{multline}
{\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,{\rm d}
\varepsilon}{\int_0^\infty\exp(-\beta\varepsilon)\,{\rm d}
\varepsilon}{\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,
{\rm d}\varepsilon}{\int_0^\infty\exp(-\beta\varepsilon)}\\
{\int_0^\infty\varepsilon\exp(-\beta\varepsilon)\,{\rm d}
\varepsilon}{\int_0^\infty\exp(-\beta\varepsilon)\,{\rm d}
\varepsilon}{\int_0^\infty\varepsilon}
{\int_0^\infty\exp(-\beta\varepsilon)}
\end{multline}
\subsection{Split environment}
The split environment is for single equations that are too long
to fit on a single line and hence must be split into multiple
lines. Unlike multline, however, the split environment provides
for alignment among the split lines.\\
\begin{Decl}
|\begin|\Arg{equation}\\
| \begin|\Arg{split}\\
| (a+b)^4 & = (a+b)^2(a+b)^2\\|\\
| & = (a^2+2ab+b^2)(a^2+2ab+b^2)\\|\\
| & = a^4+4a^3b+6a^2b^2+4ab^3+b^4|\\
| \end|\Arg{split}\\
|\end|\Arg{equation}
\end{Decl}
\begin{equation}
\begin{split}
(a+b)^4 &= (a+b)^2(a+b)^2\\
&= (a^2+2ab+b^2)(a^2+2ab+b^2)\\
&= a^4+4a^3b+6a^2b^2+4ab^3+b^4
\end{split}
\end{equation}
\subsection{Cases}
\begin{Decl}
|\begin|\Arg{equation}\\
| P_{r-j}=|\\
| \begin|\Arg{cases}\\
| 0 & \text{if $r-j$ is odd},\\|\\
| r!\,(-1)^{(r-j)/2} & \text{if $r-j$ is even}.|\\
| \end|\Arg{cases}\\
|\end|\Arg{equation}
\end{Decl}
\begin{equation}
P_{r-j}=\begin{cases}
0& \text {if $r-j$ is odd},\\
r!\,(-1)^{(r-j)/2} & \text{if $r-j$ is even}.
\end{cases}
\end{equation}
\subsection{Matrix}
\begin{Decl}
|\begin|\Arg{gather*}\\
|\begin|\Arg{matrix} | 0 & 1\\ 1 & 0 \end|\Arg{matrix}|\qquad|\\
|\begin|\Arg{pmatrix}| 0 & -i\\ i & 0 \end|\Arg{pmatrix}|\qquad|\\
|\begin|\Arg{bmatrix}| a & b\\ c & d \end|\Arg{bmatrix}|\qquad|\\
|\begin|\Arg{vmatrix}| 0 & 1\\ -1 & 0 \end|\Arg{vmatrix}|\qquad|\\
|\begin|\Arg{Vmatrix}| f & g\\ e & v \end|\Arg{Vmatrix}\\
|\end|\Arg{gather*}
\end{Decl}
\begin{gather*}
\begin{matrix} 0 & 1 \\ 1 & 0 \end{matrix} \qquad
\begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix} \qquad
\begin{bmatrix} a & b \\ c & d \end{bmatrix}\qquad
\begin{vmatrix} 0 & 1 \\ -1 & 0 \end{vmatrix} \qquad
\begin{Vmatrix} f & g \\ e & v \end{Vmatrix}
\end{gather*}
\subsection{substack environment}
\noindent\begin{minipage}{.7\linewidth}
\begin{Decl}
|\begin|\Arg{equation*}\\
| \sum_{\substack{0\leq i\leq m\\ 0>j>n}}|\\
|\end|\Arg{equation*}
\end{Decl}
\end{minipage}
\begin{minipage}{.3\linewidth}
\begin{equation*}
\sum_{\substack{0\leq i \leq m\\ 0>j>n}}
\end{equation*}
\end{minipage}
\noindent\begin{minipage}{.7\linewidth}
\begin{Decl}
|\begin|\Arg{equation*}\\
| \sum^{\substack{0\leq i\leq m\\ 0>j>n}}|\\
|\end|\Arg{equation*}
\end{Decl}
\end{minipage}
\begin{minipage}{.3\linewidth}
\begin{equation*}
\sum^{\substack{0\leq i \leq m\\ 0>j>n}}
\end{equation*}
\end{minipage}
\subsection{Commutative Diagram\protect\footnotemark[3]}
\footnotetext[3]{amscd.sty package should be loaded.}
\begin{Decl}
|\begin|\Arg{equation*}\\
|\begin|\Arg{CD}\\
| S_\Lambda^{\mathcal{W}}\otimes T @>j>> T\\|\\
| @VVV @VV{{\rm End}P}V\\|\\
| (S\otimes T)/I @= (Z\otimes T)/J|\\
|\end|\Arg{CD}\\
|\end|\Arg{equation*}
\end{Decl}
\begin{equation*}
\begin{CD}
S_\Lambda^{\mathcal{W}}\otimes T @>j>>T\\
@VVV @VV{{\rm End}P}V\\
(S\otimes T)/I @= (Z\otimes T)/J
\end{CD}
\end{equation*}
\begin{Decl}
|\begin|\Arg{equation*}\\
|\begin|\Arg{CD}\\
| S_\Lambda^{\mathcal{W}}\otimes T @>j>> T_{XF} @>xyz>> T\\|\\
| @V{{Out}p}VV & & @AA{{\rm End}P}A\\|\\
| (S\otimes T)/I @= X_{\mathcal{F}} @>fg>> (Z\otimes T)/J|\\
|\end|\Arg{CD}\\
|\end|\Arg{equation*}
\end{Decl}
\begin{equation*}
\begin{CD}
S^{\mathcal{W}}_\Lambda\otimes T @>j>> T_{XF} @>xyz>> T \\
@V{{Out}p}VV & & @AA{{\rm End}P}A \\
(S\otimes T)/I @= X_{\mathcal{F}} @>fg>> (Z\otimes T)/J
\end{CD}
\end{equation*}
\subsection{Binom}
\noindent\begin{minipage}{.5\linewidth}
\begin{Decl}
|\begin|\Arg{equation*}\\
| \binom{x}{y}|\\
|\end|\Arg{equation*}
\end{Decl}
\end{minipage}
\begin{minipage}{.5\linewidth}
\begin{equation*}
\binom{x}{y}
\end{equation*}
\end{minipage}
\subsection[AMS symbols]{\AmS\ symbols}
\begin{tabular}{lclclc}
\verb+\iint+ & $\iint$ & \verb+\iiint+ & $\iiint$ & \verb+\iiiint+ & $\iiiint$\\
\end{tabular}
\begin{screen}
\newpage
\end{screen}
\section{Mathematical Symbols}
\subsection{Lowercase Greek letters}
\begin{tabular}{@{}clclclcl@{}}
$\alpha$ & \verb.\alpha. & $\theta$ & \verb.\theta. &
$o$ & \verb.o. & $\tau$ & \verb.\tau.\\
$\beta$ & \verb.\beta. & $\vartheta$ & \verb.\vartheta.&
$\pi$ & \verb.\pi. & $\upsilon$ & \verb.\upsilon.\\
$\gamma$ & \verb.\gamma. & $\iota$ & \verb.\iota. &
$\varpi$ & \verb.\varpi. & $\phi$ & \verb.\phi.\\
$\delta$ & \verb.\delta. & $\kappa$ & \verb.\kappa. &
$\rho$ & \verb.\rho. & $\varphi$ & \verb.\varphi.\\
$\epsilon$ & \verb.\epsilon. & $\lambda$ & \verb.\lambda. &
$\varrho$ & \verb.\varrho. & $\chi$ & \verb.\chi.\\
$\varepsilon$ & \verb.\varepsilon. & $\mu$ & \verb.\mu. &
$\sigma$ & \verb.\sigma. & $\psi$ & \verb.\psi.\\
$\zeta$ & \verb.\zeta. & $\nu$ & \verb.\nu. &
$\varsigma$ & \verb.\varsigma. & $\omega$ & \verb.\omega.\\
$\eta$ & \verb.\eta. & $\xi$ & \verb.\xi.
\end{tabular}
\subsection{Uppercase Greek letters}
\begin{tabular}{@{}clclclcl@{}}
$\Gamma$ & \verb.\Gamma. & $\Lambda$ & \verb.\Lambda. &
$\Sigma$ & \verb.\Sigma. & $\Psi$ & \verb.\Psi.\\
$\Delta$ & \verb.\Delta. & $\Xi$ & \verb.\Xi. &
$\Upsilon$ & \verb.\Upsilon. & $\Omega$ & \verb.\Omega.\\
$\Theta$ & \verb.\Theta. & $\Pi$ & \verb.\Pi. &
$\Phi$ & \verb.\Phi.
\end{tabular}
\subsection{Math mode accents}
\begin{tabular}{@{}clclclclcl@{}}
$\hat a$ & \verb.\hat.\{a\} & $\acute a$ & \verb.\acute.\{a\} &
$\bar a$ & \verb.\bar.\{a\} & $\dot a$ & \verb.\dot.\{a\} &
$\breve a$ & \verb.\breve.\{a\}\\
$\check a$ & \verb.\check.\{a\} & $\grave a$ & \verb.\grave.\{a\} &
$\vec a$ & \verb.\vec.\{a\} & $\ddot a$ & \verb.\ddot.\{a\} &
$\tilde a$ & \verb.\tilde.\{a\}
\end{tabular}
\subsection{Binary Operation Symbols}
\begin{tabular}{@{}clclclcl@{}}
$\pm$ & \verb.\pm. & $\cap$ & \verb.\cap. &
$\diamond$ & \verb.\diamond. & $\oplus$ & \verb.\oplus.\\
$\mp$ & \verb.\mp. & $\cup$ & \verb.\cup. &
$\bigtriangleup$ & \verb.\bigtriangleup. & $\ominus$ & \verb.\ominus.\\
$\times$ & \verb.\times. & $\uplus$ & \verb.\uplus. &
$\bigtriangledown$ & \verb.\bigtriangledown. & $\otimes$ & \verb.\otimes.\\
$\div$ & \verb.\div. & $\sqcap$ & \verb.\sqcap. &
$\triangleleft$ & \verb.\triangleleft. & $\oslash$ & \verb.\oslash.\\
$\ast$ & \verb.\ast. & $\sqcup$ & \verb.\sqcup. &
$\triangleright$ & \verb.\triangleright. & $\odot$ & \verb.\odot.\\
$\star$ & \verb.\star. & $\vee$ & \verb.\vee. &
$\lhd$ & \verb.\lhd.$^a$ & $\bigcirc$ & \verb.\bigcirc.\\
$\circ$ & \verb.\circ. & $\wedge$ & \verb.\wedge. &
$\rhd$ & \verb.\rhd.$^a$ & $\dagger$ & \verb.\dagger.\\
$\bullet$ & \verb.\bullet. & $\setminus$ & \verb.\setminus. &
$\unlhd$ & \verb.\unlhd.$^a$ & $\ddagger$ & \verb.\ddagger.\\
$\cdot$ & \verb.\cdot. & $\wr$ & \verb.\wr. &
$\unrhd$ & \verb.\unrhd.$^a$ & $\amalg$ & \verb.\amalg.\\[10pt]
\multicolumn{8}{l}{\begin{minipage}{\textwidth}
$^a$Not predefined in NFSS. Use the latexsym or amssymb package.
\end{minipage}}
\end{tabular}
\subsection{Relation symbols}
\begin{tabular}{@{}clclclcl@{}}
$\leq$ & \verb.\leq. & $\geq$ & \verb.\geq. &
$\equiv$ & \verb.\equiv. & $\models$ & \verb.\models.\\
$\prec$ & \verb.\prec. & $\succ$ & \verb.\succ. &
$\sim$ & \verb.\sim. & $\perp$ & \verb.\perp.\\
$\preceq$ & \verb.\preceq. & $\succeq$ & \verb.\succeq. &
$\simeq$ & \verb.\simeq. & $\mid$ & \verb.\mid.\\
$\ll$ & \verb.\ll. & $\gg$ & \verb.\gg. &
$\asymp$ & \verb.\asymp. & $\parallel$ & \verb.\parallel.\\
$\subset$ & \verb.\subset. & $\supset$ & \verb.\supset. &
$\approx$ & \verb.\approx. & $\bowtie$ & \verb.\bowtie.\\
$\subseteq$ & \verb.\subseteq. & $\supseteq$ & \verb.\supseteq. &
$\cong$ & \verb.\cong. & $\Join$ & \verb.\Join.\\
$\sqsubset$ & \verb.\sqsubset. & $\sqsupset$ & \verb.\sqsupset. &
$\neq$ & \verb.\neq. & $\smile$ & \verb.\smile.\\
$\sqsubseteq$ & \verb.\sqsubseteq. & $\sqsupseteq$ & \verb.\sqsupseteq. &
$\doteq$ & \verb.\doteq. & $\frown$ & \verb.\frown.\\
$\in$ & \verb.\in. & $\ni$ & \verb.\ni. &
$\notin$ & \verb.\notin. & $\propto$ & \verb.\propto.\\
$\vdash$ & \verb.\vdash. & $\dashv$ & \verb.\dashv.
\end{tabular}
\subsection{Arrow symbols}
\begin{tabular}{@{}clclcl@{}}
$\leftarrow$ & \verb.\leftarrow. &
$\longleftarrow$ & \verb.\longleftarrow. &
$\uparrow$ & \verb.\uparrow.\\
$\Leftarrow$ & \verb.\Leftarrow. &
$\Longleftarrow$ & \verb.\Longleftarrow. &
$\Uparrow$ & \verb.\Uparrow.\\
$\rightarrow$ & \verb.\rightarrow. &
$\longrightarrow$ & \verb.\longrightarrow. &
$\downarrow$ & \verb.\downarrow.\\
$\Rightarrow$ & \verb.\Rightarrow. &
$\Longrightarrow$ & \verb.\Longrightarrow. &
$\Downarrow$ & \verb.\Downarrow.\\
$\leftrightarrow$ & \verb.\leftrightarrow. &
$\longleftrightarrow$ & \verb.\longleftrightarrow. &
$\updownarrow$ & \verb.\updownarrow.\\
$\Leftrightarrow$ & \verb.\Leftrightarrow. &
$\Longleftrightarrow$ & \verb.\Longleftrightarrow. &
$\Updownarrow$ & \verb.\Updownarrow.\\
$\mapsto\!\!\!\!\!\!${\tiny\raisebox{1pt}{$\vert$}} & \verb.\mapsto. &
$\longmapsto$ & \verb.\longmapsto. &
$\nearrow$ & \verb.\nearrow.\\
$\hookleftarrow$ & \verb.\hookleftarrow. &
$\hookrightarrow$ & \verb.\hookrightarrow. &
$\searrow$ & \verb.\searrow.\\
$\leftharpoonup$ & \verb.\leftharpoonup. &
$\rightharpoonup$ & \verb.\rightharpoonup. &
$\swarrow$ & \verb.\swarrow.\\
$\leftharpoondown$ & \verb.\leftharpoondown. &
$\rightharpoondown$ & \verb.\rightharpoondown. &
$\nwarrow$ & \verb.\nwarrow.\\
$\rightleftharpoons$ & \verb.\rightleftharpoons. &
$\leadsto$ & \verb.\leadsto.
\end{tabular}
\subsection{Miscellaneous symbols}
\begin{tabular}{@{}clclclcl@{}}
$\ldots$ & \verb.\ldots. & $\imath$ & \verb.\imath. & $\Im$ &
\verb.\Im. & $\aleph$ & \verb.\aleph.\\
$\prime$ & \verb.\prime. & $\flat$ & \verb.\flat. & $\ddots$ &
\verb.\ddots. & $\emptyset$ & \verb.\emptyset.\\
$\exists$ & \verb.\exists. & $\clubsuit$ & \verb.\clubsuit. & $\hbar$ &
\verb.\hbar. & $\triangle$ & \verb.\triangle.\\
$\Diamond$ & \verb.\Diamond.$^a$ & $\Re$ & \verb.\Re. & $\Box$ &
\verb.\Box.$^a$ & $\neq$ & \verb.\neq.\\
$\top$ & \verb.\top. & $\vdots$ & \verb.\vdots. & $\ell$ & \verb.\ell.
& $\wp$ & \verb.\wp.\\
$\bot$ & \verb.\bot. & $\infty$ & \verb.\infty. & $\sharp$ &
\verb.\sharp. & $\spadesuit$ & \verb.\spadesuit.\\
$\mho$ & \verb.\mho. & $\surd$ & \verb.\surd. & $\heartsuit$ &
\verb.\heartsuit. & $\partial$ & \verb.\partial.\\
$\cdots$ & \verb.\cdots. & $\jmath$ & \verb.\jmath. & $\angle$ &
\verb.\angle.\\
$\forall$ & \verb.\forall. & $\natural$ & \verb.\natural.&
$\nabla$ & \verb.\nabla. & $\diamondsuit$ & \verb.\diamondsuit.\\[10pt]
\multicolumn{8}{l}{\begin{minipage}{\textwidth}
$^a$Not predefined in NFSS. Use the latexsym or amssymb package.
\end{minipage}}
\end{tabular}
\subsection{Variable-sized symbols}
\begin{tabular}{@{}clclclclcl@{}}
$\sum$ & \verb.\sum. & $\prod$ & \verb.\prod. & $\coprod$ &
\verb.\coprod. & $\int$ & \verb.\int. & $\oint$ & \verb.\oint.\\
$\bigcap$ & \verb.\bigcap. & $\bigcup$ & \verb.\bigcup. & $\bigsqcup$ &
\verb.\bigsqcup. & $\bigvee$ & \verb.\bigvee. & $\bigwedge$ &
\verb.\bigwedge.\\
$\bigodot$ & \verb.\bigodot. & $\bigotimes$ & \verb.\bigotimes. &
$\bigoplus$ & \verb.\bigoplus. & $\biguplus$ & \verb.\biguplus.
\end{tabular}
\subsection{Delimiters}
\begin{tabular}{@{}clclcl@{}}
$\uparrow$ & \verb.\uparrow. & $\}$ & \verb.\}. & $\lceil$ &
\verb.\lceil.\\
$\{$ & \verb.\{. & $\rfloor$ & \verb.\rfloor. & $/$ & \verb./.\\
$\lfloor$ & \verb.\lfloor. & $\rangle$ & \verb.\rangle. & $\Downarrow$
& \verb.\Downarrow.\\
$\langle$ & \verb.\langle. & $\|$ & \verb.\|. & $\Updownarrow$
& \verb.\Updownarrow.\\
$\vert$ & $\vert$ & $\downarrow$ & \verb.\downarrow. & $\rceil$ &
\verb.\rceil.\\
$\Uparrow$ & \verb.\Uparrow. & $\updownarrow$ & \verb.\updownarrow. &
$\backslash$ & \verb.\backslash.
\end{tabular}
\subsection[LaTeX math constructs]{\LaTeX{} math constructs}
\begin{tabular}{@{}clcl@{}}
$\widetilde{abc}$ & \verb.\widetilde.\{abc\} & $\widehat{abc}$ &
\verb.\widehat.\{abc\}\\
$\overleftarrow{abc}$ & \verb.\overleftarrow.\{abc\} &
$\overrightarrow{abc}$ & \verb.\overrightarrow.\{abc\}\\
$\overline{abc}$ & \verb.\overline.\{abc\} & $\underline{abc}$ &
\verb.\underline.\{abc\}\\
$\overbrace{abc}$ & \verb.\overbrace.\{abc\} & $\underbrace{abc}$ &
\verb.\underbrace.\{abc\}\\
$\sqrt{abc}$ & \verb.\sqrt.\{abc\} & $\sqrt[n]{abc}$ &
\verb.\sqrt[n].\{abc\}\\
$f'$ & \verb.f'. & $\frac{abc}{xyz}$ & \verb.\frac.\{abc\}\{xyz\}
\end{tabular}
\subsection[AMS Greek...]{\AmS{} Greek and Hebrew (available with amssymb package)}
\begin{tabular}{@{}clclclclcl@{}}
$\digamma$ & \verb.\digamma. & $\varkappa$ & \verb.\varkappa. &
$\beth$ & \verb.\beth. & $\daleth$ & \verb.\daleth. &
$\gimel$ & \verb.\gimel.
\end{tabular}
\subsection[AMS delimiters]{\AmS{} delimiters (available with amssymb package)}
\begin{tabular}{@{}clclclcl@{}}
$\ulcorner$ & \verb.\ulcorner. & $\urcorner$ & \verb.\urcorner. &
$\llcorner$ & \verb.\llcorner. & $\lrcorner$ & \verb.\lrcorner.
\end{tabular}
\subsection[AMS Misc.]{\AmS{} miscellaneous (available with amssymb package)}
\begin{tabular}{@{}clclcl@{}}
$\hbar$ & \verb.\hbar. & $\hslash$ & \verb.\hslash. & $\vartriangle$ &
\verb.\vartriangle.\\
$\triangledown$ & \verb.\triangledown. & $\square$ & \verb.\square. &
$\lozenge$ & \verb.\lozenge.\\
$\circledS$ & \verb.\circledS. & $\angle$ & \verb.\angle. &
$\measuredangle$ & \verb.\measuredangle.\\
$\nexists$ & \verb.\nexists. & $\mho$ & \verb.\mho. & $\Finv$ &
\verb.\Finv.\\
$\Game$ & \verb.\Game. & $\Bbbk$ & \verb.\Bbbk. & $\backprime$ &
\verb.\backprime.\\
$\varnothing$ & \verb.\varnothing. & $\blacktriangle$ &
\verb.\blacktriangle. & $\blacktriangledown$ &
\verb.\blacktrinagledown.\\
$\blacksquare$ & \verb.\blacksquare. & $\blacklozenge$ &
\verb.\blacklozenge. & $\bigstar$ & \verb.\bigstar.\\
$\sphericalangle$ & \verb.\sphericalangle. & $\complement$ &
\verb.\complement. & $\eth$ & \verb.\eth.\\
$\diagup$ & \verb.\diagup. & $\diagdown$ & \verb.\diagdown.\\[10pt]
\multicolumn{6}{l}{\begin{minipage}{\textwidth}
$^a$Not defined in old releases of the amssymb package; define with the
$\backslash${\tt DeclareMathSymbol} command.
\end{minipage}}
\end{tabular}
\subsection[AMS negated ...] {\AmS{} negated arrows (available with amssymb package)}
\begin{tabular}{@{}clclcl@{}}
$\nleftarrow$ & \verb.\nleftarrow. & $\nrightarrow$ &
\verb.\nrightarrow. & $\nLeftarrow$ & \verb.\nLeftarrow.\\
$\nRightarrow$ & \verb.\nRightarrow. & $\nleftrightarrow$ &
\verb.\nleftrightarrow. & $\nLeftrightarrow$ & \verb.\nLeftrightarrow.
\end{tabular}
\subsection[AMS binary]{\AmS{} binary relations (available with amssymb package)}
\begin{tabular}{@{}clclcl@{}}
$\leqq$ & \verb.\leqq. & $\leqslant$ & \verb.\leqslant. &
$\eqslantless$ & \verb.\eqslantless.\\
$\lesssim$ & \verb.\lesssim. & $\lessapprox$ & \verb.\lessapprox. &
$\approxeq$ & \verb.\approxeq.\\
$\lessdot$ & \verb.\lessdot. & $\lll$ & \verb.\lll. & $\lessgtr$ &
\verb.\lessgtr.\\
$\lesseqgtr$ & \verb.\lesseqgtr. & $\lesseqqgtr$ & \verb.\lesseqqgtr. &
$\doteqdot$ & \verb.\doteqdot.\\
$\risingdotseq$ & \verb.\risingdotseq. & $\fallingdotseq$ &
\verb.\fallingdotseq. & $\backsim$ & \verb.\backsim.\\
$\backsimeq$ & \verb.\backsimeq. & $\subseteqq$ & \verb.\subseteqq. &
$\Subset$ & \verb.\Subset.\\
$\sqsubset$ & \verb.\sqsubset. & $\preccurlyeq$ & \verb.\preccurlyeq. &
$\curlyeqprec$ & \verb.\curlyeqprec.\\
$\precsim$ & \verb.\precsim. & $\precapprox$ & \verb.\precapprox. &
$\vartriangleleft$ & \verb.\vartriangleleft.\\
$\trianglelefteq$ & \verb.\trianglelefteq. & $\vDash$ & \verb.\vDash. &
$\Vvdash$ & \verb.\Vvdash.\\
$\smallsmile$ & \verb.\smallsmile. & $\smallfrown$ & \verb.\smallfrown.
& $\bumpeq$ & \verb.\bumpeq.\\
$\Bumpeq$ & \verb.\Bumpeq. & $\geqq$ & \verb.\geqq. & $\geqslant$ &
\verb.\geqslant.\\
$\eqslantgtr$ & \verb.\eqslantgtr. & $\gtrsim$ & \verb.\gtrsim. &
$\gtrapprox$ & \verb.\gtrapprox.\\
$\gtrdot$ & \verb.\gtrdot. & $\ggg$ & \verb.\ggg. & $\gtrless$ &
\verb.\gtrless.\\
$\gtreqless$ & \verb.\gtreqless. & $\gtreqqless$ & \verb.\gtreqqless. &
$\eqcirc$ & \verb.\eqcirc.\\
$\circeq$ & \verb.\circeq. & $\triangleq$ & \verb.\triangleq. &
$\thicksim$ & \verb.\thicksim.\\
$\thickapprox$ & \verb.\thickapprox. & $\supseteqq$ & \verb.\supseteqq.
& $\Supset$ & \verb.\Supset.\\
$\sqsupset$ & \verb.\sqsupset. & $\succcurlyeq$ & \verb.\succcurlyeq. &
$\curlyeqsucc$ & \verb.\curlyeqsucc.\\
$\succsim$ & \verb.\succsim. & $\succapprox$ & \verb.\succapprox. &
$\vartriangleright$ & \verb.\vartriangleright.\\
$\trianglerighteq$ & \verb.\trianglerighteq. & $\Vdash$ & \verb.\Vdash.
& $\shortmid$ & \verb.\shortmid.\\
$\shortparallel$ & \verb.\shortparallel. & $\between $ &
\verb.\between. & $\pitchfork$ & \verb.\pitchfork.\\
$\varpropto$ & \verb.\varpropto. & $\blacktriangleleft$ &
\verb.\blacktriangleleft. & $\therefore$ & \verb.\therefore.\\
$\backepsilon$ & \verb.\backepsilon. & $\blacktriangleright$ &
\verb.\blacktriangleright. & $\because$ & \verb.\because.
\end{tabular}
\begin{screen}
\newpage
\end{screen}
\subsection[AMS binary]{\AmS{} binary operators (available with amssymb package)}
\begin{tabular}{@{}clclcl@{}}
$\dotplus$ & \verb.\dotplus. & $\smallsetminus$ & \verb.\smallsetminus. & $\Cap$ & \verb.\Cap.\\
$\Cup$ & \verb.\Cup. & $\barwedge$ & \verb.\barwedge. & $\veebar$ & \verb.\veebar.\\
$\doublebarwedge$ & \verb.\doublebarwedge. & $\boxminus$ & \verb.\boxminus. & $\boxtimes$ & \verb.\boxtimes.\\
$\boxdot$ & \verb.\boxdot. & $\boxplus$ & \verb.\boxplus. & $\divideontimes$ & \verb.\divideontimes.\\
$\ltimes$ & \verb.\ltimes. & $\rtimes$ & \verb.\rtimes. & $\leftthreetimes$ & \verb.\leftthreetimes.\\
$\rightthreetimes$ & \verb.\rightthreetimes. & $\curlywedge$ & \verb.\curlywedge. & $\curlyvee$ & \verb.\curlyvee.\\
$\circleddash$ & \verb.\circleddash. & $\circledast$ & \verb.\circledast. & $\circledcirc$ & \verb.\circledcirc.\\
$\centerdot$ & \verb.\centerdot. & $\intercal$ & \verb.\intercal.
\end{tabular}
\subsection[AMS negated binary] {\AmS{} negated binary relations (available with amssymb package)}
\begin{tabular}{@{}clclcl@{}}
$\nless$ & \verb.\nless. & $\nleq$ & \verb.\nleq. & $\nleqslant$ & \verb.\nleqslant.\\
$\nleqq$ & \verb.\nleqq. & $\lneq$ & \verb.\lneq. & $\lneqq$ & \verb.\lneqq.\\
$\lvertneqq$ & \verb.\lvertneqq. & $\lnsim$ & \verb.\lnsim. & $\lnapprox$ & \verb.\lnapprox.\\
$\nprec$ & \verb.\nprec. & $\npreceq$ & \verb.\npreceq. & $\precnsim$ & \verb.\precnsim.\\
$\precnapprox$ & \verb.\precnapprox. & $\nsim$ & \verb.\nsim. & $\nshortmid$ & \verb.\nshortmid.\\
$\nmid$ & \verb.\nmid. & $\nvdash$ & \verb.\nvdash. & $\nvDash$ & \verb.\nvDash.\\
$\ntriangleleft$ & \verb.\ntriangleleft. & $\ntrianglelefteq$ & \verb.\ntrianglelefteq. & $\nsubseteq$ & \verb.\nsubseteq.\\
$\subsetneq$ & \verb.\subsetneq. & $\varsubsetneq$ & \verb.\varsubsetneq. & $\subsetneqq$ & \verb.\subsetneqq.\\
$\varsubsetneqq$ & \verb.\varsubsetneqq. & $\ngtr$ & \verb.\ngtr. & $\ngeq$ & \verb.\ngeq.\\
$\ngeqslant$ & \verb.\ngeqslant. & $\ngeqq$ & \verb.\ngeqq. & $\gneq$ & \verb.\gneq.\\
$\gneqq$ & \verb.\gneqq. & $\gvertneqq$ & \verb.\gvertneqq. & $\gnsim$ & \verb.\gnsim.\\
$\gnapprox$ & \verb.\gnapprox. & $\nsucc$ & \verb.\nsucc. & $\nsucceq$ & \verb.\nsucceq.\\
$\succnsim$ & \verb.\succnsim. & $\succnapprox$ & \verb.\succnapprox. & $\ncong$ & \verb.\ncong.\\
$\nshortparallel$ & \verb.\nshortparallel. & $\nparallel$ & \verb.\nparallel. & $\nvDash$ & \verb.\nvDash.\\
$\nVDash$ & \verb.\nVDash. & $\ntriangleright$ & \verb.\ntriangleright. & $\ntrianglerighteq$ & \verb.\ntrianglerighteq.\\
$\nsupseteq$ & \verb.\nsupseteq. & $\nsupseteqq$ & \verb.\nsupseteqq. & $\supsetneq$ & \verb.\supsetneq.\\
$\varsupsetneq$ & \verb.\varsupsetneq. & $\supsetneqq$ & \verb.\supsetneqq. & $\varsupsetneqq$ & \verb.\varsupsetneqq.
\end{tabular}
\subsection[AMS arrows]{\AmS{} arrows (available with amssymb package)}
\begin{tabular}{@{}clclcl@{}}
$\dashrightarrow$ & \verb.\dashrightarrow. &
$\dashleftarrow$ & \verb.\dashleftarrow. &
$\leftleftarrows$ & \verb.\leftleftarrows.\\
$\leftrightarrows$ & \verb.\leftrightarrows. &
$\Lleftarrow$ & \verb.\Lleftarrow. &
$\twoheadleftarrow$ & \verb.\twoheadleftarrow.\\
$\leftarrowtail$ & \verb.\leftarrowtail. &
$\looparrowleft$ & \verb.\looparrowleft. &
$\leftrightharpoons$ & \verb.\leftrightharpoons.\\
$\curvearrowleft$ & \verb.\curvearrowleft. &
$\circlearrowleft$ & \verb.\circlearrowleft. &
$\Lsh$ & \verb.\Lsh.\\
$\upuparrows$ & \verb.\upuparrows. &
$\upharpoonleft$ & \verb.\upharpoonleft. &
$\downharpoonleft$ & \verb.\downharpoonleft.\\
$\multimap$ & \verb.\multimap. &
$\leftrightsquigarrow$ & \verb.\leftrightsquigarrow. &
$\rightrightarrows$ & \verb.\rightrightarrows.\\
$\rightleftarrows$ & \verb.\rightleftarrows. &
$\rightrightarrows$ & \verb.\rightrightarrows. &
$\rightleftarrows$ & \verb.\rightleftarrows.\\
$\twoheadrightarrow$ & \verb.\twoheadrightarrow. &
$\rightarrowtail$ & \verb.\rightarrowtail. &
$\looparrowright$ & \verb.\looparrowright.\\
$\rightleftharpoons$ & \verb.\rightleftharpoons. &
$\curvearrowright$ & \verb.\curvearrowright. &
$\circlearrowright$ & \verb.\circlearrowright.\\
$\Rsh$ & \verb.\Rsh. &
$\downdownarrows$ & \verb.\downdownarrows. &
$\upharpoonright$ & \verb.\upharpoonright.\\
$\downharpoonright$ & \verb.\downharpoonright. &
$\rightsquigarrow$ & \verb.\rightsquigarrow.
\end{tabular}
\subsection{Log-like symbols}
\begin{tabular}{@{}llllllll@{}}
$\arccos$ & |\arccos| & $\arcsin$ & |\arcsin| &
$\arctan$ & |\arctan| & arg & |\arg|\\
$\cos$ & |\cos| & $\cosh$ & |\cosh| &
$\cot$ & |\cot| & $\coth$ & |\coth|\\
$\csc$ & |\csc| & $\deg$ & |\deg| &
$\det$ & |\det| & $\dim$ & |\dim|\\
$\exp$ & |\exp| & $\gcd$ & |\gcd| &
$\hom$ & |\hom| & $\inf$ & |\inf|\\
$\ker$ & |\ker| & $\lg$ & |\lg| &
$\lim$ & |\lim| & $\liminf$ & |\liminf|\\
$\limsup$ & |\limsup| & $\ln$ & |\ln| &
$\log$ & |\log| & $\max$ & |\max|\\
$\min$ & |\min| & $\Pr$ & |\Pr| &
$\sec$ & |\sec| & $\sin$ & |\sin|\\
$\sinh$ & |\sinh| & $\sup$ & |\sup| &
$\tan$ & |\tan| & $\tanh$ & |\tanh|
\end{tabular}
\subsection{Double accents in math (available with amssymb package)}
\begin{tabular}{@{}clcl@{}}
$\Acute{\Acute{A}}$ & \verb.\Acute{\Acute{A}}. &
$\Bar{\Bar{A}}$ & \verb.\Bar{\Bar{A}}.\\
$\Breve{\Breve{A}}$ & \verb.\Breve{\Breve{A}}. &
$\Check{\Check{A}}$ & \verb.\Check{\Check{A}}.\\
$\Ddot{\Ddot{A}}$ & \verb.\Ddot{\Ddot{A}}. &
$\Dot{\Dot{A}}$ & \verb.\Dot{\Dot{A}}.\\
$\Grave{\Grave{A}}$ & \verb.\Grave{\Grave{A}}. &
$\Hat{\Hat{A}}$ & \verb.\Hat{\Hat{A}}.\\
$\Tilde{\Tilde{A}}$ & \verb.\Tilde{\Tilde{A}}. &
$\Vec{\Vec{A}}$ & \verb.\Vec{\Vec{A}}.
\end{tabular}
\subsection{Other Styles}
\subsubsection{Caligraphic letters}
$$\mathcal{A\,B\,C\,D\,E\,F\,G\,H\,I\,J\,K\,L\,M\,N\,O\,P\,Q\,R\,S\,T\,U\,V\,W\,X\,Y\,Z}$$
\verb+use \mathcal{}+
\subsubsection{Mathbb letters}
$$\mathbb{A\,B\,C\,D\,E\,F\,G\,H\,I\,J\,K\,L\,M\,N\,O\,P\,Q\,R\,S\,T\,U\,V\,W\,X\,Y\,Z}$$
\verb+use \mathbb{}+
\subsubsection{Mathfrak letters}
$$\mathfrak{A\,B\,C\,D\,E\,F\,G\,H\,I\,J\,K\,L\,M\,N\,O\,P\,Q\,R\,S\,T\,U\,V\,W\,X\,Y\,Z}$$
\verb+use \mathfrak{} with amssymb package+
\subsubsection{Math bold italic letters}
\def\mathbi#1{\textbf{\em #1}}
$$\mathbi{A\,B\,C\,D\,E\,F\,G\,H\,I\,J\,K\,L\,M\,N\,O\,P\,Q\,R\,S\,T\,U\,V\,W\,X\,Y\,Z}$$
\verb+use \mathbi{} +
\subsubsection{Math Sans serif letters}
$$\mathsf{A\,B\,C\,D\,E\,F\,G\,H\,I\,J\,K\,L\,M\,N\,O\,P\,Q\,R\,S\,T\,U\,V\,W\,X\,Y\,Z}$$
\verb+use \mathsf{}+
\subsubsection{Math bold letters}
$$\mathbf{A\,B\,C\,D\,E\,F\,G\,H\,I\,J\,K\,L\,M\,N\,O\,P\,Q\,R\,S\,T\,U\,V\,W\,X\,Y\,Z}$$
\verb+use \mathbf{}+
\subsection{Accents--Symbols}
\begin{tabular}{@{}clclcl@{}}
\'{o} & \verb.\'{o}. & \"{o} & \verb.\"{o}. & \^{o} & \verb.\^{o}.\\
\`{o} & \verb.\`{o}. & \~{o} & \verb.\~{o}. & \={o} & \verb.\={o}.\\
\.{o} & \verb+\.{o}+ & \u{o} & \verb.\u{o}. & \H{o} & \verb.\H{o}.\\
\t{oo} & \verb.\t{oo}. & \c{o} & \verb.\c{o}. & \d{o} & \verb.\d{o}.\\
\b{o} & \verb.\b{o}. & \AA & \verb.\AA. & \aa & \verb.\aa.\\[5pt]
\ss & \verb+\ss+ & \i & \verb+\i+ & \j & \verb+\j+ \\
\o & \verb+\o+ & \t s & \verb+\t s+ & \v s & \verb+\v s+\\
\O & \verb+\O+ & \P & \verb+\P+ & \S & \verb+\S+\\
\d s & \verb+\d s+ & \r s &\verb+\r s+ & \H s & \verb+\H s+ \\
\end{tabular}
%\begin{tabular}{@{}llll@{}}
%$\vert$ & \verb+\vert+ & $\Vert$ & \verb+\Vert+
%\end{tabular}
\begin{screen}
\newpage
\end{screen}
\section{Accents and Foreign Letters}
\subsection{Printing command characters}
The characters \# \$ \~ \_ \^{} \% \{ \} are interpreted as
commands. If they are to be printed as text, the character \verb+\+
must precede them:
\begin{center}
\begin{tabular}{lllllll}
\$ = \verb+\$+ & \& = \verb+\&+ & \% = \verb+\%+
& \# = \verb+\#+ & \_ = \verb+\_+ \{ = \verb+\{+ & \} = \verb+\}+
\end{tabular}
\end{center}
\subsection{The special characters}
These special characters do not exist on the computer keyboard. They
can however be generated by special commands as follows:
\begin{center}
\begin{tabular}{llllll}
\S = \verb+\S+ & \dag = \verb+\dag+ & \ddag
= \verb+\ddag+ & \P = \verb+\P+ &
\copyright = \verb+\copyright+ & \pounds = \verb+\pounds+
\end{tabular}
\end{center}
\subsection{Foreign letters}
Special letters that exist in European languages other than English can
also be generated with \TeX. These are:
\begin{center}
\begin{tabular}{lllllll}
\oe = \verb+\oe+ & \OE = \verb+\OE+ & \ae = \verb+\ae+ & \AE =
\verb+\AE+ & \aa = \verb+\aa+ & \AA = \verb+\AA+ & !` = \verb+!`+\\
\o = \verb+\o+ & \O = \verb+\O+ & \l = \verb+\l+ & \L =
\verb+\L+ & \ss = \verb+\ss+ & \SS = \verb+\SS+ & ?` = \verb+?`+\\
\end{tabular}
\end{center}
\subsection{Accents}
\begin{center}
\begin{tabular}{lllll}
\`o = \verb+\`o+ & \'o = \verb+\'o+ & \^o = \verb+\^o+ & \"o =
\verb+\"o+ & \~o = \verb+\~o+\\
\=o = \verb-\=o- & \.o = \verb+\.o+ & \u o = \verb+\u o+ & \v o =
\verb+\v o+ & \H o = \verb+\H o+\\
\t{oo} = \verb+\t{oo}+ & \c o = \verb+\c o+ & \d o = \verb+\d o+ & \b o =
\verb+\b o+ & \r o = \verb+\r o+\\
\end{tabular}
\end{center}
The last command, \verb+\r+, is new to \LaTeXe. The {\it o} above is
given merely as an example: any letter may be used. With $i$
and $j$ it should be pointed out that the dot must first be
removed. This is carried out by prefixing these letters with \verb+\+.
The command \verb+\i+ yield \i.
|
http://sun.stanford.edu/IAUS223/abstract_form.tex
|
stanford.edu
|
CC-MAIN-2018-05
|
application/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2018-05/segments/1516084891706.88/warc/CC-MAIN-20180123032443-20180123052443-00093.warc.gz
| 325,640,117
| 1,398
|
%%%%%%%%%%%%% BEGIN OF ABSTRACT%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\documentstyle[12pt]{article}
\documentclass[12pt]{article}
\pagestyle{myheadings}
\setlength{\textwidth}{160mm}
\setlength{\textheight}{240mm}
\setlength{\topmargin}{-5mm}
\setlength{\oddsidemargin}{0mm}
\setlength{\evensidemargin}{0mm}
\setlength{\parindent}{0mm}
\setlength{\parskip}{\medskipamount}
\setlength{\unitlength}{1mm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%
% Fill in the paper title
%
\begin{center}
{\large\bf Title of the paper (will appear in lower case bold type)}\\[0.3cm]
%
% Fill in the authors' names. The name of the presenting author will be underlined
%
A.B. FirstAuthor$^1$, \underline{C.D. SecondAuthor$^2$} and E.F.
ThirdAuthor$^1$\\[0.3cm]
{\small $^1$ First Grouped Address}\\
{\small $^2$ Second Grouped Address}\\
\end{center}
%
% Abstract text
%
\begin{tabular}{p{15.5cm}}
Please fill in the text of your abstract here.
These are instructions which you should delete before sending back this file. Title, as well as authors and their address {\it (author block)}, should be centered. Leave one blank line after title. Authors: give initials (with punctuation) followed by last name. Names of authors and their addresses should be typed in upper and lower case letters. Please, underline the name of the author who will present the paper. Leave one blank line after the {\it author block}.\\
An abstract should not contain more than 400 words. Do not reduce font
size, or line spacing.\\
\end{tabular}
\vspace{0.5cm}
% Check the appropiate session.
{\bf I want to present this contribution at Session I ( ), II ( ), III ( ),
IV ( ), V ( ), VI ( ), VII ( ),
or round table discussion: 1 ( ) or 2 ( ) or 3 ( ) } \\
\end{document}
%%%%%%%%%%%% END OF ABSTRACT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
https://www.zentralblatt-math.org/matheduc/en/?id=37261&type=tex
|
zentralblatt-math.org
|
CC-MAIN-2019-35
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2019-35/segments/1566027315558.25/warc/CC-MAIN-20190820180442-20190820202442-00310.warc.gz
| 1,024,742,092
| 1,254
|
\input zb-basic
\input zb-matheduc
\iteman{ZMATH 2009a.00058}
\itemau{Luo, Yu-hua}
\itemti{Cause and countermeasures for pupils\rq\ math anxiety.}
\itemso{J. Math. Educ. (Tianjin) 17, No. 3, 100-102 (2008).}
\itemab
Summary: Math anxiety has negative impacts on pupils\rq\ math study such as strain, uneasiness, fear and so on, and imperils their physical health. We have pointed out the two general factors in causing pupils\rq\ math anxiety: the cognition experience factor and the emotion experience factor. We must rely on the good family atmosphere, healthy and progressive collective classes, to help students to conduct an objective self-evaluation, and other measures to relieve their math anxiety, promoting their physical and psychological heath.
\itemrv{~}
\itemcc{C20}
\itemut{mathematics anxiety; self concept; affective variables; student attitudes; motivation; emotional development; educational psychology}
\itemli{}
\end
|
https://dlmf.nist.gov/24.14.E2.tex
|
nist.gov
|
CC-MAIN-2018-13
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2018-13/segments/1521257644271.19/warc/CC-MAIN-20180317035630-20180317055630-00251.warc.gz
| 578,313,258
| 701
|
\[\sum_{k=0}^{n}{n\choose k}B_{k}B_{n-k}=(1-n)B_{n}-nB_{n-1}.\]
|
http://mirrors.concertpass.com/tex-archive/macros/latex/contrib/enotez/enotez_split_example.tex
|
concertpass.com
|
CC-MAIN-2015-48
|
application/x-tex
| null |
crawl-data/CC-MAIN-2015-48/segments/1448398460519.28/warc/CC-MAIN-20151124205420-00006-ip-10-71-132-137.ec2.internal.warc.gz
| 157,280,954
| 1,147
|
\documentclass{scrartcl}
% \documentclass{memoir}
% \documentclass{article}
\usepackage[english]{babel}
\usepackage{caption}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage{enotez}
\usepackage{kantlipsum}
\DeclareInstance{enotez-list}{section}{paragraph}{heading=\section{#1}}
\setenotez{
split=section,
list-style=section,
reset,
% customize the titles in between, e.g.:
% split-sectioning=addsec,
% split-title=\par\noindent<name> <ref>:
}
\usepackage{fnpct}
% \AdaptNote\endnote\multendnote
\usepackage{mwe}
\usepackage[colorlinks]{hyperref}
\begin{document}
\makeatletter
% \texttt{\meaning\@@makecaption}
\makeatother
\tableofcontents
\section{Test}
Text\endnote{\kant[1]}. Text\endnote{\kant[2]}. Text\endnote{This time
with a \textbf{nested}\multendnote{\kant[3];\kant[4]} endnote.}.
Text\multendnote{\kant[5];\kant[6]}.
\begin{figure}[htp]
\centering
\includegraphics[width=.4\linewidth]{example-image-a}
\caption[caption]{Some text\endnote{An endnote with a nested endnote\endnote{\kant[7]}
inside a figure caption.}.}
\end{figure}
\appendix
\printendnotes
\end{document}
\tableofcontents
\section{Test}
Text\endnote{\kant[1]}. Text\endnote{\kant[2]}. Text\endnote{This time
with a \textbf{nested}\multendnote{\kant[3];\kant[4]} endnote.}.
Text\multendnote{\kant[5];\kant[6]}.
\begin{figure}[htp]
\centering
\includegraphics[width=.4\linewidth]{example-image-a}
\caption[caption]{Some text\endnote{An endnote with a nested endnote\endnote{\kant[7]}
inside a figure caption.}.}
\end{figure}
\section{Test}
Text\endnote{\kant[8]}. Text\endnote{\kant[9]}. Text\endnote{This time
with a \textbf{nested}\endnote{\kant[10]} endnote.}. Text\endnote{\kant[11]}.
\appendix
\printendnotes
\end{document}
|
https://ficpubs.uai.cl/search.php?sqlQuery=SELECT%20author%2C%20title%2C%20type%2C%20year%2C%20publication%2C%20abbrev_journal%2C%20volume%2C%20issue%2C%20pages%2C%20keywords%2C%20abstract%2C%20thesis%2C%20editor%2C%20publisher%2C%20place%2C%20abbrev_series_title%2C%20series_title%2C%20series_editor%2C%20series_volume%2C%20series_issue%2C%20edition%2C%20language%2C%20author_count%2C%20online_publication%2C%20online_citation%2C%20doi%2C%20serial%2C%20area%20FROM%20refs%20WHERE%20serial%20%3D%20806%20ORDER%20BY%20first_author%2C%20author_count%2C%20author%2C%20year%2C%20title&client=&formType=sqlSearch&submit=Cite&viewType=&showQuery=0&showLinks=1&showRows=20&rowOffset=&wrapResults=1&citeOrder=&citeStyle=APA&exportFormat=RIS&exportType=html&exportStylesheet=&citeType=LaTeX&headerMsg=
|
uai.cl
|
CC-MAIN-2022-40
|
application/x-latex
|
application/x-latex
|
crawl-data/CC-MAIN-2022-40/segments/1664030337480.10/warc/CC-MAIN-20221004054641-20221004084641-00663.warc.gz
| 288,246,669
| 1,352
|
%&LaTeX
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\begin{document}
\begin{thebibliography}{1}
\bibitem{Vargas_etal2017} Vargas, I. T., Fischer, D. A., Alsina, M. A., Pavissich, J. P., Pasten, P. A., \& Pizarro, G. E. (2017). Copper Corrosion and Biocorrosion Events in Premise Plumbing. \textit{Materials}, \textit{10}(9), 30 pp.
\end{thebibliography}
\end{document}
|
https://www.mathematik.tu-dortmund.de/lsiii/cms/bibtex/75480169.tex
|
tu-dortmund.de
|
CC-MAIN-2021-21
|
application/x-tex
|
application/x-bibtex-text-file
|
crawl-data/CC-MAIN-2021-21/segments/1620243992516.56/warc/CC-MAIN-20210516075201-20210516105201-00058.warc.gz
| 883,977,242
| 837
|
@TECHREPORT{IbrahimHattafRihanTurek2016,
author = {Ibrahim, F. and Hattaf, K. and Rihan, F. and Turek, S.},
title = {Numerical method based on extended one--step schemes for optimal control problems with time--lags},
year = {2016},
month = jun,
institution = {Fakult\"{a}t f\"{u}r Mathematik, TU Dortmund},
note = {Ergebnisberichte des Instituts f\"{u}r Angewandte Mathematik, Nummer 542},
}
|
https://doc.libelektra.org/api/latest/latex/doc_AUTHORS_md.tex
|
libelektra.org
|
CC-MAIN-2023-06
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2023-06/segments/1674764500035.14/warc/CC-MAIN-20230202165041-20230202195041-00716.warc.gz
| 234,776,576
| 2,443
|
\label{doc_AUTHORS_md_md_doc_AUTHORS}%
\Hypertarget{doc_AUTHORS_md_md_doc_AUTHORS}%
This is a list of people that contributed to the Elektra Initiative.\hypertarget{doc_AUTHORS_md_autotoc_md1538}{}\doxysection{Markus Raab}\label{doc_AUTHORS_md_autotoc_md1538}
maintainer, main development, documentation, quality
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ markus@libelektra.\+org}}
\item devel/test on\+: Debian stable
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1539}{}\doxysection{Mihael Pranjić}\label{doc_AUTHORS_md_autotoc_md1539}
maintainer, development of the cache and mmapstorage plugins
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ mpranj@limun.\+org}}
\item Git\+Hub user\+: \href{https://github.com/mpranj}{\texttt{ mpranj}}
\item devel/test on\+: Fedora, Debian, mac\+OS
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1540}{}\doxysection{Klemens Böswirth}\label{doc_AUTHORS_md_autotoc_md1540}
development of the highlevel API and code-\/generation; various other things
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ k.\+boeswirth+git@gmail.\+com}}
\item Git\+Hub user\+: \href{https://github.com/kodebach}{\texttt{ kodebach}}
\item devel/test on\+: Fedora
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1541}{}\doxysection{Robert Sowula}\label{doc_AUTHORS_md_autotoc_md1541}
packaging, release automation
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ robert@sowula.\+at}}
\item Git\+Hub user\+: \href{https://github.com/robaerd}{\texttt{ robaerd}}
\item devel/test on\+: Debian, Ubuntu
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1542}{}\doxysection{Michael Tucek}\label{doc_AUTHORS_md_autotoc_md1542}
Java bindings
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ libelektra@hellwach.\+at}}
\item Git\+Hub user\+: \href{https://github.com/tucek}{\texttt{ tucek}}
\item devel/test on\+: Debian (WSL2), Ubuntu (WSL2)
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1543}{}\doxysection{Manuel Mausz}\label{doc_AUTHORS_md_autotoc_md1543}
SWIG bindings
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ manuel-\/elektra@mausz.\+at}}
\item devel/test on\+: Fedora
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1544}{}\doxysection{Dardan Haxhimustafa}\label{doc_AUTHORS_md_autotoc_md1544}
development of KConfig plugin
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ mail@dardan.\+im}}
\item Git\+Hub user\+: \href{https://github.com/darddan}{\texttt{ darddan}}
\item devel/test on\+: Arch Linux
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1545}{}\doxysection{Felix Berlakovich}\label{doc_AUTHORS_md_autotoc_md1545}
journald plugin, augeas plugin, keytometa
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ elektra@berlakovich.\+net}}
\item devel/test on\+: Debian
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1546}{}\doxysection{Kai-\/\+Uwe Behrmann}\label{doc_AUTHORS_md_autotoc_md1546}
test \& packaging on Cent\+OS, Fedora, Open\+SUSE, RHEL and SLE
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ kai-\/uwe@behrmann.\+name}}
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1547}{}\doxysection{Charles Lindsay}\label{doc_AUTHORS_md_autotoc_md1547}
ni library\hypertarget{doc_AUTHORS_md_autotoc_md1548}{}\doxysection{Avi Alkalay}\label{doc_AUTHORS_md_autotoc_md1548}
initial concept \& implementation
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ avi@\+Unix.\+sh}}
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1549}{}\doxysection{Patrick Sabin}\label{doc_AUTHORS_md_autotoc_md1549}
trie development, previous python bindings
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ patricksabin@gmx.\+at}}
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1550}{}\doxysection{Daniel Bugl}\label{doc_AUTHORS_md_autotoc_md1550}
documentation, web ui
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ me@omnidan.\+net}}
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1551}{}\doxysection{Kurt Micheli}\label{doc_AUTHORS_md_autotoc_md1551}
optimizing ks\+Lookup with order preserving minimal perfect hash map, Markdown link converter for doxygen
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ e1026558@student.\+tuwien.\+ac.\+at}}
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1552}{}\doxysection{Alexander Rössler}\label{doc_AUTHORS_md_autotoc_md1552}
improvements to the dbus plugin
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ mail@roessler.\+systems}}
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1553}{}\doxysection{Peter Nirschl}\label{doc_AUTHORS_md_autotoc_md1553}
development of the crypto plugin, minor bug fixes, BSD/mac\+OS support
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ peter.\+nirschl@gmail.\+com}}
\item Git\+Hub user\+: \href{http://github.com/petermax2}{\texttt{ petermax2}}
\item devel on\+: Fedora
\item test on\+: Fedora, Debian, mac\+OS
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1554}{}\doxysection{René Schwaiger}\label{doc_AUTHORS_md_autotoc_md1554}
documentation, bug fixes
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ sanssecours@me.\+com}}
\item Git\+Hub user\+: \href{http://github.com/sanssecours}{\texttt{ sanssecours}}
\item devel/test on\+: mac\+OS
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1555}{}\doxysection{Marvin Mall}\label{doc_AUTHORS_md_autotoc_md1555}
development of the REST service \& frontend for sharing of conf. snippets, cachefilter plugin, website
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ marvin-\/mall@msn.\+com}}
\item Git\+Hub user\+: \href{https://github.com/Namoshek}{\texttt{ Namoshek}}
\item devel/test on\+: Debian Jessie
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1556}{}\doxysection{Thomas Waser}\label{doc_AUTHORS_md_autotoc_md1556}
main development, many plugins, ansible
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ thomas.\+waser@libelektra.\+org}}
\item Git\+Hub user\+: \href{https://github.com/tom-wa}{\texttt{ tom-\/wa}}
\item devel/test on\+: Debian Testing/\+Sid
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1557}{}\doxysection{Raffael Pancheri}\label{doc_AUTHORS_md_autotoc_md1557}
design and implementation of the qt-\/gui
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ raffael@libelektra.\+org}}
\item Git\+Hub user\+: \href{https://github.com/0003088}{\texttt{ 0003088}}
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1558}{}\doxysection{Bernhard Denner}\label{doc_AUTHORS_md_autotoc_md1558}
ruby bindings, ruby plugin, build server, Puppet module
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ bernhard.\+denner@gmail.\+com}}
\item Git\+Hub user\+: \href{https://github.com/BernhardDenner}{\texttt{ Bernhard\+Denner}}
\item devel/test on\+: Ubuntu and Debian
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1559}{}\doxysection{Thomas Wahringer}\label{doc_AUTHORS_md_autotoc_md1559}
notification system, I/O bindings
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ waht@libelektra.\+org}}
\item Git\+Hub user\+: \href{https://github.com/waht}{\texttt{ waht}}
\item devel/test on\+: Debian
\end{DoxyItemize}\hypertarget{doc_AUTHORS_md_autotoc_md1560}{}\doxysection{Maximilian Irlinger}\label{doc_AUTHORS_md_autotoc_md1560}
documentation, Python bindings for elektra\+Merge
\begin{DoxyItemize}
\item email\+: \href{mailto:[email protected]}{\texttt{ max@maxirlinger.\+at}}
\item Git\+Hub user\+: \href{https://github.com/atmaxinger}{\texttt{ atmaxinger}}
\item devel/test on\+: Fedora, mac\+OS
\end{DoxyItemize}
|
https://fifthestate.anarchistlibraries.net/library/387-summer-2012-power-art-never-underestimated.tex
|
anarchistlibraries.net
|
CC-MAIN-2021-39
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-39/segments/1631780057861.0/warc/CC-MAIN-20210926114012-20210926144012-00418.warc.gz
| 310,517,499
| 4,757
|
\documentclass[DIV=12,%
BCOR=0mm,%
headinclude=false,%
footinclude=false,open=any,%
fontsize=10pt,%
oneside,%
paper=210mm:11in]%
{scrbook}
\usepackage{fontspec}
\setmainfont[Script=Latin]{CMU Serif}
\setsansfont[Script=Latin,Scale=MatchLowercase]{CMU Sans Serif}
\setmonofont[Script=Latin,Scale=MatchLowercase]{CMU Typewriter Text}
% global style
\pagestyle{plain}
\usepackage{microtype} % you need an *updated* texlive 2012, but harmless
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{verbatim}
% http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\PassOptionsToPackage{hyphens}{url}\usepackage[hyperfootnotes=false,hidelinks,breaklinks=true]{hyperref}
\usepackage{bookmark}
\usepackage[shortlabels]{enumitem}
\usepackage{tabularx}
\usepackage[normalem]{ulem}
\def\hsout{\bgroup \ULdepth=-.55ex \ULset}
% https://tex.stackexchange.com/questions/22410/strikethrough-in-section-title
% Unclear if \protect \hsout is needed. Doesn't looks so
\DeclareRobustCommand{\sout}[1]{\texorpdfstring{\hsout{#1}}{#1}}
\usepackage{wrapfig}
\usepackage{indentfirst}
% remove the numbering
\setcounter{secnumdepth}{-2}
% remove labels from the captions
\renewcommand*{\captionformat}{}
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\KOMAoption{captions}{belowfigure,nooneline}
\addtokomafont{caption}{\centering}
\usepackage{polyglossia}
\setmainlanguage{english}
% footnote handling
\usepackage[fragile]{bigfoot}
\usepackage{perpage}
\DeclareNewFootnote{default}
\DeclareNewFootnote{B}
\MakeSorted{footnoteB}
\renewcommand*\thefootnoteB{(\arabic{footnoteB})}
\deffootnote[3em]{0em}{4em}{\textsuperscript{\thefootnotemark}~}
% avoid breakage on multiple <br><br> and avoid the next [] to be eaten
\newcommand*{\forcelinebreak}{\strut\\*{}}
\newcommand*{\hairline}{%
\bigskip%
\noindent \hrulefill%
\bigskip%
}
% reverse indentation for biblio and play
\newenvironment*{amusebiblio}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newenvironment*{amuseplay}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newcommand*{\Slash}{\slash\hspace{0pt}}
\addtokomafont{disposition}{\rmfamily}
\addtokomafont{descriptionlabel}{\rmfamily}
% forbid widows/orphans
\frenchspacing
\sloppy
\clubpenalty=10000
\widowpenalty=10000
% http://tex.stackexchange.com/questions/304802/how-not-to-hyphenate-the-last-word-of-a-paragraph
\finalhyphendemerits=10000
% given that we said footinclude=false, this should be safe
\setlength{\footskip}{2\baselineskip}
\title{The Power of Art Should Never be Underestimated}
\date{}
\author{David Widgington}
\subtitle{}
% https://groups.google.com/d/topic/comp.text.tex/6fYmcVMbSbQ/discussion
\hypersetup{%
pdfencoding=auto,
pdftitle={The Power of Art Should Never be Underestimated},%
pdfauthor={David Widgington},%
pdfsubject={},%
pdfkeywords={Fifth Estate \#387, Summer, 2012}%
}
\begin{document}
\begin{titlepage}
\strut\vskip 2em
\begin{center}
{\usekomafont{title}{\huge The Power of Art Should Never be Underestimated\par}}%
\vskip 1em
\vskip 2em
{\usekomafont{author}{David Widgington\par}}%
\vskip 1.5em
\vfill
\strut\par
\end{center}
\end{titlepage}
\cleardoublepage
A review of \emph{The Listener: Memory, Lies, Art, Power, A Graphic Novel} by David Lester, Arbeiter Ring Publishing, 2011, 310 pp, \$19.95; distributed by AK Press, \href{http://www.akpress.org/thelistener.html}{akpress.org}.
All works of art, regardless of their form, offer a message to their audience. Some may be conceived as more deliberate acts of communication, while others allow room for nuanced interpretation. As a political tool, art can even inspire an audience to risk their own lives or take the lives of others in the name of social change.
Leni Riefenstahl’s film \emph{Victory of Faith} documents the Nazi Party’s 1933 Fifth Party Rally in Nuremberg and her later \emph{Triumph of the Will} was made at the Nazi Party’s 1934 congress. Both exemplify how the power of art can move an entire population to commit mass murder on the scale of the Holocaust. Riefenstahl’s films represent the art of manipulation, preying on popular anxiety for the purposes of political gain and popular domination through deliberate propaganda.
The Listener is a political graphic novel by Vancouver resident, cartoonist, painter and guitarist for Mecca Normal, David Lester. This work of historical fiction is published by Winnipeg-based Arbeiter Ring Publishing.
Other artistic initiatives like the abstract sculptures by \emph{The Listener’s} protagonist, Louise Shearing, leave more room for interpretation or inspiration for political action that have led to their own deadly consequences. The Listener begins in present-day Vancouver with a man named Vann, who dies during a political act of civil disobedience inspired by a sculpture created by Louise.
Louise then leaves on a journey to escape her guilt and to find solace in the works of Western masters within the great museums of Europe. While in Berlin, Louise meets Rudolph and Marie, an aging German couple whose memories fill the book’s pages with 1930’s German history and the propagandist politics that led to the rise of Nazi fascism. Louise listens intently to her new friends’ little-known story that becomes pivotal for her own recovery and that greatly influences the conceptualization of her next sculpture that ends the narrative, a larger-than-life work to represent the ideas of Nestor Ivanovych Makhno, the Ukrainian anarcho-communist guerrilla.
Vann, a young Cambodian doctor turned activist, provides the contrast that moves the protagonist forward past her guilt, eventually releasing her to her creativity. He is the mirror within which the protagonist can see herself and which allows her to evolve. This literary and narrative tool is perfectly embodied in Chapter 12.
In this climactic chapter, Walter, a Holocaust survivor and close friend of Vann, visits Louise in her Vancouver apartment to tell her more about the young Cambodian genocide survivor, who, until viewing Louise’s sculpture, wondered why artists were targets for eradication by the Khmer Rouge. During his unannounced visit, Walter tells Louise, “Art held a fascination for [Vann] because very few Cambodian artists survived the genocide.” He continues, “\dots{}your art inspired Vann, but it was his decision to act in the way that he did. Just as you interpret history and make art, he interpreted your art to make history.”
Art inspires creativity. Art may be inspired by memory and can be a reminder of the past. Art is also about history’s interpretation as posed by an artist’s conceptualization. But the artist has little control of the effect a work of art may have because the observer--through his\Slash{} her own contemplation-- may be roused towards grotesque acts of brutality or who may, preferably, be moved to perform exceptional acts of bravery.
Montreal anarchist poet, Norman Nawrocki expresses the role of art which is appropriately quoted in the book, “Spread the word, write it, sing it, shout it out, whisper it, type it, paint it, draw it, dance it, jiggle it, shake it up and down,\dots{}don’t be afraid, experiment, practice, agitate, organize, resist,\dots{}do something intelligent, somewhere, something new and exciting that will bring us one step closer to where we all want to go: a healthy planet, without exploiters and exploited, here and now.”
I’m sure this is what Vann had in mind as he risked his life for political expression and ultimately lost it.
I readily add David Lester’s \emph{The Listener} to my graphic novel collection and place it appropriately beside Jason Lutes’ \emph{Berlin: City of Stones} that is a beautiful multi-volume graphic novel of historical fiction of pre-WWII Germany.
David Widgington is a Media Studies graduate student at Concordia University in Montreal. He has been a radio, video and print media activist for over a decade and is rarely without multiple recording devices in one of his pockets. He blogs about the Quebec student strike at \href{http://mediaswap.wordpress.com/}{mediaswap.wordpress.com}, South Sudan --at-- southsudaninfo.net and a variety of issues at \href{http://burningbillboard.org/}{burningbillboard.org}.
% begin final page
\clearpage
% new page for the colophon
\thispagestyle{empty}
\begin{center}
\bigskip
\includegraphics[width=0.25\textwidth]{fe-logo.pdf}
\bigskip
\end{center}
\strut
\vfill
\begin{center}
David Widgington
The Power of Art Should Never be Underestimated
\bigskip
\href{https://www.fifthestate.org/archive/387-summer-2012/power-art-never-underestimated}{\texttt{https://www.fifthestate.org/archive/387-summer-2012/power-art-never-underestimated}}
Fifth Estate \#387, Summer, 2012
\bigskip
\textbf{fifthestate.anarchistlibraries.net}
\end{center}
% end final page with colophon
\end{document}
|
https://cs.uwaterloo.ca/journals/JIS/VOL17/Quaintance/quain3.tex
|
uwaterloo.ca
|
CC-MAIN-2021-04
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-04/segments/1610703497681.4/warc/CC-MAIN-20210115224908-20210116014908-00787.warc.gz
| 295,796,169
| 4,722
|
\documentclass[12pt,reqno]{article}
\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amscd}
\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}
\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}
\usepackage{color}
\usepackage{fullpage}
\usepackage{float}
\usepackage{psfig}
\usepackage{graphics,amsmath,amssymb}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{latexsym}
\usepackage{epsf}
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.5in}
\setlength{\textheight}{8.9in}
\newcommand{\seqnum}[1]{\href{http://oeis.org/#1}{\underline{#1}}}
\begin{document}
\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\begin{center}
\vskip 1cm{\LARGE\bf Bernoulli Numbers and a New Binomial \\
\vskip .1in
Transform Identity}
\vskip 1cm
\large
H. W. Gould\\
Department of Mathematics\\
West Virginia University\\
Morgantown, WV 26506\\
USA\\
\href{mailto:[email protected]}{\tt [email protected]} \\
\ \\
Jocelyn Quaintance\\
Department of Mathematics\\
Rutgers University\\
Piscataway, NJ 08854\\
USA\\
\href{mailto:[email protected]}{\tt [email protected]}
\end{center}
\vskip .2 in
\begin{abstract}
Let $(b_n)_{n \geq 0}$ be the binomial transform of
$(a_n)_{n \geq 0}$.
We show how a binomial transformation identity of Chen proves a symmetrical Bernoulli number identity attributed to Carlitz. We then modify Chen's identity to prove a new binomial transformation identity.
\end{abstract}
\vskip .2 in
Carlitz \cite{lc} posed as a problem the remarkable symmetric Bernoulli number identity
\begin{align}\label{eq1}
(-1)^m\sum_{k=0}^m{m\choose k}B_{n+k} &= (-1)^n\sum_{k=0}^n{n\choose k}B_{m+k},
\end{align}
valid for arbitrary $m, n\geq 0$. The published solution by Shannon \cite{ags} used mathematical induction on $m$ and $n$. The identity was rediscovered recently by Vassilev and Vassilev-Missana \cite{vm}, but stated in the form
\begin{align}\label{eq2}
(-1)^m\sum_{k=0}^{m-1}{m\choose k}B_{n+k} &= (-1)^n\sum_{k=0}^{n-1}{n\choose k}B_{m+k},
\end{align}
valid for arbitrary positive integers $m$ and $n$. Identity (\ref{eq2}) is equivalent to Identity (\ref{eq1}) since $\left[(-1)^m - (-1)^n\right]B_{m+n} = 0$. Their proof used the symmetry of a function $f_k(x,y)$ involving Bernoulli numbers introduced in a separate paper \cite{vm1}. They give no reference to Carlitz's or to Shannon's proof.
An alternative proof of Equation (\ref{eq1}) is derived through an application of a binomial transformation identity discovered by Chen \cite{kwc}.
Let $(a_n)$ be any sequence of numbers,
and define the binomial transform of $(a_n)$ to be the sequence $(b_n)$,
where $b_n = \sum_{k=0}^n{n\choose k}a_k$.
A corollary of \cite[Thm.\ 2.1] {kwc} is
\begin{align}\label{eq3}
\sum_{k=0}^m{m\choose k}a_{n+k} &= \sum_{k=0}^n(-1)^{n-k}{n\choose k}b_{m+k}.
\end{align}
The Bernoulli numbers satisfy the recurrence $\sum_{k=0}^n{n\choose k}B_k = (-1)^nB_n$ for $n\geq 0$. Setting $a_k = B_k$, we then have $b_n = (-1)^nB_n$, so that Equation (\ref{eq3}) becomes
\begin{align*}
\sum_{k=0}^m{m\choose k}B_{n+k} = \sum_{k=0}^n(-1)^{n-k}{n\choose k}(-1)^{m+k}B_{m+k},
\end{align*}
which is precisely Identity (\ref{eq1}) of Carlitz.
Chen's proof of Equation (\ref{eq3}) relies on certain properties of Seidel matrices. We present a direct proof which relies on the hypergeometric identity
\begin{align}\label{eq4}
\sum_{k=0}^m(-1)^k{m\choose k}{x+k\choose r} &= (-1)^m{x\choose r-m};
\end{align}
see \cite[Identity 3.47, p.\ 27]{hwg}. In Equation (\ref{eq4}) we require that $m$ and $r$ be nonnegative integers and $x$ be a complex number.
Since the binomial transform inverts to give $a_n = \sum_{k=0}^n(-1)^{n-k}{n\choose k}b_k$ we find that
\begin{align*}
\sum_{k=0}^m{m\choose k}a_{n+k} &= \sum_{k=0}^m{m\choose k}\sum_{j=0}^{n+k}(-1)^{n+k-j}{n+k\choose j}b_j\\
&= \sum_{j=0}^{n+m}(-1)^{-j}b_j\sum_{k=j-n}^m(-1)^{n+k}{m\choose k}{n+k\choose j}\\
&= \sum_{j=0}^{n+m}(-1)^{-j}b_j\sum_{k=0}^m(-1)^{n+k}{m\choose k}{n+k\choose j}\\
&= \sum_{j=0}^{n+m}(-1)^{n+m-j}{n\choose j-m}b_j = \sum_{j=0}^n(-1)^{n-j}{n\choose j}b_{j+m}.
\end{align*}
A careful analysis of this preceding proof yields a short proof of
\cite[Thm.\ 3.2]{kwc}, where Chen relies on lengthy induction arguments. We will instead use Equation (\ref{eq4}).
\begin{theorem}\cite[Thm.\ 3.2]{kwc} Let $b_n$ be the binomial transform of $a_n$. Then
\begin{align}\label{eq5}
\sum_{k=0}^m{m\choose k}{n+k\choose s}a_{n+k-s} &= \sum_{k=0}^n(-1)^{n-k}{n\choose k}{m+k\choose s}b_{m+k-s},
\end{align}
for arbitrary nonnegative $m, n,$ and $s$.
\end{theorem}
\begin{proof}
By definition $b_n = \sum_{k=0}^n{n\choose k}a_k$. This implies that $a_n = \sum_{k=0}^n(-1)^{n-k}{n\choose k}b_k$. Hence
\begin{align*}
\sum_{k=0}^m{m\choose k}{n+k\choose s}a_{n+k-s} &= \sum_{k=0}^m{m\choose k}{n+k\choose s}\sum_{j=0}^{n+k-s}(-1)^{n+k-s-j}{n+k-s\choose j}b_j\\
&= \sum_{j=0}^{n+m-s}(-1)^{n-s-j}b_j\sum_{k=0}^m(-1)^k{m\choose k}{n+k\choose s}{n+k-s\choose j}\\
&= \sum_{j=0}^{n+m-s}(-1)^{n-s-j}{s+j\choose s}b_j\sum_{k=0}^m(-1)^k{m\choose k}{n+k\choose s+j}\\
&= \sum_{j=m-s}^{n+m-s}(-1)^{m+n-j-s}{s+j\choose s}{n\choose j+s-m}b_j\\
&= \sum_{j=0}^n(-1)^{n-j}{n\choose j}{m+j\choose s}b_{m+j-s},
\end{align*}
where the fourth equality follows by Equation (\ref{eq4}).
\end{proof}
Equation (\ref{eq5}) allows us to establish a generalization of the curious formula
\begin{align}\label{eq6}
\sum_{k=0}^n{n\choose k}{n+k\choose n}x^k &= \sum_{k=0}^n(-1)^{n-k}{n\choose k}{n+k\choose n}(1+x)^k,
\end{align}
discovered by Simons \cite{ss}. A quick proof of this was given
by Gould \cite{hwg1} using elementary properties of Legendre polynomials. Instead, choose $a_n = x^n$ for all $n\geq 0$. Then $b_n = (1+x)^n$ and Identity (\ref{eq5}) tells us that
\begin{align*}
\sum_{k=0}^m{m\choose k}{n+k\choose s}x^{n+k-s} &= \sum_{k=0}^n(-1)^{n-k}{n\choose k}{m+k\choose s}(1+x)^{m+k-s}.
\end{align*}
Letting $m = s = n$ recovers Identity (\ref{eq6}).
Through an induction argument Chen proves
\begin{theorem}\cite[Thm.\ 3.1]{kwc} Let $b_n$ be the binomial transform of $a_n$. Then
\begin{align}\label{eq7}
\sum_{k=0}^m\frac{{m\choose k}}{{n+k+s\choose s}}a_{n+k+s} &= \sum_{k=0}^n(-1)^{n-k}\frac{{n\choose k}}{{m+k+s\choose s}}b_{m+k+s}\notag\\
&+ \sum_{j=0}^{s-1}\sum_{i=0}^{s-1-j}{s-1-j\choose i}{s-1\choose j}\frac{(-1)^{n+1+i}sa_j}{(m+n+1+i){m+n+i\choose n}},
\end{align}
where $m$, $n$, and $s$ are nonnegative integers.
\end{theorem}
If we use Equation (\ref{eq4}) and the following hypergeometric identity attributed to Frisch \cite{rf}, \cite[p.\ 337]{en},
\begin{align}\label{eq8}
\sum_{k=0}^n(-1)^k{n\choose k}\frac{1}{{b+k\choose c}} &= \frac{c}{n+c}\frac{1}{{n+b\choose b-c}},\qquad b\geq c > 0,
\end{align}
\cite[Identity 4.2, p.\ 46]{hwg}, we are able to prove the following new binomial transformation identity.
\begin{theorem} Let $b_n$ be the binomial transform of $a_n$. Let $m$, $n$, and $s$ be nonnegative integers. Then
\begin{align}\label{eqA}
\sum_{j=0}^s\frac{{s\choose j}a_j}{(m+n+s+1-j){m+n+s-j\choose m}} &= \sum_{j=0}^s\frac{(-1)^{s-j}{s\choose j}b_j}{(m+n+s+1-j){m+n+s-j\choose n}}.
\end{align}
\end{theorem}
\begin{proof}
By definition $b_n = \sum_{k=0}^n{n\choose k}a_k$. Hence $a_n = \sum_{k=0}^n(-1)^{n-k}{n\choose k}b_k$ and
\begin{align*}
&\sum_{k=0}^m\frac{{m\choose k}}{{n+k+s\choose s}}a_{n+k+s} = \sum_{k=0}^m\frac{{m\choose k}}{{n+k+s\choose s}}\sum_{j=0}^{n+k+s}(-1)^{n+k+s-j}{n+k+s\choose j}b_j\\
&= \sum_{j=0}^{m+n+s}(-1)^{n+s-j}b_j\sum_{k=0}^m(-1)^k\frac{{m\choose k}}{{n+k+s\choose s}}{n+k+s\choose j}\\
&= \sum_{j=s}^{m+n+s}(-1)^{n+s-j}\frac{b_j}{{j\choose s}}\sum_{k=0}^m(-1)^k{m\choose k}{n+k\choose j-s} + \sum_{j=0}^{s-1}(-1)^{n+s-j}b_j\sum_{k=0}^m(-1)^k\frac{{m\choose k}}{{n+k+s\choose s}}{n+k+s\choose j}\\
&= \sum_{j=s+m}^{m+n+s}(-1)^{m+n+s-j}\frac{{n\choose j-s-m}}{{j\choose s}}b_j + \sum_{j=0}^{s-1}(-1)^{n+s-j}b_j\sum_{k=0}^m(-1)^k\frac{{m\choose k}}{{n+k+s\choose s}}{n+k+s\choose j}\\
&= \sum_{j=0}^n(-1)^{n-j}\frac{{n\choose j}}{{m+j+s\choose s}}b_{m+j+s} + \sum_{j=0}^{s-1}(-1)^{n+s-j}b_j\sum_{k=0}^m(-1)^k\frac{{m\choose k}}{{n+k+s\choose s}}{n+k+s\choose j}\\
&= \sum_{j=0}^n(-1)^{n-j}\frac{{n\choose j}}{{m+j+s\choose s}}b_{m+j+s} + \sum_{j=0}^{s-1}(-1)^{n+s-j}{s\choose j}b_j\sum_{k=0}^m(-1)^k\frac{{m\choose k}}{{n+k+s-j\choose s-j}}\\
&= \sum_{j=0}^n(-1)^{n-j}\frac{{n\choose j}}{{m+j+s\choose s}}b_{m+j+s} + \sum_{j=0}^{s-1}(-1)^{n+s-j}\frac{(s-j){s\choose j}}{(m+s-j){m+n+s-j\choose n}}b_j\\
&= \sum_{j=0}^n(-1)^{n-j}\frac{{n\choose j}}{{m+j+s\choose s}}b_{m+j+s} + \sum_{j=0}^{s-1}(-1)^{n+s-j}\frac{s{s-1\choose j}}{(m+n+s-j){m+n+s-j-1\choose n}}b_j.
\end{align*}
The fourth line follows from Equation (\ref{eq4}) while the seventh follows from Equation (\ref{eq8}).
In summary, we have shown that
\begin{align}\label{eq9}
\sum_{k=0}^m\frac{{m\choose k}}{{n+k+s\choose s}}a_{n+k+s} &= \sum_{j=0}^n\frac{(-1)^{n-j}{n\choose j}}{{m+j+s\choose s}}b_{m+j+s} + \sum_{j=0}^{s-1}\frac{(-1)^{n+s-j}s{s-1\choose j}}{(m+n+s-j){m+n+s-j-1\choose n}}b_j,
\end{align}
If we compare Identity (\ref{eq7}) to Identity (\ref{eq9}), we conclude that
\begin{align}\label{eq10}
\sum_{j=0}^{s-1}&\frac{(-1)^{n+s-j}s{s-1\choose j}}{(m+n+s-j){m+n+s-j-1\choose n}}b_j \notag\\
&= \sum_{j=0}^{s-1}\sum_{i=0}^{s-1-j}{s-1-j\choose i}{s-1\choose j}\frac{(-1)^{n+1+i}sa_j}{(m+n+1+i){m+n+i\choose n}}.
\end{align}
Equation (\ref{eq10}) can be furthered simplified by applying Equation (\ref{eq8}). In particular,
\begin{align*}
\sum_{j=0}^{s-1}\sum_{i=0}^{s-1-j}{s-1-j\choose i}&{s-1\choose j}\frac{(-1)^{n+1+i}sa_j}{(m+n+1+i){m+n+i\choose n}}\\
&= \sum_{j=0}^{s-1}(-1)^{n+1}\frac{s}{n+1}{s-1\choose j}a_j\sum_{i=0}^{s-1-j}(-1)^i\frac{{s-1-j\choose i}}{{m+n+1+i\choose n+1}}\\
&= \sum_{j=0}^{s-1}(-1)^{n+1}\frac{s}{n+1}{s-1\choose j}a_j\frac{n+1}{n+s-j}\frac{1}{{m+n+s-j\choose m}}\\
&= (-1)^{n+1}\sum_{j=0}^{s-1}\frac{s{s-1\choose j}}{(n+s-j){m+n+s-j\choose m}}a_j.
\end{align*}
These calculations show that Equation (\ref{eq10}) is equivalent to
\begin{align}
-\sum_{j=0}^{s-1}\frac{{s-1\choose j}}{(n+s-j){m+n+s-j\choose m}}a_j &= \sum_{j=0}^{s-1}(-1)^{s-j}\frac{{s-1\choose j}}{(m+n+s-j){m+n+s-j-1\choose n}}b_j.
\end{align}
Set $s\rightarrow s+1$ to obtain
\begin{align}\label{eqA1}
\sum_{j=0}^s\frac{{s\choose j}a_j}{(n+s+1-j){m+n+s+1-j\choose m}} &= \sum_{j=0}^s\frac{(-1)^{s-j}{s\choose j}b_j}{(m+n+s+1-j){m+n+s-j\choose n}}.
\end{align}
Since $(n+s+1-j){m+n+s+1-j\choose m} = (m+n+s+1-j){m+n+s-j\choose m}$, we see that Equation (\ref{eqA1}) is equivalent to Equation (\ref{eqA}).
\end{proof}
\begin{thebibliography}{99}
\bibitem{lc} L. Carlitz, Problem 795, {\it Math. Mag.} {\bf 44} (1971), 107.
\bibitem{ags} A. G. Shannon, Solution of Problem 795, {\it Math. Mag.} {\bf 45} (1972), 55--56.
\bibitem{kwc} K. W. Chen, Identities from the binomial transform, {\it J. Number Theory} {\bf 124} (2007), 142--150.
\bibitem{rf} R. Frisch, Sur les semi-invariants et moments employ\'{e}s dans l'\'{e}tude des distributions
statistiques, {\it Skrifter utgitt av Det Norske Videnskaps-Akademi i Oslo, II}.
Historisk-Filosofisk Klasse, 1926, No. 3, 87 pp.
\bibitem{en} Eugen Netto, {\it Lehrbuch der Combinatorik}, 2nd edition, 1927.
Reprinted by Chelsea, 1958.
\bibitem{hwg} H. W. Gould, {\it Combinatorial Identities, A Standardized Set of Tables Listing 500 Binomial Coefficient Summations}, revised edition. Published by the author, Morgantown, WV, 1972.
\bibitem{hwg1} H. W. Gould, A curious identity which is not so curious. {\it Math. Gaz.} {\bf 88} (2004), 87.
\bibitem{ss} S. Simons, A curious identity, {\it Math. Gaz.} {\bf 85} (2001), 296--298.
\bibitem{vm1} P. Vassilev and M. Vassilev-Missana, On the sum of equal powers of the first $n$ terms of an arbitrary arithmetic progression, {\it Notes on Number Theory and Discrete Mathematics} {\bf 11} (2005), 15--21.
\bibitem{vm} P. Vassilev and M. Vassilev-Missana, On one remarkable identity involving Bernoulli numbers, {\it Notes on Number Theory and Discrete Mathematics} {\bf 11} (2005), 22--24.
\end{thebibliography}
\bigskip
\hrule
\bigskip
\noindent 2010 {\it Mathematics Subject Classification}:
Primary 11B68; Secondary 05A10, 11B65.
\noindent \emph{Keywords: }
Bernoulli number, binomial transform.
\bigskip
\hrule
\bigskip
\noindent (Concerned with sequences
\seqnum{A027641} and
\seqnum{A027642}.)
\bigskip
\hrule
\bigskip
\vspace*{+.1in}
\noindent
Received October 2 2013;
revised version received January 3 2014.
Published in {\it Journal of Integer Sequences}, January 3 2014.
\bigskip
\hrule
\bigskip
\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{http://www.cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in
\end{document}
|
http://dlmf.nist.gov/31.15.E1.tex
|
nist.gov
|
CC-MAIN-2016-50
|
application/x-tex
| null |
crawl-data/CC-MAIN-2016-50/segments/1480698541170.58/warc/CC-MAIN-20161202170901-00278-ip-10-31-129-80.ec2.internal.warc.gz
| 73,436,173
| 646
|
\[\frac{{d}^{2}w}{{dz}^{2}}+\left(\sum_{j=1}^{N}\frac{\gamma_{j}}{z-a_{j}}\right%
)\frac{dw}{dz}+\frac{\Phi(z)}{\prod_{j=1}^{N}(z-a_{j})}w=0,\]
|
http://tex.bilkent.edu.tr/macros/latex/base/lablst.tex
|
bilkent.edu.tr
|
CC-MAIN-2018-43
|
text/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2018-43/segments/1539583509170.2/warc/CC-MAIN-20181015100606-20181015122106-00458.warc.gz
| 353,833,240
| 2,217
|
% \iffalse meta-comment
%
% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
% The LaTeX3 Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
% -------------------------------------------
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This file has the LPPL maintenance status "maintained".
%
% The list of all files belonging to the LaTeX base distribution is
% given in the file `manifest.txt'. See also `legal.txt' for additional
% information.
%
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
%
% \fi
% LABLST.TEX -- A LaTeX input file for printing label definitions.
% Copyright (c) 1985, 1994 by Leslie Lamport, Chris Rowley
% This file created on 5 November 1994
%
% Modified December 1994 (DPC) to allow _ ^ etc in label keys and to
% input packages used by the main file.
%
% Modified June 1995 (CAR)
%
% This version puts all bibilographic entries at the end of the
% output. It inputs the .aux file twice.
% Initial interactions:
%
\typeout{}
\typeout{LABLST version of 10 June 1995}
\typeout{}
\typeout{*********************************}
\typeout{* Enter input file name }
\typeout{* \space\space without the .tex extension: }
\typein[\lablstfile]{*********************************}
\def\spaces{\space\space\space\space\space}
\typeout{}
\typeout{********************************************************}
\typeout{* Enter document class used in file \lablstfile.tex }
\typeout{* \space\space with no options or extension: }
\typein[\lablstclass]%
{********************************************************}
\documentclass{\lablstclass}
% Now ask for packages. The answer should be a comma separated list.
% In fact only packages that define commands that are used in
% section titles etc need be loaded.
% \def\spaces{\space\space\space\space\space}
\typeout{}
\typeout{**************************************************}
\typeout{* Enter packages used in file \lablstfile.tex }
\typeout{* \space\space with no options or extensions: }
\typein[\lablstpackages]%
{**************************************************}
\usepackage{\lablstpackages}
\nofiles
\parindent 0pt
\begin{document}
\mbox{}
\vspace{-3cm}
{\LARGE File \textbf{\lablstfile.tex} --- lablst output}
{\Large (\today)
\\[0.5\baselineskip]
Using document class:\quad \lablstclass\\
\mbox{\phantom{Using }and packages:\quad \lablstpackages}
}
\vspace{2\baselineskip}
\makeatletter
% This is always disabled:
%
\let \@mlabel \@gobbletwo
% No protection needed:
%
\let \protect \relax
% Better formatting?:
%
\let \raggedright \relax
% Only write out toc entries:
%
\def \@writefile #1#2{%
\def\lablst@tempa{#1}%
\def\lablst@tempb{toc}%
\ifx \lablst@tempa\lablst@tempb
\par{#2}\par\nobreak
\vspace{3pt}%
\fi
}
% Allow characters like ^ _ to be printed `verbatim'.
%
\def\@lablstverb#1{%
\def\lablst@tempa{#1}%
{\ttfamily\expandafter\strip@prefix\meaning\lablst@tempa}}%
% For first run:
%
\def \newlabel #1#2{%
\par
\hbox to \textwidth{%
\hfill\makebox[10em][r]{\@lablstverb{#1}}%
\hspace{1em}\makebox[4.5em][l]{\@firstoftwo #2}%
Page:
\makebox[2.5em][r]{\@secondoftwo #2}%
\hspace{4em}}\par
}
\let \bibcite \@gobbletwo
{\Large \sl Logical labels within sections}
\input \lablstfile.aux
% For second run:
%
\def \bibcite #1#2{\par
\hbox to \textwidth{%
\hfill\makebox[2in][r]{\@lablstverb{#1}}\hspace{1em}[#2]\hspace{4em}}}
\let \newlabel \@gobbletwo
\let \@writefile \@gobbletwo
\par
\vspace{2\baselineskip}
{\Large \sl Bibliography logical labels}
\input \lablstfile.aux
\end{document}
|
http://www.emis.de/journals/JIS/VOL15/Dajani/dajani2.tex
|
emis.de
|
CC-MAIN-2018-05
|
text/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2018-05/segments/1516084889798.67/warc/CC-MAIN-20180121001412-20180121021412-00648.warc.gz
| 455,003,372
| 18,559
|
\documentclass[12pt,reqno]{article}
\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amscd}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}
\usetikzlibrary{matrix,arrows}
\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}
\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}
\usepackage{color}
\usepackage{fullpage}
\usepackage{float}
\usepackage{psfig}
\usepackage{graphics,amsmath,amssymb}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{latexsym}
\usepackage{epsf}
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.5in}
\setlength{\textheight}{8.9in}
\newcommand{\seqnum}[1]{\href{http://oeis.org/#1}{\underline{#1}}}
\begin{document}
\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{assumption}[theorem]{Assumption}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\begin{center}
\vskip 1cm{\LARGE\bf
Symbolic Dynamics of $(-\beta)$-Expansions
}
\vskip 1cm
\large
K. Dajani and S. D. Ramawadh\\
Department of Mathematics\\
Utrecht University\\
Postbus 80.010 \\
3508 TA Utrecht\\
The Netherlands \\
\href{mailto:[email protected]}{\tt [email protected]} \\
\href{mailto:[email protected]}{\tt [email protected]}\\
\end{center}
\vskip .2 in
\newcommand{\ba}{\begin{eqnarray}}
\newcommand{\ea}{\end{eqnarray}}
\newcommand{\bea}{\begin{eqnarray*}}
\newcommand{\eea}{\end{eqnarray*}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\CC}{\mathbb{C}}
%\newcommand{\cal}{\mathcal}
\newcommand{\T}{T_{-\beta}}
\newcommand{\Tl}{T_{L,-\beta}}
\newcommand{\Tr}{T_{R,-\beta}}
\newcommand{\dn}{d_{-\beta}}
\newcommand{\dl}{d_{L,-\beta}}
\newcommand{\dr}{d_{R,-\beta}}
\newcommand{\dls}{d^*_{L,-\beta}}
\newcommand{\drs}{d^*_{R,-\beta}}
\newcommand{\Sn}{S_{-\beta}}
\newcommand{\Sl}{S_{L,-\beta}}
\newcommand{\Sr}{S_{R,-\beta}}
\newcommand{\vectwo}[2]{\genfrac{}{}{0pt}{}{#1}{#2}}
\newcommand{\vecthree}[3]{\begin{array}{c}#1\\#2\\#3\end{array}}
\begin{abstract}
We study shift spaces associated with a family of transformations
generating expansions in base $-\beta$, with $\beta>1$. We give a
complete characterization when these shift spaces are sofic or even
shifts of finite type.
\end{abstract}
\section{Introduction}
In 1957, R\'{e}nyi studied the expansions of numbers in base $\beta>1$.
He only considered the numbers in $[0,1)$, and only considered one
specific rule, the $\beta$-transformation, with which we could find
these expansions \cite{Ren57}. Many other mathematicians have studied
these expansions since then, of which the most famous result is a paper
by Parry \cite{Par60}, in which he gave quite an extensive description
of both ergodic and symbolic properties of the $\beta$-transformation
posed by R\'{e}nyi. Later on several others looked at other types of
$\beta$-expansions. Erd\H{o}s \cite{EJ91}, for example, studied lazy
$\beta$-expansions (the opposite, the greedy $\beta$-expansions were
studied by R\'{e}nyi). Dajani and Kraaikamp studied a whole class of
$\beta$-expansions \cite{DK03} and also random $\beta$-expansions
\cite{DK04,DV05}.
In 2009, Ito and Sadahiro \cite{IS09} studied $(-\beta)$-expansions in base $-\beta$, $\beta>1$. They introduced a transformation, the $(-\beta)$-transformation, which allowed them to find an expansion of the form
\ba\label{eq:1}
x = \sum_{n=1}^\infty \frac{x_n}{(-\beta)^n}, & & x_n\in\{0,1,\ldots,\lfloor\beta\rfloor\}
\ea
of any number $x\in I:=\left[-\frac{\beta}{\beta+1},\frac{1}{\beta+1}\right)$. After having introduced this dynamical system, they continued their study of these expansions by introducing an order on the set of expansions and studying the resulting $(-\beta)$-shift. This approach was later continued by Frougny and Lai \cite{FL09}, who gave a detailed description of the symbolic properties of the $(-\beta)$-shift. Recently, others have considered different transformations generating $(-\beta)$-expansions. Dombek, Mas\'{a}kov\'{a} and Pelantov\'{a}
\cite{DMP11} considered a generalization of the aforementioned approach. Dajani and Kalle \cite{DK11}, took an even more general approach by studying a whole class of transformations generating $(-\beta)$-expansions for $1<\beta<2$.
The aim of this paper is to study shift spaces associated with various transformations generating $(-\beta)$-expansions and to give a complete characterization when these shift spaces are sofic or shifts of finite type.
\section{The dynamical system}
Let $\beta>1$ be given. The set of numbers $x\in\RR$ that satisfy \eqref{eq:1} for certain coefficients $x_n\in\{0,1,\ldots,\lfloor\beta\rfloor\}$ is contained in the interval
\bea
I_{-\beta} := \left[-\frac{\beta\cdot\lfloor\beta\rfloor}{\beta^2-1},\ \frac{\lfloor\beta\rfloor}{\beta^2-1}\right].
\eea
We call the set ${\cal A}:=\{0,1,\ldots,\lfloor\beta\rfloor\}$ the \emph{canonical alphabet}. If $x$ has an expansion of the form \eqref{eq:1}, then we may refer to the right-hand side of \eqref{eq:1} as \emph{a $(-\beta)$-expansion of x}. Moreover, we can refer to the digits of the expansion explicitly as follows:
\bea
\dn(x) := (x_1,x_2,\ldots) & \textrm{and} & \dn(x,n) := x_n.
\eea
We may also write $x=(.x_1x_2\cdots)_{-\beta}$. Moreover, if a part is periodic we can show this by overlining it. For example, $(1,\overline{0,2})=(1,0,2,0,2,0,2,\ldots)$. If a sequence consists of only a periodic part, we will call it \emph{purely periodic}. If it consists of a pre-periodic and a periodic part, we will call it \emph{eventually periodic}. Now, suppose that $x\in I_{-\beta}$ with expansion $\dn(x)=(x_1,x_2,\ldots)$. It follows that
\bea
-\beta x-x_1 = \sum_{n=1}^\infty \frac{x_{n+1}}{(-\beta)^n}.
\eea
In particular, we see that $-\beta x-x_1\in I_{-\beta}$ as the right-hand side is another $(-\beta)$-expansion. Therefore, one should look at the family of maps $-\beta x-a$, $a\in{\cal A}$, on the interval $I_{-\beta}$. Figure \ref{fig:1} shows what happens for a specific choice for $\beta$.
\begin{figure}
\centering
\begin{tikzpicture}[scale=2.5]
\draw[->] (-1.2,0) -- (0.8,0);
\draw[->] (0,-1.2) -- (0,0.8);
\draw[black!50!white] (0,-1) -- (0,0.62);
\draw[black!50!white] (0.62,0) -- (-1,0);
\draw[dashed] (-0.38,-1) -- (-0.38,0.62);
\draw (-1,-1) rectangle (0.62,0.62);
\draw[color=blue,thick] (-1,0.62) -- (0,-1);
\draw[color=blue,thick] (-0.38,0.62) -- (0.62,-1);
\draw (-1,-1) node [below] {$-1$} -- (-0.38,-1) node [below] {$-\frac{1}{\beta^2}$} -- (0.62,-1) node [below] {$\frac{1}{\beta}$};
\end{tikzpicture}
\caption{The maps $-\beta x-a$ with $a\in{\cal A}$ on $I_{-\beta}$ for $\beta=\frac{1+\sqrt{5}}{2}$.\label{fig:1}}
\end{figure}
Notice that there is a small subinterval for which there is more than one possibility for $a$ such that $-\beta x-a$ remains in $I_{-\beta}$ for all points in this subinterval. Such a subinterval will be called a \emph{choice region}. Other subintervals, where there is only one choice for $a\in{\cal A}$, are called \emph{uniqueness regions}. Note that this behaviour is not restricted to this specific base $-\beta$; in fact, it happens for all non-integer base $-\beta$. This is a consequence of our alphabet ${\cal A}$.
In any case, we need to specify a function $d:I_{-\beta}\to{\cal A}$, the \emph{digit function}, such that for any $x\in I_{-\beta}$ it follows that also $-\beta x-d(x)\in I_{-\beta}$. Henceforth, we will work with the following assumptions:
\begin{assumption}\label{ass:2.1}
The digit function $d:I_{-\beta}\to{\cal A}$ satisfies the following properties:
\begin{enumerate}
\item[i.] $d(x)$ is such that $x\in I_{-\beta}\Rightarrow -\beta x-d(x)\in I_{-\beta}$,
\item[ii.] $d$ is either left- or right-continuous everywhere,
\item[iii.] $d$ is nonincreasing on $I_{-\beta}$.
\end{enumerate}
\end{assumption}
The idea behind the assumptions on the digit function is that it divides the interval $I_{-\beta}$ into at most $\lfloor\beta\rfloor+1$ smaller intervals, where the intervals are all either left- or right-closed and each of the intervals has a digit from the alphabet ${\cal A}$ assigned to them. These digits are assigned in such a way that, from left to right, these digits are decreasing. This implies that all digits of ${\cal A}$ are actually used.
Property i of Assumption 2.1 is worth considering more carefully. As a consequence of our choice of alphabet ${\cal A}$, we have that for any $\beta>1$ and any $x\in I_{-\beta}$ there is at least one $a\in{\cal A}$ such that $-\beta x-a\in I_{-\beta}$. To see why, fix $x\in I_{-\beta}$ and consider the set $S(x)=\left\{-\beta x-a:\ a\in{\cal A}\right\}$. The smallest element of $S(x)$ cannot be greater than $\frac{\lfloor\beta\rfloor}{\beta^2-1}$ and the largest element of $S(x)$ cannot be smaller than $-\frac{\beta\cdot\lfloor\beta\rfloor}{\beta^2-1}$. Moreover, $I_{-\beta}$ has length strictly greater than $1$, whereas the difference between two consecutive digits in ${\cal A}$ is $1$. These observations imply that $S(x)\cap I_{-\beta}\neq\emptyset$.
The points where $d$ is discontinuous are called \emph{cut points}. The cut points always lie in choice regions, and the cut points divide these regions into smaller regions on which the digit function dictates which map $-\beta x-a$ to choose.
Using this digit function, we can finally pose our dynamical system. We define, for a given digit function $d$, the map
\bea
\T(x) & := & -\beta x-d(x)
\eea
on $I_{-\beta}$. If we want to emphasize whether the underlying digit function is left- or right-continuous, we may write $\Tl(x)$ and $\Tr(x)$ respectively.
\begin{proposition}\label{prop:2.2}
Let $x\in I_{-\beta}$ be arbitrary and let $x_n := d\left(\T^{n-1}(x)\right)$. Then we have $x=(.x_1x_2\ldots)_{-\beta}$.
\end{proposition}
\begin{proof}
We show, by induction on $n$, that for all $n\geq 1$ we have
\bea
x = \frac{\T^n(x)}{(-\beta)^n} + \sum_{k=1}^n \frac{x_k}{(-\beta)^k}.
\eea
By definition, we have $\T(x)=-\beta x-x_1$, which in turn is equivalent to $x=\frac{\T(x)}{-\beta}+\frac{x_1}{-\beta}$. Hence, the statement holds for $n=1$.
Now assume that the statement is true for some positive integer $m-1$. Since we know that $\T^m(x)=-\beta\T^{m-1}(x)-x_m$, we also have
\bea
\T^{m-1}(x) = \frac{x_m}{-\beta}+\frac{T^m(x)}{-\beta}
\eea
and hence
\bea
x &=& \frac{\T^{m-1}(x)}{(-\beta)^{m-1}} + \sum_{k=1}^{m-1} \frac{x_k}{(-\beta)^k}\\
&=& \frac{\frac{x_m}{-\beta}+\frac{T^m(x)}{-\beta}}{(-\beta)^{m-1}} + \sum_{k=1}^{m-1} \frac{x_k}{(-\beta)^k}\\
&=& \frac{\T^m(x)}{(-\beta)^m} + \sum_{k=1}^m \frac{x_k}{(-\beta)^k}.
\eea
We see that the statement is true for $m$ as well. The proof is finished by noting that $\frac{\T^m(x)}{(-\beta)^m}\to 0$ as $m\to\infty$.
\end{proof}
The following example shows that the original $(-\beta)$-transformation posed by Ito and Sadahiro \cite{IS09} can be viewed as restrictions of our maps.
\begin{example}\label{ex:2.3}
Let the base be given by $\beta = \frac{1+\sqrt{5}}{2}$ and consider the map $\Tl$ with cut point $2-\sqrt{5}$. This map is shown in Figure \ref{fig:2}.
\begin{figure}[ht]
\centering
\begin{tikzpicture}[scale=2.5]
\draw[->] (-1.2,0) -- (0.8,0);
\draw[->] (0,-1.2) -- (0,0.8);
\draw[black!50!white] (0,-1) -- (0,0.62);
\draw[black!50!white] (0.62,0) -- (-1,0);
\draw (-1,-1) rectangle (0.62,0.62);
\draw[color=blue,thick] (-1,0.62) -- (-0.236,-0.62);
\draw[color=blue,thick] (-0.232,0.36) -- (0.62,-1);
\filldraw[color=blue] (-0.236,-0.62) circle(0.5pt);
\draw[color=blue] (-0.239,0.38) circle(0.5pt);
\draw (-1,-1) node [below] {$-1$} -- (0,-1) node [below left] {$0$} -- (0.62,-1) node [below] {$\beta-1$};
\draw[dashed] (-0.62,-0.62) rectangle (0.38,0.38);
\end{tikzpicture}
\caption{The map $\Tl$ from Example \ref{ex:2.3}.\label{fig:2}}
\end{figure}
The smaller box in Figure \ref{fig:2} is the $(-\beta)$-transformation as defined by Ito and Sadahiro. Hence, for this particular $\beta$ and choice of cut point, our map $\Tl$ is an extension of their $(-\beta)$-transformation.
Finding $(-\beta)$-expansions using this map $\Tl$ can be done using Proposition \ref{prop:2.2}. For example, we find $-\frac{1}{2}=\left(.\overline{100}\right)_{-\beta}$, which agrees with the result of Ito and Sadahiro. However, we can also find $-\frac{3}{4}=\left(.1\overline{011110}\right)_{-\beta}$; a result that cannot be found using the original $(-\beta)$-transformation.
\end{example}
\section{Admissibility and shift spaces}
Henceforth, whenever we refer to the map $\T$, we assume that it has been fixed beforehand. A sequence $(x_1,x_2,\ldots)\in{\cal A}^\NN$ is called \emph{$\T$-admissible} if we have $\dn(x)=(x_1,x_2,\ldots)$ for some $x\in I_{-\beta}$ and, moreover, the $(-\beta)$-expansion of $x$ generated by the map $\T$ (see Proposition \ref{prop:2.2}) has coefficients $x_1,x_2,\ldots$ A finite block is called $\T$-admissible if it appears in a $\T$-admissible sequence.
In order to nicely characterize the $\T$-admissible sequences, we introduce an order on the set of $\T$-admissible sequences: the \emph{alternate (lexicographical) order}. We write $(x_1,x_2,\ldots)\prec(y_1,y_2,\ldots)$ if and only if there exists some integer $k\geq 1$ such that $x_i=y_i$ for all $i<k$ and $(-1)^k(x_k-y_k)<0$. Also, $(x_1,x_2,\ldots)\preceq(y_1,y_2,\ldots)$ means that either $(x_1,x_2,\ldots)\prec(y_1,y_2,\ldots)$ or $(x_1,x_2,\ldots)=(y_1,y_2,\ldots)$ holds.
\begin{proposition}\label{prop:3.1}
Let $\T$ be given. Let $x,y\in I_{-\beta}$ with $x\neq y$ be arbitrary and let $\dn(x)$ and $\dn(y)$ be the $(-\beta)$-expansions of respectively $x$ and $y$ generated by $\T$. Then $x<y$ if and only if $\dn(x)\prec\dn(y)$.
\end{proposition}
\begin{proof}
This has been shown in \cite[Lemma 3.1]{DK11} for $1<\beta<2$. We give the proof here for completeness. Write $\dn(x)=(x_1,x_2,\ldots)$ and $\dn(y)=(y_1,y_2,\ldots)$. Let $k\geq 1$ be the smallest integer for which $x_k\neq y_k$. Then we have
\bea
x = \frac{\T^{k-1}(x)}{(-\beta)^{k-1}}+\sum_{i=1}^{k-1}\frac{x_i}{(-\beta)^i} < \frac{\T^{k-1}(y)}{(-\beta)^{k-1}}+\sum_{i=1}^{k-1}\frac{y_i}{(-\beta)^i} = y
\eea
if and only if
\bea
\frac{\T^{k-1}(x)}{(-\beta)^{k-1}}<\frac{\T^{k-1}(y)}{(-\beta)^{k-1}}.
\eea
This latter inequality is, regardless of the parity of $k$,
equivalent to the inequality $$(-1)^k\left(x_k-y_k\right)<0,$$
since $x_k=d\left(\T^{k-1}(x)\right)$ (similar for $y_k$).
The statement now follows.
\end{proof}
We see that the alternate order respects the natural order on $\RR$ (as long as we compare $(-\beta)$-expansions generated by the same map $\T$). The behaviour of the map $\T$, and hence the generated $(-\beta)$-expansions, are determined by our choice for the cut points; two maps with the same base $\beta$ but different cut points will produce different $(-\beta)$-expansions for at least one point $x\in I_{-\beta}$. Therefore, we should pay extra attention to our cut points. Let $c$ be any cut point of a given map $\T$, then we define $\dl(c)$ to be $(-\beta)$-expansion generated by the left-continuous version of $\T$, regardless of the continuity of $\T$ itself (we define $\dr(c)$ similarly).
\begin{example}\label{ex:3.2}
We continue Example \ref{ex:2.3}. Our cut point is $2-\sqrt{5}$, and the $(-\beta)$-expansion of this point generated by the map is $2-\sqrt{5}=\left(.11\overline{0}\right)_{-\beta}$. Since the map in Example \ref{ex:2.3} is left-continuous, we know that $\dl(2-\sqrt{5})=(1,1,\overline{0})$. To determine $\dr(2-\sqrt{5})$ we modify the map in Example \ref{ex:2.3} such that it is right-continuous at $2-\sqrt{5}$ (all other points remain unchanged). The $(-\beta)$-expansion of $2-\sqrt{5}$ generated by this new map is $\dr(2-\sqrt{5})$. The reader is invited to verify that $\dr(2-\sqrt{5})=(0,0,1,\overline{0})$.
\end{example}
In order to state the following characterization of $\T$-admissible sequences neatly, we introduce a little more notation. Recall that the digit function divides $I_{-\beta}$ into smaller subintervals. A subinterval on which the digit function is constant with value $a$ will be denoted by $I_a$. Its left and right endpoint will be denoted by respectively $\ell_a$ and $r_a$. We can now characterize $\T$-admissible sequences as follows:
\begin{proposition}\label{prop:3.3}
The following hold:
\begin{itemize}
\item[(a)] If $(x_1,x_2,\ldots)$ is $\Tl$-admissible, then for all $n\geq 1$:
\begin{itemize}
\item if $x_n=\lfloor\beta\rfloor$, then $\dn(\ell_{\lfloor\beta\rfloor})\preceq(x_n,x_{n+1},\ldots)\preceq\dl(r_{\lfloor\beta\rfloor})$;
\item if $x_n=a\neq\lfloor\beta\rfloor$, then $\dr(\ell_a)\prec(x_n,x_{n+1},\ldots)\preceq\dl(r_a)$.
\end{itemize}
\item[(b)] If $(x_1,x_2,\ldots)$ is $\Tr$-admissible, then for all $n\geq 1$:
\begin{itemize}
\item if $x_n=0$, then $\dr(\ell_0)\preceq(x_n,x_{n+1},\ldots)\preceq\dn(r_0)$;
\item if $x_n=a\neq 0$, then $\dr(\ell_a)\preceq(x_n,x_{n+1},\ldots)\prec\dl(r_a)$.
\end{itemize}
\end{itemize}
\end{proposition}
\begin{proof}
We will only prove (a), since the proof of (b) is similar. If $x_n=\lfloor\beta\rfloor$, the result follows from Proposition \ref{prop:3.1}.
Now, suppose that $x_n=a\neq\lfloor\beta\rfloor$. Then, by Proposition \ref{prop:3.1} we only need to show that $\dr(\ell_a)\prec(x_n,x_{n+1},\ldots)$. Since the map is left-continuous, we know that $\dl(\ell_a,1)\neq a$ and hence $\ell_a<\Tl^{n-1}(x)$. Hence, there is a smallest integer $k\geq 1$ such that $\dr(\ell_a,k)\neq\dr(\Tl^{n-1}(x),k)$. Regardless of the parity of $k$, it follows that
\bea
(-1)^k\left(\dr(\ell_a,k)-\dr(\Tl^{n-1}(x)),k\right)<0,
\eea
which proves $\dr(\ell_a)\prec(x_n,x_{n+1},\ldots)$.
\end{proof}
The converse of Proposition \ref{prop:3.3} is not generally true. It is true in the case of Example \ref{ex:2.3} (we will see this later). We present the following Example in which the converse is not true.
\begin{example}\label{ex:3.4}
Consider the map $\Tl$ with $\beta=\frac{1+\sqrt{5}}{2}$ and cut point $0$, that is, the map $\Tl$ on $I_{-\beta}=[-1,\beta-1]$ given by:
\bea
\Tl(x) & = & \begin{cases}
-\beta x-1, & \text{if $-1\leq x\leq 0$};\\
-\beta x, & \text{if $0<x<\beta-1$}.
\end{cases}
\eea
Then, according to Proposition \ref{prop:3.3}, a sequence $(x_1,x_2,\ldots)$ is $\Tl$-admissible if
\bea
(\overline{1,0})\preceq(x_n,x_{n+1}\ldots)\preceq(1,\overline{1,0}) & \textrm{or} & (\overline{0})\prec(x_n,x_{n+1},\ldots)\preceq(\overline{0,1})
\eea
holds for all $n\geq 1$. The sequence $(0,1,\overline{1,0})$ also satisfies this condition, but it is not $\Tl$-admissible. To see this, note that $(.01\overline{10})_{-\beta}=0$, whereas the $(-\beta)$-expansion of $0$ generated by the map $\Tl$ is $\dn(0)=(1,\overline{1,0})$.
\end{example}
Hence, the set of sequences that satisfy the series of inequalities in Proposition \ref{prop:3.3} might be a bit larger than the set of $\T$-admissible sequences. The problem arises whenever a cut point gets mapped onto some (not necessarily different) cut point after an odd amount of applications of the map $\T$.
Let $\T$ be given and let $c$ be any cut point of $\T$. We define
\bea
\dls(c) := \lim_{x\uparrow c} \dn(x) & \textrm{and} & \drs(c) := \lim_{x\downarrow c} \dn(x).
\eea
Notice that the definition of $\dls(c)$ does not require that the underlying map is left-continuous (similar for $\drs(c)$). Instead, these sequences should be thought of as ``improvements'' of respectively $\dl(c)$ and $\dr(c)$. The improvement follows from the following lemma:
\begin{lemma}\label{lem:3.5}
Let $\T$ be given and let $c$ be any cut point of $\T$. The following hold:
\begin{enumerate}
\item[(a)] There exists no $\Tl$-admissible sequence $(x_1,x_2,\ldots)$ such that we have $\dr(c)\prec(x_1,x_2,\ldots)\prec\drs(c)$.
\item[(b)] There exists no $\Tr$-admissible sequence $(x_1,x_2,\ldots)$ such that we have $\dls(c)\prec(x_1,x_2,\ldots)\prec\dl(c)$.
\end{enumerate}
\end{lemma}
\begin{proof}
We only prove (a), since the proof of (b) is similar. Suppose that the statement is false and let $(x_1,x_2,\ldots)$ be a $\Tl$-admissible sequence satisfying $\dr(c)\prec(x_1,x_2,\ldots)\prec\drs(c)$ and $x=(.x_1x_2\cdots)_{-\beta}$. By assumption, we have $x_1=\dr(c,1)$, and hence $x>c$.
Let $(x^n)_{n=1}^\infty$ be a decreasing sequence for which $\dn(x^n,1)=\drs(c,1)$ for all $n\geq 1$, where $\dn(x^n)$ is the $(-\beta)$-expansion of $x^n$ generated by $\T$. For all $m,n\geq 1$ with $m<n$ we have $\dn(x^n)\prec\dn(x^m)$ by Proposition \ref{prop:3.1}. It follows that $\drs(c)\preceq\dn(x^n)$ for all $n\geq 1$. Moreover, the sequence converges to $c$ and hence for some $k\geq 1$ we have $x^k<x$ and $\drs(c)\preceq\dn(x^k)\prec\dn(x)$. This latter is, however, a contradiction and hence the sequence $(x_1,x_2,\ldots)$ cannot exist.
\end{proof}
For any given map $\T$, computing the sequences $\dls(c)$ and $\drs(c)$, where $c$ is a cut point, is not hard. Fix $c$ and suppose we want to find $\dls(c)$. We present the following algorithm:
\begin{enumerate}
\item[1.] Start with $k:=1$, $\hat{T}_1:=\Tl$ and $c_0:=c$.
\item[2.] Compute $c_k:=\hat{T}_k(c_{k-1})$ and set
\bea
\dls(c,k) & := &
\begin{cases}
d^L(c_{k-1}), & \text{if $\hat{T}_k=\Tl$};\\
d^R(c_{k-1}), & \text{if $\hat{T}_k=\Tr$};
\end{cases}
\eea
where $d^L$ and $d^R$ are the digit functions of $\Tl$ and $\Tr$ respectively.
\item[3.] Let $m:=\max\{0\leq i<k: c_i\textrm{ is a cut point}\}$. If $c_k$ is a cut point and if $k-m$ is odd, then:
\begin{itemize}
\item if $\hat{T}_k=\Tl$, then $\hat{T}_{k+1}:=\Tr$;
\item if $\hat{T}_k=\Tr$, then $\hat{T}_{k+1}:=\Tl$;
\end{itemize}
and else $\hat{T}_{k+1}:=\hat{T}_k$.
\item[4.] Increase $k$ by one and go back to step 2.
\end{enumerate}
If we wish to find $\drs(c)$ instead, all that changes is that we should start with $\hat{T}_1:=\Tr$.
\begin{proposition}\label{prop:3.6}
The method described above for finding $\dls(c)$ and $\drs(c)$ is correct.
\end{proposition}
\begin{proof}
We only prove correctness for $\dls(c)$. Call the sequence obtained by the algorithm above $s_{L,-\beta}(c)$, then we need to show that $s_{L,-\beta}(c)=\lim_{x\uparrow c} \dn(x)$. For any integer $n\geq 1$, define (recall that $\ell_{s_{L,-\beta}(c,k)}$ denotes the left endpoint of the subinterval on which the digit function equals the $k$th digit of $s_{L,-\beta}(c)$):
\bea
\epsilon_n & := & \frac{1}{\beta^{n-1}}\min\left(\left\{\left|c_k-\ell_{s_{L,-\beta}(c,k+1)}\right|:\ 0\leq k\leq n,\ k \textrm{ even}\right\}\right.\\
& & \cup \left.\left\{\left|c_k-r_{s_{L,-\beta}(c,k+1)}\right|:\ 0\leq k\leq n,\ k \textrm{ odd}\right\}\right) .
\eea
It follows that any $x\in(c-\epsilon_n,c)$ satisfies $\dl(x,i)=s_{L,-\beta}(c,i)$ for all $i\leq n$. It suffices to show that $\epsilon_n\neq 0$ for all $n\geq 1$. Suppose that $k\geq 1$ is the smallest integer such that $\epsilon_k=0$ and assume that $k$ is odd (the proof is similar for $k$ even). It follows that $c_k=r_{s_{L,-\beta}(c,k+1)}$, and, since $\hat{T}_{k+1}=\Tr$, we must hit $r_{-\beta}$ after an odd number of iterations (it cannot be any other cut point since that would imply $c_k=\ell_{s_{L,-\beta(c,k+1)}}\neq r_{s_{L,-\beta}(c,k+1)}$). It follows that $c_{k-1}$ is either a cut point or $-\frac{\beta\cdot\lfloor\beta\rfloor}{\beta^2-1}$. By iterating this argument it follows that $c$ must be an endpoint of $I_{-\beta}$. We have reached a contradiction since the endpoints are no cut points. It follows that $\epsilon_n>0$ for all $n\geq 1$.
\end{proof}
\begin{example}\label{ex:3.7}
We continue Example \ref{ex:3.4}. Since the orbit of $0$ never hits $0$ again under $\Tl$, we conclude that $\dls(0)=\dl(0)=(1,\overline{1,0})$. Under $\Tr$, however, $0$ hits itself after one iteration. Hence, we have $\drs(0,1)=0$ and continue iterating $\Tl$. At this point, we know the orbit of $0$ under $\Tl$ and therefore $\drs(0)$ is the concatenation of the single-digit block $(0)$ with $(1,\overline{1,0})$: $\drs(0)=(0,1,\overline{1,0})$.
\end{example}
\begin{example}\label{ex:3.8}
We continue Example \ref{ex:3.2}. Since the orbit of $2-\sqrt{5}$ never hits itself under both $\Tl$ and $\Tr$, we have $\dls(2-\sqrt{5})=\dl(2-\sqrt{5})=(1,1,\overline{0})$ and $\drs(2-\sqrt{5})=\dr(2-\sqrt{5})=(0,0,1,\overline{0})$.
\end{example}
\begin{remark}
The sequences $\dls(c)$ and $\drs(c)$ are concatenations of blocks of sequences of the form $\dl(\ell_a)$, $\dr(\ell_a)$, $\dl(r_a)$ and $\dr(r_a)$ where $a\in{\cal A}$.
\end{remark}
The following lemma is very important:
\begin{lemma}
Let $(x_1,x_2,\ldots)\in{\cal A}^\NN$. The following hold:\label{lem:3.10}
\begin{itemize}
\item[(a)] If for all $n\geq 1$ we have
\bea
\drs(\ell_{x_n})\preceq(x_n,x_{n+1},\ldots)\preceq\dl(r_{x_n}),
\eea
then every finite subblock of $(x_1,x_2,\ldots)$ is $\Tl$-admissible.
\item[(b)] If for all $n\geq 1$ we have
\bea
\dr(\ell_{x_n})\preceq(x_n,x_{n+1},\ldots)\preceq\dls(r_{x_n}),
\eea
then every finite subblock of $(x_1,x_2,\ldots)$ is $\Tr$-admissible.
\end{itemize}
\end{lemma}
\begin{proof}
We only prove (a), as the proof of (b) is similar. Suppose that $(x_1,x_2,\ldots)$ satisfies the given condition and define $x^{(k)}:=\sum_{n=k}^\infty \frac{x_n}{(-\beta)^{n-k+1}}$. Assume that there exist integers $s(k),t(k)>k$ such that:
\bea
x_k\cdots x_{s(k)-1} = \drs(\ell_{x_k},1)\cdots\drs(\ell_{x_k},s(k)-k),\\
(-1)^{s(k)-k+1}\left(\drs(\ell_{x_k},s(k)-k+1)-x_{s(k)}\right)<0,
\eea
and
\bea
x_k\cdots x_{t(k)-1} = \dl(r_{x_k},1)\cdots \dl(r_{x_k},t(k)-k),\\
(-1)^{t(k)-k+1}\left(x_{t(k)}-\dl(r_{x_k},t(k)-k+1)\right)<0.
\eea
If either $s(k)$ or $t(k)$ does not exist, then there is nothing to prove. Let $y$ be a point such that $\dl(y,i)=\drs(\ell_{x_k},i)$ for $1\leq i\leq s(k)-k+1$, then
\bea
x^{(k)}-\ell_{x_k} & > & x^{(k)}-y\\
&=& \sum_{n=s(k)}^\infty \frac{x_n}{(-\beta)^{n-k+1}} - \frac{\Tl^{s(k)-k}(y)}{(-\beta)^{s(k)-k}}\\
&>& \frac{1}{(-\beta)^{s(k)-k}}\left(x^{s(k)}-\Tl^{s(k)-k}(y)\right),
\eea
from which it follows that
\ba\label{eq:3.2}
x^{(k)}-\ell_{x_k} &>& \begin{cases}
\frac{x^{s(k)}-\ell_{x_{s(k)}}}{(-\beta)^{s(k)-k+1}}, & \text{if $s(k)-k+1$ is odd};\\
\frac{x^{s(k)}-r_{x_{s(k)}}}{(-\beta)^{s(k)-k+1}}, & \text{if $s(k)-k+1$ is even}.
\end{cases}
\ea
Similarly, one can show that
\ba\label{eq:3.3}
r_{x_k}-x^{(k)} &>& \begin{cases}
\frac{r_{x_{t(k)}}-x^{t(k)}}{(-\beta)^{t(k)-k+1}}, & \text{if $t(k)-k+1$ is odd};\\
\frac{\ell_{x_{t(k)}}-x^{t(k)}}{(-\beta)^{t(k)-k+1}}, & \text{if $t(k)-k+1$ is even}.\\
\end{cases}
\ea
By iteratively applying the bounds in \eqref{eq:3.2} and \eqref{eq:3.3} we get a sequence of bounds that approach zero (as the numerator is bounded and the denominator goes to infinity). It follows that $l_{x_k}<x^{(k)}<r_{x_k}$ for all $k\geq 1$, which implies $\dl\left(x^{(1)}\right)=(x_1,x_2,\ldots)$.
\end{proof}
Using these new objects, we can make the inequalities in Proposition \ref{prop:3.3} more strict and obtain an equivalence.
\begin{theorem}
The following hold:\label{thm:3.9}
\begin{itemize}
\item[(a)] The sequence $(x_1,x_2,\ldots)$ is $\Tl$-admissible if and only if for all $n\geq 1$:
\begin{itemize}
\item if $x_n=\lfloor\beta\rfloor$, then $\dn(\ell_{\lfloor\beta\rfloor})\preceq(x_n,x_{n+1},\ldots)\preceq\dl(r_{\lfloor\beta\rfloor})$;
\item if $x_n=a\neq\lfloor\beta\rfloor$, then $\drs(\ell_a)\prec(x_n,x_{n+1},\ldots)\preceq\dl(r_a)$.
\end{itemize}
\item[(b)] The sequence $(x_1,x_2,\ldots)$ is $\Tr$-admissible if and only if for all $n\geq 1$:
\begin{itemize}
\item if $x_n=0$, then $\dr(\ell_0)\preceq(x_n,x_{n+1},\ldots)\preceq\dn(r_0)$;
\item if $x_n=a\neq 0$, then $\dr(\ell_a)\preceq(x_n,x_{n+1},\ldots)\prec\dls(r_a)$.
\end{itemize}
\end{itemize}
\end{theorem}
\begin{proof}
This has been proven for $1<\beta<2$ in \cite[Theorem 3.1]{DK11}. We give the proof for completeness. We only prove (a), since the proof of (b) is similar. The "only if" part follows from Proposition \ref{prop:3.3} and Lemma \ref{lem:3.5}.
To prove the "if" part, suppose that $(x_1,x_2,\ldots)$ satisfies the given inequalities. From Lemma \ref{lem:3.10} it follows that every finite subblock $(x_n,\ldots,x_{n+k})$ is $\Tl$-admissible. It is sufficient to check that $(x_n,x_{n+1},\ldots)\neq\drs(\ell_{x_n})$ for all $n\geq 1$ such that $x_n\neq\lfloor\beta\rfloor$. However, this follows directly from the given inequalities.
\end{proof}
Let $\T$ be a $(-\beta)$-transformation such that $\T$ restricted to the interval $\left[-\frac{\beta}{\beta+1},\frac{1}{\beta+1}\right)$ is the Ito-Sadahiro transformation. While our condition in Theorem \ref{thm:3.9} is different from the condition found by Ito and Sadahiro \cite[Theorem 10]{IS09}, the two actually agree. This is because their transformation implicitly specifies the cut points. Moreover, these cut points are all mapped to $-\frac{\beta}{\beta+1}$. The following example illustrates this:
\begin{example}
Consider the map of Example \ref{ex:2.3} restricted to the interval $\left[-\frac{\beta}{\beta+1},\frac{1}{\beta+1}\right)$. Our condition in Theorem \ref{thm:3.9}(a), when restricted to this interval, becomes:
\ba\label{eq:3.1}
(1,\overline{0})\preceq (x_n,x_{n+1},\ldots)\preceq (1,1,\overline{0}) & \vee & (0,0,1,\overline{0})\prec (x_n,x_{n+1},\ldots)\prec (0,1,\overline{0})
\ea
for all $n\geq 1$. On the other hand, by Ito and Sadahiro \cite[Theorem 10]{IS09} we have:
\bea
(1,\overline{0})\preceq (x_n,x_{n+1},\ldots)\prec(0,1,\overline{0})
\eea
for all $n\geq 1$, which suggests that the sequences corresponding to the cut point are redundant. To see why this is the case, suppose that $(x_1,x_2,\ldots)$ satisfies \eqref{eq:3.1} for all $n\geq 1$. Fix $k\geq 1$ and assume for now that $x_k=1$, then we have $(x_k,x_{k+1},\ldots)\preceq(1,1,\overline{0})$ from which it follows that $(1,\overline{0})\preceq(x_{k+1},x_{k+2},\ldots)$. This condition, however, is already satisfied which means that we can reduce the first part of \eqref{eq:3.1} to $(1,\overline{0})\preceq(x_k,x_{k+1},\ldots)$. Similarly, we can reduce the second part of \eqref{eq:3.1} whenever $x_k=0$ and get
\bea
\begin{cases}
(1,\overline{0})\preceq(x_n,x_{n+1},\ldots), & \text{whenever $x_n=1$};\\
(x_n,x_{n+1},\ldots)\prec(0,1,\overline{0}), & \text{whenever $x_n=0$},
\end{cases}
\eea
which in turn can be neatly written as
\bea
(1,\overline{0})\preceq (x_n,x_{n+1},\ldots)\prec(0,1,\overline{0}),
\eea
which is the result by Ito and Sadahiro.
\end{example}
\section{Shifts and graphs}
In Theorem \ref{thm:3.9} we gave a characterization of the shift-invariant set of $\T$-admissible sequences. This set will be denoted with $S_T$. In order to turn $S_T$ into a shift space, we need to consider its closure. This closure will be called the \emph{$(-\beta)$-shift (for the underlying map $\T$)} and will be denoted by $\Sn$. The context should make it clear what the underlying map $\T$ is. If we wish to emphasize whether $\T$ is left- or right-continuous, we may write $\Sl$ and $\Sr$ respectively. The most straightforward characterization of the $(-\beta)$-shift is the following.
\begin{lemma}\label{lem:4.1}
Let $\T$ be given and let $\boldsymbol{x}\in{\cal A}^\NN$. Then $\boldsymbol{x}\in\Sn$ if and only if $(\boldsymbol{x}_p,\ldots,\boldsymbol{x}_q)$ is $\T$-admissible for all $1\leq p\leq q$.
\end{lemma}
We use this lemma to prove the following much more useful characterization.
\begin{theorem}\label{thm:4.2}
Let $\T$ be given and let $\boldsymbol{x}\in{\cal A}^\NN$. The following hold:
\begin{enumerate}
\item[(a)] We have $\boldsymbol{x}\in\Sl$ if and only if $\drs(\ell_{x_n})\preceq(x_n,x_{n+1},\ldots)\preceq\dl(r_{x_n})$ for all $n\geq 1$.
\item[(b)] We have $\boldsymbol{x}\in\Sr$ if and only if $\dr(\ell_{x_n})\preceq(x_n,x_{n+1},\ldots)\preceq\dls(r_{x_n})$ for all $n\geq 1$.
\end{enumerate}
\end{theorem}
\begin{proof}
We only prove (a), as the proof of (b) is similar.
The "if" part follows from Lemma \ref{lem:3.10} and Lemma \ref{lem:4.1}. Let $N\geq 1$ be arbitrary and fixed. If $(x_N,x_{N+1},\ldots)$ is $\Tl$-admissible, Theorem \ref{thm:3.9} applies. Thus, assume it is not $\Tl$-admissible. By Lemma \ref{lem:4.1}, every finite subblock $(x_N,\ldots,x_{N+k})$, where $k\geq 1$, is $\Tl$-admissible. Hence, we have
\bea
(x_N,\ldots,x_{N+k})\preceq\left(\dl(r_{x_N},1),\ldots,\dl(r_{x_N},k+1)\right)
\eea
which follows immediately and, by Lemma \ref{lem:3.5}, we also have
\bea
\left(\drs(\ell_{x_N},1),\ldots,\drs(\ell_{x_N},k+1)\right)\preceq (x_N,\ldots,x_{N+k}).
\eea
This proves the theorem.
\end{proof}
Based on this theorem, we can classify the shift space $\Sn$. The behaviour of these shift spaces depend on the sequences $\drs(\ell_a)$ and $\dl(r_a)$ (where $a\in{\cal A}$) if the underlying map is left-continuous and $\dr(\ell_a)$ and $\dls(r_a)$ if the underlying map is right-continuous. The sequences will be called \emph{boundary sequences}.
The next theorem states that eventually periodic boundary sequences are a necessary and sufficient condition for the shift space to be sofic. In order to prove this, we will give an algorithm, based on the algorithm in \cite{IS09}, that construct a labeled graph recognizing the shift. For now, we will assume that all boundary sequences are eventually periodic.
Assume that our shift space has a left-continuous underlying map. The shift space has at most $2(\lfloor\beta\rfloor+1)$ boundary sequences, two for each
$a\in{\cal A}$ used by the underlying digit function: one corresponding to $\ell_a$ and the other to $r_a$. In what follows we will assume that all digits in
$\cal A $ are used. Hence, we will need two sets for each digit, $m^\ell_a$ and $m^r_a$, which are subsets of $\ZZ_{\geq 0}$. These sets keep track of the (finite) memory of a machine that reads the sequence $(x_1,x_2,\ldots)$ one digit at a time. The meaning of $k\in m^\ell_a$ is that the current memory contains a finite subblock starting with $a$ that equals the prefix of the boundary sequence corresponding to $\ell_a$ and where the next digit needs to be matched against the $(k+1)$-th digit of the boundary sequence corresponding to $\ell_a$ (similarly for $m^r_a$). In fact, we can give an upper bound for each of these memory sets by using the fact that all boundary sequences are eventually periodic. Let the boundary sequence be eventually periodic with pre-periodic part of length $q\geq 0$ and periodic part of length $p\geq 1$, then the upper bounds, denoted by $U^\ell_a$ and $U^r_a$ respectively, are equal to
\bea
\begin{cases}
2p, & \text{if $q=0$};\\
2p+q-1, & \text{if $q\neq 0$ and $p$ is odd};\\
p+q-1, & \text{if $q\neq 0$ and $p$ is even}.
\end{cases}
\eea
These upper bounds tell us how many different prefixes we may expect.
Next, assume that we read a new digit of the sequence $(x_1,x_2,\ldots)$, say $d$. Our memory has now changed and hence we need to update our memory sets. If $k\in m^\ell_a$ and we read the digit $d$, we change the index $k$ into another index $m^\ell_a(k/d)$, which is defined as:
\ba\label{eq:2}
m^\ell_a(k/d) & := & \begin{cases}
k+1, & \text{if $k<U^\ell_a$ and $d=\drs(\ell_a,k+1)$};\\
1, & \text{if $k=U^\ell_a$, $d=\drs(\ell_a,k+1)$ and $q=0$};\\
q, & \text{if $k=U^\ell_a$, $d=\drs(\ell_a,k+1)$ and $q\neq 0$};\\
0, & \text{if $k\neq 0$ and $(-1)^{k+1}\left(\drs(\ell_a,k+1)-d\right)<0$};\\
0, & \text{if $k=0$ and $d\neq a$};\\
1, & \text{if $k=0$ and $d=a$};\\
F, & \text{otherwise}.
\end{cases}
\ea
Let us shortly explain what each of these seven cases mean. If our memory contains a subblock matching the prefix of the boundary sequence of $\ell_a$ but does not contain one complete period, then we check digit $d$ against the next digit of the prefix (case 1). If the boundary sequence is purely periodic and if our memory contains two complete periods (we need two complete periods in the case $p$ is odd), then move back to the beginning (case 2). If the boundary sequence is eventually periodic and our memory contains the maximum number of complete periods (one if $p$ is even, otherwise two), then return to the beginning of the periodic part (case 3). If our memory contains a subblock that, together with the digit $d$, can be accepted bacause of Theorem \ref{thm:4.2}, then accept it and "forget" about this block (case 4). If our memory does not contain the digit $a$ and if the new digit also is not $a$, do absolutely nothing (case 5). On the other hand, if the new digit equals $a$, we have a subblock of length 1 matching the prefix of equal length of the boundary sequence $\ell_a$ (case 6). If none of the above happens, then we are neither undecided (cases 1,2,3,5 and 6) nor can we accept any subblock (case 4), and hence we must reject it (case 7).
Similarly, we define
\ba\label{eq:3}
m^r_a(k/d) & := & \begin{cases}
k+1, & \textrm{if $k<U^r_a$ and $d=\dl(r_a,k+1)$};\\
1, & \textrm{if $k=U^r_a$, $d=\dl(r_a,k+1)$ and $q=0$};\\
q, & \textrm{if $k=U^r_a$, $d=\dl(r_a,k+1)$ and $q\neq 0$};\\
0, & \textrm{if $k\neq 0$ and $(-1)^{k+1}\left(d-\dl(r_a,k+1)\right)<0$};\\
0, & \textrm{if $k=0$ and $d\neq a$};\\
1, & \textrm{if $k=0$ and $d=a$};\\
F, & \textrm{otherwise}.
\end{cases}
\ea
We state the following result, which follows directly from equations \eqref{eq:2} and \eqref{eq:3}:
\begin{corollary}\label{cor:4.3}
Let $(z_1,\ldots,z_n)$ be our current memory containing no forbidden blocks. Then for some $a\in{\cal A}$ and $i\leq U^\ell_a$ (or $U^r_a$) either $m^\ell_a(i/d)$ or $m^r_a(i/d)$ equals $F$ if and only if $(z_1,\ldots,z_n,d)$ contains a forbidden block.
\end{corollary}
To construct a labeled graph recognizing the shift $\Sl$ whose boundary sequences are all eventually periodic, we perform the following steps:
\begin{enumerate}
\item[1.] Let ${\cal V}$ be the set of vertices where each vertex $v\in{\cal V}$ is labeled\\ $(m_0^\ell,m_0^r,\ldots,m_{\lfloor\beta\rfloor}^\ell,m_{\lfloor\beta\rfloor}^r)$ such that $m^\ell_a$ is a nonempty subset of\\ $\{0,1,\ldots,U^\ell_a\}$ and $m^r_a$ is a nonempty subset of $\{0,1,\ldots,U^r_a\}$.
\item[2.] For each vertex $v\in{\cal V}$ and $d\in{\cal A}$ draw an edge with label $d$ from vertex $v$ to vertex $w=(w_1,w_2,\ldots,w_{2\lfloor\beta\rfloor+2})$, where
\bea
w_k &=& \begin{cases}
\varphi_{\ell,(k-1)/2}(m^\ell_{(k-1)/2},d), & \text{if $k$ is odd};\\
\varphi_{\ell,(k-2)/2}(m^r_{(k-2)/2},d), & \text{if $k$ is even};
\end{cases}
\eea
and the maps $\varphi_{\ell,a}$ and $\varphi_{r,a}$ are defined as
\ba\label{eq:4}
\varphi_{\ell,a}(v,d) & := & \begin{cases}
F, & \text{if $F\in\bigcup_{i\in v} \left\{m^\ell_a(i/d)\right\}$};\\
\bigcup_{i\in v} \left\{m^\ell_a(i/d)\right\}\setminus\{0\}, & \text{if $\{0\}\subsetneq\bigcup_{i\in v} \left\{m^\ell_a(i/d)\right\}$}\\ & \text{and $F\notin\bigcup_{i\in v} \left\{m^\ell_a(i/d)\right\}$};\\
\{1\}\cup \bigcup_{i\in v} \left\{m^\ell_a(i/d)\right\}\setminus\{0\}, & \text{if $1,F\notin \bigcup_{i\in v} \left\{m^\ell_a(i/d)\right\}$}\\
& \text{and $d=a$};\\
\bigcup_{i\in v} \left\{m^\ell_a(i/d)\right\}, & \textrm{otherwise}.
\end{cases}
\ea
The definition of $\varphi_{r,a}$ is nearly identical; simply replaces all instances of $\ell$ in \eqref{eq:4} with $r$.
\item[3.] The connected component (i.e., each vertex has at least one outgoing edge) containing the zero vertex is the labeled graph recognizing $\Sl$.
\end{enumerate}
Since our memory sets may contain more than one digit, we need to keep track of the way each of these indices react to the new digit $d$ and, should they arise, remove any inconsistencies. This is the job of $\varphi_{\ell,a}$ and $\varphi_{r,a}$. Let us explain the four cases in \eqref{eq:4} in more detail. If, because of the new digit $d$, our memory contains a forbidden subblock, automatically reject it (case 1). If we cannot reject it, then suppose our memory contains at least two subblocks on which we are undecided, but can accept some (not all) of them after we read the new digit $d$. In that case adding a $0$ to the memory set would be redundant (case 2). If the new digit equals $a$, then add $1$ to the memory set, as we have a new subblock (of length $1$) starting with $a$ (case 3). If none of these three cases apply, there are no inconsistencies (case 4).
In practice, one starts with the zero vertex and adds vertices along the way. Since none of the vertices carry the label $F$, we do not draw an edge if the update rule in \eqref{eq:4} implies that the edge should point towards such a vertex.
\begin{theorem}\label{thm:4.4}
The shift space $\Sn$ is sofic if and only if its boundary sequences are all eventually periodic.
\end{theorem}
\begin{proof}
Assume, without loss of generality, that the underlying map is left-continuous (in the remainder of the proof we will write $\Sl$). Let ${\cal G}$ be a right-resolving labeled graph recognizing $\Sl$ (recall \cite[Theorem 3.3.2]{LM95}) and let ${\cal L}$ be the labeling. Fix $a\in{\cal A}$ and consider $\drs(\ell_a)$ (the argument is similar for $\dl(r_a)$). There exists a path $\xi=e_1e_2\cdots$ in ${\cal G}$ such that $\left({\cal L}(e_1),{\cal L}(e_2),\ldots\right)=\drs(\ell_a)$. By Theorem \ref{thm:4.2}, $\drs(\ell_a)$ is the smallest sequence with respect to the order $\prec$ starting with $a$ and hence $\xi$ is the path that first chooses the edge with label $a$ and then the edge with the smallest possible label (with respect to $\prec$). Since ${\cal G}$ is finite, the path $\xi$ passes some vertex $v$ infinitely often. Hence, $\xi$ contains a loop of even length, which implies that for some $k,n\geq 1$ we have ${\cal L}(e_i)={\cal L}(e_{i+2k})$. It follows that $\drs(\ell_a)$ is eventualy periodic.
Conversely, let $\Sl$ be given, $\cal G$
the labeled graph that follows from our construction and let $L_S$ and
$L_{\cal G}$ be the language of the shift space $\Sl$ and the edge shift on
$\cal G $ respectively. By Corollary~\ref{cor:4.3} and the construction of
$\cal G$ it immediately follows that $L_S\subset L_{\cal G}$. If $(a_1,\ldots,a_n,d)\notin L_S$ and $(a_1,\ldots,a_n)\in L_S$ (we may assume this without loss of generality), then from Corollary~\ref{cor:4.3} it follows that either $m^\ell_a(i/d)$ or $m^r_a(i/d)$ equals $F$ for some $i$ and $a$. Hence, by construction, there is a finite path $\zeta=(e_1,\ldots,e_n)$ such that ${\cal L}(e_i)=a_i$. Say the path $\zeta$ ends at vertex $v$, then there is no outgoing edge from $v$ with label $d$. For if it did exist, it would point to a vertex with label $F$ as one of its coordinates by \eqref{eq:4}. Such vertices, however, do not exist (recall step 1 of the construction). It follows that $L_S=L_{\cal G}$.
\end{proof}
\begin{remark}
The construction of the labeled graph is also valid if at least one boundary sequence is not eventually periodic. In this case, the upper bound $U^\ell_a$ or $U^r_a$ corresponding to this boundary sequence, as well as $p$ for this specific boundary sequence, should be equal to $\infty$ (as there is no periodicity to exploit). Using our construction, the number of vertices in the labeled graphs of these shifts might be countably infinite.
\end{remark}
Let us illustrate the results of this section with two examples.
\begin{example}\label{ex:4.5}
We continue the case of Example \ref{ex:2.3}. In Examples \ref{ex:3.2} and \ref{ex:3.8} we determined the boundary sequences and hence, by Theorem 4.2, a sequence belongs to the shift space $\Sn$ if and only if
\bea
(\overline{1,0})\preceq(x_n,x_{n+1},\ldots)\preceq(1,1,\overline{0}) & \vee & (0,0,1,\overline{0})\preceq(x_n,x_{n+1},\ldots)\preceq(\overline{0,1})
\eea
holds for all $n\geq 1$. We can simplify this as
\ba\label{eq:5}
(x_n,x_{n+1},\ldots)\preceq(1,1,\overline{0}) & \vee & (0,0,1,\overline{0})\preceq(x_n,x_{n+1},\ldots),
\ea
since the other two inequalities are always satisfied, as $(\overline{1,0})$ and $(\overline{0,1})$ are the smallest and the greatest sequences with respect to the alternate order respectively. It is useful to create tables stating all possible outcomes of $m^\ell_a(i/d)$ and $m^r_a(i/d)$ for all $a,d\in{\cal A}$ and all allowed indices $i$. In this specific case, we find:
\bea
\begin{tabular}{|c|c|c|}
$m_0^\ell(i/d)$ & 0 & 1\\
\hline
0 & 1 & 0\\
1 & 2 & 0\\
2 & 0 & 3\\
3 & 4 & 0\\
4 & 3 & $F$
\end{tabular}
& &
\begin{tabular}{|c|c|c|}
$m_1^r(i/d)$ & 0 & 1\\
\hline
0 & 0 & 1\\
1 & 0 & 2\\
2 & 3 & 0\\
3 & 2 & $F$
\end{tabular}
\eea
The entries labeled $F$ correspond to forbidden blocks, though not all forbidden blocks can be found explicitly this way. We see that $m^\ell_0(4/1)=F$, which means we can find a forbidden block by taking the prefix of length $4$ of $\drs(2-\sqrt{5})$ and adding a fifth digit to it, in this case $1$. So, $(0,0,1,0,1)$ is a forbidden block, which is clear from \eqref{eq:5}. Similarly, $m_1^r(3/1)=F$ tells us that $(1,1,0,1)$ is a forbidden block. Figure \ref{fig:3} shows the labeled graph recognizing the shift space.
\begin{figure}[ht]
\centering
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.2cm,semithick]
\node[state] (00) {$\vectwo{0}{0}$};
\node[state] (10) [right of=00] {$\vectwo{1}{0}$};
\node[state] (01) [below of=00] {$\vectwo{0}{1}$};
\node[state] (120) [right of=10] {$\vectwo{1,2}{0}$};
\node[state] (31) [below of=120] {$\vectwo{3}{1}$};
\node[state] (140) [right of=31] {$\vectwo{1,4}{0}$};
\node[state] (1230) [above of=140] {$\vectwo{1,2,3}{0}$};
\node[state] (1240) [right of=1230] {$\vectwo{1,2,4}{0}$};
\node[state] (012) [below of=01] {$\vectwo{0}{1,2}$};
\node[state] (13) [right of=012] {$\vectwo{1}{3}$};
\node[state] (122) [right of=13] {$\vectwo{1,2}{2}$};
\node[state] (123) [right of=122] {$\vectwo{1,2}{3}$};
\path (00) edge node {0} (10)
edge node [left] {1} (01)
(10) edge node {0} (120)
edge [bend left] node {1} (01)
(01) edge [bend left] node {0} (10)
edge node {1} (012)
(120) edge [loop above] node {0} (120)
edge node {1} (31)
(31) edge node [below] {0} (140)
edge node {1} (012)
(140) edge node {0} (1230)
(1230) edge [bend left] node {0} (1240)
edge node {1} (31)
(1240) edge [bend left] node {0} (1230)
(012) edge node [below] {0} (13)
edge [loop left] node {1} (012)
(13) edge node [below] {0} (122)
(122) edge [bend left] node {0} (123)
edge node {1} (31)
(123) edge [bend left] node {0} (122);
\end{tikzpicture}
\caption{A labeled graph recognizing the shift space given by \eqref{eq:5}.\label{fig:3}}
\end{figure}
\end{example}
\begin{example}\label{ex:4.6}
Now consider the map given in Example \ref{ex:3.4}. By Example \ref{ex:3.7}, $\drs(0)=(0,1,\overline{1,0})$, and thus a sequence belongs to the shift space generated by this map if and only if
\ba\label{eq:6}
(x_n,x_{n+1},\ldots)\preceq(1,\overline{1,0}) & \vee & (0,1,\overline{1,0})\preceq(x_n,x_{n+1},\ldots)
\ea
holds for all $n\geq 1$. Once again, we omitted two inequalities since they are redundant. We can proceed as in the previous example and create the following tables:
\bea
\begin{tabular}{|c|c|c|}
$m_0^\ell(i/d)$ & 0 & 1\\
\hline
0 & 1 & 0\\
1 & $F$ & 2\\
2 & 0 & 3\\
3 & 2 & 0\\
\end{tabular}
& &
\begin{tabular}{|c|c|c|}
$m_1^r(i/d)$ & 0 & 1\\
\hline
0 & 0 & 1\\
1 & 0 & 2\\
2 & 1 & 0\\
\end{tabular}
\eea
The tables now only reveal one forbidden block: $(0,0)$. As we will see in a later section, this is the only forbidden block. For the moment, assume we are not aware of this. We construct a labeled graph that recognizes the shift based on our lengthy exposition earlier. This graph is shown in Figure \ref{fig:4}.
\begin{figure}[ht]
\centering
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.2cm,semithick]
\node[state] (00) {$\vectwo{0}{0}$};
\node[state] (10) [right of=00] {$\vectwo{1}{0}$};
\node[state] (01) [below of=00] {$\vectwo{0}{1}$};
\node[state] (012) [below of=01] {$\vectwo{0}{1,2}$};
\node[state] (11) [below of=10] {$\vectwo{1}{1}$};
\node[state] (21) [right of=11] {$\vectwo{2}{1}$};
\node[state] (212) [below of=21] {$\vectwo{2}{1,2}$};
\node[state] (312) [right of=212] {$\vectwo{3}{1,2}$};
\node[state] (121) [above of=312] {$\vectwo{1,2}{1}$};
\node[state] (2312) [above of=121] {$\vectwo{2,3}{1,2}$};
\path (00) edge node {0} (10)
edge node [left] {1} (01)
(10) edge [bend left] node {1} (21)
(01) edge node {0} (10)
edge node {1} (012)
(012) edge node {0} (11)
edge [loop left] node {1} (012)
(11) edge [bend left] node {1} (212)
(21) edge [bend left] node {0} (10)
edge node {1} (312)
(212) edge [bend left] node {0} (11)
edge node {1} (312)
(312) edge node {0} (121)
edge [bend left] node {1} (012)
(121) edge node [right] {1} (2312)
(2312) edge [bend right] node [left] {0} (121)
edge [bend left] node {1} (312);
\end{tikzpicture}
\caption{A labeled graph recognizing the shift space given by \eqref{eq:6}.\label{fig:4}}
\end{figure}
\end{example}
As in the case of expansions in positive base, whenever $\beta$ is Pisot we can improve Theorem \ref{thm:4.4} a little. Recall that a \emph{Pisot number} is a positive algebraic integer whose other conjugates lie in the unit circle in the complex plane. The following theorem shows why Pisot bases are nice to work with.
\begin{theorem}
Let $\beta$ be Pisot, $x\in I_{-\beta}$ and $\T$ be given and let $\dn(x)$ be the $(-\beta)$-expansion of $x$ generated by $\T$. If $x\in\QQ(\beta)$, then $\dn(x)$ is eventually periodic.
\end{theorem}
\begin{proof}
We will not give the complete proof here, as it is nearly identical to the proof of \cite[Theorem 24]{DMP11}. In our case, replace $[l,r)$ with $I_{-\beta}$ and note that we have the bound $|r_n|<\frac{\beta\cdot\lfloor\beta\rfloor}{\beta^2-1}$.
\end{proof}
As an immediate corollary, we have:
\begin{theorem}\label{thm:4.8}
Let $\beta$ be Pisot and $\Sn$ be given. Then $\Sn$ is sofic if and only if the cut points of the underlying map $\T$ all lie in $\QQ(\beta)$.
\end{theorem}
\section{Forbidden blocks}
Example \ref{ex:4.6} showed that, while technically correct, our construction of the labeled graph can yield us quite large graphs. However, by carefully looking at Examples \ref{ex:4.5} and \ref{ex:4.6} we see why the first one is only sofic and the latter is actually a shift of finite type. In the first example, the forbidden blocks contain both a part of the pre-periodic and a part of the periodic part of the boundary sequence, where in the second example the forbidden block only contained part of the pre-periodic part. This observation quickly leads us to a conjecture: a shift space of the form given in Theorem \ref{thm:4.2} is a shift of finite type if and only if its forbidden blocks only contain part of either pre-periodic or periodic parts of boundary sequences, but not both. Indeed, if the latter does happen, we can abuse the periodicity of the boundary sequences to generate infinitely many forbidden blocks that cannot be covered by a finite set (because of the pre-periodic part). Based on these observations, we state the following
\begin{theorem}\label{thm:5.1}
Let $\Sn$ be a sofic shift. Then $\Sn$ is a shift of finite type if and only if the periodic part of every eventually periodic boundary sequence is a purely periodic boundary sequence.
\end{theorem}
\begin{proof}
Once again, we assume that the underlying map is left-continuous and write $\Sl$ instead of $\Sn$. Let $\Sl$ be a shift of finite type. Every shift of finite type is sofic and hence by Theorem \ref{thm:4.4} we conclude that all boundary sequences are eventually periodic. Assume that there exists a left-boundary sequence (the proof is similar for right-boundary sequences) $(a_1,\ldots,a_k,\overline{a_{k+1},\ldots,a_{k+p}})$, where $k,p\geq 1$, whose periodic part does not equal some other boundary sequence. Moreover, assume that $k$ is odd (the proof is similar for $k$ even). By assumption, there exists a smallest integer $1\leq j\leq p$ such that there exists some $b\in{\cal A}$ for which we have $(-1)^{k+j}(b-a_{k+j})<0$. It follows that the block $(a_1,\ldots,a_{k+j-1},b)$ is forbidden. Moreover, the blocks $w^{(n)}:= a_1\cdots a_k(a_{k+1}\cdots a_{k+p})^{2n} a_{k+1}\cdots a_{k+j-1}b$ are forbidden for all $n\geq 0$.
Suppose that there exists some $1\leq i\leq j-1$ such that the subblock $a_{k+i}\cdots b$ of length at most $j$ is forbidden. Then the blocks $(a_{k+1}\cdots a_{k+p})^{2n}a_{k+1}\cdots a_{k+j-1}b$ are forbidden for all $n\geq 0$ and thus we conclude that
\bea
(\overline{a_{k+1}\cdots a_{k+p}})\prec (a_{k+1}\cdots a_{k+p})^{2n} a_{k+1}\cdots a_{k+j-1}b
\eea
holds for all $n\geq 1$. This, however, implies that $(\overline{a_{k+1},\ldots,a_{k+p}})$ is a right-boundary sequence, which contradicts our initial assumption. Hence, there exists some integer $1\leq m\leq k$ such that the blocks $a_m\cdots a_k(a_{k+1}\cdots a_{k+p})^{2n}a_{k+1}\cdots a_{k+j-1}b$ are forbidden for all $n\geq 0$, but any of their subblocks are admissible. Hence, $\Sn$ is not a shift of finite type.
Next, assume that all boundary sequences satisfy the property given in Theorem \ref{thm:5.1} and let $(a_1,a_2,\ldots)$ be an arbitrary but fixed left-boundary sequence (the proof is similar for right-boundary sequences). If it is purely periodic with period $p$, then the forbidden blocks are given by
\ba\label{eq:7}
\left\{ (x_1,\ldots,x_{2p})\in{\cal A}^{2p}:\ (x_1,\ldots,x_{2p})\prec (a_1,\ldots,a_{2p})\,\wedge\,x_1=a_1\right\}.
\ea
If it is eventually periodic with pre-periodic part of length $q$ and period $p$, then the set
\ba\label{eq:8}
\left\{ (x_1,\ldots,x_{q+1})\in{\cal A}^{q+1}:\ (x_1,\ldots,x_{q+1})\prec(a_1,\ldots,a_{q+1})\,\wedge\,x_1=a_1\right\}
\ea
is sufficient. To see why, let $(y_1,y_2,\ldots)$ be a sequence such that $y_1=a_1$ and $(y_1,y_2,\ldots)\prec(a_1,a_2,\ldots)$. Let $m$ be the smallest integer such that $y_i=a_i$ for $i<m$ and $(-1)^m(y_m-a_m)<0$ and assume that $m>q+1$. Moreover, assume that $q$ is odd (the argument is similar for $q$ even). Then $y_1\cdots y_{q+1}=a_1\cdots a_{q+1}$ and
\bea
(\overline{a_{q+1},\ldots,a_{q+p}})\prec(y_{k+1},y_{k+2},\ldots).
\eea
Since the purely periodic sequence on the left-hand side is another boundary sequence, it follows that the forbidden blocks of $(y_1,y_2,\ldots)$ are contained within the subsequence $(y_{q+1},y_{q+2},\ldots)$. But these forbidden blocks are already covered by a set of the form \eqref{eq:7}. Hence, it is sufficient to consider forbidden blocks of the form in \eqref{eq:8}. Since there are finitely many boundary sequences and since each of these boundary sequences only have a finite number of forbidden blocks, the shift space is a shift of finite type.
\end{proof}
We can use the result of this theorem to reduce our graphs quite a bit as follows. Consider any boundary sequence. If its periodic part is a boundary sequence of the same shift space, then remove this periodic part. If our memory contains the whole pre-periodic part of this boundary sequence, then accept it and forget about it (i.e., the new memory index in this specific case would be a zero). The following two examples illustrate this.
\begin{example}
Reconsider Example \ref{ex:4.6}. Since $(\overline{1,0})$ is a boundary sequence (the smallest with respect to $\prec$), we can forget about this periodic part. Moreover, this turns $(1,\overline{1,0})$ into the single digit boundary block $(1)$, which itself is redundant, and hence we are left with the following condition:
\bea
(0,1)\preceq(x_n,x_{n+1})
\eea
for all $n\geq 1$ such that $x_n=0$. Although not necessary at this point, we still fill in the table:
\bea
\begin{tabular}{|c|c|c|}
$m_0^\ell(i/d)$ & 0 & 1\\
\hline
0 & 1 & 0\\
1 & $F$ & 0\\
\end{tabular}
\eea
The resulting graph is shown in Figure \ref{fig:5}.
\begin{figure}[ht]
\centering
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.2cm,semithick]
\node[state] (0) {$0$};
\node[state] (1) [right of=0] {$1$};
\path (0) edge [loop left] node {1} (0)
edge [bend left] node {0} (1)
(1) edge [bend left] node {1} (0);
\end{tikzpicture}
\caption{Another labeled graph recognizing the shift space of Example \ref{ex:4.6}.\label{fig:5}}
\end{figure}
\end{example}
The same approach can be applied to any shift space of the form in Theorem \ref{thm:4.2} as long as at least one eventually periodic boundary sequence has a periodic part equal to a periodic boundary sequence.
\begin{example}\label{ex:5.3}
Let $\beta=2$ and consider the left-continuous map with cut points $-\frac{5}{6}$ and $-\frac{1}{6}$. Theorem \ref{thm:4.2} tells us that $(x_1,x_2,\ldots)\in\Sn$ if and only if for all $n\geq 1$ we have:
\bea
\begin{array}{rrllll}
& (\overline{2,0}) & \preceq & (x_n,x_{n+1},\ldots) & \preceq & (2,\overline{1}),\\
& (1,\overline{0,2}) & \preceq & (x_n,x_{n+1},\ldots) & \preceq & (1,\overline{1,0}),\\
\textrm{or} & (0,\overline{0,1}) & \preceq & (x_n,x_{n+1},\ldots) & \preceq & (\overline{0,2}).
\end{array}
\eea
Careful inspection reveals that the boundary sequences ($\overline{2,0})$ and $(\overline{0,2})$ are redundant (the smallest and largest possible sequence with respect to $\prec$). Moreover, we may reduce $(1,\overline{0,2})$ to the single digit block $(1)$, which is once again redundant. We are left with:
\ba\label{eq:9}
\begin{cases}
(x_n,x_{n+1},\ldots) \preceq (2,\overline{1}), & \text{whenever $x_n=2$};\\
(x_n,x_{n+1},\ldots) \preceq (1,\overline{1,0}), & \text{whenever $x_n=1$};\\
(0,\overline{0,1}) \preceq (x_n,x_{n+1},\ldots), & \text{whenever $x_n=0$}.
\end{cases}
\ea
We create tables one more time:
\bea
\begin{tabular}{c|c|c|c}
$m_0^\ell(i/d)$ & 0 & 1 & 2\\
\hline
0 & 1 & 0 & 0\\
1 & 2 & 0 & 0\\
2 & 0 & 1 & $F$
\end{tabular}
&
\begin{tabular}{c|c|c|c}
$m_1^r(i/d)$ & 0 & 1 & 2\\
\hline
0 & 0 & 1 & 0\\
1 & 0 & 2 & $F$\\
2 & 1 & 0 & 0
\end{tabular}
&
\begin{tabular}{c|c|c|c}
$m_2^r(i/d)$ & 0 & 1 & 2\\
\hline
0 & 0 & 0 & 1\\
1 & 0 & 2 & $F$\\
2 & $F$ & 1 & 0
\end{tabular}
\eea
and use these to produce the labeled graph in Figure \ref{fig:6}.
\begin{figure}[b]
\centering
\begin{tikzpicture}[->,>=stealth',auto,node distance=3.5cm,semithick,scale=0.5]
\node[state] (000) {$\vecthree{0}{0}{0}$};
\node[state] (010) [right of=000] {$\vecthree{0}{1}{0}$};
\node[state] (100) [below of=010] {$\vecthree{1}{0}{0}$};
\node[state] (001) [below of=000] {$\vecthree{0}{0}{1}$};
\node[state] (012) [below of=001] {$\vecthree{0}{1}{2}$};
\node[state] (0122) [right of=012] {$\vecthree{0}{1,2}{2}$};
\node[state] (0121) [right of=0122] {$\vecthree{0}{1,2}{1}$};
\node[state] (0120) [right of=010] {$\vecthree{0}{1,2}{0}$};
\node[state] (1200) [right of=100] {$\vecthree{1,2}{0}{0}$};
\node[state] (110) [right of=1200] {$\vecthree{1}{1}{0}$};
\path (000) edge node {0} (100)
edge node {1} (010)
edge node {2} (001)
(010) edge node {1} (0120)
edge node [left] {0} (100)
(001) edge node {0} (100)
edge node {1} (012)
(100) edge [bend right] node [right] {1} (010)
edge [bend left] node {2} (001)
edge node {0} (1200)
(012) edge [bend left=60] node [below] {1} (0121)
(0121) edge [bend right] node {0} (110)
edge [bend left] node {1} (0122)
(0122) edge [bend left] node {1} (0121)
(1200) edge [loop above] node {0} (1200)
edge node {1} (110)
(0120) edge [loop above] node {1} (0120)
edge node [below left] {0} (110)
(110) edge [bend right] node [above right] {1} (0120)
edge [bend left] node {0} (1200);
\end{tikzpicture}
\caption{A labeled graph recognizing the shift from Example \ref{ex:5.3}.\label{fig:6}}
\end{figure}
\end{example}
\section{Discussion}
Our goal was to consider a large class of $(-\beta)$-transformations and to prove statements analogous to what Ito and Sadahiro for their $(-\beta)$-transformation. Our class of $(-\beta)$-transformations include transformations that, when restricted to the interval $\left[-\frac{\beta}{\beta+1},\frac{1}{\beta+1}\right)$, are the Ito-Sadahiro transformation. As to be expected, our results agree with results on their transformation (compare Theorem \ref{thm:3.9} and \ref{thm:4.4} with \cite[Theorem 10 \& 12]{IS09} and Theorem \ref{thm:5.1} with \cite[Theorem 4]{FL09}). While we only considered the canonical alphabet, there are many other alphabets to be considered. In fact, there is a rather large class of alphabets satisfying property i of Assumption \ref{ass:2.1} (compare with \cite[Proposition 2.1]{Ped04}) of which we assume the results in this paper will carry over.
Of the many open problems surrounding $(-\beta)$-expansions we want to highlight two. The first problem is based on the examples in sections 4 and 5 illustrating the output of our algorithm. Can this algorithm be improved upon? The second problem follows from \cite{IS09}: given two sequences $\boldsymbol{x},\boldsymbol{y}\in{\cal A}^\NN$ (or any other alphabet), is there a $(-\beta)$-transformation such that $\boldsymbol{x}$ and $\boldsymbol{y}$ are boundary sequences of this transformation?
\begin{thebibliography}{10}
\bibitem{DK11} K. Dajani and C. Kalle, Transformations generating negative $\beta$-expansions, \emph{Integers} \textbf{11B} (2011).
\bibitem{DK03} K. Dajani and C. Kraaikamp, From greedy to lazy expansions and their driving dynamics, \emph{Expo. Math.} \textbf{20} (2002), 315--327.
\bibitem{DK04} K. Dajani and C. Kraaikamp, Random $\beta$-expansions, \emph{Ergodic Theory Dynam. Systems} \textbf{23} (2003), 461--479.
\bibitem{DV05} K. Dajani and M. de Vries, Measures of maximal entropy for random $\beta$-expansions, \emph{J. Eur. Math. Soc. (JEMS)} \textbf{7} (2005), 51--68.
\bibitem{DMP11} D. Dombek, Z. Mas\'{a}kov\'{a}, and E. Pelantov\'{a}, Number representation using generalized $(-\beta)$-transformation, \emph{Theoret. Comput. Sci.} \textbf{412} (2011), 6653--6665.
\bibitem{EJ91} P. Erd\H{o}s and I. Jo\'{o}, On the expansion $1=\sum q^{-n_i}$, \emph{Period. Math. Hungar.} \textbf{23} (1991), 27--30.
\bibitem{FL09} C. Frougny and A. C. Lai, On negative bases, in
{\it Proc. DLT 09},
Lecture Notes in Comp. Sci., Vol.\ 5583, Springer,
2009, pp.\ 252--263.
\bibitem{IS09} S. Ito and T. Sadahiro, Beta-expansions with negative bases, \emph{Integers} \textbf{9} (2009), 239--259.
\bibitem{LM95} D. Lind and B. Marcus, \emph{An Introduction to Symbolic Dynamics and Coding}, Cambridge University Press, 1995.
\bibitem{Par60} W. Parry, On the $\beta$-expansions of real numbers, \emph{Acta. Math. Acad. Sci. Hung.} \textbf{11} (1960), 401--416.
\bibitem{Ped04} M. Pedicini, Greedy expansions and sets with deleted digits, \emph{Theoret. Comput. Sci.} \textbf{332} (2005), 313--336.
\bibitem{Ren57} A. R\'{e}nyi, Representations for real numbers and their ergodic properties, \emph{Acta. Math. Acad. Sci. Hung.} \textbf{8} (1957), 477--493.
\end{thebibliography}
\bigskip
\hrule
\bigskip
\noindent 2010 {\it Mathematics Subject Classification}:
Primary 37B10; Secondary 11A63.
\noindent \emph{Keywords: }
$(-\beta)$-expansions, sofic shift, shift of finite type.
\bigskip
\hrule
\bigskip
\vspace*{+.1in}
\noindent
Received October 10 2011;
revised version received January 11 2012.
Published in {\it Journal of Integer Sequences}, January 14 2012.
\bigskip
\hrule
\bigskip
\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{http://www.cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in
\end{document}
|
http://mlsp2005.conwiz.dk/Template.tex
|
conwiz.dk
|
CC-MAIN-2018-47
|
application/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2018-47/segments/1542039750800.95/warc/CC-MAIN-20181121193727-20181121215727-00545.warc.gz
| 212,785,965
| 4,314
|
% Template for ICASSP-2005 paper; to be used with:
% spconf.sty - ICASSP/ICIP LaTeX style file, and
% IEEEbib.bst - IEEE bibliography style file.
% --------------------------------------------------------------------------
\documentclass{article}
\usepackage{spconf,amsmath,epsfig}
% Example definitions.
% --------------------
\def\x{{\mathbf x}}
\def\L{{\cal L}}
% Title.
% ------
\title{AUTHOR GUIDELINES FOR ICASSP-2005 PROCEEDINGS MANUSCRIPTS}
%
% Single address.
% ---------------
\name{Author(s) Name(s)\thanks{Thanks to XYZ agency for funding.}}
\address{Author Affiliation(s)}
%
% For example:
% ------------
%\address{School\\
% Department\\
% Address}
%
% Two addresses (uncomment and modify for two-address case).
% ----------------------------------------------------------
%\twoauthors
% {A. Author-one, B. Author-two\sthanks{Thanks to XYZ agency for funding.}}
% {School A-B\\
% Department A-B\\
% Address A-B}
% {C. Author-three, D. Author-four\sthanks{The fourth author performed the work
% while at ...}}
% {School C-D\\
% Department C-D\\
% Address C-D}
%
\begin{document}
%\ninept
%
\maketitle
%
\begin{abstract}
The abstract should appear at the top of the left-hand column of text, about
0.5 inch (12 mm) below the title area and no more than 3.125 inches (80 mm) in
length. Leave a 0.5 inch (12 mm) space between the end of the abstract and the
beginning of the main text. The abstract should contain about 100 to 150
words, and should be identical to the abstract text submitted electronically
along with the paper cover sheet. All manuscripts must be in English, printed
in black ink.
\end{abstract}
%
\section{Introduction}
\label{sec:intro}
These guidelines include complete descriptions of the fonts, spacing, and
related information for producing your proceedings manuscripts. Please follow
them and if you have any questions, direct them to Conference Management
Services: Phone (979) 846-6800 or Fax (979) 846-6900.
\section{Formatting your paper}
\label{sec:format}
All printed material, including text, illustrations, and charts, must be kept
within a print area of 6.9 inches (175 mm) wide by 8.9 inches (226 mm) high. Do
not write or print anything outside the print area. The top margin must be 1
inch (25 mm), except for the title page, and the left margin must be 0.75 inch
(19 mm). All {\it text} must be in a two-column format. Columns are to be 3.27
inches (83 mm) wide, with a 0.37 inch (8 mm) space between them. Text must be
fully justified.
\section{PAGE TITLE SECTION}
\label{sec:pagestyle}
The paper title (on the first page) should begin 1-3/8 inches (35 mm) from the
top edge of the page, centered, completely capitalized, and in Times 14-point,
boldface type. The authors' name(s) and affiliation(s) appear below the title
in capital and lower case letters. Papers with multiple authors and
affiliations may require two or more lines for this information.
\section{TYPE-STYLE AND FONTS}
\label{sec:typestyle}
To achieve the best rendering both in the proceedings and from the CD-ROM, we
strongly encourage you to use Times-Roman font. In addition, this will give
the proceedings a more uniform look. Use a font that is no smaller than nine
point type throughout the paper, including figure captions.
In nine point type font, capital letters are 2 mm high. If you use the
smallest point size, there should be no more than 3.2 lines/cm (8 lines/inch)
vertically. This is a minimum spacing; 2.75 lines/cm (7 lines/inch) will make
the paper much more readable. Larger type sizes require correspondingly larger
vertical spacing. Please do not double-space your paper. True-Type 1 fonts
are preferred.
The first paragraph in each section should not be indented, but all the
following paragraphs within the section should be indented as these paragraphs
demonstrate.
\section{MAJOR HEADINGS}
\label{sec:majhead}
Major headings, for example, "1. Introduction", should appear in all capital
letters, bold face if possible, centered in the column, with one blank line
before, and one blank line after. Use a period (".") after the heading number,
not a colon.
\subsection{Subheadings}
\label{ssec:subhead}
Subheadings should appear in lower case (initial word capitalized) in
boldface. They should start at the left margin on a separate line.
%Subheadings should appear in capital and lower case (initial caps), either
%underlined or in boldface. They start at the left margin on a separate line.
\subsubsection{Sub-subheadings}
\label{sssec:subsubhead}
Sub-subheadings, as in this paragraph, are discouraged. However, if you
must use them, they should appear in lower case (initial word
capitalized) and start at the left margin on a separate line, with paragraph
text beginning on the following line. They should be in italics.
%Sub-subheadings, as in this paragraph, are discouraged. However, if you must
%use them, they should appear in capital and lower case (initial caps), indented
%like a paragraph and on a separate line, with paragraph text beginning on the
%following line. They may be underlined or in italics.
\section{PRINTING YOUR PAPER}
\label{sec:print}
Print your properly formatted text on high-quality, 8.5 x 11-inch white printer
paper. A4 paper is also acceptable, but please leave the extra 0.5 inch (12 mm)
empty at the BOTTOM of the page and follow the top and left margins as
specified. If the last page of your paper is only partially filled, arrange
the columns so that they are evenly balanced if possible, rather than having
one long column.
In LaTeX, to start a new column (but not a new page) and help balance the
last-page column lengths, you can use the command ``$\backslash$pagebreak'' as
demonstrated on this page (see the LaTeX source below).
\section{PAGE NUMBERING}
\label{sec:page}
Please do {\bf not} paginate your paper. Page numbers, session numbers, and
conference identification will be inserted when the paper is included in the
proceedings.
\section{ILLUSTRATIONS, GRAPHS, AND PHOTOGRAPHS}
\label{sec:illust}
Illustrations must appear within the designated margins. They may span the two
columns. If possible, position illustrations at the top of columns, rather
than in the middle or at the bottom. Caption and number every illustration.
All halftone illustrations must be clear black and white prints. Do not use
any colors in illustrations.
Since there are many ways, often incompatible, of including images (e.g., with
experimental results) in a LaTeX document, below is an example of how to do
this \cite{Lamp86}.
% Below is an example of how to insert images. Delete the ``\vspace'' line,
% uncomment the preceding line ``\centerline...'' and replace ``imageX.ps''
% with a suitable PostScript file name.
% -------------------------------------------------------------------------
\begin{figure}[htb]
\begin{minipage}[b]{1.0\linewidth}
\centering
% \centerline{\epsfig{figure=image1.ps,width=8.5cm}}
\vspace{2.0cm}
\centerline{(a) Result 1}\medskip
\end{minipage}
%
\begin{minipage}[b]{.48\linewidth}
\centering
% \centerline{\epsfig{figure=image3.ps,width=4.0cm}}
\vspace{1.5cm}
\centerline{(b) Results 3}\medskip
\end{minipage}
\hfill
\begin{minipage}[b]{0.48\linewidth}
\centering
% \centerline{\epsfig{figure=image4.ps,width=4.0cm}}
\vspace{1.5cm}
\centerline{(c) Result 4}\medskip
\end{minipage}
%
\caption{Example of placing a figure with experimental results.}
\label{fig:res}
%
\end{figure}
% To start a new column (but not a new page) and help balance the last-page
% column length use \vfill\pagebreak.
% -------------------------------------------------------------------------
\vfill
\pagebreak
\section{FOOTNOTES}
\label{sec:foot}
Use footnotes sparingly (or not at all!) and place them at the bottom of the
column on the page on which they are referenced. Use Times 9-point type,
single-spaced. To help your readers, avoid using footnotes altogether and
include necessary peripheral observations in the text (within parentheses, if
you prefer, as in this sentence).
\section{COPYRIGHT FORMS}
\label{sec:copyright}
You must include your fully completed, signed IEEE copyright release form when
you submit your final paper. We {\bf must} have this form before your paper can be
published in the proceedings. The copyright form is available as a Word file,
a PDF file, and an HTML file. You can also use the form sent with your author
kit.
\section{REFERENCES}
\label{sec:ref}
List and number all bibliographical references at the end of the paper. The references can be numbered in alphabetic order or in order of appearance in the document. When referring to them in the text, type the corresponding reference number in square brackets as shown at the end of this sentence [1].
% References should be produced using the bibtex program from suitable
% BiBTeX files (here: strings, refs, manuals). The IEEEbib.bst bibliography
% style file from IEEE produces unsorted bibliography list.
% -------------------------------------------------------------------------
\bibliographystyle{IEEEbib}
\bibliography{strings,refs,manuals}
\end{document}
|
https://gitlab.in2p3.fr/limbra/limbra/-/raw/ead373492fe1ee19a19fe37d63d9436910f6f59c/views/lists/index.tex?inline=false
|
in2p3.fr
|
CC-MAIN-2023-06
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2023-06/segments/1674764500357.3/warc/CC-MAIN-20230206181343-20230206211343-00874.warc.gz
| 304,654,963
| 1,768
|
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{enumitem}
\begin{document}
{{extend 'layout_tools.html'}}
{{
import re
import textwrap
#
# HEADER
#
if list.header_flag:
title = get_title(tool, dbui.UNDEF_ID)
date = request.now.strftime("%d %b %Y")
response.write("\n\\begin{flushleft}\n")
response.write("\\textsc{\LARGE Publications %s -- %s}\n" % (title, date))
response.write("\end{flushleft}\n")
pass
#
# BODY
#
for key in paths_keys:
level = key.count('/')
if level == 0:
response.write("\n\n\section*{%s}" % key, escape=False)
else:
indent = 1.2 * (level - 1)
response.write("\n\hangindent=%sem" % indent, escape=False)
response.write("\n\hangafter=0", escape=False)
response.write("\n\\noindent \\textsc{%s}\\vspace{1ex}\n\n" % key.split('/')[-1])
pass
if key not in paths_data:
continue
margin = 1.6 * level
response.write("\n \\begin{enumerate}[leftmargin=%sem]" % margin, escape=False)
for record in paths_data[key]:
s = record.replace('<br>', '')
s = s.replace('<b>', '\textbf{').replace('</b>', '}')
s = s.replace('<i>', '\emph{').replace('</i>', '}')
s = s.replace('<u>', '\underline{').replace('</u>', '}')
s = s.replace("<span style='font-style: italic;'>", '\\textit{')
s = s.replace("<span style='font-weight: bold;'>", '\\textbf{')
s = s.replace("<span style='text-decoration: underline;'>", '\\underline{')
s = s.replace('<span style="font-style: italic;">', '\\textit{')
s = s.replace('<span style="font-weight: bold;">', '\textbf{')
s = s.replace('<span style="text-decoration: underline;">', '\\underline{')
s = s.replace('</span>', '}')
s = textwrap.fill("\\item %s" % s, initial_indent=' '*4, subsequent_indent=' '*4)
response.write("\n%s" % s, escape=False)
pass
response.write("\n \\end{enumerate}", escape=False)
pass
}}
\end{document}
{{include}}
|
https://sv.theanarchistlibrary.org/library/kevin-tucker-att-producera-eller-inte-producera.tex
|
theanarchistlibrary.org
|
CC-MAIN-2022-49
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2022-49/segments/1669446710409.16/warc/CC-MAIN-20221127141808-20221127171808-00846.warc.gz
| 609,906,353
| 9,559
|
\documentclass[DIV=12,%
BCOR=0mm,%
headinclude=false,%
footinclude=false,open=any,%
fontsize=10pt,%
oneside,%
paper=a4]%
{scrbook}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainfont{Linux Libertine O}
% these are not used but prevents XeTeX to barf
\setsansfont[Scale=MatchLowercase]{CMU Sans Serif}
\setmonofont[Scale=MatchLowercase]{CMU Typewriter Text}
\setmainlanguage{swedish}
% global style
\pagestyle{plain}
\usepackage{microtype} % you need an *updated* texlive 2012, but harmless
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{verbatim}
% http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\PassOptionsToPackage{hyphens}{url}\usepackage[hyperfootnotes=false,hidelinks,breaklinks=true]{hyperref}
\usepackage{bookmark}
% footnote handling
\usepackage[fragile]{bigfoot}
\usepackage{perpage}
\DeclareNewFootnote{default}
\DeclareNewFootnote{B}
\MakeSorted{footnoteB}
\renewcommand*\thefootnoteB{(\arabic{footnoteB})}
\deffootnote[3em]{0em}{4em}{\textsuperscript{\thefootnotemark}~}
% continuous numbering across the document. Defaults to resetting at chapter. Unclear
% \usepackage{chngcntr}
% \counterwithout{footnote}{chapter}
\usepackage[shortlabels]{enumitem}
\usepackage{tabularx}
\usepackage[normalem]{ulem}
\def\hsout{\bgroup \ULdepth=-.55ex \ULset}
% https://tex.stackexchange.com/questions/22410/strikethrough-in-section-title
% Unclear if \protect \hsout is needed. Doesn't looks so
\DeclareRobustCommand{\sout}[1]{\texorpdfstring{\hsout{#1}}{#1}}
\usepackage{wrapfig}
\usepackage{indentfirst}
% remove the numbering
\setcounter{secnumdepth}{-2}
% remove labels from the captions
\renewcommand*{\captionformat}{}
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\KOMAoption{captions}{belowfigure,nooneline}
\addtokomafont{caption}{\centering}
% avoid breakage on multiple <br><br> and avoid the next [] to be eaten
\newcommand*{\forcelinebreak}{\strut\\*{}}
\newcommand*{\hairline}{%
\bigskip%
\noindent \hrulefill%
\bigskip%
}
% reverse indentation for biblio and play
\newenvironment*{amusebiblio}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newenvironment*{amuseplay}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newcommand*{\Slash}{\slash\hspace{0pt}}
\addtokomafont{disposition}{\rmfamily}
\addtokomafont{descriptionlabel}{\rmfamily}
% forbid widows/orphans
\frenchspacing
\sloppy
\clubpenalty=10000
\widowpenalty=10000
% http://tex.stackexchange.com/questions/304802/how-not-to-hyphenate-the-last-word-of-a-paragraph
\finalhyphendemerits=10000
% given that we said footinclude=false, this should be safe
\setlength{\footskip}{2\baselineskip}
\title{Att producera eller inte producera?}
\date{}
\author{Kevin Tucker}
\subtitle{Klass, modernitet[1] och identitet}
% https://groups.google.com/d/topic/comp.text.tex/6fYmcVMbSbQ/discussion
\hypersetup{%
pdfencoding=auto,
pdftitle={Att producera eller inte producera?},%
pdfauthor={Kevin Tucker},%
pdfsubject={Klass, modernitet[1] och identitet},%
pdfkeywords={anarko-primitivism; klasskamp; modernitet; Teknologi}%
}
\begin{document}
\begin{titlepage}
\strut\vskip 2em
\begin{center}
{\usekomafont{title}{\huge Att producera eller inte producera?\par}}%
\vskip 1em
{\usekomafont{subtitle}{Klass, modernitet[1] och identitet\par}}%
\vskip 2em
{\usekomafont{author}{Kevin Tucker\par}}%
\vskip 1.5em
\vfill
\strut\par
\end{center}
\end{titlepage}
\cleardoublepage
Klass är en social relation. Den handlar i grunden om ekonomi. Den handlar om att vara producent, distributör eller ägare av produktionsmedlen och dess frukter. Oavsett vilken kategori en person tillhör, så har det att göra med identitet. Vem identifierar du dig med? Eller snarare, vad identifierar du dig med? Vi passar alla in i en mängd socioekonomiska kategorier, men det är inte det som är frågan. Är ditt jobb din identitet? Är din ekonomiska nisch det?
Låt oss gå tillbaka ett steg och fråga oss, vad är ekonomi? Min ordbok definierar det som ”vetenskapen om produktion, distribution, och konsumtion av varor och tjänster”. För all del, ekonomier existerar. I alla samhällen där tillgången till livets nödvändigheter är ojämnt fördelade, där folk är beroende av varandra (och framförallt av institutioner), finns det ekonomi. Målet för revolutionärer och reformister har nästan alltid handlat om att omorganisera ekonomin, att rikedomar måste omfördelas. Kapitalist, kommunist, socialist, syndikalist, allt handlar om ekonomi. Varför? Därför att produktionen har naturaliserats, ekonomin blivit en vetenskap, och arbete helt enkelt blivit ett nödvändigt ont.
Det har att göra med syndafallet, när Adam inte lydde Gud och därför fick som straff att odla jorden. Det har att göra med den protestantiska arbetsmoralen, och varningar om de sysslolösa händernas synd. Arbetet blir grunden för mänskligheten. Det är det som är ekonomins inbyggda budskap.
Arbetet ”är det första grundvillkoret för all mänsklig existens, och detta i en sådan utsträckning, att vi på sätt och vis måste säga att arbetet skapade människan själv”. Det är inte Adam Smith eller Gud som säger detta (i alla fall inte den här gången), utan Friedrich Engels.
Men någonting är väldigt fel här. Hur är det med de där Andra, de bortom Edens murar? Hur är det med de vildar som jordbrukarna och conquistadorerna (om man nu kan skilja dem åt) betraktade som lata bara för att de inte arbetade? Är ekonomi något universellt?
Låt oss gå tillbaka till vår definition.
Produktion är ekonomins kärna. Så om produktion inte är något universellt, så kan lyckligtvis inte heller ekonomi vara det. De där Andra, barbarerna bortom Edens murar, Babylons murar, och trädgårdarna, de som var nomadiska samlare och jägare, de producerade ingenting. En jägare producerar inte vilda djur, och en samlare producerar inte vilda växter. De bara jagar och samlar. Deras existens är att ge och ta. Men det är ekologi, och inte ekonomi. Varje individ i ett samhälle av nomadiska samlare och jägare är kapabel att skaffa det den behöver på egen hand. Att de inte agerar ensamma är en fråga om ömsesidig hjälp och socialt samarbete, inte tvång. Om de inte gillar sin situation, ser de till att ändra de på den. De är kapabla till det, och de uppmuntras att göra så. Deras slags utbyte är anti-ekonomi, och bygger på allmän ömsesidighet. Det betyder förenklat att folk ger vad som helst, till vem som helst, när som helst. Det finns inga protokoll, inga kvitton, inga skatter och inget system för att mäta eller värdera.
Dessa samhällen är egentligen anti-produktion, anti-rikedom, anti-makt och anti-ekonomi. De är helt enkelt jämställda i grunden, i en sorts organisk primal-anarki. Men det förklarar inte hur vi blev ekonomiska människor, och hur arbete blev identitet. Förklaringen får vi genom att se på civilisationens ursprung. Civilisation bygger på produktion. Det första exemplet på produktion är överskottsproduktion. Nomadiska samlare och jägare skaffade det de behövde, när de behövde det. De åt djur, insekter och växter. När ett antal samlare och jägare blev bofasta, fortsatte de jaga djur och samla växter, men inte för att äta (i alla fall inte omedelbart). I Mesopotamien, vår nu globala civilisations vagga, gick det att skörda vidsträckta fält av vild spannmål. Till skillnad från kött och de flesta vilda växter, kan spannmål lagras utan någon intensiv teknologi. Den lades i enorma magasin. Men spannmål skördas efter säsong, så när folkmängder växer blir de mer beroende av spannmålsmagasin än av vad som finns fritt tillgängligt. Det är här distributionen kommer in. Spannmålsmagasinen ägdes av eliter eller familjeäldre, och de bestämde över fördelningen och distributionen till folket som tjänade dem. Beroende medför kompromiss, och det är ett centralt element inom domesticering. Spannmål måste lagras, och ägarna till magasinen lagrar och fördelar spannmålet i utbyte mot ökad social status. Social status medför tvångsmakt. Så uppstod Staten.
På andra ställen, t ex längs vad som nu är USA’s nordvästra kust upp in i Kanada, fylldes magasinen med torkad fisk istället för spannmål. Kungadömen och strikta hövdingadömen uppstod. Det var de som fyllde magasinen som fick kontroll över den uppstådda makten. Det här borde låta bekant. Expansiva handelsnätverk bildades, och domesticeringen av först växter och sen djur följde i befolkningsökningens spår. Behovet av mer spannmål gjorde att samlare blev jordbrukare. Jordbrukarna behövde mer land, och krig utkämpades. Soldater värvades, slavar infångades, och nomadiska samlare och jägare, och hortikulturalister trycktes bort och dödades. Folket gjorde inte allt detta bara därför att deras kungar och hövdingar sa så, utan för att deras skapade gudar sa så. Prästerna var lika viktiga för statens uppkomst som hövdingar och kungar. Vid vissa tillfällen var de i samma ställning, vid andra inte, men de levde av varandra. Ekonomi, politik och religion har alltid varit ett och samma system. Nu för tiden har vetenskapen tagit religionens roll. Det är därför som Engels kunde säga att arbete är vad som skilde människor från apor. För vetenskapligt sett kunde det lätt vara sant. Gud dömde Adam och Evas ättlingar till att betvinga jorden. Båda synsätten handlar bara om tro. Och tro uppstår lätt när den påbjuds av handen som föder en. Så länge som vi är beroende av ekonomi, kommer vi kompromissa med vad växterna och djuren säger oss, och med vad våra kroppar säger oss. Ingen vill arbeta, men ändå är det något man måste göra, för så är det bara.
Så ser vi genom civilisationens tunnelseende. Ekonomin behöver reformeras eller revolutioneras. Produktionens frukter behöver omfördelas.
\emph{Det är här klasskampen kommer in.}
Klass är en av flera sorters relationer inom civilisationen. Det har ofta hävdats att civilisationens historia är historien om klasskamp. Men jag skulle hävda annorlunda. Relationen mellan bonde och kung, och mellan hövding och ofrälse, kan inte reduceras till en enda uppsättning kategorier. När vi gör det ignorerar vi de skillnader som hör till en mängd olika aspekter inom civilisationen. Förenkling är trevligt och frestande, men om vi ska förstå hur civilisationen uppstod, så att vi kan förstöra den, måste vi vara öppna för att förstå subtila och betydande skillnader. Vad kan vara mer betydande än hur makt skapas, upprätthålls och hävdas? Jag menar inte att nedvärdera det mycket verkliga motstånd som ”underklassen” har gjort mot olika eliter, långt ifrån. Men att säga att klass eller klassmedvetande är universellt bortser från viktiga detaljer. Klass handlar om kapitalism. Det handlar om ett globaliserande system som grundar sig på absolut förmedling och specialisering. De uppstod ur feodala förhållanden genom handelskapitalism, in i industriell kapitalism, och nu modernitet. Proletärer, borgare, bönder, småborgare, är sociala klasser som rör vår relation till produktion och distribution. Speciellt i kapitalistiska samhällen handlar allt om detta. Allt det här var som tydligast under kapitalismens höjdpunkt. Du antingen arbetade i en fabrik, ägde den, eller sålde det som kom ut ur den. Det var klassmedvetandets höjdpunkt, just eftersom det inte fanns något tvivel om klasserna. Proletärer befann sig under samma villkor, och till största delen visste de också att det var där de alltid skulle stanna. De tillbringade sina dagar och nätter i fabriker, medan de borgerliga övre samhällsskikten alltid var tillräckligt när att känna lukten men inte smaken av. Oavsett om du trodde på Gud, Smith, eller Engels, så var det arbetet som var ditt innersta väsen. Det var det som gjorde dig till människa. Att få ditt arbete stulet från dig måste ha varit det värsta av alla brott. Arbetarna skötte maskinerna, och det var också inom deras räckhåll att ta över dem. De kunde göra sig av med chefen och sätta in en ny, eller sätta in ett arbetarråd.
För den som trodde att produktion var något nödvändigt var det här revolutionerande. I synnerhet därför att det var fullständigt möjligt. Några provade det. Vissa av dem lyckades. Många lyckades inte. De flesta revolutioner anklagades för att ha svikit sina skapares ideal. Men inte någonstans gjorde det proletära motståndet helt slut på förtryckande relationer. Den enkla anledningen är att de var inne på fel spår. Kapitalism är bara en form av förtryck, och inte dess källa. Produktion och industrialism är delar av civilisationen, ett arv mycket äldre och långt mer rotat än kapitalismen. Men frågan handlar egentligen om identitet. Klasskämparna accepterade sitt öde som producenter, men försökte göra det bästa av en redan dålig situation. Civilisationen kräver en sådan trohet, men det är ett öde som jag inte kommer acceptera. Och det är ett öde som Jorden inte kommer acceptera.
Klasskampens oundvikliga slutsats är begränsad, därför att den grundar sig i ekonomi. Klass är en social relation, men den är knuten till den kapitalistiska ekonomin. Proletärer definieras som folk som säljer sitt arbete, och proletär revolution handlar om att ta tillbaka sitt arbete. Men jag köper inte Guds, Smiths, eller Engels myter. Arbete och produktion är inte universellt, och det är civilisationen som är problemet.
Det vi måste lära oss är att länken mellan våra egna klassrelationer och tidigare civilisationers sådana, inte handlar om vem som säljer och vem som köper arbete, utan om själva existensen av produktion. Om hur vi började tro att det är rättfärdigat att tillbringa våra liv med att bygga makt som utövas mot oss. Om hur kompromissandet av våra liv som fria varelser, till att bli arbetare och soldater, blev en kompromiss vi var villiga att göra. Det handlar om civilisationens materiella villkor, och rättfärdigandet av dessa, därför att det är så vi kommer att kunna förstå civilisationen. Så att vi kan förstå vad domesticeringen kostar oss själva och Jorden. Så att vi kan förstöra den en gång för alla. Det är det som den anarko-primitivistiska kritiken av civilisationen försöker göra. Den handlar om att förstå civilisationen, och hur den skapas och upprätthålls. Kapitalism är ett sent stadium i civilisationen, och klasskampen som motstånd mot den ordningen är extremt viktig, både för vår förståelse av civilisationen och hur vi ska angripa den. Det finns ett rikt arv av motstånd mot kapitalismen. Det är en av flera delar av historien om motstånd mot makten, som går tillbaka till dess ursprung. Men vi måste vara vaksamma mot att se något stadium som det enda stadiet. Anti-kapitalistiska angrepp är just det, anti-kapitalistiska. De är inte anti-civilisatoriska. De berör en viss typ av ekonomi, inte ekonomin, produktionen eller industrialismen i sig själva. En förståelse av kapitalismen är endast användbar så länge den är historiskt och ekologiskt rotad.
Men kapitalismen har varit den huvudsakliga måltavlan för de gångna århundradenas motstånd. Som sådant är klasskampens grepp uppenbarligen inte lätt att gå vidare från. En global kapitalism var väl rotad vid år 1500 e kr, och fortsatte sedan genom de senaste 500 årens teknologiska, industriella, och gröna revolutioner. Med en teknologisk uppgång har den spridits över planeten, till en punkt där det nu finns endast en global civilisation. Men kapitalismen är fortfarande inte universell. Om vi ser världen som en scen för klasskamp ignorerar vi de många fronter av motstånd som uttryckligen kämpar mot civilisationen. Detta är något som klasskampens förespråkare så typiskt ignorerar. Men på sätt och vis är det endast ett av två huvudsakliga problem. Det andra problemet är förnekandet av moderniteten.
Moderniteten är den sena kapitalismens ansikte, och det är det ansiktet som vi har sett sprida sig under de senaste 50 åren. Detta genom en serie av teknologisk expansion, som har gjort den globala ekonomi som vi känner möjlig. Den kännetecknas av hyperteknologi och hyperspecialisering. Vi måste inse att kapitalisterna vet vad de håller på med. Hotet om en proletariatets revolution har troligen aldrig upplevts så starkt som det gjorde under perioden som ledde fram till första världskriget, och sen sträckte sig fram genom andra världskriget. Båda krigen utkämpades delvis för att släcka den revolutionära glöden.
Men det slutade inte där. Kapitalisterna visste att under efterkrigsperioderna måste all form av större återuppbyggnad verka emot nivån av klassmedvetande. Det var viktigt att bryta ner möjligheterna till organisering. Vår globala ekonomi var begriplig, inte bara i ekonomiska, utan också i sociala termer. Klassammanhållningens konkreta verklighet hade skakats. Framför allt så innebar den globala produktionen att en proletariatets revolution inte kunde föda och försörja sig själv. Det var en av de främsta orsakerna till de socialistiska revolutionernas ”misslyckanden” i Ryssland, Kina, Nicaragua och Kuba, för att bara nämna några. Modernitetens struktur är anti-klassmedvetande. I industrialiserade länder är den största delen av arbetsstyrkan serviceorienterad. Folk skulle mycket enkelt kunna ta över ett antal Wal-Marts, men vad skulle det leda till? Den moderna kapitalismens periferi och kärna är helt och hållet spridda över världen. En revolution skulle behöva vara global, men skulle resultatet se något annorlunda ut när allt kommer omkring? Skulle det bli någonting mer önskvärt?
I utvecklingsländerna, som tillgodoser nästan alla behov de industrialiserade länderna har, är klassmedvetandets verklighet väldigt påtaglig. Men situationen är mycket densamma som här. Vi har polis och vi vet vår plats, de har en vardagsverklighet fylld av militära ingripanden. Hotet om statlig vedergällning är mycket verkligare, och kärnstaternas makt att hålla dessa folk på plats är något som de flesta av oss antagligen inte kan förställa oss. Men även om en revolt skulle lyckas; vad ska de med slavlönefabriker och monokulturella åkrar till? Problemet går mycket djupare än vad som kan uppnås genom att omstrukturera produktionen. Och sett till industriländerna, så går problemet ännu djupare än så. Modernitetens anda är extremt individualistisk. Även om det faktumet i sig själv förstör allt som det innebär att vara människa, så är det just den vi har emot oss. Den är som lottokapitalism; var och en tror på sin egen möjlighet att bli rik. Vi håller bara på att leta efter vinstlotten. Vi vill mer än gärna bli rika, och vi är beredda att försöka tills vi dör.
Den postmoderna utgångspunkt som definierar vår verklighet, säger oss at vi inte har några rötter. Den matar den passiva nihilism som påminner oss om att vi är körda, men att det inte går att göra någonting åt det. Så sa Gud, Smith och Engels, och numera påminner oss filmer, musik och marknaden om detta.
Sanningen är att i den här kontexten så har den proletära identiteten inte mycket mening. Klasser existerar fortfarande, men inte i någon revolutionär kontext. Studie efter studie visar att de flesta amerikaner ser sig själva som medelklass. Vi dömer efter vad vi äger snarare än vad vi är skyldiga kreditbolaget. Lånade och imaginära pengar föder en identitet och en kompromiss – att vi är villiga att sälja vår själ för mer prylar.
Vår verklighet går djupare än vad en proletär identitet kan svara mot. Den anti-civilisatoriska kritiken pekar mot en mycket mer ursprunglig källa till våra förhållanden än så. Den accepterar inga myter om nödvändig produktion eller arbete, utan söker efter ett sätt att leva där dessa saker inte bara är frånvarande, utan där de också är medvetet undantryckta.
Den kanaliserar någonting som mer och mer upplevs som att moderniteten automatiserar livet. Medan utvecklingen förstör de återstående ekosystemen, medan produktionen ger oss ett fullständigt syntetiskt liv, medan livet förlorar mening, medan Jorden dödas.
\emph{Jag förespråkar primalkrig.}
Men det här är inte ett slags anti-civilisatoriskt klasskrig. Det är inte ett verktyg för organisering, utan ett uttryck av vrede. En sorts vrede som känns vid varje steg i den domesticerande processen. En sorts vrede som det inte kan sättas ord på. Det ursprungliga jagets vrede, som har underkuvats av produktion och tvång. Den sortens vrede som inte kompromissar. Den sortens vrede som kan krossa civilisationen.
\emph{Det är en fråga om identitet.}
Är du producent, distributör, ägare, eller människa? Och framför allt, vill du omorganisera civilisationen och dess ekonomi, eller kommer du inte nöja dig med något mindre än dess totala förstörelse?
[1]\textbf{Modernitet} är ett begrepp som betecknar den samhällsordning som växte fram ur upplysningen, baserat på rationella\Slash{}vetenskapliga principer, individuella rättigheter och etablerade politiska system.
% begin final page
\clearpage
% new page for the colophon
\thispagestyle{empty}
\begin{center}
Det Anarkistiska Biblioteket
\bigskip
\includegraphics[width=0.25\textwidth]{logo-sv.pdf}
\bigskip
\end{center}
\strut
\vfill
\begin{center}
Kevin Tucker
Att producera eller inte producera?
Klass, modernitet[1] och identitet
\bigskip
\bigskip
\textbf{sv.theanarchistlibrary.org}
\end{center}
% end final page with colophon
\end{document}
|
http://popov.math.mrsu.ru/files/auto.tex
|
mrsu.ru
|
CC-MAIN-2017-39
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2017-39/segments/1505818689192.26/warc/CC-MAIN-20170922202048-20170922222048-00308.warc.gz
| 276,860,676
| 14,901
|
\documentstyle[12pt,russian,cyrsam,amsfonts,amssymb,emlines]{mrep}
\pagestyle{headings}
\makeatletter
% Изменить колонтитулы
\renewcommand{\@oddhead}{\normalsize\centerline\thepage}
\renewcommand{\@oddfoot}{}
\makeatother
% Страницы могут быть неодинаковыми
\raggedbottom
%\textwidth=114mm
%\textheight=150mm
\textwidth=164mm
\textheight=250mm
%\setlength{\parsep}{0mm}
%\setlength{\itemsep}{-10mm}
%\textwidth=152mm
%\textheight=240mm
\newcommand{\cyr}{\rm}
\newcommand{\cyrit}{\it}
\newcommand{\cyrbold}{\bf}
\newcommand{\bdot}{$\!\!${\bf .}$\,$}
%\newcommand{\Nom}{\char125}
\newcommand{\Nn}{{\rm N}}
\newcommand{\cA}{{\cal A}}
\newcommand{\cQ}{{\cal Q}}
\newcommand{\cM}{{\cal M}}
\newcommand{\AAA}{{\bf A}}
\newcommand{\KKK}{{\rm K}}
\newcommand{\BB}{{\bf B}}
\newcommand{\rB}{{\rm B}}
\newcommand{\NNN}{{\mathbb N}}
\newcommand{\SSS}{{\mathbb S}}
\newcommand{\rr}{{\bf r}}
\newcommand{\pp}{{\bf p}}
\newcommand{\bxi}{{\vec\xi}}
\newcommand{\bgamma}{{\vec\gamma}}
\newcommand{\blambda}{{\vec\lambda}}
\newcommand{\bkappa}{{\vec\kappa}}
\newcommand{\ii}{{\bf i}}
\newcommand{\jj}{{\bf j}}
\newcommand{\kk}{{\bf k}}
\newcommand{\ee}{{\bf e}}
\newcommand{\uu}{{\bf u}}
\newcommand{\vv}{{\bf v}}
\newcommand{\RR}{{\mathbb R}}
\newcommand{\RRR}{{\cal R}}
\newcommand{\TT}{{\mathbb T}}
\newcommand{\ZZ}{{\mathbb Z}}
\newcommand{\CC}{{\mathbb C}}
\newcommand{\DD}{{\cal D}}
\newcommand{\KK}{{\cal K}}
\newcommand{\HH}{{\cal H}}
\newcommand{\FF}{{\cal F}}
\newcommand{\VV}{{\bf V}}
\newcommand{\black}{\rule{7pt}{7pt}}
\newcommand{\dg}{{\rm diag\,}}
\newcommand{\rang}{{\rm rang\,}}
\newcommand{\Res}{{\rm Res\,}}
\newcommand{\rot}{{\rm rot\,}}
\newcommand{\Lin}{{\rm Lin\,}}
\newcommand{\RRe}{{\rm Re\,}}
\newcommand{\IIm}{{\rm Im\,}}
\newcommand{\ch}{{\rm ch\,}}
\newcommand{\sh}{{\rm sh\,}}
\newcommand{\th}{{\rm th\,}}
\newcommand{\tg}{{\rm tg\,}}
%\newcommand{\ind}{{\rm def\,}}
\newcommand{\ind}{n}
\newcommand{\mdiv}{{\rm div\,}}
\newcommand{\sgn}{{\rm sgn\,}}
\newcommand{\note}{{\cyrbold Замечание }}
\newcommand{\vr}{{\vec r}}
\newcommand{\eps}{{\varepsilon}}
\newcommand{\NN}{{\cal N}}
\newcommand{\MM}{{\cal M}}
\newcommand{\GG}{{\cal G}}
\newcommand{\LL}{{\cal L}}
\newcommand{\Ran}{{\rm Ran\,}}
\newcommand{\Ker}{{\rm Ker\,}}
\newcommand{\aaa}{{\bf a}}
\newcommand{\xx}{{\bf x}}
\newcommand{\yy}{{\bf y}}
\newcommand{\dd}{\partial}
\newcommand{\mod}{\mbox{\rm mod\, }}
\newcommand{\grad}{\mbox{\rm grad\, }}
\renewcommand{\hat}{\widehat}
\renewcommand{\phi}{\varphi}
\renewcommand{\tilde}{\widetilde}
\renewcommand{\cap}{\bigcap}
\renewcommand{\cup}{\bigcup}
\renewcommand{\leq}{\leqslant}
\renewcommand{\geq}{\geqslant}
\renewcommand{\le}{\leqslant}
\renewcommand{\ge}{\geqslant}
\newcommand{\bb}{{\bf b}}
\renewcommand{\baselinestretch}{1.23}
\newcommand{\ov}{\overline}
\newcommand{\ovalpha}{\tilde\alpha}
\newcommand{\ovbeta}{\tilde\beta}
\newcommand{\ovgamma}{\tilde\gamma}
\newcommand{\limdown}{\lim\limits_{x\downarrow 0}}
\newcommand{\limdownr}{\lim\limits_{\rho\downarrow 0}}
\newcommand{\limiinf}{\lim\limits_{x\to-\infty}}
\newcommand{\sm}{\setminus}
\newcommand{\bs}{\setminus\{0\}}
\newcommand{\longra}{\longrightarrow}
\renewcommand{\Box}{{\mbox{\cyrbold Доказательство. }}}
\newtheorem{prop}{\cyrbold Предложение}[chapter]
\newtheorem{lem}{\cyrbold Лемма}[chapter]
\newtheorem{teor}{\cyrbold Теорема}[chapter]
%\newtheorem{prop}{\cyrbold Предложение}
%\newtheorem{lem}{\cyrbold Лемма}
%\newtheorem{teor}{\cyrbold Теорема}
\newtheorem{corteor}{\cyrbold Следствие}[teor]
\newtheorem{corprop}{\cyrbold Следствие}[prop]
\newtheorem{corlem}{\cyrbold Следствие}[lem]
\renewcommand{\thelem}{\thechapter.\arabic{lem}}
\renewcommand{\theteor}{\thechapter.\arabic{teor}}
\renewcommand{\theprop}{\thechapter.\arabic{prop}}
\renewcommand{\thecorteor}{\arabic{corteor}}
\renewcommand{\thecorprop}{\arabic{corprop}}
\renewcommand{\thecorlem}{\arabic{corlem}}
\begin{document}
%\large\cyr
%\pagestyle{headings}
\addtolength{\baselineskip}{1pt}
\addtolength{\parindent}{5.2mm}
%----------------------------------------------------------------------
\thispagestyle{empty}
%\centerline{\small\cyr Мордовский государственный университет имени Н.П.Огарева}
%\vskip 0mm
%\noindent{\vrule height5pt width102mm depth-4.6pt}
\ \
\vskip 20mm
\hfill{\large\cyr На правах рукописи}
%\hfill{\large\cyr УДК 538.9:517.98}
\vskip 25mm
\centerline{\large\cyr ПОПОВ АНДРЕЙ ВЛАДИМИРОВИЧ}
\vskip 15mm
\centerline{\large\cyr СПЕКТРАЛЬНЫЕ СВОЙСТВА ПЕРИОДИЧЕСКИХ}
\vskip 2mm
\centerline{\large\cyr МАССИВОВ КВАНТОВЫХ ТОЧЕК И КОЛЕЦ }
\vskip 2mm
\centerline{\large\cyr В МАГНИТНОМ ПОЛЕ}
\vskip 15mm
\centerline{\large\cyr Специальность 05.13.18 - теоретические основы }
%\vskip -2mm
\centerline{\large\cyr математического моделирования, численные }
%\vskip -2mm
\centerline{\large\cyr методы и комплексы программ}
\vskip 15mm
\centerline{\large\cyr АВТОРЕФЕРАТ}
\centerline{\large\cyr диссертации на соискание ученой степени}
\centerline{\large\cyr кандидата физико-математических наук }
\vskip 45mm
\centerline{\large Саранск - 2000}
%----------------------------------------------------------------------------
\newpage
\thispagestyle{empty}
%\addtolength{\baselineskip}{3.2pt}
%\addtolength{\baselineskip}{2.8pt}
\large
\begin{center}
Работа выполнена в Мордовском
государственном университете
\end{center}
\begin{center}
имени Н.П.Огарева
\end{center}
\vskip 8mm
\noindent Научный руководитель: \hfill{кандидат физико-математических наук,}
\noindent \hfill{доцент В.А. Гейлер}
\vskip 8mm
\noindent Официальные оппоненты: \hfill{доктор физико-математических наук,}
\leftskip 33mm
\noindent \hfill{профессор В.В. Учайкин}
\vskip 8mm
\noindent \hfill{кандидат физико-математических наук,}
\noindent \hfill{Н.П. Тихонова}
\vskip 8mm
\leftskip 0mm
\noindent Ведущая организация: \hfill{Санкт-Петербургский государственный}
\hfill{Институт точной механики и оптики}
\leftskip 44mm
\noindent \hfill{(Технический университет)}
\leftskip 0cm
\vskip 8mm
Защита диссертации состоится
"14" декабря 2000~г. в 10 ч. 00 мин.
на заседании диссертационного совета К 053.37.06 в Ульяновском
государственном университете по адресу: 432700, Набережная р. Свияги,
ауд. 701
\vskip 3mm
С диссертацией можно ознакомиться в Научной библиотеке Ульяновского
государственного университета.
\vskip 6mm
Автореферат разослан "\ \ \ \ \ " ноября 2000~г. Отзывы на автореферат
просим присылать по адресу: 432700, г.Ульяновск, ул. Л.Толстого, 42, УлГУ.
\vskip 10mm
\noindent Ученый секретарь диссертационного
\noindent совета К 053.37.06 кандидат
\noindent физико-математических наук, доцент \hfill Е.П. Чирко
%----------------------------------------------------------------------------
\newpage
%\small
\centerline{\cyr ОБЩАЯ ХАРАКТЕРИСТИКА РАБОТЫ}
\bigskip
{\bf \underline{Актуальность темы}.}
Интерес к периодическим системам в магнитных полях резко возрос за
последние годы среди специалистов как по математической, так и по
теоретической физике. Интерес физиков-теоретиков к таким
системам в последние полтора десятилетия обуславливался
необычайно важными экспериментальными открытиями, такими как квантовый
эффект Холла (Нобелевская премия 1985~г.);
квантовый биллиард в периодических массивах квантовых
антиточек; экспериментальное обнаружение фрактальной структуры
спектра (бабочка Хофштадтера) в периодических массивах квантовых точек
и др. Строгое математическое обоснование теоретических
построений физиков, связанных с объяснениями этих экспериментов, потребовало
привлечения мощных методов алгебраической топологии, спектрального анализа,
некоммутативной геометрии и др.
При этом немалую роль в построении общей теории для указанных
выше экспериментов и в анализе других свойств периодических систем
в магнитных полях играют получаемые в тех или иных приближениях различные
явнорешаемые модели. В связи с этим
построение явнорешаемых математических моделей периодических
квантовых систем при наличии магнитного поля и исследование их
энергетического спектра представляется весьма актуальным.
{\cyrbold \underline{Цель работы.}}
1. Построение самосопряженных операторов,
являющихся модельными гамильтонианами периодических
массивов квантовых точек и одномерных квантовых колец с вихрями
Ааронова--Бома, находящихся во внешнем однородном магнитном поле.
2. Аналитическое и численное исследование структуры спектра построенных
гамильтонианов.
Для достижения основной цели работы потребовалось решить
следующие задачи,
вспомогательные по отношению к указанным выше, но тем не менее
представляющие и самостоятельный интерес.
3. Построение всех самосопряженных расширений одного класса симметрических
операторов, выделение из них расширения по Фридрихсу,
которое можно считать гамильтонианом двумерного квантового кольца,
находящегося в однородном магнитном поле в присутствии
соленоида Ааронова--Бома, и исследование его спектра.
4. Разложение построенных гамильтонианов указанных выше периодических систем
в прямые интегралы по спектру неприводимых представлений дискретной группы
магнитных трансляций и исследование спектра слоя в полученных разложениях.
{\cyrbold \underline{Общая методика исследования}} основана на применении методов
теории самосопряженных расширений симметрических операторов в гильбертовых
пространствах, теории представлений групп и техники разложения
периодического оператора в прямой интеграл по тору квазиимпульсов.
{\cyrbold \underline{Научная новизна и значимость}} работы определяются
следующими основными результатами.
1. Описаны все самосопряженные расширения одного класса симметрических
операторов, из них выделено расширение по Фридрихсу,
которое можно считать гамильтонианом двумерного квантового кольца,
находящегося в однородном магнитном поле в присутствии
соленоида Ааронова--Бома. Проведен анализ спектра этого гамильтониана
для всех возможных значений параметров модели.
2. С помощью теории самосопряженных расширений построены операторы
энергии двух периодических квантовых систем на плоскости, находящихся в
магнитном поле: массивов квантовых точек и квантовых колец, причем
впервые для моделей такого типа учитывалась не только однородная составляющая
магнитного поля, но и поле, создаваемое периодической системой соленоидов
Ааронова--Бома.
3. Проведено аналитическое и численное исследование структуры спектра
построенных гамильтонианов. Получены условия, налагаемые на величину
магнитного потока, которые определяют зонную или канторовскую структуру
энергетического спектра. Доказано появление в рассматриваемых
системах собственных значений, погруженных в непрерывный спектр, и
вырожденных подзон. Построены диаграммы поток--энергия.
{\cyrbold\underline{Положения, выносимые на защиту.}}
1. Найдены все самосопряженные расширения одного класса симметрических
операторов, из них выделено расширение по Фридрихсу,
которое можно считать гамильтонианом двумерного квантового кольца,
находящегося в однородном магнитном поле в присутствии
соленоида Ааронова--Бома, и исследован спектр этого гамильтониана.
2. Построены операторы
энергии двух квантовых систем, находящихся во внешнем однородном
магнитном поле:
гамильтониан $H^{arr}$ периодического массива квантовых точек с вихрями
Ааронова--Бома и гамильтониан $H_A$ периодической системы квантовых колец
Ааронова--Бома.
3. Для случая, когда поток однородного поля через элементарную
ячейку кристаллической решетки системы рационален, получено
разложение
гамильтониана $H^{arr}$ в прямой интеграл по спектру неприводимых
представлений дискретной группы магнитных трансляций, найден спектр
слоя этого разложения над произвольной точкой тора квазиимпульсов. Доказана
зонная структура спектра оператора $H^{arr}$, построены диаграммы
поток--энергия.
4. В случае квадратной решетки доказана фрактальная структура спектра
оператора $H^{arr}$ для почти всех иррациональных значений потока.
Доказано существование у оператора $H^{arr}$
собственных значений, погруженных в его непрерывный спектр.
5. Для случая рационального потока и квадратной кристаллической
решетки получено разложение гамильтониана $H_A$ в прямой интеграл по спектру
неприводимых представлений дискретной группы магнитных трансляций, найден
спектр слоя этого разложения над произвольной точкой тора
квазиимпульсов. Доказана зонная структура спектра оператора $H_A$,
получена оценка на количество подзон в каждой зоне.
6. Доказано существование при целом потоке у гамильтониана $H_A$
вырожденных подзон (локализованных состояний).
{\cyrbold \underline{Практическая значимость.}}
Работа носит теоретический характер. Полученные результаты могут представлять
интерес как для специалистов по квантовой теории твердого тела, так и
для специалистов по спектральной теории самосопряженных операторов.
{\cyrbold \underline{Структура и объем диссертации.}}
Диссертация состоит из введения,
четырех глав и заключения. Материал работы, изложенный на 179 страницах
машинописного текста, включает 19 рисунков и список литературы, содержащий
112 наименований.
{\cyrbold \underline{Апробация работы.}}
Основные результаты диссертации докладывались на четвертой
международной конференции по разностным уравнениям и их приложениям
(Познань, 1998 г.), на международной конференции "Физика на пороге 21 века"
(Санкт-Петербург, 1998 г.), на научных межвузовских конференциях
"Математическое моделирование и краевые задачи" (Самара, 1998, 2000 гг.),
на международной конференциях "Дифференциальные уравнения и их
приложения" (Саранск, 1998, 2000 гг.), на {\rm II}
Уральской региональной межвузовской
научно-практической конференции "Проблемы физико-математического образования
в ВУЗах России" (Уфа, 1997 г.), на второй международной научно-технической
конференции "Проблемы и прикладные вопросы физики" (Саранск, 1999 г.),
на региональной научно-практической конференции "Критические технологии
в регионах с недостатком природных ресурсов" (Саранск, 1999 г.), на
конференциях молодых ученых Мордовского госуниверситета (Саранск,
1996--1998 гг.), на Огаревских чтениях (Саранск, 1998--2000 гг.).
{\cyrbold \underline{Личное участие автора.}} Исходные теоретические
положения разработаны совместно с В.А. Гейлером. Доказательство основных
теорем, численные расчеты и анализ результов проведены автором
самостоятельно.
{\cyrbold \underline{Публикации.}}
Основные результаты работы отражены в двадцати публикациях.
%---------------------------------------------------------------------------
\newpage
\bigskip
\centerline{\cyr КРАТКОЕ СОДЕРЖАНИЕ РАБОТЫ}
\normalsize
\smallskip
{\cyrbold Во введении} проводится обоснование актуальности темы диссертации,
дается краткий обзор работ по ее тематике, формулируются основные результаты,
полученные в диссертации.
{\cyrbold Первая глава} носит вспомогательный характер, в ней описывается
используемый нами в дальнейшем метод построения и спектрального исследования
явнорешаемых решеточных моделей "с внутренней структурой", который
был предложен Б.С.Павловым. Гамильтониан периодической системы, находящейся в однородном магнитном
поле, строится с помощью формулы М.Г.Крейна для резольвент теории
самосопряженных расширений симметрических операторов. Для анализа
спектра построенного гамильтониа используется гармонический анализ на так
называемой дискретной группе магнитных трансляций, которая является группой
инвариантности этого оператора.
Во {\bf второй главе } рассматривается симметрический оператор
$\displaystyle H_d^0=\sum\limits_{m\in\ZZ}\!{}^\oplus H_m\otimes
I^{(\phi)}_m$, где $I^{(\phi)}_m$ -- тождественный оператор в натянутом
на функцию $\displaystyle e^{im\phi}$ одномерном пространстве $L_m$,
а действующий в $L^2(\RR_+,\rho d\rho)$ оператор $H_m$ с областью определения
$C_0^\infty(\RR_+)$ имеет следующий вид:
$$
H_m=-\frac{1}{\rho}\frac{\partial}{\partial\rho}\rho
\frac{\partial}{\partial\rho}+\frac{(m+\Phi)^2+\beta_0}{\rho^2}+
\sigma\rho^2+\frac{\omega_c}{2}(m+\Phi),
$$
где параметры $\Phi$, $\beta_0$, $\sigma$ и $\omega_c$ могут быть любыми
действительными неотрицательными числами. Нетривиальные самосопряженные
расширения имеют лишь парциальные операторы $H_m$, для которых
$0\le (m+\Phi)^2+\beta_0<1$. Эти расширения описываются теоремой 2.6.
\noindent
{\bf Теорема 2.6.} {\it
Пусть $\mu_m=\sqrt{(m+\Phi)^2+\beta_0}$, $\Omega=4\sqrt{\sigma}$.
При $0\leq\mu_m<1$ заданный в $L^2(\RR_+,\rho d\rho)$ оператор $H_m$
с областью определения $C_0^\infty(\RR_+)$
является положительным симметрическим оператором с индексами дефекта
$n_+=n_-=1${\rm ;} дефектное пространство $\NN_z(H_m)$
порождено функцией
$$\psi(\rho;z)=e^{-\Omega\rho^2/8}\left(\sqrt{\frac{\Omega}{2}}\rho\right)^{\mu_m}
\Psi\left(\frac{\mu_m+1}{2}-
\tilde z,1+\mu_m;\frac{\Omega\rho^2}{4}\right),
$$
где
$$\tilde z=\frac{z-\omega_c(m+\Phi)/2}{\Omega}.
$$
При этом справедливы следующие утверждения.\rm
\begin{enumerate}
\item\it Граничная тройка оператора $H^*_m$ может быть
определена в виде $\{\CC,\tilde\Gamma_1,\tilde\Gamma_2\}$, где операторы
$\tilde\Gamma_1,\tilde\Gamma_2:L^2(\RR_+,\rho d\rho)\to\CC$, заданы
следующими формулами\rm:
$$
\tilde\Gamma_1\phi=\cases{\displaystyle
\limdownr\left(\frac{2}{\mu_m}\rho^{1-\mu_m}\phi'\left(
\frac{\Omega\rho^2}{4}\right)+\frac{\rho^{-\mu_m}}{2}\phi\left(
\frac{\Omega\rho^2}{4}\right)+\rho^{\mu_m}\phi\left(
\frac{\Omega\rho^2}{4}\right)\right),\cr
\mbox{\it если }0<\mu_m<1,\cr
\displaystyle\limdownr\left(\rho^2 \ln\rho\phi'\left(
\frac{\Omega\rho^2}{4}\right)-\phi\left(
\frac{\Omega\rho^2}{4}\right)\right),\;\mbox{\it если }\mu_m=0,}
$$
$$
\tilde\Gamma_2\phi=\cases{\displaystyle
\limdownr 2\mu_m\rho^{\mu_m}\phi\left(
\frac{\Omega\rho^2}{4}\right),\;\mbox{\it если }0<\mu_m<1,\cr
\displaystyle\limdownr \rho^2\phi'\left(
\frac{\Omega\rho^2}{4}\right),\;\mbox{\it если }\mu_m=0;}
$$
\item\it Соответствующая функция Вейля $\tilde M_m(z)$ вычисляется по
формуле\rm
$$
\tilde M_m(z)=\cases{\displaystyle
\left(\frac{\Omega}{4}\right)^{\mu_m}
\frac{\Gamma(-\mu_m)}{2\Gamma(\mu_m+1)}\cdot
\frac{\Gamma((1+\mu_m)/2-\tilde z)}{\Gamma((1-\mu_m)/2-\tilde z)}+
\frac{1}{\mu_m}
\;\mbox{\it при }0<\mu_m<1,\cr
\displaystyle -\frac{1}{2}\left(\psi(1/2-\tilde z)+\ln\frac{\Omega}{4}+2C_E\right)\;
\mbox{\it при }\mu_m=0.}
$$
\item\it При фиксированном $z$ функция $\tilde M_m(z)$ непрерывна по
параметру $\mu_m$, $0\leq\mu_m<1$\rm;
\item\it Всякое самосопряженное расширение $\tilde H_{m,\theta}$
оператора $H_m$ характеризуется условиями{\rm:}
$\phi\in\DD(\tilde H_{m,\theta})$
тогда и только тогда, когда $\phi\in\DD(H^*_m)$ и
$$
\tilde\Gamma_1\phi=\theta\tilde\Gamma_2\phi,\;\;\theta\in\ov\RR;
$$
при $\theta=\infty$ граничное условие приобретает
вид $\tilde\Gamma_2\phi=0$, то есть\rm
$$
\limdownr \rho^{\mu_m}\phi\left(\frac{\Omega\rho^2}{4}\right)=0\;\;
\mbox{\it при }0<\mu_m<1,
$$
$$
\limdownr \rho^2\phi'\left(\frac{\Omega\rho^2}{4}\right)=0\;\;
\mbox{\it при }\mu_m=0;
$$
\item\cyrit Расширение $\tilde H_{m,\infty}$
является расширением по Фридрихсу.
\end{enumerate}}
Здесь $\Psi(a,c;x)$ -- вырожденная гипергеометрическая функция Трикоми,
$\Gamma(x)$ -- $\Gamma$-функция Эйлера, $\psi(x)$ -- логарифмическая
производная функции $\Gamma(x)$, $C_E$ -- постоянная Эйлера. Теорема 2.8
определяет в пространстве $L^2(\RR^2)$ самосопряженный оператор $\hat H_d$,
который можно считать гамильтонианом находящегося в однородном магнитном поле
одиночного квантового кольца с вихрем Ааронова--Бома $\Phi$.
\noindent
{\bf Теорема 2.8.} {\it
Обозначим через $\hat H_m$ действующий в пространстве
$L^2(\RR_+,\rho d\rho)$ самосопряженный оператор, определенный
следующим выражением:
$$
\hat H_m=\cases{\tilde H_{m,\infty},\;
\mbox{если }0\leq\mu_m=(m+\Phi)^2+\beta_0<1,\cr
\ov H_m,\;\mbox{в остальных случаях},
}
$$
где операторы $\tilde H_{m,\infty}$ определены в теореме {\rm 2.6.}
Тогда оператор $\hat H_d$,
$$
\hat H_d=\sum\limits_{m\in\ZZ}\!{}^\oplus\hat H_m\otimes I^{(\phi)}_m,
$$
будет самосопряженным оператором в $L^2(\RR^2)$.}
Спектр оператора $\hat H_d$ описывают теоремы 2.9 и 2.10.
\noindent
{\bf Теорема 2.9.} {\it
Числа
$$
E_{mn}=\Omega\left(\frac{\mu_m+1}{2}+n\right)+\frac{\omega_c}{2}
(m+\Phi),
$$
$$
m=0,\pm1,\pm2,\dots;\,n=0,1,2,\dots,
$$
образуют полный набор собственных чисел оператора $\hat H_d$.
Соответствующие им нормированные собственные функции $f_{mn}$ в полярной
системе координат имеют следующий вид:
$$
f_{mn}(\rho,\phi)=\left(\frac{\Omega n!}{4\pi 2^{\mu_m}
\Gamma(\mu_m+n+1)}\right)^{1/2}e^{im\phi}e^{-\Omega\rho^2/8}
\left(\sqrt{\frac{\Omega}{2}}\rho\right)^{\mu_m}L_n^{(\mu_m)}
\left(\frac{\Omega\rho^2}{4}\right),
$$
где $L_n^{(\mu_m)}(x)$ -- полином Лагерра-Сонина степени $n$.}
\noindent
{\bf Теорема 2.10.} {\it
Справедливы следующие утверждения.\rm
\begin{enumerate}
\item\it Пусть $\beta_0=0$, $\omega_0=0$. Если $\Phi\notin\ZZ$, то спектр
$\hat H_d$ чисто
точечный и состоит из собственных чисел $E_{mn}$, которые бесконечно
вырождены, если $m<-\Phi$, и имеют конечную кратность в противном
случае. Если $\Phi\in\ZZ$, то все $E_{mn}$ бесконечно вырождены.\rm
\item\it Если $\omega_0\neq0$, то спектр $\hat H_d$ дискретный и состоит
из собственных чисел $E_{mn}$ конечной кратности.\rm
\item\it Если $\omega_0=0$, но $\beta_0\neq0$, то спектр $\hat H_d$ состоит
из собственных чисел конечной кратности $E_{mn}$ и из точек вида
$\omega_c(n+1/2)$, каждая из которых является предельной точкой спектра
$\hat H_d$. Таким образом, в этом случае
$$
\sigma_{ess}(\hat H_d)=\{\omega_c(n+1/2)\,:\,n=0,1,\dots\},
$$
$$
\sigma_{dis}(\hat H_d)=\{E_{mn}\,:\,m\in\ZZ,n=0,1,\dots\}\setminus
\sigma_{ess}(\hat H_d).
$$
\end{enumerate}}
%-------------------- конец 2 главы ----------------------------------
В первом параграфе {\bf третьей главы} строится гамильтониан $H^{arr}$
периодического массива квантовых точек с вихрями Ааронова--Бома, который
находится во внешнем однородном магнитном поле.
Заметим, что квантовая точка является предельным случаем рассмотренного
во второй главе квантового кольца при нулевом внутреннем радиусе.
В нашем случае
$$
H^{arr}=\left(\sum\limits_{\gamma\in\Gamma}\!{}^\oplus
\tilde H_{m_1}\otimes I_{m_1}^{(\phi)}\right)\oplus
\left(\sum\limits_{\gamma\in\Gamma}\!{}^\oplus
\tilde H_{m_2}\otimes I_{m_2}^{(\phi)}\right)\oplus
\left(\sum\limits_{m\neq m_1,m_2}\!{}^\oplus
\sum\limits_{\gamma\in\Gamma}\!{}^\oplus\ov H_m\otimes I_m^{(\phi)}\right),
$$
где $m_1=-[\Phi]$, $m_2=-[\Phi]-1$. Отметим, что мы рассматривали только
случай нецелого потока Ааронова--Бома $\Phi$, так как гамильтониан $H^{arr}$
при $\Phi\in\ZZ$ унитарно эквивалентен изученному в работах Б.С.Павлова,
В.А.Гейлера и И.Ю.Попова оператору $H^{arr}$ с нулевым потоком $\Phi$.
Во втором параграфе мы исследуем спектр построенного гамильтониана.
Далее везде символом $\eta$ будем обозначать поток внешнего однородного
магнитного поля через элементарную ячейку векторов трансляции системы.
Если $\eta=N/M$, где $N$ и $M$ -- взаимно простые числа, то через
$\TT^2_\eta$ будем обозначать двумерный тор, полученный склеиванием
прямоугольника $[0,M^{-1})\times[0,1)$. В случае рационального потока $\eta$
для анализа спектра операторов $H^{arr}_{(m_j)}$, $j=1,2$, мы разлагаем
унитарно эквивалентные им операторы $\tilde H^{arr}_{(m_j)}$ в прямые
интегралы операторов над тором $\TT^2_\eta$,
$$
\tilde H^{arr}_{(m_j)}=\int\limits_{\TT^2_\eta}\!{}^\oplus
\tilde H^{arr}_{(m_j)}(\pp)\,d\pp.
$$
Пусть $\Gamma=\Lambda+\KKK$,
где $\KKK=\{\kappa_1,\dots,\kappa_K\}$.
Спектр оператора $\tilde H^{arr}_{(m_j)}(\pp)$ над произвольной точкой
$\pp\in\TT^2_\eta$ описывает теорема 3.2.
%--------------------------------------------------------------------
% Массив точек, рациональный поток, спектр слоя
\noindent
{\bf Теорема 3.2.} {\it Пусть точка $\pp$, $\pp\in\TT^2_\eta$, фиксирована.
Если поток $\eta$ внешнего однородного магнитного поля через
элементарную ячейку решетки $\Lambda$ рационален, $\eta=N/M$, то
спектр оператора $\tilde H^{arr}_{(m_j)}(\pp)$, $j=1,2$, дискретный и
состоит из собственных значений $E^{(m_j)}_n(\pp)$, $n\geq0$.
Собственное подпространство оператора $\tilde H^{arr}_{(m_j)}(\pp)$,
соответствующее
собственному значению $E^{(m_j)}_n(\pp)$, есть образ подпространства
$N^{(m_j)}_n(\pp)$,
$$
N^{(m_j)}_n(\pp)=\Ker\left[\tilde Q_{(m_j)}(E^{(m_j)}_n(\pp))-
\tilde A(\pp)\right],
$$
под действием инъективного отображения
$$
\tilde\rB_{(m_j)}\left(\pp;E^{(m_j)}_n(\pp)\right):
\CC^M\otimes\CC^M\otimes l^2(\KKK)\to
\CC^M\otimes\CC^M\otimes l^2(\KKK)\otimes L^2(\RR_+,\rho d\rho);
$$
следовательно, каждое собственное
значение $E^{(m_j)}_n(\pp)$ вырождено с кратностью $d^{(m_j)}_n(\pp)$,
где $d^{(m_j)}_n(\pp)$ -- размерность подпространства $N^{(m_j)}_n(\pp)$
в $\CC^M\otimes\CC^M\otimes l^2(\KKK)$.}
Сгруппируем собственные числа $E^{(m_j)}_n(\pp)$, $n\geq0$,
в серии $E^{(m_j)}_{l,\kappa,i}(\pp)$ $(l=0,1,\dots;
\kappa\in\KKK;i=1,\dots,M)$ таким образом, чтобы выполнялись неравенства:
$$
-\infty<E^{(m_j)}_{0,\kappa_1,1}(\pp)\leq\dots
\leq E^{(m_j)}_{0,\kappa_1,M}(\pp)<E_{m_j,0}<E_{m_j,1}<
E^{(m_j)}_{1,\kappa_1,1}(\pp)\leq\dots\leq E^{(m_j)}_{1,\kappa_1,M}(\pp)<
\dots
$$
$$
\cdots
$$
$$
-\infty<E^{(m_j)}_{0,\kappa_K,1}(\pp)\leq\dots
\leq E^{(m_j)}_{0,\kappa_K,M}(\pp)<E_{m_j,0}<E_{m_j,1}<
E^{(m_j)}_{1,\kappa_K,1}(\pp)\leq\dots\leq E^{(m_j)}_{1,\kappa_K,M}(\pp)<
\dots
$$
Одним из главных результатов второго параграфа и всей работы является
теорема 3.4,
описывающая спектр оператора $H^{arr}$ в случае рационального потока $\eta$
однородной составляющей магнитного поля.
%--------------------------------------------------------------------
% Массив точек, рациональный поток, спектр гамильтониана
\noindent
{\bf Теорема 3.4.} {\it
Пусть решетка $\Gamma$ векторов трансляций имеет вид $\Gamma=\Lambda+\KKK$,
$|\KKK|=K$. Обозначим $m_1=m_2+1=-[\Phi]$. Если поток $\eta$ внешнего
однородного магнитного поля через элементарную ячейку решетки $\Lambda$
рационален,
$\eta=N/M$, то спектр оператора $H^{arr}$ является существенным и
не имеет сингулярно непрерывной компоненты.
При этом $\sigma(H^{arr})$ распадается на две (возможно, пересекающиеся)
части: $\sigma(H^{arr})=\Sigma_1\cup\Sigma_2$.\rm
\begin{enumerate}
\item\it Часть $\Sigma_1$ состоит из бесконечно вырожденных собственных
значений $E_{mn}$ операторов $H^0_{(m)}=\sum
\limits_{\gamma\in\Gamma}\!{}^\oplus\hat H_m$,
$$
\displaystyle E_{mn}=\Omega\frac{|m+\Phi|+1+2n}{2}+\frac{\tilde\omega_c}{2}
(m+\Phi),
$$
где $n\geq0$, $m\neq m_1,m_2$.\rm
\item\it Зонная часть спектра $\Sigma_2$ состоит из зон $I^{(m_j)}_l$,
$\Sigma_2=\cup\limits_{{l\geq0}\atop{j=1,2}}I^{(m_j)}_l$, причем
$I^{(m_j)}_l\subset(E_{m_j,l-1},E_{m_j,l})$ для всех $l\geq0$.
Каждая зона $I^{(m_j)}_l$
разбивается на $K$ подзон (атомных подзон): $I^{(m_j)}_l=\cup
\limits_{\kappa\in\KKK}I^{(m_j)}_{l,\kappa}$. Каждая подзона
$I^{(m_j)}_{l,\kappa}$, в свою очередь, разбивается на $M$ дополнительных
подзон (магнитных подзон): $I^{(m_j)}_{l,\kappa}=\cup\limits_{i=1}^{M}
I^{(m_j)}_{l,\kappa,i}$, где $I^{(m_j)}_{l,\kappa,i}=\{
E^{(m_j)}_{l,\kappa,i}(\pp)\,:\,\pp\in\TT^2_\eta\}$, а совокупность чисел
$\left\{E^{(m_j)}_{l,\kappa,i}(\pp)\,:\,\kappa\in\KKK,i=1,\dots,M\right\}$
является множеством всех решений дисперсионного уравнения
$$
\det\left[\tilde Q_{(m_j)}(\zeta)-
\tilde A(\pp)\right]=0,
$$
лежащих на отрезке $(E_{m_j,l-1},E_{m_j,l})$.
Подзоны
$I^{(m_j)}_{l,\kappa,i}$ одной зоны $I^{(m_j)}_{l}$ могут перекрываться;
некоторые из них могут вырождаться в точку.
\end{enumerate}
}
Зонная часть спектра оператора $H^{arr}$ во втором параграфе нами исследована
численно; в качестве иллюстрации к теореме 3.4 построены диаграммы
"поток--энергия" зависимости спектра исследуемого гамильтониана от величины
потока однородного поля.
В случае иррационального потока $\eta$ спектр гамильтониана $H^{arr}$
описывается в теореме 3.5; если решетка векторов трансляции является
квадратной, то для почти всех $\eta$ спектр имеет фрактальную
структуру.
%--------------------------------------------------------------------
% Массив точек, иррациональный поток, спектр гамильтониана
\noindent
{\bf Теорема 3.5.} {\it Пусть решетка $\Gamma$ векторов трансляций системы является
квадратной, $\Gamma=\Lambda$, и матрица
$(A(\lambda,\lambda'))_{\lambda,\lambda'\in\Lambda}$ оператора взаимодействия
$A:l^2(\Lambda)\to l^2(\Lambda)$, $A=D+T$, задается следующими соотношениями:
$$
D(\lambda,\lambda')=\alpha'\delta_{\lambda\lambda'},
$$
$$
T(\lambda,0)=\cases{
\alpha,\;\mbox{если }\lambda=\pm\aaa_1,\pm\aaa_2;\cr
0,\;\mbox{в остальных случаях.}
}
$$
Обозначим $m_1=m_2+1=-[\Phi]$.
Если поток $\eta$ внешнего однородного магнитного поля через элементарную
ячейку решетки $\Lambda$ является иррациональным числом, то спектр
оператора
$H^{arr}$ с константами связи $\alpha'$ и $\alpha$ является существенным
и распадается на три (возможно, пересекающиеся) компоненты:
$\sigma(H^{arr})=\Sigma_1\cup\Sigma_2\cup\Sigma_3$.\rm
\begin{enumerate}
\item\it Часть $\Sigma_1$ состоит из бесконечно вырожденных собственных
значений $E_{mn}$,
$$
E_{mn}=\Omega\frac{|m+\Phi|+1+2n}{2}+
\frac{\tilde\omega_c}{2}(m+\Phi),
$$
где $n\geq0$, $m\neq m_1,m_2$.\rm
\item\it Часть спектра $\Sigma_2$ состоит из множеств
$Y^{(m_j)}_n$, $\Sigma_2=\cup\limits_{{n\geq0}\atop{j=1,2}}Y^{(m_j)}_n$,
где $Y^{(m_j)}_n$ -- образ множества $\alpha'+\alpha\Sigma^\eta$ под
действием аналитической ветви $\chi^{(m_j)}_n$ многозначной
вещественно-аналитической функции
$\chi^{(m_j)}=\left(Q^{(m_j)}_0\right)^{-1}$.
Каждое множество $Y^{(m_j)}_n$ лежит внутри интервала
$(E_{m_j,n-1},E_{m_j,n})$; для почти всех иррациональных $\eta$ все
множества $Y^{(m_j)}_n$ являются канторовскими.\rm
\item\it Часть $\Sigma_3$ состоит из бесконечно вырожденных собственных
значений $E_{m_jn}$, $j=1,2$, $n\geq0$. Множество $\Sigma_3$ может
быть пустым.
\end{enumerate}
}
Здесь через $\Sigma^\eta$ обозначен спектр хорошо известного дискретного
оператора Харпера.
Для случая, когда кристаллическая решетка является квадратной,
в теореме 3.6 доказано существование у оператора $H^{arr}$ собственных
значений, погруженных в его непрерывный спектр.
%--------------------------------------------------------------------
% Погруженные собственные значения
\noindent
{\bf Теорема 3.6.} {\it Пусть решетка $\Gamma$ векторов трансляции системы является
квадратной, $\Gamma=\Lambda$, и матрица
$(A(\lambda,\lambda'))_{\lambda,\lambda'\in\Lambda}$ оператора взаимодействия
$A:l^2(\Lambda)\to l^2(\Lambda)$, $A=D+T$, задается следующими соотношениями:
$$
D(\lambda,\lambda')=\alpha'\delta_{\lambda\lambda'},
$$
$$
T(\lambda,0)=\cases{
\alpha,\;\mbox{если }\lambda=\pm\aaa_1,\pm\aaa_2;\cr
0,\;\mbox{в остальных случаях.}
}
$$
Если собственное значение $E_{mn}$ оператора $H^{arr}$ не равно ни одному
из собственных чисел $E_{m_j,n}$, $j=1,2$, $n\geq1$, оператора
$\hat H_{m_j}$, то для любого числа $\alpha\in\RR$
существует константа связи $\alpha'\in\RR$ такая, что собственное число
$E_{mn}$ погружено в непрерывный спектр оператора $H^{arr}$.}
%---------------- конец 3 главы --------------------------------
В первом параграфе {\bf четвертой главы} строится гамильтониан $H_A$
помещенного в однородное магнитное поле периодического массива одномерных
квантовых колец Ааронова--Бома. Эти одномерные кольца являются другим
предельным случаем рассмотренного во второй главе квантового кольца при
одинаковых внутреннем и внешнем радиусах.
Мы рассматриваем случай, когда решетка векторов трансляций системы является
квадратной, а поток $\eta$ внешнего однородного магнитного поля через
элементарную ячейку этой решетки рационален. Тогда гамильтониан $H_A$
унитарно эквивалентен оператору $\tilde H_A$, который разлагается в прямой
интеграл операторов по спектру неприводимых представления дискретной группы
магнитных трансляций, $\displaystyle\tilde H_A=
\int\limits_{\TT^2_\eta}\!{}^\oplus\tilde H_A(\pp)\,d\pp$.
Спектр оператора $\tilde H_A(\pp)$ полностью описывает теорема 4.1,
являющаяся основным результатом второго параграфа четвертой главы.
%--------------------------------------------------------------------
% Массив колец, спектр слоя
\noindent
{\bf Теорема 4.1.} {\it
Пусть $\pp$, $\pp\in\TT^2_\eta$, зафиксировано.
Если поток $\eta$ внешнего однородного магнитного поля через элементарную
ячейку решетки $\Lambda$ рационален, $\eta=N/M$, то спектр оператора
$\tilde H_A(\pp)$ дискретный и состоит из двух непересекающихся частей.
{\rm 1.} Первую часть $\sigma_1(\pp)$ составляет строго возрастающая
последовательность $\{\tilde\eps_s(\pp)\,:\,s\geq0\}$ всех решений
$\tilde E_n(\pp)$, $n\geq0$, приведенного дисперсионного уравнения
$$
\det\left[\tilde Q_0(\zeta)-\tilde D_0-\tilde T_0(\pp)\right]=0.
$$
Если $\tilde\eps_s(\pp)\notin\sigma(H^0)$, то кратность числа
$\tilde\eps_s(\pp)$ в спектре оператора $\tilde H_A(\pp)$ равна
$M\tilde m_s(\pp)$, где $\tilde m_s(\pp)$ -- кратность точки
$\tilde\eps_k(\pp)$ в последовательности $(\tilde E_n(\pp))_{n\geq0}$.
Если $\tilde\eps_s(\pp)=\eps_n$
для некоторого $n\geq0$, то кратность числа $\tilde\eps_s(\pp)$ в спектре
оператора $\tilde H_A(\pp)$ равна $M(\tilde m_s(\pp)+M)$ в случае, когда
$\tilde\Phi\in\ZZ$, $n\neq0$ и $\eps_n$ является четным числом, и равна
$M\tilde m_s(\pp)$ в противном случае.
{\rm 2.} Если $\tilde\Phi$ -- целое число, то вторая часть $\sigma_2(\pp)$
состоит из тех собственных значений $\eps_n$, $n\neq0$, оператора $H^0$,
которые не попадают в $\sigma_1(\pp)$ и являются четными числами
{\rm(}напомним, что $\eps_n=(m+\tilde\Phi)^2$ для некоторого $m\in\ZZ${\rm)}.
Кратность точки $\eps_n$, $\eps_n\in\sigma_2(\pp)$, в спектре оператора
$\tilde H_A(\pp)$ равна $M^2$. Если $\tilde\Phi\notin\ZZ$, то
$\sigma_2(\pp)=\emptyset$.
Собственное подпространство $L(E)$ оператора $\tilde H_A(\pp)$,
соответствующее собственному числу $E$, можно описать следующим образом.
{\rm 1.} Если $E\notin\sigma(H^0)$, то $L(E)$ является образом множества
$$
\Ker\left[\tilde Q(E)-\tilde D-\tilde T(\pp)\right]\subset
\CC^M\otimes\CC^M\otimes\CC^4,
$$
под действием отображения $\tilde\Gamma(E):\CC^M\otimes\CC^M\otimes\CC^4\to
\CC^M\otimes\CC^M\otimes L^2([0,2\pi])$.
{\rm 2.} Если $E=\eps_n$, то $L(E)=L_1\oplus L_2$. Здесь $L_1$ --
ортогональное дополнение векторов
$e_{k_1}\otimes e_{k_2}\otimes\delta_l^{(n)}(\eps_n)$,
$1\leq k_1,k_2\leq M$, $1\leq l\leq4$, в собственном подпространстве
$L^0(\eps_n)$ оператора $\tilde H^0$, соответствующем собственному значению
$\eps_n$. Если $\eps_n\notin\sigma_1(\pp)$, то $L_2=\{0\}$. Иначе, пусть
$\eps_n=\tilde\eps_s(\pp)$ для некоторого $s\geq 0$. Тогда $L_2$ является
$M\tilde m_s$-мерным подпространством, принадлежащим ортогональному
дополнению к подпространству $L^0(\eps_n)$ в пространстве $\CC^M\otimes\CC^M
\otimes L^2([0,2\pi])$ {\rm(}точное описание $L_2$ дано в доказательстве
теоремы{\rm)}.
}
Структура спектра оператора $H_A$ описывается теоремой 4.2. Эта теорема
является основным результатом четвертой главы.
%--------------------------------------------------------------------
% Массив колец, спектр гамильтониана
\noindent
{\bf Теорема 4.2.} {\it
Пусть решетка $\Lambda$ векторов трансляций является квадратной.
Если поток $\eta$ внешнего однородного магнитного поля через элементарную
ячейку решетки $\Lambda$ рационален, $\eta=N/M$, то спектр $\sigma(H_A)$
оператора $H_A$ является существенным и не имеет сингулярно
непрерывной компоненты. При этом $\sigma(H_A)$ состоит из двух частей:
$\sigma(H_A)=\Sigma_1\cup\Sigma_2$.\rm
\begin{enumerate}
\item\it Если общий поток $\tilde\Phi$ магнитного поля через кольцо является
целым числом, то $\Sigma_1$ состоит из тех и только
тех бесконечно вырожденных собственных значений $E_m=(m+\tilde\Phi)^2$
оператора
$H_A$, которые являются строго положительными четными числами. Если
$\tilde\Phi\notin\ZZ$, то $\Sigma_1=\emptyset$. \rm
\item\it Зонная часть спектра $\Sigma_2$ состоит из зон $Z_0,Z_1,\dots,
Z_l,\dots,$ лежащих в интервалах $(-\infty,\eps_3],[\eps_0,\eps_4],
[\eps_1,\eps_5],\dots,[\eps_l,\eps_{l+4}],\dots$ {\rm(}зона $Z_0$ может быть
пустой{\rm):}
$$
Z_l=\cup\limits_{\pp\in\TT^2_\eta}Z_l(\pp).
$$
Каждая зона $Z_l$, $l\geq1$, разбивается на $\tilde n_l$,
$M\leq \tilde n_l\leq 10M$, дополнительных
магнитных подзон{\rm:}
$Z_l=\cup\limits_{i=1}^{\tilde n_l}Z_{l,i}=\cup\limits_{i=1}^{\tilde n_l}
\left(\cup\limits_{\pp\in\TT^2_\eta}Z_{l,i}(\pp)\right)$,
где
$Z_{l,i}(\pp)$ -- множество всех лежащих в интервале $[\eps_{l-1},\eps_l]$
решений приведенного дисперсионного уравнения
$$
\det\left[\tilde Q_0(\zeta)-\tilde D_0-\tilde T_0(\pp)\right]=0,
$$
$Z_{l,i}(\pp)=\{E_{l,i}(\pp)\,:\,\pp\in\TT^2_\eta\}$. Для фиксированного
значения $\pp\in\TT^2_\eta$ каждая точка из $\sigma_2$ вырождена с
кратностью $M$.
\end{enumerate}
}
Теорема 4.3 показывает, что в спектре $\sigma(H_A)$ могут также
появляться
собственные значения, не являющиеся точками спектра оператора $H_{\rm AB}$.
Такие собственные значения возникают как постоянные решения (не зависящие
от $\pp\in\TT^2_\eta$) дисперсионного уравнения, т.е. как вырожденные
подзоны.
%--------------------------------------------------------------------
% Массив колец, локализация
\noindent
{\bf Теорема 4.3.} {\it
Если $\eta$ является целым числом: $\eta=N$, то элементы подгоночной
матрицы $D_0$ могут быть выбраны таким образом, что дисперсионное
уравнение $\det[\tilde Q_0(E)-\tilde D_0-\tilde T_0(\pp)]=0$ имеет решение,
не зависящее от $\pp\in\TT^2_\eta$ и параметра туннелирования $\tau$.}
{\bf В заключении} кратко повторяются основные полученные результаты и
делаются выводы из этих результатов.
%--------------------------------------------------------------------
%\newpage
\begin{center}
{\cyr ВЫВОДЫ}
\end{center}
В работе построены и исследованы самосопряженные операторы, которые
можно считать модельными гамильтонианами периодических массивов
квантовых точек и квантовых колец, находящихся во внешнем магнитном поле.
В этих моделях впервые учитывается не только однородная компонента
магнитного поля, в котором находится система,
но и поле, создаваемое периодической системой соленоидов
Ааронова--Бома.
Основными результатами диссертации являются теоремы~3.4
и~4.2, описывающие зонную структуру спектра рассматриваемых операторов
при рациональном потоке однородного магнитного поля, и
теорема 3.5, доказывающая канторовскую структуру спектра массива
квантовых точек с вихрями Ааронова--Бома для
почти всех иррациональных значениях потока в случае квадратной решетки.
Дополнительное численное исследование, проведенное для случаев
квадратной и гексагональной решеток, позволяет сделать следующие выводы
относительно структуры спектра массива квантовых точек с вихрями
Ааронова--Бома: 1) зоны спектра имеют наклон по направлению роста поля;
2) в случае гексагональной решетки и при ненулевом потоке Ааронова--Бома
происходит сгущение магнитных подзон; 3) для гексагональной решетки
соответствующие атомные подзоны внутри одной зоны не перекрываются.
%--------------------------------------------------------------------
\begin{center}
{\cyr РАБОТЫ, ОПУБЛИКОВАННЫЕ\\
ПО ТЕМЕ ДИССЕРТАЦИИ}
\end{center}
\cyr
\begin{enumerate}
\item Geyler V.A., Popov A.V. Hofstadter butterfly for
a periodic array of quantum dots // Integral methods in
science and ingineering. Volume one: analytic methods.
(Pitman Research Notes in Mathematics Series, 374). 1997.
P.~74--78.
\item Geyler V.A., Popov A.V. Localization in a periodic
system of the Aharonov--Bohm rings // Reports on
Mathematical Physics. 1997. V.~42, N.~3. P.~74--78.
\item Гейлер В.А., Попов А.В. Спектр периодического массива квантовых точек
с вихрями Ааронова--Бома // Математическое моделирование.
1998. Т.~10, N.~12. С.~32.
\item Попов И.Ю, Гейлер В.А., Попов А.В. Локализация в системе
связанные колец Ааронова--Бома // Физика твердого тела. 1999.
Т.~40. \Nn~5. С.~910--913.
\item Geyler V.A., Popov I.Yu., Popov A.V., Ovechkina A.A.
Fractal spectrum of periodic quantum systems in a
magnetic field // Chaos, Solitons and Fractals. 1999. V.~11,
N.~1--3. P.~281--288.
\item Попов А.В. Собственные значения, погруженные в зонный спектр
для периодического массива квантовых точек с
вихрями Ааронова--Бома // Математическое моделирование.
2000. Т.~12, N.~3. С.~41--42.
\item Попов А.В. {Спектральные свойства некоторых периодических
систем в магнитном поле} // Депонировано в ВИНИТИ от 30.03.1998.
{\rm N} 903--B98, 16 с.
\item Geyler V.A., Popov A.V. {An explicitly solvable model
with a periodic system of the Aharonov--Bohm vortices} //
{\rm IV} International Conference of Difference Equations
and Applications, abstracts -- Poznan: Poznan
University of Technology. 1998. P.~39.
\item Geyler V.A., Popov A.V. {An explicitly solvable model
with a periodic system of the Aharonov--Bohm vortices} //
{\rm IV} International Conference of Difference Equations
and Applications, extended abstracts -- Poznan: Poznan
University of Technology. 1998. P.~115--118.
\item Demidov V.V., Geyler V.A., Popov A.V., Grishanov E.N. Fractal structure
for the periodic array of quantum dots // International
Conference "Physics at the Turn on $21^{st}$ Century",
summaries -- Санкт-Петербург. 1998. С.~50.
\item Гейлер В.А., Попов А.В. Оператор Ландау, возмущенный гексагональной
решеткой точечных потенциалов // Труды {\rm VIII}
научной межвузовской конференции "Математическое моделирование
и краевые задачи" -- Самара. 1998. С.~32--34.
\item Гейлер В.А., Попов А.В. Спектр периодического массива квантовых точек
с вихрями Ааронова--Бома // Труды {\rm III} международной
конференции "Дифференциальные уравнения и их приложения" --
Саранск: Изд-во Морд. ун-та, 1998. С.~228--229.
\item Попов А.В. {Спектр массива квантовых точек} //
Материалы {\rm II} Уральской региональной межвузовской
научно-практической конференции "Проблемы
физико-математического образования". Часть {\rm II} --
Уфа: Изд-во Баш. ГПИ, 1997. С.~60--61.
\item Попов А.В. {Спектральные свойства периодических
квантовых систем с вихрями Ааронова-Бома в однородном
магнитном поле} // Тезисы докладов {\rm I} конференции
молодых ученых МордГУ. Часть {\rm II} -- Саранск: Изд-во
Морд. ун-та, 1996. С.~25.
\item Попов А.В. {Фрактальная структура спектра периодического
массива квантовых точек в магнитном поле} // Тезисы докладов
{\rm II} конференции молодых ученых МордГУ -- Саранск: Изд-во
Морд. ун-та, 1997. С.~7.
\item Попов А.В. {Спектр периодического массива квантовых точек:
рациональный поток} // Труды {\rm III} конференции молодых
ученых МордГУ -- Саранск: Изд-во Морд. ун-та, 1998. С.~12.
\item Попов А.В. {Спектр кольца Ааронова--Бома} //
{\rm XXVII} Огаревские чтения. Материалы научной
конференции -- Саранск: Изд-во Морд. ун-та, 1998.
С.~107--108.
\item Попов А.В. {Спектр периодического массива квантовых колец
в магнитном поле} // Тезисы докладов {\rm II} международной
научно-технической конференции "Проблемы и прикладные
вопросы физики" -- Саранск: Изд-во Морд. ГПИ, 1999. С.~133.
\item Демидов В.В., Гейлер В.А., Попов А.В., Гришанов Е.Н.
Фрактальная структура спектра для периодического
массива квантовых точек // Труды региональной
научно-практической конференции "Критические технологии
в регионах с недостатком природных ресурсов" --
Саранск, 2000. С.~86--89.
\item Попов А.В. Собственные значения, погруженные в зонный спектр
для периодической системы в магнитном поле // Труды {\rm X}
научной межвузовской конференции "Математическое
моделирование и краевые задачи" --
Самара: Изд-во Самарского ГТУ, 2000. С.~130--131.
\end{enumerate}
\end{document}
|
http://dlmf.nist.gov/19.22.E20.tex
|
nist.gov
|
CC-MAIN-2014-10
|
application/x-tex
| null |
crawl-data/CC-MAIN-2014-10/segments/1393999652934/warc/CC-MAIN-20140305060732-00093-ip-10-183-142-35.ec2.internal.warc.gz
| 49,765,491
| 665
|
\[(p_{{\pm}}^{2}-p_{{\mp}}^{2})\mathop{R_{J}\/}\nolimits\!\left(x^{2},y^{2},z^{2%
},p^{2}\right)=2(p_{{\pm}}^{2}-a^{2})\mathop{R_{J}\/}\nolimits\!\left(a^{2},z_%
{{+}}^{2},z_{{-}}^{2},p_{{\pm}}^{2}\right)-3\!\mathop{R_{F}\/}\nolimits\!\left%
(x^{2},y^{2},z^{2}\right)+3\!\mathop{R_{C}\/}\nolimits\!\left(z^{2},p^{2}%
\right),\]
|
https://anarchistischebibliothek.org/library/le-retif-den-trugbildern-entgegen.tex
|
anarchistischebibliothek.org
|
CC-MAIN-2021-43
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2021-43/segments/1634323585302.91/warc/CC-MAIN-20211020055136-20211020085136-00369.warc.gz
| 198,642,531
| 6,802
|
\documentclass[DIV=12,%
BCOR=0mm,%
headinclude=false,%
footinclude=false,open=any,%
fontsize=11pt,%
oneside,%
paper=a4]%
{scrbook}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainfont{Linux Libertine O}
% these are not used but prevents XeTeX to barf
\setsansfont[Scale=MatchLowercase]{CMU Sans Serif}
\setmonofont[Scale=MatchLowercase]{CMU Typewriter Text}
\setmainlanguage{german}
% global style
\pagestyle{plain}
\usepackage{microtype} % you need an *updated* texlive 2012, but harmless
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{verbatim}
% http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\PassOptionsToPackage{hyphens}{url}\usepackage[hyperfootnotes=false,hidelinks,breaklinks=true]{hyperref}
\usepackage{bookmark}
% footnote handling
\usepackage[fragile]{bigfoot}
\usepackage{perpage}
\DeclareNewFootnote{default}
\DeclareNewFootnote{B}
\MakeSorted{footnoteB}
\renewcommand*\thefootnoteB{(\arabic{footnoteB})}
\deffootnote[3em]{0em}{4em}{\textsuperscript{\thefootnotemark}~}
% continuous numbering across the document. Defaults to resetting at chapter. Unclear
% \usepackage{chngcntr}
% \counterwithout{footnote}{chapter}
\usepackage[shortlabels]{enumitem}
\usepackage{tabularx}
\usepackage[normalem]{ulem}
\def\hsout{\bgroup \ULdepth=-.55ex \ULset}
% https://tex.stackexchange.com/questions/22410/strikethrough-in-section-title
% Unclear if \protect \hsout is needed. Doesn't looks so
\DeclareRobustCommand{\sout}[1]{\texorpdfstring{\hsout{#1}}{#1}}
\usepackage{wrapfig}
\usepackage{indentfirst}
% remove the numbering
\setcounter{secnumdepth}{-2}
% remove labels from the captions
\renewcommand*{\captionformat}{}
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\KOMAoption{captions}{belowfigure,nooneline}
\addtokomafont{caption}{\centering}
% avoid breakage on multiple <br><br> and avoid the next [] to be eaten
\newcommand*{\forcelinebreak}{\strut\\*{}}
\newcommand*{\hairline}{%
\bigskip%
\noindent \hrulefill%
\bigskip%
}
% reverse indentation for biblio and play
\newenvironment*{amusebiblio}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newenvironment*{amuseplay}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newcommand*{\Slash}{\slash\hspace{0pt}}
\addtokomafont{disposition}{\rmfamily}
\addtokomafont{descriptionlabel}{\rmfamily}
% forbid widows/orphans
\frenchspacing
\sloppy
\clubpenalty=10000
\widowpenalty=10000
% http://tex.stackexchange.com/questions/304802/how-not-to-hyphenate-the-last-word-of-a-paragraph
\finalhyphendemerits=10000
% given that we said footinclude=false, this should be safe
\setlength{\footskip}{2\baselineskip}
\title{Den Trugbildern entgegen}
\date{9. März 1911}
\author{Le Retif}
\subtitle{}
% https://groups.google.com/d/topic/comp.text.tex/6fYmcVMbSbQ/discussion
\hypersetup{%
pdfencoding=auto,
pdftitle={Trugbildern entgegen},%
pdfauthor={Retif, Le; Serge (Kibaltschitsch), Victor},%
pdfsubject={},%
pdfkeywords={Illusionen}%
}
\begin{document}
\begin{titlepage}
\strut\vskip 2em
\begin{center}
{\usekomafont{title}{\huge Den Trugbildern entgegen\par}}%
\vskip 1em
\vskip 2em
{\usekomafont{author}{Le Retif\par}}%
\vskip 1.5em
\vfill
{\usekomafont{date}{9. März 1911\par}}%
\end{center}
\end{titlepage}
\cleardoublepage
Die Reisenden, die einmal die Wüste durchquerten, kennen diese verlockenste und gefährlichste aller Illusionen: Das Trugbild. Während die Karawane unter der sengend heissen Sonne ihren Weg durch das Meer aus Sand sucht, träumen die Menschen von einer Oase, an der sie sich endlich unter dem wohltuenden Schatten der Palmen ausruhen können. Rundum gibt es nichts als Wüste und sie wissen, dass noch viele Marschstunden vor ihnen liegen, bis sie den langersehnten Rastplatz erreichen. Ihre Augen sind es müde einzig und ununterbrochen den gelben Sand und den stahlblauen Himmel zu sehen. Das Fieber überkommt sie und ihr Verlangen, Wasser und Pflanzen zu sehen und etwas Schatten zu geniessen, wächst an. So ziehen sie weiter; und plötzlich erfüllt sich das Wunder – ihr verzweifeltes Verlangen nimmt Gestalt an. Dort am Horizont zeichnet sich etwas ab. Das Meer aus Sand verschwindet und grüne blumige Wiesen erstrecken sich soweit das Auge reicht\dots{} Die verwunderten Augen der Reisenden suchen die Weite ab und dort, ganz nahe, sehen sie die ersehnte Oase. Die grossen Palmenschatten wiegen sich über die weissen Häuser, wo sie sich auffrischen und erhohlen werden. Dahinter erstreckt sich die azurblaue Fläche eines Sees. Bei Abenddämmerung werden sie an dessen Ufern das Hereinbrechen der Nacht abwarten\dots{} Und die Reisenden zeigen mit den Fingern nach den bezaubernden Palmen, den weissen Häusern, dem Azurblau des Sees. Alle sehen sie es und die Hoffnung auf baldiges Glück lässt ihre Kräfte erneut beleben.
Dennoch liegt dort vor ihnen nichts, nichts als die monotone Wüste, Sand und Himmel, Himmel und Sand\dots{} Sie werden die Oase erst später erreichen, nach tagelangen Anstrengungen vielleicht; was sie sehen, ist bloss eine Lüge, eine grobe Illusion. Doch ihr Verlangen nach Ruhe, Schatten und Frieden ist so gross, die Schönheit des Trugblides so verführerisch, dass in manchen Momenten selbst die grössten Skeptiker daran glauben\dots{}
Sie beschleunigen ihre Schritte; wenn sie könnten, würden sie rennen. Die Sonne verbrennt sie; das falbe Licht errötet ihre verwirrten Augen, der Durst hat sie überkommen – sie gehen und gehen. Die Oase nähert sich nicht: Noch immer liegt sie dort am Horizont, zauberhaft, anziehend, verheissungsvoll – verlogen. Sie gehen weiter, hartnäckig hoffend, und die unendliche Wüste verhöhnt sie. Wie viele fielen unterwegs in den brennenden Sand, entkräftet, aber noch nicht ohne Hoffnung! Wie viele sind gestorben, mit der tödlichen Illusion des Trugbildes vor ihren Augen!
Nicht selten ist es bloss das Trugbild, das sie vom rechten Weg abbringt und sie so durch den vergeblichen Marsch tötet. Oft vergessen sie für es, um seinetwillen, die Gefahren, die Schwierigkeiten, das Interesse an der Realität, und verlieren sich\dots{}
Auf die selbe Weise verleiten andere Trugbilder jene, die hier leiden, dazu, die mühsame Arbeit, das graue Leben, das Fortschreiten ohne Hoffnung zu akzeptieren. Für Trugbilder, für Illusionen, für Lügen fallen und sterben die Menschen auf allen Pfaden der Erde\dots{}
\begin{center}
\textbf{*}
\end{center}
Arme einfache Leute, die es gewohnt sind, vor dem Unbekannten zu zittern, die Stärkeren zu verehren, naiv an das Wort des Erlösers zu glauben, an die Gerechtigkeit eines Gottes, den sie nicht verstehen und an die magische Kraft der Gesetze unter denen sie ächzen.
Dies verwundert uns nicht. Dass die Massen den Drang haben, sich selbst zu täuschen, und dass eine einzige Täuschung sie zu verführen vermag, können wir verstehen. Eine gewaltige Vergangenheit hemmt sie; sie sind es gewohnt zu glauben, gewohnt zu gehorchen, gewohnt geführt zu werden. Sie leiden. Das Volk ist das Kanonenfutter des Leidens. Da sein Leben nunmal schrecklich trüb, unschön und schmerzhaft ist, ist es nunmal nötig, dass seine Fantasie unter der scheusslichen Realität, märchenhafte Hirngespinste strickt\dots{} Für jene, die zum gehen zu schwach sind, ist es nunmal nötig, sich auf einem Stock zu stützen.
Was wir weniger verstehen, ist die Macht, die die Illusion über jene Gemüter aufrechterhält, die sich von den Ängsten und Pflichten der Masse befreit haben. Was wir nicht verstehen ist, dass die Menschen, die die Sinnlosigkeit und Nichtigkeit der Dogmen, den Schwindel der Doktrinen und die Vergeblichkeit der Anstrengungen der alten Parteien gesehen haben, noch immer ein Trugbild benötigen und für dieses die Gegenwart, die Realität und das Leben - diesen Schatz - aufopfern.
Man sollte doch meinen, dass jene, denen sich die Lüge der Religionen enthüllt hat, nicht mehr nach dem trügerischen Jenseits trachten und endlich gewillt sein müssten auf der Erde zu leben – ohne zu warten. Denn ist die Zukunft nicht ein anderer Himmel, ein anderes Trugbild? Was ist schon wirklich ausser der Gegenwart?
- Im Diesseits leben, jetzt Leben! Müsste dies nicht die Schlussfolgerung jener sein, die nicht mehr an einen Gott glauben, an einen Schšpfer und Spender überirdischer Glückseligkeit?
Aber nein. Das ist schon zuviel verlangt von den Menschen, auf die die alten Trugbilder noch nicht völlig einzuwirken aufgehöhrt haben. Jahrhunderte lebten sie mit nichts als dem grossen christlichen Traum vor ihren Augen. Nun, da sie ihn zugrunde gehen sahen, brauchen sie dafür einen anderen. Sie warten nicht mehr auf all dies, weder auf den Messias, noch auf das himmlische Königreich; und einige von ihnen lachen über die «unbewusste» Masse, die noch immer darauf wartet. Sie sagen, es sei Schwindel, ein alter Fehler, eine Alberei\dots{} – Aber sie, sie warten auf Morgen!
\begin{center}
\textbf{*}
\end{center}
«Morgen, so lehren die belesenen Professoren, wird die neue heile Gesellschaft, inspiriert von den grossen Prinzipien des ‘freien Forschens’, des Friedens und der Gleichheit, allen das gute Leben zurückerstatten\dots{}»
«Morgen, versprechen dickbäuchige Apostel, wird der Kollektivismus einem jeden ein allumfängliches Wohlbefinden verschaffen\dots{}»
«Morgen, erzählen uns gute, treue und aufrichtige Gefährten, werden wir den Generalstreik machen, die Revolution, und dann werden wir den anarchistischen Kommunismus einführen. Und von da an wird die Harmonie und das Glück unter den Sterblichen herrschen\dots{}»
Und während sie ihren Trugbildern nacheilen, verfestigen die Bosse ihre Herrschaft über die Arbeiter immer mehr; die Regierungen schmieden Ketten, unterzeichnen Allianzen und Abkommen, bereiten zukünftige Morde vor, erschiessen die Revoltierenden, erdrücken, verhöhnen und töten die Armen.
Unterdessen arbeiten die belesenen Professoren einen detaillierten, minutieusen Plan der harmonischen Stadt von Morgen aus. Währenddessen unterrichten die gelehrten Strategen der zukünftigen Revolution ihren Jünglingen, dass man auf jene und auf keine andere, der Doktrin eintgegengesetzte Weise vorzugehen hat\dots{}
- Wir werden die Revolution mit der Armee machen! Ruft ein fleissiger Theoretiker.
- Nein, wir werden sie gegen die Armee machen! Antwortet ein anderer, nicht weniger fleissiger Theoretiker.
- Wir werden die Revolution mit Hilfe der Offiziere machen, verdeutlicht ein dritter.
- Nein, verkündigt noch ein anderer, wir werden die Revolution mit den Soldaten gegen die Offiziere machen\dots{}
Währenddessen werden sie von der Armee tagtäglich mit Gewehren und Mitrailletten bedroht. Die Armee bereitet sich vielleicht gerade darauf vor, sie auf neue Schlachtfelder zu schieben. Sie nimmt ihnen die besten, die jüngsten Kräfte ab, bedient sich daran und verdirbt sie. Sie entreisst einem jeden von ihnen 24 Monate des Lebens\dots{} Würden sie nicht besser daran tun, weniger darüber zu sinnieren sich ihrer zu bedienen und stattdessen aufhöhren ihr zu dienen? Wären sie nicht viel konsequenter, würden sie, jene, die die Armee abschaffen wollen, damit beginnen, ihren Dienst zu verweigern?
Doch da befindet sich das Trugbild, dort am Horizont. Für die ideale Stadt von Morgen akkzeptieren unsere Revolutionäre die schmutzige Stadt von Heute. Für das idyllische Leben einer Zukunft, die sie nicht kennen werden, passen sie sich an die erbärmliche Gegenwart an.
\begin{center}
\textbf{*}
\end{center}
Nach der religiösen Illusion, nach der reformistischen Illusion, die Revolutionäre Illusion. Im Grunde ist es der ewige Neubeginn desselben Abenteuers: Der Traum steht über der Handlung, der Traum ersetzt die Revolte und das Heute wird für ein Morgen verspielt.
Lassen wir nicht davon ab es zu wiederhohlen. Lassen wir keine Gelegenheit ungenutzt, um den Schwindel dieser Trugbilder zu enthüllen und diejenigen unter uns, die sich noch immer betören lassen, daran zu erinnern, dass der Tod Gottes die Paradiese in Rauch aufgehen liess.
Es sind es nicht allzu viele von all unseren Energien, die dazu aufgewendet werden, die Gegenwart etwas zu verschönern. Die unmittelbaren Revolten erfordern dringend all unsere Kräfte; wir haben weder die Musse noch die Mittel, um sie im Hinblick auf weit entfernte – und sehr hypothetische – Revolten zu vergeuden.
Das Leben, das gesamte Leben, liegt in der Gegenwart. Warten bedeutet es zu verlieren. Auf Morgen warten um frei zu sein, um die Existenz zu geniessen, um sich leben zu spüren? Wir machen dieses Spiel nicht länger mit. Die Zeit, die durch das Warten verstreicht, ist unwiederruflich verloren, und wir legen Wert darauf, nichts von dem Leben zu verlieren. Die schöne Revolte vervollständigt das Denken oder den Traum durch die unmittelbare Handlung. Der Rest ist blosses Geschwätz\dots{} oder Verfolgung von Trugbildern.
% begin final page
\clearpage
% new page for the colophon
\thispagestyle{empty}
\begin{center}
Anarchistische Bibliothek
\smallskip
Anticopyright
\bigskip
\includegraphics[width=0.25\textwidth]{logo-yu.pdf}
\bigskip
\end{center}
\strut
\vfill
\begin{center}
Le Retif
Den Trugbildern entgegen
9. März 1911
\bigskip
\href{http://acorpsperdu.wikidot.com/den-trugbildern-entgegen}{http:\Slash{}\Slash{}acorpsperdu.wikidot.com\Slash{}den-trugbildern-entgegen}
Publiziert in \emph{l’anarchie}, nr. 309, 9. März 1911, Paris. Auf Deutsch veröffentlicht in \emph{A Corps Perdu}, internationale anarchistische Zeitschrift, Nr. 2, November 2009.
\bigskip
\textbf{anarchistischebibliothek.org}
\end{center}
% end final page with colophon
\end{document}
|
http://dr-rohlfs.de/kettenlehre/kette.tex
|
dr-rohlfs.de
|
CC-MAIN-2019-09
|
application/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2019-09/segments/1550247481612.36/warc/CC-MAIN-20190217031053-20190217053053-00152.warc.gz
| 72,386,303
| 2,072
|
%%% kettenverschleisslehre
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% man kann mit dieser kettenlehre die laengung der kette feststellen, ohne ausbau.
%% genauigkeit ca. 0.1-0.2 prozent.
%% formate: TeX, DVI, POSTSCRIPT, pcx
%% beschreibung: unten, ab \end{document}
%%
\NeedsTeXFormat{LaTeX2e}
\documentclass[a4paper]{article}
\usepackage{times, a4}
\pagestyle{empty}
%% falls der Ausdruck horizontal verschoben werden muss: den wert entsprechend „ndern
\setlength{\topmargin}{0mm}
\setlength{\textheight}{300mm}
\begin{document}
\newcounter{lauf}
\setlength{\unitlength}{0.5in}
\begin{picture}(1,20.6)(-8.46,-1.75)
\multiput(0,0)(0,2){10}
{\line(1,0){0.5}\makebox(0,0)[l]{\ \thelauf\ glieder}\addtocounter{lauf}{2}}
\linethickness{0.1mm}
\multiput(0,20)(0,0.04){10}{\line(1,0){0.3}}
\multiput(0,20)(0,0.2){2}{\line(1,0){0.4}}
\put(0,20){\line(1,0){0.5}}
\put(0,20.4){\line(1,0){0.5}}
\put(0.6,20.4){\makebox(0,0)[l]{\it 2\%}}
\put(0.6,20){\makebox(0,0)[l]{\it 0\%}}
\put(1.2,0.39){\shortstack{\bf ketten-\\ \bf verschleiss-\\ \bf lehre\\[1ex]
\tiny idee:\\ \tiny ingo.rohlfs(at)gmx.de}}
%\put(-8.5,0){\line(0,1){19.685} \ hier falten}
\put(-8.5,0){\line(0,1){19.685}}
\put(-8.4,5){\small Kontrolle: Strichl\"ange 25cm}
\end{picture}
\end{document}
anwendung: die datei mit LaTeX kompilieren und auf einem drucker
mit moeglichst hoher aufloesung ausdrucken. das blatt dreimal in
laengsrichtung nach hinten falten falten, am strich beginnend.
man erhaelt einen papierstreifen von 52.5 mm breite und 298 mm
laenge mit vier lagen papier. falz gut andruecken, am besten mit
falzhorn oder fingernagel. das wars.
! ein wenig wasserfreier (sic!) kleber schadet nicht.
nur kann man der verschleiss messen, indem man die nulllinie ex
akt mit einer lasche in deckung bringt, festhaelt und an der an
deren seite an der entsprechenden lasche den verschleiss in
prozent abliest.
allerdings gibt es bei einigen druckern schwierigkeiten mit dem
gleichmaessigen papiertransport. Abhilfe: mehrfach ausdrucken und
mit einer neuen kette vergleichen. dann auswahl der geeigneten
lehre.
! bei 1-2 prozent solle ein austausch vorgenommen werden,
! je nach ritzelabnutzung. d.h.:
! - 2% nur bei sehr stark abgenutzten ritzeln oder nabenschaltung
! - 1% bei normal abgenutzen ritzeln guter qualitaet
! - 0.5% bei neuen weichen ritzeln (alu, manche shimano)
ich habe alle raeder hier kontrolliert, geht wunderbar.
sollte die skala nicht genau am rand anliegen ist der druck
ertreiber(drucher) nicht gut eingerichtet.
diejenigen, die keine textverarbeitung machen, oder aus anderen
gründen keinen tex-compiler besitzen, finden auf der web-seite
www.dr-rohlfs.de/kettenlehre weiter dateiformate.
das TeX-system gibt es fuer alle systeme kostenlos bei
ftp.dante.de oder fast allen uni-servern.
ueber antworten und erfahrungsberichte freute ich mich.
|
http://dragula.viettug.org/attachments/157/pst-loibom.tex
|
viettug.org
|
CC-MAIN-2019-35
|
text/html
|
application/x-tex
|
crawl-data/CC-MAIN-2019-35/segments/1566027316783.70/warc/CC-MAIN-20190822042502-20190822064502-00488.warc.gz
| 57,399,140
| 7,492
|
\csname PSTLOIBOMLoaded\endcsname
\let\PSTLOIBOMLoaded\endinput
% Requires PSTricks, pst-xkey and pst-node packages
\ifx\PSTSOLIDESIIIDLoaded\endinput\else\input pst-solides3d.tex \input ifthen.tex \input multido.tex \fi
\def\fileversion{1.0}
\def\filedate{2009/03/20}
\message{`PSTLOIBOM' v\fileversion, \filedate}
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
\pst@addfams{pst-loibom}
%% Dat chieu dai bang bien thien
\define@key[psset]{pst-loibom}{dai}{\def\pst@loibom@dai{#1}}
\psset[pst-loibom]{dai=8} % Mac dinh chieu dai bang 8
%% Dat chieu cao bang bien thien
\define@key[psset]{pst-loibom}{cao}{\def\pst@loibom@cao{#1}}
\psset[pst-loibom]{cao=2} % Mac dinh chieu cao bang 3
%%
\define@key[psset]{pst-loibom}{hY}{\def\pst@loibom@hY{#1}}
\psset[pst-loibom]{hY=0.8} % Mac dinh 0.8 cho khoang cach 2 hang o y'
\define@key[psset]{pst-loibom}{hX}{\def\pst@loibom@hX{#1}}
\psset[pst-loibom]{hX=0.8} % Mac dinh 0.8 cho phan du o x
%% Chän gãc nh×n th¼ng (theo mÆt ph¼ng Oyz)----Xem gãi pst-solides3d.sty
\psset{viewpoint=100 0 0, Decran=100}
\psset{coorType=2,Alpha=90}
\psset{arrowsize=5pt}
%% ten x, y', y
\def\pst@loibom@tenbien@i#1,#2,#3,#4\@nil{%
\def\pst@loibom@BBT@xname{#1}
\def\pst@loibom@BBT@diffname{#2}
\def\pst@loibom@BBT@funcname{#3}}
\define@key[psset]{pst-loibom}{tenbien}{%
\expandafter\pst@loibom@tenbien@i#1,,,\@nil}%
\psset[pst-loibom]{tenbien={$x$,$y'$,$y$}} % Mac dinh x,y',y
%% So khoang
\define@key[psset]{pst-loibom}{sokhoang}{\def\pst@loibom@sokhoang{#1}}
\psset[pst-loibom]{sokhoang=1} % Mac dinh so khoang =1
%% Chia khoang
\def\pst@loibom@giatribien@i#1,#2,#3,#4,#5,#6,#7,#8,#9\@nil{ %
\def\pst@loibom@giatribien@xI{#1}
\def\pst@loibom@giatribien@xII{#2}
\def\pst@loibom@giatribien@xIII{#3}
\def\pst@loibom@giatribien@xIV{#4}
\def\pst@loibom@giatribien@xV{#5}
\def\pst@loibom@giatribien@xVI{#6}
\def\pst@loibom@giatribien@xVII{#7}
\def\pst@loibom@giatribien@xVIII{#8}
\def\pst@loibom@giatribien@xIX{#9}}
\define@key[psset]{pst-loibom}{giatribien}{\expandafter
\pst@loibom@giatribien@i#1,,,,,,,,\@nil}
% mac dinh khoang (-\vc;+\vc)
\psset[pst-loibom]{giatribien={ , , , , , , , , }}
%% Dau dao ham
\def\pst@loibom@daudaoham@i#1,#2,#3,#4,#5,#6,#7,#8,#9\@nil{ %
\def\pst@loibom@daudaoham@xI{#1}
\def\pst@loibom@daudaoham@xII{#2}
\def\pst@loibom@daudaoham@xIII{#3}
\def\pst@loibom@daudaoham@xIV{#4}
\def\pst@loibom@daudaoham@xV{#5}
\def\pst@loibom@daudaoham@xVI{#6}
\def\pst@loibom@daudaoham@xVII{#7}
\def\pst@loibom@daudaoham@xVIII{#8}}
\define@key[psset]{pst-loibom}{daudaoham}{\expandafter
\pst@loibom@daudaoham@i#1,,,,,,,,\@nil}
\psset[pst-loibom]{daudaoham={1,1,1,1,1,1,1,1}}
%% Dat diem gian doan
\define@boolkey[psset]{pst-loibom}[Pst@]{giandoan}[true]{}
\psset[pst-loibom]{giandoan=false} % Mac dinh khong co diem gian doan
\def\pst@loibom@diemgiandoan@i#1,#2,#3,#4,#5,#6,#7,#8,#9\@nil{ %
\def\pst@loibom@diemgiandoan@sodiemgd{#1}
\def\pst@loibom@diemgiandoan@I{#2}
\def\pst@loibom@diemgiandoan@II{#3}
\def\pst@loibom@diemgiandoan@III{#4}
\def\pst@loibom@diemgiandoan@IV{#5}
\def\pst@loibom@diemgiandoan@V{#6}
\def\pst@loibom@diemgiandoan@VI{#7}
\def\pst@loibom@diemgiandoan@VII{#8}
\def\pst@loibom@diemgiandoan@VIII{#9}}
\define@key[psset]{pst-loibom}{diemgiandoan}{\expandafter
\pst@loibom@diemgiandoan@i#1,,,,,,,,\@nil}
\psset[pst-loibom]{diemgiandoan={1,2}}
%% Diem toi han
\def\pst@loibom@diemtoihan@i#1,#2,#3,#4,#5,#6,#7,#8,#9\@nil{ %
\def\pst@loibom@diemtoihan@I{#1}
\def\pst@loibom@diemtoihan@II{#2}
\def\pst@loibom@diemtoihan@III{#3}
\def\pst@loibom@diemtoihan@IV{#4}
\def\pst@loibom@diemtoihan@V{#5}
\def\pst@loibom@diemtoihan@VI{#6}
\def\pst@loibom@diemtoihan@VII{#7}
\def\pst@loibom@diemtoihan@VIII{#8}
\def\pst@loibom@diemtoihan@IX{#9}}
\define@key[psset]{pst-loibom}{diemtoihan}{\expandafter
\pst@loibom@diemtoihan@i#1,,,,,,,,\@nil}
\psset[pst-loibom]{diemtoihan={0,0,0,0,0,0,0,0}}
%% Dat gia tri ham
\def\pst@loibom@giatriham@i#1,#2,#3,#4,#5,#6,#7,#8,#9\@nil{ %
\def\pst@loibom@giatriham@I{#1}
\def\pst@loibom@giatriham@II{#2}
\def\pst@loibom@giatriham@III{#3}
\def\pst@loibom@giatriham@IV{#4}
\def\pst@loibom@giatriham@V{#5}
\def\pst@loibom@giatriham@VI{#6}
\def\pst@loibom@giatriham@VII{#7}
\def\pst@loibom@giatriham@VIII{#8}
\def\pst@loibom@giatriham@IX{#9}}
\define@key[psset]{pst-loibom}{giatriham}{\expandafter
\pst@loibom@giatriham@i#1,,,,,,,,\@nil}
%%% Kiem tra tich 2 so cung dau trai dau
\def\is@loibom@samesign#1#2{
\ifnum#1<0
\ifnum#2<0 1 \else 0\fi
\else \ifnum#2<0 0 \else 1 \fi
\fi}
%% kiem tra tat ca cac so cung dau
%%----------------------------------------------
\def\is@nonchangesign@iii#1#2#3{
\ifnum\is@loibom@samesign{#1}{#2}=1
\ifnum\is@loibom@samesign{#2}{#3}=1 0 \else 2 \fi
\else 1
\fi}
%%-----------------------------------------------
\def\is@nonchangesign@iv#1#2#3#4{
\ifnum\is@loibom@samesign{#1}{#2}=0 1
\else\ifnum\is@loibom@samesign{#3}{#4}=0 3
\else\ifnum\is@loibom@samesign{#2}{#3}=0 2
\else 0
\fi
\fi
\fi}
%%-----------------------------------------------
\def\is@nonchangesign@v#1#2#3#4#5{
\ifnum\is@loibom@samesign{#1}{#2}=0 1 % doi dau 1-2
\else\ifnum\is@loibom@samesign{#4}{#5}=0 4
\else\ifnum\is@nonchangesign@iv{#2}{#3}{#4}{#5}=1 2
\else \ifnum\is@nonchangesign@iv{#2}{#3}{#4}{#5}=2 3
\else 0
\fi
\fi
\fi
\fi}
%%-----------------------------------------------
\def\is@nonchangesign@vi#1#2#3#4#5#6{
\ifnum\is@loibom@samesign{#1}{#2}=0 1 % doi dau 1-2
\else\ifnum\is@loibom@samesign{#5}{#6}=0 5
\else\ifnum\is@nonchangesign@v{#2}{#3}{#4}{#5}{#6}=1 2
\else \ifnum\is@nonchangesign@v{#2}{#3}{#4}{#5}{#6}=2 3
\else \ifnum\is@nonchangesign@v{#2}{#3}{#4}{#5}{#6}=3 4
\else 0
\fi
\fi
\fi
\fi
\fi}
%%-----------------------------------------------
\def\is@nonchangesign@vii#1#2#3#4#5#6#7{
\ifnum\is@loibom@samesign{#1}{#2}=0 1 % doi dau 1-2
\else\ifnum\is@loibom@samesign{#6}{#7}=0 6
\else\ifnum\is@nonchangesign@vi{#2}{#3}{#4}{#5}{#6}{#7}=1 2
\else \ifnum\is@nonchangesign@vi{#2}{#3}{#4}{#5}{#6}{#7}=2 3
\else \ifnum\is@nonchangesign@vi{#2}{#3}{#4}{#5}{#6}{#7}=3 4
\else \ifnum\is@nonchangesign@vi{#2}{#3}{#4}{#5}{#6}{#7}=4 5
\else 0
\fi
\fi
\fi
\fi
\fi
\fi}
%% Vi tu tam I ti so k
\def\loibom@vitu(#1,#2,#3)(#4,#5,#6)#7#8{
\psPoint(#4 #1 sub #7 mul #1 add,#5 #2 sub #7 mul #2 add,#6 #3 sub #7 mul #3 add){#8}}
%%-----------Lenh ghep so---------------
\def\lb@ghepso#1#2#3#4#5#6#7#8#9{
\ifnum#1=1 #2
\else\ifnum#1=2 #2#3
\else\ifnum#1=3 #2#3#4
\else\ifnum#1=4 #2#3#4#5
\else\ifnum#1=5 #2#3#4#5#6
\else\ifnum#1=6 #2#3#4#5#6#7
\else\ifnum#1=7 #2#3#4#5#6#7#8
\else #2#3#4#5#6#7#8#9
\fi\fi\fi\fi\fi\fi\fi}
\newcounter{donvilb}
\newcounter{xoadonvilb}
\newcounter{sodiemgiandoan}
\def\muiten@I#1#2#3{
\pst@killglue %
\begingroup
\use@par
\psPoint(0,#1 hXXX add,hYYY -1 mul){MTItop}
\psPoint(0,#1 hXXX add,zB hYYY add){MTIbot}
\psPoint(0,#2 hXXX sub,hYYY -1 mul){MTItop'}
\psPoint(0,#2 hXXX sub,zB hYYY add){MTIbot'}
\ifnum#3<0\psline{->}(MTItop)(MTIbot')\else\psline{->}(MTIbot)(MTItop')\fi
\endgroup
\ignorespaces%
}% end \muiten@I
%%%--------ve mui ten 2 khoang lien tuc ---------------------------------
\def\muiten@lientuc@II#1#2#3#4{
\pst@killglue %
\begingroup
\use@par
\pstVerb{/varII #2 #1 sub 2 div #1 add def
/mau varII #1 sub hXXX sub 2 mul def
/kI hXXX -2 mul varII add #1 sub mau div def
/kII varII #1 sub mau div def}
\psPoint(0,#1 hXXX add,hYYY -1 mul){MTII1top}
\psPoint(0,#1 hXXX add,zB hYYY add){MTII1bot}
\psPoint(0,varII hXXX sub,zB hYYY add){MTII1bot'}
\psPoint(0,varII hXXX sub,hYYY -1 mul){MTII1top'}
\psPoint(0,varII hXXX add,zB hYYY add){MTII2bot}
\psPoint(0,varII hXXX add,hYYY -1 mul){MTII2top}
\psPoint(0,#2 hXXX sub,hYYY -1 mul){MTII2top'}
\psPoint(0,#2 hXXX sub,zB hYYY add){MTII2bot'}
\ifnum\is@loibom@samesign{#3}{#4}=0 % if 1 dao ham doi dau
\ifnum#3<0 % if 2 y': - +
\psline{->}(MTII1top)(MTII1bot')
\psline{->}(MTII2bot)(MTII2top')
\else %y': + -
\psline{->}(MTII1bot)(MTII1top')
\psline{->}(MTII2top)(MTII2bot')
\fi % end if 2
\else % dao ham cung dau
\ifnum#3<0 % if 3
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){kI}{MTII1mid'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){kII}{MTII2mid}
\psline{->}(MTII1top)(MTII1mid')\psline{->}(MTII2mid)(MTII2bot')
\else
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){kI}{MTII1mid'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){kII}{MTII2mid}
\psline{->}(MTII1bot)(MTII1mid')\psline{->}(MTII2mid)(MTII2top')
\fi % end if 3
\fi % end if 1
\endgroup%
\ignorespaces%
}% end \muiten@lientuc@II
%%%--------ve mui ten 3 khoang lien tuc ---------------------------------
\def\muiten@lientuc@III#1#2#3#4#5{
\pst@killglue %
\begingroup
\use@par
\pstVerb{/lengthIII #2 #1 sub 3 div def
/VarII lengthIII #1 add def
/VarIII lengthIII 2 mul #1 add def}
\psPoint(0,#1 hXXX add,hYYY -1 mul){MTIII1top}
\psPoint(0,#1 hXXX add,zB hYYY add){MTIII1bot}
\psPoint(0,VarII hXXX sub,zB hYYY add){MTIII1bot'}
\psPoint(0,VarII hXXX sub,hYYY -1 mul){MTIII1top'}
\psPoint(0,VarIII hXXX add,zB hYYY add){MTIII3bot}
\psPoint(0,VarIII hXXX add,hYYY -1 mul){MTIII3top}
\psPoint(0,#2 hXXX sub,hYYY -1 mul){MTIII3top'}
\psPoint(0,#2 hXXX sub,zB hYYY add){MTIII3bot'}
\ifnum\is@loibom@samesign{#3}{#4}=0 % if 1 y' doi dau lan 1
\ifnum\is@loibom@samesign{#4}{#5}=0 % if 2 y' doi dau lan 2
\muiten@lientuc@II{#1}{VarIII}{#3}{#4}
\muiten@lientuc@II{VarII}{#2}{#4}{#5}
\else % y' khong doi dau lan 2
\muiten@I{#1}{VarII}{#3}
\muiten@lientuc@II{VarII}{#2}{#4}{#5}
\fi % end if 2
\else % y' khong doi dau lan 1
\ifnum\is@loibom@samesign{#4}{#5}=0 % if 4
\muiten@lientuc@II{#1}{VarIII}{#3}{#4}
\muiten@I{VarIII}{#2}{#5}
\else % y ' khong doi dau lan nao
\pstVerb{
/mau hXXX -2 mul #2 add #1 sub def
/kI hXXX -2 mul VarII add #1 sub mau div def
/kII VarII #1 sub mau div def
/kIII hXXX -2 mul VarIII add #1 sub mau div def
/kIV VarIII #1 sub mau div def
}
\ifnum#3<0 % if 6 y': - - -
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){kI}{MTIII1midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){kII}{MTIII2midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){kIII}{MTIII2midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){kIV}{MTIII3midbot}
\psline{->}(MTIII1top)(MTIII1midbot')
\psline{->}(MTIII2midbot)(MTIII2midbot')
\psline{->}(MTIII3midbot)(MTIII3bot')
\else % y': + + +
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){kI}{MTIII1midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){kII}{MTIII2midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){kIII}{MTIII2midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){kIV}{MTIII3midbot}
\psline{->}(MTIII1bot)(MTIII1midbot')
\psline{->}(MTIII2midbot)(MTIII2midbot')
\psline{->}(MTIII3midbot)(MTIII3top')
\fi % end if 6
\fi % end if 4
\fi % end if 1
\endgroup%
\ignorespaces%
}% end \muiten@lientuc@III
%%%--------ve mui ten 4 khoang lien tuc ---------------------------------
\def\muiten@lientuc@IV#1#2#3#4#5#6{
\pst@killglue %
\begingroup
\use@par
\pstVerb{/lengthIV #2 #1 sub 4 div def
/vArII lengthIV #1 add def
/vArIII lengthIV 2 mul #1 add def
/vArIV lengthIV 3 mul #1 add def}
\psPoint(0,#1 hXXX add,hYYY -1 mul){MTIV1top}
\psPoint(0,#1 hXXX add,zB hYYY add){MTIV1bot}
\psPoint(0,vArII hXXX sub,zB hYYY add){MTIV1bot'}
\psPoint(0,vArII hXXX sub,hYYY -1 mul){MTIV1top'}
\psPoint(0,vArIV hXXX add,zB hYYY add){MTIV4bot}
\psPoint(0,vArIV hXXX add,hYYY -1 mul){MTIV4top}
\psPoint(0,#2 hXXX sub,hYYY -1 mul){MTIV4top'}
\psPoint(0,#2 hXXX sub,zB hYYY add){MTIV4bot'}
\ifnum\is@nonchangesign@iv{#3}{#4}{#5}{#6}=1 % if 1
\muiten@lientuc@III{vArII}{#2}{#4}{#5}{#6}
\muiten@I{#1}{vArII}{#3}
\else\ifnum\is@nonchangesign@iv{#3}{#4}{#5}{#6}=2 % if 3
\muiten@lientuc@II{#1}{vArIII}{#3}{#4}
\muiten@lientuc@II{vArIII}{#2}{#5}{#6}
\else\ifnum\is@nonchangesign@iv{#3}{#4}{#5}{#6}=3 % if 4
\muiten@lientuc@III{#1}{vArIV}{#3}{#4}{#5}
\muiten@I{vArIV}{#2}{#6}
\else
\pstVerb{
/MauIV hXXX -2 mul #2 add #1 sub def
/tisokI hXXX -2 mul lengthIV add MauIV div def
/tisokII lengthIV MauIV div def
/tisokIII lengthIV hXXX sub 2 mul MauIV div def
/tisokIV lengthIV 2 mul MauIV div def
/tisokV lengthIV hXXX sub 2 mul lengthIV add MauIV div def
/tisokVI lengthIV 3 mul MauIV div def
}
\ifnum#3<0% if 7
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisokI}{MTIV1midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisokII}{MTIV2midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisokIII}{MTIV2midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisokIV}{MTIV3midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisokV}{MTIV3midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisokVI}{MTIV4midbot}
\psline{->}(MTIV1top)(MTIV1midbot')
\psline{->}(MTIV2midbot)(MTIV2midbot')
\psline{->}(MTIV3midbot)(MTIV3midbot')
\psline{->}(MTIV4midbot)(MTIV4bot')
\else
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisokI}{MTIV1midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisokII}{MTIV2midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisokIII}{MTIV2midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisokIV}{MTIV3midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisokV}{MTIV3midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisokVI}{MTIV4midbot}
\psline{->}(MTIV1bot)(MTIV1midbot')
\psline{->}(MTIV2midbot)(MTIV2midbot')
\psline{->}(MTIV3midbot)(MTIV3midbot')
\psline{->}(MTIV4midbot)(MTIV4top')
\fi %end if 7
\fi %end if 4
\fi % end if 3
\fi % end if 1
\endgroup%
\ignorespaces%
}% end \muiten@lientuc@IV
%%%--------ve mui ten 5 khoang lien tuc ---------------------------------
\def\muiten@lientuc@V#1#2#3#4#5#6#7{
\pst@killglue %
\begingroup
\use@par
\pstVerb{/lengthV #2 #1 sub 5 div def
/VArII lengthV #1 add def
/VArIII lengthV 2 mul #1 add def
/VArIV lengthV 3 mul #1 add def
/VArV lengthV 4 mul #1 add def}
\psPoint(0,#1 hXXX add,hYYY -1 mul){MTV1top}
\psPoint(0,#1 hXXX add,zB hYYY add){MTV1bot}
\psPoint(0,VArII hXXX sub,zB hYYY add){MTV1bot'}
\psPoint(0,VArII hXXX sub,hYYY -1 mul){MTV1top'}
\psPoint(0,VArV hXXX add,zB hYYY add){MTV5bot}
\psPoint(0,VArV hXXX add,hYYY -1 mul){MTV5top}
\psPoint(0,#2 hXXX sub,hYYY -1 mul){MTV5top'}
\psPoint(0,#2 hXXX sub,zB hYYY add){MTV5bot'}
\ifnum\is@nonchangesign@v{#3}{#4}{#5}{#6}{#7}=1 % if 1: y' doi dau tu dau
\muiten@lientuc@IV{VArII}{#2}{#4}{#5}{#6}{#7}
\muiten@I{#1}{VArII}{#3}
\else\ifnum\is@nonchangesign@v{#3}{#4}{#5}{#6}{#7}=2 % if 3
\muiten@lientuc@II{#1}{VArIII}{#3}{#4}
\muiten@lientuc@III{VArIII}{#2}{#5}{#6}{#7}
\else\ifnum\is@nonchangesign@v{#3}{#4}{#5}{#6}{#7}=3 % if 4
\muiten@lientuc@III{#1}{VArIV}{#3}{#4}{#5}
\muiten@lientuc@II{VArIV}{#2}{#6}{#7}
\else\ifnum\is@nonchangesign@v{#3}{#4}{#5}{#6}{#7}=4 % if 5
\muiten@lientuc@IV{#1}{VArV}{#3}{#4}{#5}{#6}
\muiten@I{VArV}{#2}{#7}
\else % dao ham khong doi dau
\pstVerb{
/MauV hXXX -2 mul #2 add #1 sub def
/tisoVki hXXX -2 mul lengthV add MauV div def
/tisoVkii lengthV MauV div def
/tisoVkiii lengthV hXXX sub 2 mul MauV div def
/tisoVkiv lengthV 2 mul MauV div def
/tisoVkv lengthV hXXX sub 2 mul lengthV add MauV div def
/tisoVkvi lengthV 3 mul MauV div def
/tisoVkvii hXXX -2 mul lengthV 4 mul add MauV div def
/tisoVkviii lengthV 4 mul MauV div def
}
\ifnum#3<0% if 7
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVki}{MTV1midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVkii}{MTV2midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVkiii}{MTV2midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVkiv}{MTV3midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVkv}{MTV3midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVkvi}{MTV4midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVkvii}{MTV4midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVkviii}{MTV5midbot}
\psline{->}(MTV1top)(MTV1midbot')
\psline{->}(MTV2midbot)(MTV2midbot')
\psline{->}(MTV3midbot)(MTV3midbot')
\psline{->}(MTV4midbot)(MTV4midbot')
\psline{->}(MTV5midbot)(MTV5bot')
\else
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVki}{MTV1midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVkii}{MTV2midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVkiii}{MTV2midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVkiv}{MTV3midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVkv}{MTV3midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVkvi}{MTV4midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVkvii}{MTV4midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVkviii}{MTV5midbot}
\psline{->}(MTV1bot)(MTV1midbot')
\psline{->}(MTV2midbot)(MTV2midbot')
\psline{->}(MTV3midbot)(MTV3midbot')
\psline{->}(MTV4midbot)(MTV4midbot')
\psline{->}(MTV5midbot)(MTV5top')
\fi %end if 7
\fi % end if 5
\fi % end if 4
\fi % end if 3
\fi
\endgroup%
\ignorespaces%
}%% end \muiten@lientuc@V
%%%--------ve mui ten 6 khoang lien tuc ---------------------------------
\def\muiten@lientuc@VI#1#2#3#4#5#6#7#8{
\pst@killglue %
\begingroup
\use@par
\pstVerb{/lengthVI #2 #1 sub 6 div def
/VARII lengthVI #1 add def
/VARIII lengthVI 2 mul #1 add def
/VARIV lengthVI 3 mul #1 add def
/VARV lengthVI 4 mul #1 add def
/VARVI lengthVI 5 mul #1 add def}
\psPoint(0,#1 hXXX add,hYYY -1 mul){MTVI1top}
\psPoint(0,#1 hXXX add,zB hYYY add){MTVI1bot}
\psPoint(0,VARII hXXX sub,zB hYYY add){MTVI1bot'}
\psPoint(0,VARII hXXX sub,hYYY -1 mul){MTVI1top'}
\psPoint(0,VARVI hXXX add,zB hYYY add){MTVI6bot}
\psPoint(0,VARVI hXXX add,hYYY -1 mul){MTVI6top}
\psPoint(0,#2 hXXX sub,hYYY -1 mul){MTVI6top'}
\psPoint(0,#2 hXXX sub,zB hYYY add){MTVI6bot'}
\ifnum\is@nonchangesign@vi{#3}{#4}{#5}{#6}{#7}{#8}=1 % if 1: y' doi dau tu dau
\muiten@lientuc@V{VARII}{#2}{#4}{#5}{#6}{#7}{#8}
\muiten@I{#1}{VARII}{#3}
\else\ifnum\is@nonchangesign@vi{#3}{#4}{#5}{#6}{#7}{#8}=2 % if 3
\muiten@lientuc@II{#1}{VARIII}{#3}{#4}
\muiten@lientuc@IV{VARIII}{#2}{#5}{#6}{#7}{#8}
\else\ifnum\is@nonchangesign@vi{#3}{#4}{#5}{#6}{#7}{#8}=3 % if 4
\muiten@lientuc@III{#1}{VARIV}{#3}{#4}{#5}
\muiten@lientuc@III{VARIV}{#2}{#6}{#7}{#8}
\else\ifnum\is@nonchangesign@vi{#3}{#4}{#5}{#6}{#7}{#8}=4 % if 5
\muiten@lientuc@IV{#1}{VARV}{#3}{#4}{#5}{#6}
\muiten@lientuc@II{VARV}{#2}{#7}{#8}
\else\ifnum\is@nonchangesign@vi{#3}{#4}{#5}{#6}{#7}{#8}=5 % if 6
\muiten@lientuc@V{#1}{VARVI}{#3}{#4}{#5}{#6}{#7}
\muiten@I{VARVI}{#2}{#8}
\else % \is@nonchangesign@vi{#3}{#4}{#5}{#6}{#7}{#8}=5 =0
\pstVerb{
/MauVI hXXX -2 mul #2 add #1 sub def
/tisoVIki hXXX -2 mul lengthVI add MauVI div def
/tisoVIkii lengthVI MauVI div def
/tisoVIkiii lengthVI hXXX sub 2 mul MauVI div def
/tisoVIkiv lengthVI 2 mul MauVI div def
/tisoVIkv lengthVI hXXX sub 2 mul lengthVI add MauVI div def
/tisoVIkvi lengthVI 3 mul MauVI div def
/tisoVIkvii hXXX -2 mul lengthVI 4 mul add MauVI div def
/tisoVIkviii lengthVI 4 mul MauVI div def
/tisoVIkix hXXX -2 mul lengthVI 5 mul add MauVI div def
/tisoVIkx lengthVI 5 mul MauVI div def
}
\ifnum#3<0% if 8
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIki}{MTVI1midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIkii}{MTVI2midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIkiii}{MTVI2midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIkiv}{MTVI3midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIkv}{MTVI3midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIkvi}{MTVI4midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIkvii}{MTVI4midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIkviii}{MTVI5midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIkix}{MTVI5midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIkx}{MTVI6midbot}
\psline{->}(MTVI1top)(MTVI1midbot')
\psline{->}(MTVI2midbot)(MTVI2midbot')
\psline{->}(MTVI3midbot)(MTVI3midbot')
\psline{->}(MTVI4midbot)(MTVI4midbot')
\psline{->}(MTVI5midbot)(MTVI5midbot')
\psline{->}(MTVI6midbot)(MTVI6bot')
\else
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIki}{MTVI1midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIkii}{MTVI2midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIkiii}{MTVI2midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIkiv}{MTVI3midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIkv}{MTVI3midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIkvi}{MTVI4midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIkvii}{MTVI4midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIkviii}{MTVI5midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIkix}{MTVI5midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIkx}{MTVI6midbot}
\psline{->}(MTVI1bot)(MTVI1midbot')
\psline{->}(MTVI2midbot)(MTVI2midbot')
\psline{->}(MTVI3midbot)(MTVI3midbot')
\psline{->}(MTVI4midbot)(MTVI4midbot')
\psline{->}(MTVI5midbot)(MTVI5midbot')
\psline{->}(MTVI6midbot)(MTVI6top')
\fi %end if 8
\fi % end if 6
\fi % end if 5
\fi % end if 4
\fi % end if 3
\fi % end if 1
\endgroup%
\ignorespaces%
}%% end \muiten@lientuc@VI
%%%--------ve mui ten 7 khoang lien tuc ---------------------------------
\def\muiten@lientuc@VII#1#2#3#4#5#6#7#8#9{
\pst@killglue %
\begingroup
\use@par
\pstVerb{/lengthVII #2 #1 sub 7 div def
/VARSII lengthVII #1 add def
/VARSIII lengthVII 2 mul #1 add def
/VARSIV lengthVII 3 mul #1 add def
/VARSV lengthVII 4 mul #1 add def
/VARSVI lengthVII 5 mul #1 add def
/VARSVII lengthVII 6 mul #1 add def}
\psPoint(0,#1 hXXX add,hYYY -1 mul){MTVII1top}
\psPoint(0,#1 hXXX add,zB hYYY add){MTVII1bot}
\psPoint(0,VARSII hXXX sub,zB hYYY add){MTVII1bot'}
\psPoint(0,VARSII hXXX sub,hYYY -1 mul){MTVII1top'}
\psPoint(0,VARSVII hXXX add,zB hYYY add){MTVII7bot}
\psPoint(0,VARSVII hXXX add,hYYY -1 mul){MTVII7top}
\psPoint(0,#2 hXXX sub,hYYY -1 mul){MTVII7top'}
\psPoint(0,#2 hXXX sub,zB hYYY add){MTVII7bot'}
\ifnum\is@nonchangesign@vii{#3}{#4}{#5}{#6}{#7}{#8}{#9}=1 % if 1: y' doi dau tu dau
\muiten@lientuc@VI{VARSII}{#2}{#4}{#5}{#6}{#7}{#8}{#9}
\muiten@I{#1}{VARSII}{#3}
\else\ifnum\is@nonchangesign@vii{#3}{#4}{#5}{#6}{#7}{#8}{#9}=2 % if 3
\muiten@lientuc@II{#1}{VARSIII}{#3}{#4}
\muiten@lientuc@V{VARSIII}{#2}{#5}{#6}{#7}{#8}{#9}
\else\ifnum\is@nonchangesign@vii{#3}{#4}{#5}{#6}{#7}{#8}{#9}=3 % if 4
\muiten@lientuc@III{#1}{VARSIV}{#3}{#4}{#5}
\muiten@lientuc@IV{VARSIV}{#2}{#6}{#7}{#8}{#9}
\else\ifnum\is@nonchangesign@vii{#3}{#4}{#5}{#6}{#7}{#8}{#9}=4 % if 5
\muiten@lientuc@IV{#1}{VARSV}{#3}{#4}{#5}{#6}
\muiten@lientuc@III{VARSV}{#2}{#7}{#8}{#9}
\else\ifnum\is@nonchangesign@vii{#3}{#4}{#5}{#6}{#7}{#8}{#9}=5 % if 6
\muiten@lientuc@V{#1}{VARSVI}{#3}{#4}{#5}{#6}{#7}
\muiten@lientuc@II{VARSVI}{#2}{#8}{#9}
\else\ifnum\is@nonchangesign@vii{#3}{#4}{#5}{#6}{#7}{#8}{#9}=6 % if 7
\muiten@lientuc@VI{#1}{VARSVII}{#3}{#4}{#5}{#6}{#7}{#8}
\muiten@I{VARSVII}{#2}{#9}
\else % \is@nonchangesign@vi{#3}{#4}{#5}{#6}{#7}{#8}=5 =0
\pstVerb{
/MauVII hXXX -2 mul #2 add #1 sub def
/tisoVIIki hXXX -2 mul lengthVII add MauVII div def
/tisoVIIkii lengthVII MauVII div def
/tisoVIIkiii lengthVII hXXX sub 2 mul MauVII div def
/tisoVIIkiv lengthVII 2 mul MauVII div def
/tisoVIIkv lengthVII hXXX sub 2 mul lengthVII add MauVII div def
/tisoVIIkvi lengthVII 3 mul MauVII div def
/tisoVIIkvii hXXX -2 mul lengthVII 4 mul add MauVII div def
/tisoVIIkviii lengthVII 4 mul MauVII div def
/tisoVIIkix hXXX -2 mul lengthVII 5 mul add MauVII div def
/tisoVIIkx lengthVII 5 mul MauVII div def
/tisoVIIkxi hXXX -2 mul lengthVII 6 mul add MauVII div def
/tisoVIIkxii lengthVII 6 mul MauVII div def
}
\ifnum#3<0% if 9
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIIki}{MTVII1midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIIkii}{MTVII2midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIIkiii}{MTVII2midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIIkiv}{MTVII3midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIIkv}{MTVII3midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIIkvi}{MTVII4midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIIkvii}{MTVII4midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIIkviii}{MTVII5midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIIkix}{MTVII5midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIIkx}{MTVII6midbot}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIIkxi}{MTVII6midbot'}
\loibom@vitu(0,#1 hXXX add,hYYY -1 mul)(0,#2 hXXX sub,zB hYYY add){tisoVIIkxii}{MTVII7midbot}
\psline{->}(MTVII1top)(MTVII1midbot')
\psline{->}(MTVII2midbot)(MTVII2midbot')
\psline{->}(MTVII3midbot)(MTVII3midbot')
\psline{->}(MTVII4midbot)(MTVII4midbot')
\psline{->}(MTVII5midbot)(MTVII5midbot')
\psline{->}(MTVII6midbot)(MTVII6midbot')
\psline{->}(MTVII7midbot)(MTVII7bot')
\else
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIIki}{MTVII1midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIIkii}{MTVII2midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIIkiii}{MTVII2midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIIkiv}{MTVII3midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIIkv}{MTVII3midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIIkvi}{MTVII4midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIIkvii}{MTVII4midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIIkviii}{MTVII5midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIIkix}{MTVII5midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIIkx}{MTVII6midbot}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIIkxi}{MTVII6midbot'}
\loibom@vitu(0,#1 hXXX add,zB hYYY add)(0,#2 hXXX sub,hYYY -1 mul){tisoVIIkxii}{MTVII7midbot}
\psline{->}(MTVII1bot)(MTVII1midbot')
\psline{->}(MTVII2midbot)(MTVII2midbot')
\psline{->}(MTVII3midbot)(MTVII3midbot')
\psline{->}(MTVII4midbot)(MTVII4midbot')
\psline{->}(MTVII5midbot)(MTVII5midbot')
\psline{->}(MTVII6midbot)(MTVII6midbot')
\psline{->}(MTVII7midbot)(MTVII7top')
\fi %end if 9
\fi % end if 7
\fi % end if 6
\fi % end if 5
\fi % end if 4
\fi % end if 3
\fi % end if 1
\endgroup%
\ignorespaces%
}%% end \muiten@lientuc@VII
%%------------ Ve mui ten gian doan 2 khoang ------------
\def\muiten@giandoan@II#1#2#3#4#5{
\pst@killglue %
\begingroup
\use@par
\pstVerb{/gdvarII #2 #1 sub 2 div #1 add def}
\setcounter{donvilb}{#5}
\ifnum\thedonvilb=2
\muiten@I{#1}{gdvarII}{#3}
\muiten@I{gdvarII}{#2}{#4}
\else \muiten@lientuc@II{#1}{#2}{#3}{#4}
\fi
\endgroup%
\ignorespaces%
}% end \muiten@giandoan@II
\def\muiten@giandoan@III#1#2#3#4#5#6{
\pst@killglue
\begingroup
\use@par
\pstVerb{/LengthIII #2 #1 sub 3 div def
/GdvarII LengthIII #1 add def
/GdvarIII LengthIII 2 mul #1 add def}
\setcounter{donvilb}{#6-10*(#6/10)}
\setcounter{xoadonvilb}{#6/10}
\ifnum\thedonvilb=2
\muiten@I{#1}{GdvarII}{#3}
\muiten@lientuc@II{GdvarII}{#2}{#4}{#5}
\else\ifnum\thedonvilb=3\muiten@giandoan@II{#1}{GdvarIII}{#3}{#4}{\thexoadonvilb}
\muiten@I{GdvarIII}{#2}{#5}
\else\muiten@lientuc@III{#1}{#2}{#3}{#4}{#5}
\fi\fi
\endgroup%
\ignorespaces%
}
%%--------Ve mui ten gian doan 4 khoang-----------------
\def\muiten@giandoan@IV#1#2#3#4#5#6#7{
\pst@killglue
\begingroup
\use@par
\pstVerb{/LengthIV #2 #1 sub 4 div def
/IVxgdII LengthIV #1 add def
/IVxgdIII LengthIV 2 mul #1 add def
/IVxgdIV LengthIV 3 mul #1 add def}
\setcounter{donvilb}{#7-10*(#7/10)}
\setcounter{xoadonvilb}{#7/10}
\ifnum\thedonvilb=2
\muiten@I{#1}{IVxgdII}{#3}
\muiten@lientuc@III{IVxgdII}{#2}{#4}{#5}{#6}
\else\ifnum\thedonvilb=3
\muiten@giandoan@II{#1}{IVxgdIII}{#3}{#4}{\thexoadonvilb}
\muiten@lientuc@II{IVxgdIII}{#2}{#5}{#6}
\else\ifnum\thedonvilb=4
\muiten@giandoan@III{#1}{IVxgdIV}{#3}{#4}{#5}{\thexoadonvilb}
\muiten@I{IVxgdIV}{#2}{#6}
\else\muiten@lientuc@IV{#1}{#2}{#3}{#4}{#5}{#6}
\fi
\fi
\fi
\endgroup%
\ignorespaces%
}%end \muiten@giandoan@IV
%%--------Ve mui ten gian doan 5 khoang-----------------
\def\muiten@giandoan@V#1#2#3#4#5#6#7#8{
\pst@killglue
\begingroup
\use@par
\pstVerb{/LengthV #2 #1 sub 5 div def
/VxgdII LengthV #1 add def
/VxgdIII LengthV 2 mul #1 add def
/VxgdIV LengthV 3 mul #1 add def
/VxgdV LengthV 4 mul #1 add def}
\setcounter{donvilb}{#8-10*(#8/10)}
\setcounter{xoadonvilb}{#8/10}
\ifnum\thedonvilb=2
\muiten@I{#1}{VxgdII}{#3}
\muiten@lientuc@IV{VxgdII}{#2}{#4}{#5}{#6}{#7}
\else\ifnum\thedonvilb=3
\muiten@giandoan@II{#1}{VxgdIII}{#3}{#4}{\thexoadonvilb}
\muiten@lientuc@III{VxgdIII}{#2}{#5}{#6}{#7}
\else\ifnum\thedonvilb=4
\muiten@giandoan@III{#1}{VxgdIV}{#3}{#4}{#5}{\thexoadonvilb}
\muiten@lientuc@II{VxgdIV}{#2}{#6}{#7}
\else\ifnum\thedonvilb=5
\muiten@giandoan@IV{#1}{VxgdV}{#3}{#4}{#5}{#6}{\thexoadonvilb}
\muiten@I{VxgdV}{#2}{#7}
\else\muiten@lientuc@V{#1}{#2}{#3}{#4}{#5}{#6}{#7}
\fi
\fi
\fi
\fi
\endgroup%
\ignorespaces%
}%end \muiten@giandoan@V
\def\muiten@giandoan@VI#1#2#3#4#5#6#7#8#9{
\pst@killglue
\begingroup
\use@par
\pstVerb{/LengthVI #2 #1 sub 6 div def
/VIxgdII LengthVI #1 add def
/VIxgdIII LengthVI 2 mul #1 add def
/VIxgdIV LengthVI 3 mul #1 add def
/VIxgdV LengthVI 4 mul #1 add def
/VIxgdVI LengthVI 5 mul #1 add def}
\setcounter{donvilb}{#9-10*(#9/10)}
\setcounter{xoadonvilb}{#9/10}
\ifnum\thedonvilb=2
\muiten@I{#1}{VIxgdII}{#3}
\muiten@lientuc@V{VIxgdII}{#2}{#4}{#5}{#6}{#7}{#8}
\else\ifnum\thedonvilb=3
\muiten@giandoan@II{#1}{VIxgdIII}{#3}{#4}{\thexoadonvilb}
\muiten@lientuc@IV{VIxgdIII}{#2}{#5}{#6}{#7}{#8}
\else\ifnum\thedonvilb=4
\muiten@giandoan@III{#1}{VIxgdIV}{#3}{#4}{#5}{\thexoadonvilb}
\muiten@lientuc@III{VIxgdIV}{#2}{#6}{#7}{#8}
\else\ifnum\thedonvilb=5
\muiten@giandoan@IV{#1}{VIxgdV}{#3}{#4}{#5}{#6}{\thexoadonvilb}
\muiten@lientuc@II{VIxgdV}{#2}{#7}{#8}
\else\ifnum\thedonvilb=6
\muiten@giandoan@V{#1}{VIxgdVI}{#3}{#4}{#5}{#6}{#7}{\thexoadonvilb}
\muiten@I{VIxgdVI}{#2}{#8}
\else\muiten@lientuc@VII{0}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}
\fi
\fi
\fi
\fi
\fi
\endgroup%
\ignorespaces%
}%end \muiten@giandoan@VI
\def\muiten@giandoan@VII#1#2#3#4#5#6#7#8#9{
\pst@killglue
\begingroup
\use@par
\pstVerb{/LengthVII #1 7 div def
/VIIxgdII LengthVII def
/VIIxgdIII LengthVII 2 mul def
/VIIxgdIV LengthVII 3 mul def
/VIIxgdV LengthVII 4 mul def
/VIIxgdVI LengthVII 5 mul def
/VIIxgdVII LengthVII 6 mul def}
\setcounter{donvilb}{#9-10*(#9/10)}
\setcounter{xoadonvilb}{#9/10}
\ifnum\thedonvilb=2
\muiten@I{0}{VIIxgdII}{#2}
\muiten@lientuc@VI{VIIxgdII}{#1}{#3}{#4}{#5}{#6}{#7}{#8}
\else\ifnum\thedonvilb=3
\muiten@giandoan@II{0}{VIIxgdIII}{#2}{#3}{\thexoadonvilb}
\muiten@lientuc@V{VIIxgdIII}{#1}{#4}{#5}{#6}{#7}{#8}
\else\ifnum\thedonvilb=4
\muiten@giandoan@III{0}{VIIxgdIV}{#2}{#3}{#4}{\thexoadonvilb}
\muiten@lientuc@IV{VIIxgdIV}{#1}{#5}{#6}{#7}{#8}
\else\ifnum\thedonvilb=5
\muiten@giandoan@IV{0}{VIIxgdV}{#2}{#3}{#4}{#5}{\thexoadonvilb}
\muiten@lientuc@III{VIIxgdV}{#2}{#6}{#7}{#8}
\else\ifnum\thedonvilb=6
\muiten@giandoan@V{0}{VIIxgdVI}{#2}{#3}{#4}{#5}{#6}{\thexoadonvilb}
\muiten@lientuc@II{VIIxgdVI}{#1}{#7}{#8}
\else\ifnum\thedonvilb=7
\muiten@giandoan@VI{0}{VIIxgdVII}{#2}{#3}{#4}{#5}{#6}{#7}{\thexoadonvilb}
\muiten@I{VIIxgdVII}{#1}{#8}
\else\muiten@lientuc@VII{0}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}
\fi
\fi
\fi
\fi
\fi
\fi
\endgroup%
\ignorespaces%
}%end \muiten@giandoan@VII
%%% ve bang bien thien
\def\BBT{\def\pst@par{}\pst@object{BBT}}
\def\BBT@i{
\pst@killglue %
\begingroup
\use@par %
\pstVerb{
/hYYY \pst@loibom@hY\space 5 mul 8 div def
/hXXX \pst@loibom@hX\space 5 mul 8 div def
/hXX \pst@loibom@hX\space 2 div def
/zA \pst@loibom@hY\space 2 mul def
/zB \pst@loibom@cao\space -1 mul def
/yC \pst@loibom@hX\space -1 mul def
/zC \pst@loibom@hY\space def
/yE \pst@loibom@hX\space -1 mul def
/yG \pst@loibom@dai\space def
/yD \pst@loibom@dai\space def
/zD \pst@loibom@hY\space def
/zx \pst@loibom@hY\space def
/ydiff \pst@loibom@hY\space 2 div def
/yfunc \pst@loibom@cao\space -3 div def
/yxII \pst@loibom@dai\space hXX sub \pst@loibom@sokhoang\space div def
/yxI 0 def
/yxIII yxII 2 mul def
/yxIV yxII 3 mul def
/yxV yxII 4 mul def
/yxVI yxII 5 mul def
/yxVII yxII 6 mul def
/yxVIII yxII 7 mul def
/yxIX yxII 8 mul def
/ydifI yxII 2 div def
/ydifII ydifI 3 mul def
/ydifIII ydifI 5 mul def
/ydifIV ydifI 7 mul def
/ydifV ydifI 9 mul def
/ydifVI ydifI 11 mul def
/ydifVII ydifI 13 mul def
/ydifVIII ydifI 15 mul def
}
\psPoint(0,0,0){O}
\psPoint(0,0,zx){x}
\psPoint(0,0,ydiff){y'}
\psPoint(0,0,yfunc){y}
\psPoint(0,0,zA){A}
\psPoint(0,0,zB){B}
\psPoint(0,yC,zC){C}
\psPoint(0,yD,zD){D}
\psPoint(0,yE,0){E}
\psPoint(0,yG,0){G}
\psPoint(0,yxI,zx){xI}
\psPoint(0,yxII,zx){xII}
\psPoint(0,yxIII,zx){xIII}
\psPoint(0,yxIV,zx){xIV}
\psPoint(0,yxV,zx){xV}
\psPoint(0,yxVI,zx){xVI}
\psPoint(0,yxVII,zx){xVII}
\psPoint(0,yxVIII,zx){xVIII}
\psPoint(0,yxIX,zx){xIX}
\psPoint(0,yxI,zx){dif1top}\psPoint(0,yxI,0){dif1bot}
\psPoint(0,yxII,zx){dif2top}\psPoint(0,yxII,0){dif2bot}
\psPoint(0,yxIII,zx){dif3top}\psPoint(0,yxIII,0){dif3bot}
\psPoint(0,yxIV,zx){dif4top}\psPoint(0,yxIV,0){dif4bot}
\psPoint(0,yxV,zx){dif5top}\psPoint(0,yxV,0){dif5bot}
\psPoint(0,yxVI,zx){dif6top}\psPoint(0,yxVI,0){dif6bot}
\psPoint(0,yxVII,zx){dif7top}\psPoint(0,yxVII,0){dif7bot}
\psPoint(0,yxVIII,zx){dif8top}\psPoint(0,yxVIII,0){dif8bot}
\psPoint(0,ydifI,zx 2 div){sign1}
\psPoint(0,ydifII,zx 2 div){sign2}
\psPoint(0,yxII,zx 2 div){dth2}
%%-----------dat cac diem cho gia tri ham -------------------
\psPoint(0,yxII,hYYY -1 mul){gt2top}
\psPoint(0,yxII,hYYY zB add){gt2bot}
\psPoint(0,yxIII,hYYY -1 mul){gt3top}
\psPoint(0,yxIII,hYYY zB add){gt3bot}
\psPoint(0,yxIV,hYYY -1 mul){gt4top}
\psPoint(0,yxIV,hYYY zB add){gt4bot}
\ifPst@giandoan
\ifnum\pst@loibom@sokhoang=2
\muiten@giandoan@II{yxI}{yxIII}{\pst@loibom@daudaoham@xI}{\pst@loibom@daudaoham@xII}{\pst@loibom@diemgiandoan@I}
\else\ifnum\pst@loibom@sokhoang=3
\setcounter{sodiemgiandoan}{\lb@ghepso{\pst@loibom@diemgiandoan@sodiemgd}{\pst@loibom@diemgiandoan@I}{\pst@loibom@diemgiandoan@II}{9}{9}{9}{9}{9}{9}}
\muiten@giandoan@III{yxI}{yxIV}{\pst@loibom@daudaoham@xI}{\pst@loibom@daudaoham@xII}{\pst@loibom@daudaoham@xIII}{\thesodiemgiandoan}
\else\ifnum\pst@loibom@sokhoang=4
\setcounter{sodiemgiandoan}{\lb@ghepso{\pst@loibom@diemgiandoan@sodiemgd}{\pst@loibom@diemgiandoan@I}{\pst@loibom@diemgiandoan@II}{\pst@loibom@diemgiandoan@III}{9}{9}{9}{9}{9}}
\muiten@giandoan@IV{yxI}{yxV}{\pst@loibom@daudaoham@xI}{\pst@loibom@daudaoham@xII}{\pst@loibom@daudaoham@xIII}{\pst@loibom@daudaoham@xIV}{\thesodiemgiandoan}
\else\ifnum\pst@loibom@sokhoang=5
\setcounter{sodiemgiandoan}{\lb@ghepso{\pst@loibom@diemgiandoan@sodiemgd}{\pst@loibom@diemgiandoan@I}{\pst@loibom@diemgiandoan@II}{\pst@loibom@diemgiandoan@III}{\pst@loibom@diemgiandoan@IV}{9}{9}{9}{9}}
\muiten@giandoan@V{yxI}{yxVI}{\pst@loibom@daudaoham@xI}{\pst@loibom@daudaoham@xII}{\pst@loibom@daudaoham@xIII}{\pst@loibom@daudaoham@xIV}{\pst@loibom@daudaoham@xV}{\thesodiemgiandoan}
\else\ifnum\pst@loibom@sokhoang=6
\setcounter{sodiemgiandoan}{\lb@ghepso{\pst@loibom@diemgiandoan@sodiemgd}{\pst@loibom@diemgiandoan@I}{\pst@loibom@diemgiandoan@II}{\pst@loibom@diemgiandoan@III}{\pst@loibom@diemgiandoan@IV}{\pst@loibom@diemgiandoan@V}{9}{9}{9}}
\muiten@giandoan@VI{yxI}{yxVII}{\pst@loibom@daudaoham@xI}{\pst@loibom@daudaoham@xII}{\pst@loibom@daudaoham@xIII}{\pst@loibom@daudaoham@xIV}{\pst@loibom@daudaoham@xV}{\pst@loibom@daudaoham@xVI}{\thesodiemgiandoan}
\else\ifnum\pst@loibom@sokhoang=7
\setcounter{sodiemgiandoan}{\lb@ghepso{\pst@loibom@diemgiandoan@sodiemgd}{\pst@loibom@diemgiandoan@I}{\pst@loibom@diemgiandoan@II}{\pst@loibom@diemgiandoan@III}{\pst@loibom@diemgiandoan@IV}{\pst@loibom@diemgiandoan@V}{\pst@loibom@diemgiandoan@VI}{9}{9}}
\muiten@giandoan@VII{yxVIII}{\pst@loibom@daudaoham@xI}{\pst@loibom@daudaoham@xII}{\pst@loibom@daudaoham@xIII}{\pst@loibom@daudaoham@xIV}{\pst@loibom@daudaoham@xV}{\pst@loibom@daudaoham@xVI}{\pst@loibom@daudaoham@xVII}{\thesodiemgiandoan}
\fi % end so khoang 7
\fi % end so khoang 6
\fi % end so khoang 5
\fi %end so khoang 4
\fi %% end do khoang 3
\fi%%-------------------------------------------------
\else
\ifnum\pst@loibom@sokhoang=1 \muiten@I{yxI}{yxII}{\pst@loibom@daudaoham@xI}
\else\ifnum\pst@loibom@sokhoang=2 %--------------------------
\muiten@lientuc@II{yxI}{yxIII}{\pst@loibom@daudaoham@xI}{\pst@loibom@daudaoham@xII}
\else\ifnum\pst@loibom@sokhoang=3 %-------------------------
\muiten@lientuc@III{yxI}{yxIV}{\pst@loibom@daudaoham@xI}{\pst@loibom@daudaoham@xII}{\pst@loibom@daudaoham@xIII}
\else\ifnum\pst@loibom@sokhoang=4 %--------------------------
\muiten@lientuc@IV{yxI}{yxV}{\pst@loibom@daudaoham@xI}{\pst@loibom@daudaoham@xII}{\pst@loibom@daudaoham@xIII}{\pst@loibom@daudaoham@xIV}
\else\ifnum\pst@loibom@sokhoang=5
\muiten@lientuc@V{yxI}{yxVI}{\pst@loibom@daudaoham@xI}{\pst@loibom@daudaoham@xII}{\pst@loibom@daudaoham@xIII}{\pst@loibom@daudaoham@xIV}{\pst@loibom@daudaoham@xV}
\else \ifnum\pst@loibom@sokhoang=6
\muiten@lientuc@VI{yxI}{yxVII}{\pst@loibom@daudaoham@xI}{\pst@loibom@daudaoham@xII}{\pst@loibom@daudaoham@xIII}{\pst@loibom@daudaoham@xIV}{\pst@loibom@daudaoham@xV}{\pst@loibom@daudaoham@xVI}
\else \ifnum\pst@loibom@sokhoang=7
\muiten@lientuc@VII{yxI}{yxVIII}{\pst@loibom@daudaoham@xI}{\pst@loibom@daudaoham@xII}{\pst@loibom@daudaoham@xIII}{\pst@loibom@daudaoham@xIV}{\pst@loibom@daudaoham@xV}{\pst@loibom@daudaoham@xVI}{\pst@loibom@daudaoham@xVII}
\fi
\fi
\fi
\fi
\fi
\fi
\fi % end if khong co diem gian doan
\fi
\psline(A)(B)
\psline(C)(D)
\psline(E)(G)
\uput[ul](x){\pst@loibom@BBT@xname}
\uput[l](y'){\pst@loibom@BBT@diffname}
\uput[dl](y){\pst@loibom@BBT@funcname}
\uput[ur](xI){\pst@loibom@giatribien@xI}
\uput[u](xII){\pst@loibom@giatribien@xII}
\uput[u](xIII){\pst@loibom@giatribien@xIII}
\uput[u](xIV){\pst@loibom@giatribien@xIV}
\uput[u](xV){\pst@loibom@giatribien@xV}
\uput[u](xVI){\pst@loibom@giatribien@xVI}
\uput[u](xVII){\pst@loibom@giatribien@xVII}
\uput[u](xVIII){\pst@loibom@giatribien@xVIII}
%% Dat dau dao ham
\ifnum\pst@loibom@sokhoang=1 % if 1
\ifnum\pst@loibom@daudaoham@xI=-1
\pstThreeDPut(0,ydifI,zx 2 div){$-$}
\else\pstThreeDPut(0,ydifI,zx 2 div){$+$}\fi
\else\ifnum\pst@loibom@sokhoang=2 % if 2
\ifnum\pst@loibom@daudaoham@xI=-1 \Rput[c](sign1){$-$}
\else \Rput[c](sign1){$+$}\fi
\ifnum\pst@loibom@daudaoham@xII=-1\Rput[c](sign2){$-$}
\else \Rput[c](sign2){$+$}\fi
\ifnum\pst@loibom@diemtoihan@II=0\Rput[c](dth2){$0$}
\else\psline[doubleline=true](dif2top)(dif2bot)\fi
\else\ifnum\pst@loibom@sokhoang=3 % if 3
\ifnum\pst@loibom@daudaoham@xI=-1\pstThreeDPut(0,ydifI,zx 2 div){$-$}\else\pstThreeDPut(0,ydifI,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xII=-1\pstThreeDPut(0,ydifII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xIII=-1\pstThreeDPut(0,ydifIII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifIII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@diemtoihan@II=0\pstThreeDPut(0,yxII,zx 2 div){$0$}\else\psline[doubleline=true](dif2top)(dif2bot)\fi
\ifnum\pst@loibom@diemtoihan@III=0\pstThreeDPut(0,yxIII,zx 2 div){$0$}\else\psline[doubleline=true](dif3top)(dif3bot)\fi
\else\ifnum\pst@loibom@sokhoang=4 % if 4
\ifnum\pst@loibom@daudaoham@xI=-1\pstThreeDPut(0,ydifI,zx 2 div){$-$}\else\pstThreeDPut(0,ydifI,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xII=-1\pstThreeDPut(0,ydifII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xIII=-1\pstThreeDPut(0,ydifIII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifIII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xIV=-1\pstThreeDPut(0,ydifIV,zx 2 div){$-$}\else\pstThreeDPut(0,ydifIV,zx 2 div){$+$}\fi
\ifnum\pst@loibom@diemtoihan@II=0\pstThreeDPut(0,yxII,zx 2 div){$0$}\else\psline[doubleline=true](dif2top)(dif2bot)\fi
\ifnum\pst@loibom@diemtoihan@III=0\pstThreeDPut(0,yxIII,zx 2 div){$0$}\else\psline[doubleline=true](dif3top)(dif3bot)\fi
\ifnum\pst@loibom@diemtoihan@IV=0\pstThreeDPut(0,yxIV,zx 2 div){$0$}\else\psline[doubleline=true](dif4top)(dif4bot)\fi
\else\ifnum\pst@loibom@sokhoang=5 % if 5
\ifnum\pst@loibom@daudaoham@xI=-1\pstThreeDPut(0,ydifI,zx 2 div){$-$}\else\pstThreeDPut(0,ydifI,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xII=-1\pstThreeDPut(0,ydifII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xIII=-1\pstThreeDPut(0,ydifIII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifIII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xIV=-1\pstThreeDPut(0,ydifIV,zx 2 div){$-$}\else\pstThreeDPut(0,ydifIV,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xV=-1\pstThreeDPut(0,ydifV,zx 2 div){$-$}\else\pstThreeDPut(0,ydifV,zx 2 div){$+$}\fi
\ifnum\pst@loibom@diemtoihan@II=0\pstThreeDPut(0,yxII,zx 2 div){$0$}\else\psline[doubleline=true](dif2top)(dif2bot)\fi
\ifnum\pst@loibom@diemtoihan@III=0\pstThreeDPut(0,yxIII,zx 2 div){$0$}\else\psline[doubleline=true](dif3top)(dif3bot)\fi
\ifnum\pst@loibom@diemtoihan@IV=0\pstThreeDPut(0,yxIV,zx 2 div){$0$}\else\psline[doubleline=true](dif4top)(dif4bot)\fi
\ifnum\pst@loibom@diemtoihan@V=0\pstThreeDPut(0,yxV,zx 2 div){$0$}\else\psline[doubleline=true](dif5top)(dif5bot)\fi
\else\ifnum\pst@loibom@sokhoang=6 % if 6
\ifnum\pst@loibom@daudaoham@xI=-1\pstThreeDPut(0,ydifI,zx 2 div){$-$}\else\pstThreeDPut(0,ydifI,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xII=-1\pstThreeDPut(0,ydifII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xIII=-1\pstThreeDPut(0,ydifIII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifIII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xIV=-1\pstThreeDPut(0,ydifIV,zx 2 div){$-$}\else\pstThreeDPut(0,ydifIV,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xV=-1\pstThreeDPut(0,ydifV,zx 2 div){$-$}\else\pstThreeDPut(0,ydifV,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xVI=-1\pstThreeDPut(0,ydifVI,zx 2 div){$-$}\else\pstThreeDPut(0,ydifVI,zx 2 div){$+$}\fi
\ifnum\pst@loibom@diemtoihan@II=0\pstThreeDPut(0,yxII,zx 2 div){$0$}\else\psline[doubleline=true](dif2top)(dif2bot)\fi
\ifnum\pst@loibom@diemtoihan@III=0\pstThreeDPut(0,yxIII,zx 2 div){$0$}\else\psline[doubleline=true](dif3top)(dif3bot)\fi
\ifnum\pst@loibom@diemtoihan@IV=0\pstThreeDPut(0,yxIV,zx 2 div){$0$}\else\psline[doubleline=true](dif4top)(dif4bot)\fi
\ifnum\pst@loibom@diemtoihan@V=0\pstThreeDPut(0,yxV,zx 2 div){$0$}\else\psline[doubleline=true](dif5top)(dif5bot)\fi
\ifnum\pst@loibom@diemtoihan@VI=0\pstThreeDPut(0,yxVI,zx 2 div){$0$}\else\psline[doubleline=true](dif6top)(dif6bot)\fi
\else\ifnum\pst@loibom@sokhoang=7 % if 7
\ifnum\pst@loibom@daudaoham@xI=-1\pstThreeDPut(0,ydifI,zx 2 div){$-$}\else\pstThreeDPut(0,ydifI,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xII=-1\pstThreeDPut(0,ydifII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xIII=-1\pstThreeDPut(0,ydifIII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifIII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xIV=-1\pstThreeDPut(0,ydifIV,zx 2 div){$-$}\else\pstThreeDPut(0,ydifIV,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xV=-1\pstThreeDPut(0,ydifV,zx 2 div){$-$}\else\pstThreeDPut(0,ydifV,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xVI=-1\pstThreeDPut(0,ydifVI,zx 2 div){$-$}\else\pstThreeDPut(0,ydifVI,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xVII=-1\pstThreeDPut(0,ydifVII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifVII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@diemtoihan@II=0\pstThreeDPut(0,yxII,zx 2 div){$0$}\else\psline[doubleline=true](dif2top)(dif2bot)\fi
\ifnum\pst@loibom@diemtoihan@III=0\pstThreeDPut(0,yxIII,zx 2 div){$0$}\else\psline[doubleline=true](dif3top)(dif3bot)\fi
\ifnum\pst@loibom@diemtoihan@IV=0\pstThreeDPut(0,yxIV,zx 2 div){$0$}\else\psline[doubleline=true](dif4top)(dif4bot)\fi
\ifnum\pst@loibom@diemtoihan@V=0\pstThreeDPut(0,yxV,zx 2 div){$0$}\else\psline[doubleline=true](dif5top)(dif5bot)\fi
\ifnum\pst@loibom@diemtoihan@VI=0\pstThreeDPut(0,yxVI,zx 2 div){$0$}\else\psline[doubleline=true](dif6top)(dif6bot)\fi
\ifnum\pst@loibom@diemtoihan@VII=0\pstThreeDPut(0,yxVII,zx 2 div){$0$}\else\psline[doubleline=true](dif7top)(dif7bot)\fi
\else\ifnum\pst@loibom@sokhoang=8 % if 8
\ifnum\pst@loibom@daudaoham@xI=-1\pstThreeDPut(0,ydifI,zx 2 div){$-$}\else\pstThreeDPut(0,ydifI,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xII=-1\pstThreeDPut(0,ydifII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xIII=-1\pstThreeDPut(0,ydifIII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifIII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xIV=-1\pstThreeDPut(0,ydifIV,zx 2 div){$-$}\else\pstThreeDPut(0,ydifIV,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xV=-1\pstThreeDPut(0,ydifV,zx 2 div){$-$}\else\pstThreeDPut(0,ydifV,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xVI=-1\pstThreeDPut(0,ydifVI,zx 2 div){$-$}\else\pstThreeDPut(0,ydifVI,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xVII=-1\pstThreeDPut(0,ydifVII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifVII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@daudaoham@xVIII=-1\pstThreeDPut(0,ydifVIII,zx 2 div){$-$}\else\pstThreeDPut(0,ydifVIII,zx 2 div){$+$}\fi
\ifnum\pst@loibom@diemtoihan@II=0\pstThreeDPut(0,yxII,zx 2 div){$0$}\else\psline[doubleline=true](dif2top)(dif2bot)\fi
\ifnum\pst@loibom@diemtoihan@III=0\pstThreeDPut(0,yxIII,zx 2 div){$0$}\else\psline[doubleline=true](dif3top)(dif3bot)\fi
\ifnum\pst@loibom@diemtoihan@IV=0\pstThreeDPut(0,yxIV,zx 2 div){$0$}\else\psline[doubleline=true](dif4top)(dif4bot)\fi
\ifnum\pst@loibom@diemtoihan@V=0\pstThreeDPut(0,yxV,zx 2 div){$0$}\else\psline[doubleline=true](dif5top)(dif5bot)\fi
\ifnum\pst@loibom@diemtoihan@VI=0\pstThreeDPut(0,yxVI,zx 2 div){$0$}\else\psline[doubleline=true](dif6top)(dif6bot)\fi
\ifnum\pst@loibom@diemtoihan@VII=0\pstThreeDPut(0,yxVII,zx 2 div){$0$}\else\psline[doubleline=true](dif7top)(dif7bot)\fi
\ifnum\pst@loibom@diemtoihan@VIII=0\pstThreeDPut(0,yxVIII,zx 2 div){$0$}\else\psline[doubleline=true](dif8top)(dif8bot)\fi
\fi % end if 8
\fi % end if 7
\fi % end if 6
\fi % end if 5
\fi % end if 4
\fi % end if 3
\fi % end if 2
\fi % end if 1
%% Dat dau dao ham xong
%% Dat cac diem gian doan
\ifPst@giandoan % if 1
\ifnum\pst@loibom@diemgiandoan@sodiemgd=1% if 2
\pstVerb{/ygdi \pst@loibom@diemgiandoan@I\space yxII mul yxII sub def}
\psPoint(0,ygdi,zx){gd1top} \psPoint(0,ygdi,zB){gd1bot}
\psline[doubleline=true](gd1top)(gd1bot)
\else\ifnum\pst@loibom@diemgiandoan@sodiemgd=2 % if 3
\pstVerb{
/ygdi \pst@loibom@diemgiandoan@I\space yxII mul yxII sub def
/ygdii \pst@loibom@diemgiandoan@II\space yxII mul yxII sub def}
\psPoint(0,ygdi,zx){gd1top} \psPoint(0,ygdi,zB){gd1bot}
\psPoint(0,ygdii,zx){gd2top} \psPoint(0,ygdii,zB){gd2bot}
\psline[doubleline=true](gd1top)(gd1bot)
\psline[doubleline=true](gd2top)(gd2bot)
\else\ifnum\pst@loibom@diemgiandoan@sodiemgd=3 % if 4
\pstVerb{
/ygdi \pst@loibom@diemgiandoan@I\space yxII mul yxII sub def
/ygdii \pst@loibom@diemgiandoan@II\space yxII mul yxII sub def
/ygdiii \pst@loibom@diemgiandoan@III\space yxII mul yxII sub def}
\psPoint(0,ygdi,zx){gd1top} \psPoint(0,ygdi,zB){gd1bot}
\psPoint(0,ygdii,zx){gd2top} \psPoint(0,ygdii,zB){gd2bot}
\psPoint(0,ygdiii,zx){gd3top} \psPoint(0,ygdiii,zB){gd3bot}
\psline[doubleline=true](gd1top)(gd1bot)
\psline[doubleline=true](gd2top)(gd2bot)
\psline[doubleline=true](gd3top)(gd3bot)
\else\ifnum\pst@loibom@diemgiandoan@sodiemgd=4 % if 5
\pstVerb{
/ygdi \pst@loibom@diemgiandoan@I\space yxII mul yxII sub def
/ygdii \pst@loibom@diemgiandoan@II\space yxII mul yxII sub def
/ygdiii \pst@loibom@diemgiandoan@III\space yxII mul yxII sub def
/ygdiv \pst@loibom@diemgiandoan@IV\space yxII mul yxII sub def}
\psPoint(0,ygdi,zx){gd1top} \psPoint(0,ygdi,zB){gd1bot}
\psPoint(0,ygdii,zx){gd2top} \psPoint(0,ygdii,zB){gd2bot}
\psPoint(0,ygdiii,zx){gd3top} \psPoint(0,ygdiii,zB){gd3bot}
\psPoint(0,ygdiv,zx){gd4top} \psPoint(0,ygdiv,zB){gd4bot}
\psline[doubleline=true](gd1top)(gd1bot)
\psline[doubleline=true](gd2top)(gd2bot)
\psline[doubleline=true](gd3top)(gd3bot)
\psline[doubleline=true](gd4top)(gd4bot)
\else\ifnum\pst@loibom@diemgiandoan@sodiemgd=5 % if 6
\pstVerb{
/ygdi \pst@loibom@diemgiandoan@I\space yxII mul yxII sub def
/ygdii \pst@loibom@diemgiandoan@II\space yxII mul yxII sub def
/ygdiii \pst@loibom@diemgiandoan@III\space yxII mul yxII sub def
/ygdiv \pst@loibom@diemgiandoan@IV\space yxII mul yxII sub def
/ygdv \pst@loibom@diemgiandoan@V\space yxII mul yxII sub def}
\psPoint(0,ygdi,zx){gd1top} \psPoint(0,ygdi,zB){gd1bot}
\psPoint(0,ygdii,zx){gd2top} \psPoint(0,ygdii,zB){gd2bot}
\psPoint(0,ygdiii,zx){gd3top} \psPoint(0,ygdiii,zB){gd3bot}
\psPoint(0,ygdiv,zx){gd4top} \psPoint(0,ygdiv,zB){gd4bot}
\psPoint(0,ygdv,zx){gd5top} \psPoint(0,ygdv,zB){gd5bot}
\psline[doubleline=true](gd1top)(gd1bot)
\psline[doubleline=true](gd2top)(gd2bot)
\psline[doubleline=true](gd3top)(gd3bot)
\psline[doubleline=true](gd4top)(gd4bot)
\psline[doubleline=true](gd5top)(gd5bot)
\else\ifnum\pst@loibom@diemgiandoan@sodiemgd=6 % if 7
\pstVerb{
/ygdi \pst@loibom@diemgiandoan@I\space yxII mul yxII sub def
/ygdii \pst@loibom@diemgiandoan@II\space yxII mul yxII sub def
/ygdiii \pst@loibom@diemgiandoan@III\space yxII mul yxII sub def
/ygdiv \pst@loibom@diemgiandoan@IV\space yxII mul yxII sub def
/ygdv \pst@loibom@diemgiandoan@V\space yxII mul yxII sub def
/ygdvi \pst@loibom@diemgiandoan@VI\space yxII mul yxII sub def}
\psPoint(0,ygdi,zx){gd1top} \psPoint(0,ygdi,zB){gd1bot}
\psPoint(0,ygdii,zx){gd2top} \psPoint(0,ygdii,zB){gd2bot}
\psPoint(0,ygdiii,zx){gd3top} \psPoint(0,ygdiii,zB){gd3bot}
\psPoint(0,ygdiv,zx){gd4top} \psPoint(0,ygdiv,zB){gd4bot}
\psPoint(0,ygdv,zx){gd5top} \psPoint(0,ygdv,zB){gd5bot}
\psPoint(0,ygdvi,zx){gd6top} \psPoint(0,ygdvi,zB){gd6bot}
\psline[doubleline=true](gd1top)(gd1bot)
\psline[doubleline=true](gd2top)(gd2bot)
\psline[doubleline=true](gd3top)(gd3bot)
\psline[doubleline=true](gd4top)(gd4bot)
\psline[doubleline=true](gd5top)(gd5bot)
\psline[doubleline=true](gd6top)(gd6bot)
\else\ifnum\pst@loibom@diemgiandoan@sodiemgd=7 % if 8
\pstVerb{
/ygdi \pst@loibom@diemgiandoan@I\space yxII mul yxII sub def
/ygdii \pst@loibom@diemgiandoan@II\space yxII mul yxII sub def
/ygdiii \pst@loibom@diemgiandoan@III\space yxII mul yxII sub def
/ygdiv \pst@loibom@diemgiandoan@IV\space yxII mul yxII sub def
/ygdv \pst@loibom@diemgiandoan@V\space yxII mul yxII sub def
/ygdvi \pst@loibom@diemgiandoan@VI\space yxII mul yxII sub def
/ygdvii \pst@loibom@diemgiandoan@VII\space yxII mul yxII sub def}
\psPoint(0,ygdi,zx){gd1top} \psPoint(0,ygdi,zB){gd1bot}
\psPoint(0,ygdii,zx){gd2top} \psPoint(0,ygdii,zB){gd2bot}
\psPoint(0,ygdiii,zx){gd3top} \psPoint(0,ygdiii,zB){gd3bot}
\psPoint(0,ygdiv,zx){gd4top} \psPoint(0,ygdiv,zB){gd4bot}
\psPoint(0,ygdv,zx){gd5top} \psPoint(0,ygdv,zB){gd5bot}
\psPoint(0,ygdvi,zx){gd6top} \psPoint(0,ygdvi,zB){gd6bot}
\psPoint(0,ygdvii,zx){gd7top} \psPoint(0,ygdvii,zB){gd7bot}
\psline[doubleline=true](gd1top)(gd1bot)
\psline[doubleline=true](gd2top)(gd2bot)
\psline[doubleline=true](gd3top)(gd3bot)
\psline[doubleline=true](gd4top)(gd4bot)
\psline[doubleline=true](gd5top)(gd5bot)
\psline[doubleline=true](gd6top)(gd6bot)
\psline[doubleline=true](gd7top)(gd7bot)
\fi % end if 8
\fi % end if 7
\fi % end if 6
\fi % end if 5
\fi % end if 4
\fi % end if 3
\fi % end if 2
\else\relax % khong co diem gian doan
\fi % end if 1
\endgroup%
\ignorespaces%
}%%
\catcode`\@=\PstAtCode\relax
\endinput
|
http://www.cs.berkeley.edu/~russell/slides/algorithms/find-transform-algorithm.tex
|
berkeley.edu
|
CC-MAIN-2016-18
|
application/x-tex
| null |
crawl-data/CC-MAIN-2016-18/segments/1461860115672.72/warc/CC-MAIN-20160428161515-00112-ip-10-239-7-51.ec2.internal.warc.gz
| 448,443,076
| 732
|
\code{
\func{Find-Transform}{{\ts}\var{$p_1${\ac}$p_2${\ac}$p_3${\ac}$\mu_1${\ac}$\mu_2${\ac}$\mu_3$}}{a transform \var{Q} such that}
$Q(\mu_1)=p_1$
$Q(\mu_2)=p_2$
$Q(\mu_3)=p_3$
\firstinputs{$p_1${\ac}$p_2${\ac}$p_3$}{image feature points}
\inputs{$\mu_1${\ac}$\mu_2${\ac}$\mu_3$}{model feature points}
}
|
https://cheatography.com/mr-medcraig/cheat-sheets/pe-102-fitness-exercises-lm2/tex/
|
cheatography.com
|
CC-MAIN-2022-49
|
text/plain
|
application/x-tex
|
crawl-data/CC-MAIN-2022-49/segments/1669446710711.7/warc/CC-MAIN-20221129200438-20221129230438-00006.warc.gz
| 200,349,101
| 5,847
|
\documentclass[10pt,a4paper]{article}
% Packages
\usepackage{fancyhdr} % For header and footer
\usepackage{multicol} % Allows multicols in tables
\usepackage{tabularx} % Intelligent column widths
\usepackage{tabulary} % Used in header and footer
\usepackage{hhline} % Border under tables
\usepackage{graphicx} % For images
\usepackage{xcolor} % For hex colours
%\usepackage[utf8x]{inputenc} % For unicode character support
\usepackage[T1]{fontenc} % Without this we get weird character replacements
\usepackage{colortbl} % For coloured tables
\usepackage{setspace} % For line height
\usepackage{lastpage} % Needed for total page number
\usepackage{seqsplit} % Splits long words.
%\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely.
\usepackage[normalem]{ulem} % For underlining links
% Most of the following are not required for the majority
% of cheat sheets but are needed for some symbol support.
\usepackage{amsmath} % Symbols
\usepackage{MnSymbol} % Symbols
\usepackage{wasysym} % Symbols
%\usepackage[english,german,french,spanish,italian]{babel} % Languages
% Document Info
\author{mr.medcraig}
\pdfinfo{
/Title (pe-102-fitness-exercises-lm2.pdf)
/Creator (Cheatography)
/Author (mr.medcraig)
/Subject (PE 102 - Fitness Exercises (LM2) Cheat Sheet)
}
% Lengths and widths
\addtolength{\textwidth}{6cm}
\addtolength{\textheight}{-1cm}
\addtolength{\hoffset}{-3cm}
\addtolength{\voffset}{-2cm}
\setlength{\tabcolsep}{0.2cm} % Space between columns
\setlength{\headsep}{-12pt} % Reduce space between header and content
\setlength{\headheight}{85pt} % If less, LaTeX automatically increases it
\renewcommand{\footrulewidth}{0pt} % Remove footer line
\renewcommand{\headrulewidth}{0pt} % Remove header line
\renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit
% This two commands together give roughly
% the right line height in the tables
\renewcommand{\arraystretch}{1.3}
\onehalfspacing
% Commands
\newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour
\newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols
\newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns
\newcommand{\tn}{\tabularnewline} % Required as custom column type in use
% Font and Colours
\definecolor{HeadBackground}{HTML}{333333}
\definecolor{FootBackground}{HTML}{666666}
\definecolor{TextColor}{HTML}{333333}
\definecolor{DarkBackground}{HTML}{A35B0A}
\definecolor{LightBackground}{HTML}{F9F4EF}
\renewcommand{\familydefault}{\sfdefault}
\color{TextColor}
% Header and Footer
\pagestyle{fancy}
\fancyhead{} % Set header to blank
\fancyfoot{} % Set footer to blank
\fancyhead[L]{
\noindent
\begin{multicols}{3}
\begin{tabulary}{5.8cm}{C}
\SetRowColor{DarkBackground}
\vspace{-7pt}
{\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent
\hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}}
}
\end{tabulary}
\columnbreak
\begin{tabulary}{11cm}{L}
\vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{PE 102 - Fitness Exercises (LM2) Cheat Sheet}}}} \\
\normalsize{by \textcolor{DarkBackground}{mr.medcraig} via \textcolor{DarkBackground}{\uline{cheatography.com/146306/cs/31621/}}}
\end{tabulary}
\end{multicols}}
\fancyfoot[L]{ \footnotesize
\noindent
\begin{multicols}{3}
\begin{tabulary}{5.8cm}{LL}
\SetRowColor{FootBackground}
\mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\
\vspace{-2pt}mr.medcraig \\
\uline{cheatography.com/mr-medcraig} \\
\end{tabulary}
\vfill
\columnbreak
\begin{tabulary}{5.8cm}{L}
\SetRowColor{FootBackground}
\mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\
\vspace{-2pt}Published 11th April, 2022.\\
Updated 11th April, 2022.\\
Page {\thepage} of \pageref{LastPage}.
\end{tabulary}
\vfill
\columnbreak
\begin{tabulary}{5.8cm}{L}
\SetRowColor{FootBackground}
\mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\
\SetRowColor{white}
\vspace{-5pt}
%\includegraphics[width=48px,height=48px]{dave.jpeg}
Measure your website readability!\\
www.readability-score.com
\end{tabulary}
\end{multicols}}
\begin{document}
\raggedright
\raggedcolumns
% Set font size to small. Switch to any value
% from this page to resize cheat sheet text:
% www.emerson.emory.edu/services/latex/latex_169.html
\footnotesize % Small font.
\begin{multicols*}{3}
\begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Module 2: Benefits of Physical Activity}} \tn
% Row 0
\SetRowColor{LightBackground}
\mymulticolumn{2}{x{5.377cm}}{3.1 Hypokinetic Diseases and Conditions \{\{nl\}\} - It describes many of the diseases and conditions associated with inactivity and poor fitness. Health problems brought about by lack of exercise have increased.} \tn
% Row Count 5 (+ 5)
% Row 1
\SetRowColor{white}
{\bf{1. Cardiovascular Diseases}} \{\{nl\}\} Two kinds of {\emph{risk factors}} exist: {\bf{primary (most important)}} and {\bf{secondary (less important)}}. Sedentary, or inactive, living is one {\emph{primary risk factor}}, so cardiovascular disease is considered a hypokinetic condition. . {\emph{Secondary risk factors}} include stressful living and excessive alcohol use. & {\bf{Coronary artery disease}} is a cardiovascular disease that is the number one cause of early death. Coronary artery disease exists when the arteries in your heart are clogged. \{\{nl\}\} Clogging of the arteries is called {\bf{atherosclerosis.}} It occurs when substances including fats, such as cholesterol, build up on the inside walls. \tn
% Row Count 23 (+ 18)
% Row 2
\SetRowColor{LightBackground}
{\bf{a. Heart attack}} & Occurs when the blood supply into or within the heart is severely reduced or cut off. As a result, an area of the heart muscle can die. During a heart attack, the heart may beat abnormally or even stop beating. \tn
% Row Count 34 (+ 11)
\end{tabularx}
\par\addvspace{1.3em}
\vfill
\columnbreak
\begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Module 2: Benefits of Physical Activity (cont)}} \tn
% Row 3
\SetRowColor{LightBackground}
{\bf{b. Stroke}} & It is the third leading cause of death and occurs when the oxygen in the blood supply to the brain is severely reduced or cut off. \tn
% Row Count 7 (+ 7)
% Row 4
\SetRowColor{white}
Important terms & {\bf{Blood pressure}} - the force of blood against your artery walls. \{\{nl\}\} {\bf{Systolic blood pressure}} - The pressure in your arteries immediately after the heart beats. The one that gets the higher readings. \{\{nl\}\} {\bf{Diastolic blood pressure}} - the lower of the two numbers and is the pressure in the artery just before the next beat of the heart. \tn
% Row Count 25 (+ 18)
% Row 5
\SetRowColor{LightBackground}
\mymulticolumn{2}{x{5.377cm}}{{\bf{High blood pressure}} is sometimes referred to as {\emph{hypertension.}} It is the condition in which blood pressure is consistently higher than normal. \{\{nl\}\} Normal - \textless{}120/\textless{}180 \{\{nl\}\} Prehypertension - 120-139/80-89} \tn
% Row Count 30 (+ 5)
\end{tabularx}
\par\addvspace{1.3em}
\vfill
\columnbreak
\begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Module 2: Benefits of Physical Activity (cont)}} \tn
% Row 6
\SetRowColor{LightBackground}
\mymulticolumn{2}{x{5.377cm}}{{\bf{Prehypertension}} is a new category that has been recently added. People in this range have higher than normal blood pressure and should start to take precautions to prevent higher blood pressure.} \tn
% Row Count 5 (+ 5)
% Row 7
\SetRowColor{white}
{\bf{2. Cancer}} & More than 100 different diseases characterized by the uncontrollable growth of abnormal cells are categorized as cancer. Cancer's uncontrolled cells invade normal cells, steal their nutrition, and interfere with the cells' normal functions. \tn
% Row Count 18 (+ 13)
% Row 8
\SetRowColor{LightBackground}
{\bf{3. Diabetes}} & When a person's body cannot regulate sugar levels. \tn
% Row Count 21 (+ 3)
% Row 9
\SetRowColor{white}
\mymulticolumn{2}{x{5.377cm}}{{\bf{Types of Diabetes}} \{\{nl\}\} {\bf{Type I}} - is not a hypokinetic condition. This condition is often hereditary and accounts for about 10\% of all diabetics. \{\{nl\}\} {\bf{Type II}} - most common kind of diabetes. This is a hypokinetic condition because people who are physically active are less likely to have it. Overfatness is considered to be a major risk factor for Type II diabetes.} \tn
% Row Count 29 (+ 8)
% Row 10
\SetRowColor{LightBackground}
{\bf{4. Obesity}} & A condition in which a person has a high percentage of body fat. Often is the result of inactivity, although many other factors may contribute. \tn
% Row Count 37 (+ 8)
\end{tabularx}
\par\addvspace{1.3em}
\vfill
\columnbreak
\begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Module 2: Benefits of Physical Activity (cont)}} \tn
% Row 11
\SetRowColor{LightBackground}
{\bf{5. Osteoporosis}} & When the structure of the bones deteriorates and the bones become weak. Lack of calcium in the diet, especially when a person is young, contributes to osteoporosis. \tn
% Row Count 9 (+ 9)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}
\begin{tabularx}{5.377cm}{x{1.24425 cm} x{3.73275 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Physical Activity Wellness}} \tn
% Row 0
\SetRowColor{LightBackground}
\mymulticolumn{2}{x{5.377cm}}{{\bf{Physical activity}} plays an important role in the prevention of hypokinetic diseases and conditions. Therefore, physical activity is important to good health.} \tn
% Row Count 4 (+ 4)
% Row 1
\SetRowColor{white}
{\bf{Benefits:}} & 1. Improved sense of well-being and functioning \{\{nl\}\} 2. Looking your best \{\{nl\}\} 3. Enjoying leisure activities \{\{nl\}\} 4. Wellness and physical activity \{\{nl\}\} 5. Work efficiency \{\{nl\}\} 6. Opportunity for social interaction \{\{nl\}\} 7. Ability to meet emergencies \tn
% Row Count 13 (+ 9)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}
\begin{tabularx}{5.377cm}{x{1.94103 cm} x{3.03597 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Hyperkinetic Conditions}} \tn
% Row 0
\SetRowColor{LightBackground}
\mymulticolumn{2}{x{5.377cm}}{People experience {\emph{hyperkinetic conditions}} health problems caused by doing too much physical activity.} \tn
% Row Count 3 (+ 3)
% Row 1
\SetRowColor{white}
{\bf{1. Overuse Injuries}} & Occur when you do so much physical activity that your bones, muscles, or other tissues are damaged. It is easy to see that overuse injuries for example, stress fractures, shin splints, and blisters are a type of hyperkinetic condition. \tn
% Row Count 13 (+ 10)
% Row 2
\SetRowColor{LightBackground}
{\bf{2. Activity Neurosis}} & Neurosis is a condition that occurs when a person is overly concerned or fearful about something. People with activity neurosis are overly concerned about getting enough exercise and are upset if they miss a regular workout. \tn
% Row Count 23 (+ 10)
% Row 3
\SetRowColor{white}
{\bf{3. Body Image Disorder}} & This disorder occurs when a person tries to achieve an ideal body by doing excessive exercise. The ideal body is unrealistic and distorted. \tn
% Row Count 29 (+ 6)
% Row 4
\SetRowColor{LightBackground}
{\bf{4. Eating Disorder}} & Several kinds of eating disorders result from an extreme desire to be abnormally thin. People with these conditions have dangerous eating habits and often resort to excessive activity to expend calories for fat loss. \tn
% Row Count 39 (+ 10)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}
\begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{3.2 Healthy Back and Good Posture}} \tn
% Row 0
\SetRowColor{LightBackground}
\mymulticolumn{2}{x{5.377cm}}{{\bf{Back Problems}}} \tn
% Row Count 1 (+ 1)
% Row 1
\SetRowColor{white}
{\bf{Backache}} is considered a hypokinetic condition because weak and short muscles are linked to some types of back problems. {\bf{Poor posture}} also is associated with muscles that are not strong or long enough. & {\bf{Lordosis}}, which is too much arch in the lower back. Lordosis, also called swayback, results when the abdominal muscles are weak and the hip flexor muscles (iliopsoas) are too strong and too short. Lordosis is a problem that can lead to backache. \tn
% Row Count 14 (+ 13)
% Row 2
\SetRowColor{LightBackground}
\mymulticolumn{2}{x{5.377cm}}{{\bf{Posture Problems}}} \tn
% Row Count 15 (+ 1)
% Row 3
\SetRowColor{white}
{\bf{Ptosis (Protruding abdomen/Distended Stomach)}} & A distended stomach is a term usually used to refer to distension or swelling of the abdomen and not of the stomach itself. \tn
% Row Count 22 (+ 7)
% Row 4
\SetRowColor{LightBackground}
{\bf{Kyphosis (Rounded back and shoulders)}} & An exaggerated, forward rounding of the back. It can occur at any age but is most common in older women. Severe kyphosis can cause pain and be disfiguring. \tn
% Row Count 30 (+ 8)
\end{tabularx}
\par\addvspace{1.3em}
\vfill
\columnbreak
\begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{3.2 Healthy Back and Good Posture (cont)}} \tn
% Row 5
\SetRowColor{LightBackground}
{\bf{Back and Posture Improvement and Maintenance}} & 1. Use the large muscles of the body when lifting. \{\{nl\}\} 2. When lifting, keep your weight (hips) low. \{\{nl\}\} 3. Divide a load to make it easier to carry. \{\{nl\}\} 4. Avoid twisting while lifting. \{\{nl\}\} 5. Push or pull heavy objects rather than lift them. \{\{nl\}\} 6. Avoid a bent-over position when sitting, standing, or lifting. \tn
% Row Count 17 (+ 17)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}
% That's all folks
\end{multicols*}
\end{document}
|
https://indico.in2p3.fr/event/1399/contributions/16154/attachments/13494/16560/moriond09_EW_winhart_proceedings.tex
|
in2p3.fr
|
CC-MAIN-2020-34
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2020-34/segments/1596439739048.46/warc/CC-MAIN-20200813161908-20200813191908-00590.warc.gz
| 350,322,335
| 9,408
|
%====================================================================%
% MORIOND.TEX 2-Feb-1995 %
% This latex file rewritten from various sources for use in the %
% preparation of the standard proceedings Volume, latest version %
% for the Neutrino'96 Helsinki conference proceedings %
% by Susan Hezlet with acknowledgments to Lukas Nellen. %
% Some changes are due to David Cassel. %
% %
% Updated to LaTeX2e and adapted to Moriond 2001 conditions %
% by F.Montanet 24/04/2001 %
%====================================================================%
\documentclass[11pt]{article}
\usepackage{moriond,epsfig}
%\documentstyle[11pt,moriond,epsfig]{article}
\bibliographystyle{unsrt}
% for BibTeX - sorted numerical labels by order of
% first citation.
% A useful Journal macro
\def\Journal#1#2#3#4{{#1} {\bf #2}, #3 (#4)}
% Some useful journal names
\def\NCA{\em Nuovo Cimento}
\def\NIM{\em Nucl. Instrum. Methods}
\def\NIMA{{\em Nucl. Instrum. Methods} A}
\def\NPB{{\em Nucl. Phys.} B}
\def\PLB{{\em Phys. Lett.} B}
\def\PRL{\em Phys. Rev. Lett.}
\def\PRD{{\em Phys. Rev.} D}
\def\ZPC{{\em Z. Phys.} C}
\def\PAN{\em Phys. Atom. Nucl.}
% Some other macros used in the sample text
\def\st{\scriptstyle}
\def\sst{\scriptscriptstyle}
\def\mco{\multicolumn}
\def\epp{\epsilon^{\prime}}
\def\vep{\varepsilon}
\def\ra{\rightarrow}
\def\ppg{\pi^+\pi^-\gamma}
\def\vp{{\bf p}}
\def\ko{K^0}
\def\kb{\bar{K^0}}
\def\al{\alpha}
\def\ab{\bar{\alpha}}
\def\bi{\begin{itemize}}
\def\ei{\end{itemize}}
\def\be{\begin{equation}}
\def\ee{\end{equation}}
\def\bea{\begin{eqnarray}}
\def\eea{\end{eqnarray}}
\def\CPbar{\hbox{{\rm CP}\hskip-1.80em{/}}}
\newcommand{\ratio}{\mbox{$\Gamma_{Ke2}/\Gamma_{K\mu2}$}}
\newcommand{\ratiolong}{\mbox{$\Gamma(K\rightarrow e\nu)/\Gamma(K\rightarrow\mu\nu)}$}
\newcommand{\ratiofrac}{\mbox{$\frac{\Gamma_{Ke2}}{\Gamma_{K\mu2}}$}}
\newcommand{\rk}{\mbox{$R_K$}}
\newcommand{\kmt}{\mbox{$K_{\mu 2}$}}
\newcommand{\ket}{\mbox{$K_{e2}$}}
\newcommand{\klt}{\mbox{$K_{l2}$}}
\newcommand{\kp}{\mbox{$K^+$}}
\newcommand{\km}{\mbox{$K^-$}}
\newcommand{\MM}{\mbox{$M_{miss}^2$}}
\newcommand{\kc}{\mbox{$K^\pm$}}
\newcommand{\kctothreepi}{\mbox{$\kc \rightarrow 3\pi$}}
\newcommand{\pmue}{\mbox{$P(\mu\to e)$}}
\newcommand{\ketwog}{\mbox{$Ke2\gamma$}}
%temp replacement due to no font
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% BEGINNING OF TEXT %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\vspace*{4cm}
\title{A STRINGENT TEST OF \boldmath $\mu-e$ UNIVERSALITY IN \boldmath
$K\to l\nu$ DECAYS \\BY NA62 AT CERN}
\author{ A. WINHART }
\address{Institut f\"{u}r Physik, Johannes-Gutenberg-Universit\"{a}t,\\
Mainz, Germany}
\maketitle\abstracts{
New interest has arisen in measuring the ratio $\rk =
\ket/\kmt$, as recent high-intensity kaon experiments are able to
largely improve the precision. With $\sim$150000 collected
\ket~decays, the NA62 experiment has increased the world \ket~sample
by an order of magnitude, allowing a stringent test of $\mu-e$ lepton
universality. Here, we describe the experiment and summarize the status
of the analysis based on $\sim$40\,$\%$ of the total data sample taken
in 2007.
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
In the Standard Model (SM), ratios of purely leptonic decay rates of
$K$ and $\pi$ mesons ($R_l = \Gamma (l^\pm \rightarrow e^\pm \nu) /
\Gamma (l^\pm \rightarrow \mu^\pm \nu), l = K,\pi$) are predicted with excellent sub-permille
accuracy due to the cancellation of hadronic uncertainties. The ratio
\rk, denoted as \ket/\kmt, is given as~\cite{rk_sm}
%
\be
R_K^{SM} =
\frac{m_e^2}{m_\mu^2} \cdot
\left(\frac{m_K^2 - m_e^2}{m_K^2 - m_\mu^2}\right)^2 \cdot
(1 + \delta R_{QED}) =
(2.477 \pm 0.001)\times 10^{-5}\,,
\label{eq:rk_sm}
\ee
%
where $\delta R_{QED} = (3.78 \pm 0.04)\,\%$ is a correction due to
the IB part of the radiative $K_{l2\gamma}$ process. By definition,
the IB part is included in \rk, while the DE structure-dependent (SD)
part is not. The factor $(m_e/m_\mu)^2$ accounts for the strong
helicity suppression of the electron channel, which makes the
\ket~amplitude sensitive to contributions from physics beyond the
SM. Recently, it has been pointed out that in minimal supersymmetric
extensions lepton flavour violating (LFV) processes mediated by the
charged Higgs could occur, in particular in the kaon decay to an
electron and a tau neutrino~\cite{masiero}
%
\be
R_K^{LFV} \approx
R_K^{SM} \left[ 1 + \left(\frac{m_K^4}{M_{H^\pm}^4} \right) \left(
\frac{m_\tau^2}{M_e^2} \right) {|\Delta_{13}|^2} {\tan^6 \beta} \right]\,.
\label{eq:rk_susy}
\ee
%
In a large (not extreme) $\tan\beta$ regime with relatively massive charged
Higgs, an enhancement of \rk~by a few percent is possible, while
analogous SUSY effects in the pion decay are suppressed by a factor
$\rm (m_\pi/M_K)^4 \approx 6\times 10^{-3}$.
Due to the helicity suppression, the thus rare \ket~decay limited the
experimental precision of \rk~measurements in the past; the current world
average $R_K^{PDG} = (2.45 \pm 0.11)\times 10^{-5}$ is based on three
experiments from the 1970's~\cite{pdg}. A series of preliminary results by the
high-intensity kaon experiments NA48/2 and KLOE has improved the
situation, yielding a $1.3\,\%$ precision in combination. Recently, the
KLOE collaboration announced the final result on
\rk~based on $\sim$14000 \ket~candidates with $1.3\,\%$
accuracy~\cite{kloe}. For a stringent test of $\mu-e$ universality, however, the
uncertainty must be reduced even further. In order to reach this
goal, the NA62 experiment collected $\sim$150000 \ket~decays in a
dedicated run in 2007, aiming at measuring \rk~with a precision better
than $0.5\,\%$.~\cite{na62status}
The following results presented here are based on a partial data
sample ($\sim 40\,\%$) with pure \kp~beam.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Data Taking, Beams and Detector}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
For the 2007 data taking, beam setup and detector of the NA48/2
experiment, located at the North Area of the CERN SPS, were
used. Based on the experience of previous NA48/2 studies, the
running conditions were optimized for the \ket~measurement. The main
sample was collected during four months of data taking in 2007 with a
minimum bias trigger condition to ensure high trigger
efficiencies. About 400k SPS spills were recorded with a data volume
of $\sim$90\,TB on tape. Offline data reprocessing and preparation
have been finished. Two more weeks of data taking were allocated in
2008. A number of special data sets were recorded, which will provide a
better understanding of systematic effects whose precision is limited
by statistics of the control samples they are measured with.
Generally, the beam line delivered simultaneous \kp~and \km~beams with narrow
momentum band ($75\pm2$\,GeV/c) by 400\,GeV/$c$ primary SPS protons
interacting with a beryllium target. However, the performance of the muon
sweeping system was such that the beam halo background was much higher
for $K_{e2}^-$ ($\sim20\%$) than for $K_{e2}^+$ ($\sim 1\%$). As a
result, most of the data ($\sim90\%$) were taken with \kp~beam only
and about $10\%$ with \km~beam only. In both cases, the second
beam had been dumped upstream the decay volume. As a benefit of this
method, samples of reconstructed $K_{l2}$ candidates with the charge of
the blocked kaon beam provide a direct measurement of background from the
corresponding beam halo, as it passed the beam dump unaffectedly.
After passing a set of collimators, the kaon beam entered a fiducial
decay volume in a 114\,m long cylindrical vacuum tank, which is followed
by the main detector. The subdetectors relevant for the \ket~measurement
are:
\bi
\item A magnetic spectrometer consisting of four drift chambers (DCHs) with a
central dipole magnet and four views per chamber, used to measure the momenta of
charged particles. The resolution of the track momentum is $\sigma(p)/p =
(0.47 \oplus 0.02\cdot p)\,\%$, with $p$ in GeV/$c$.
\item A plastic scintillator hodoscope with good time resolution to
provide fast trigger signals.
\item The liquid krypton electromagnetic calorimeter (LKr) used for $\gamma$ detection and
particle identification. It's a quasi homogeneous ionization chamber
with 7\,m$^3$ of krypton as active medium and transversally
segmented into 13248 projective cells ($2\times 2$\,cm$^2$ each). The calorimeter is 27
radiation lengths deep and fully contains electromagnetic showers
with energies up to 100\,GeV. The energy resolution obtained is
$\sigma(E)/E = (3.2/\sqrt{E} \oplus 9.0/E \oplus 0.42)\,\%$, with $E$ in GeV.
\ei
A detailed description of the apparatus can be found elsewhere~\cite{na48_detector}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Data Analysis}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Measurement method}
In this experiment, \ket~and \kmt~decays were collected
simultaneously, making the measurement independent of the kaon flux
and leading to cancellation (at first order) of several systematic
effects, e.g. parts of the trigger and detection efficiencies.
Detailed Monte Carlo (MC) simulations have been performed to describe
the data, however, they are used only to a limited extent to rely on
the simulation as little as possible. The MC is needed to 1) evaluate the
geometric acceptance corrections; 2) simulate the very special high
energetic bremsstrahlung process of muons, which will be discussed in
detail below. Trigger and particle identification efficiencies were
measured directly from the data.
As a matter of principle, this is a counting experiment of reconstructed \ket~and
\kmt~candidates. As the backgrounds and acceptances strongly depend on
the momentum of the charged track (ptrack), the analysis is performed
in bins of this variable. In each bin, the ratio \rk~is computed as follows:
%
\be
\rk =
\frac{N(\ket) - N_B(\ket)}{N(\kmt) - N_B(\kmt)} \cdot
\frac{A(\kmt)\times f_\mu\times\epsilon(\kmt)}{A(\ket)\times
f_e\times\epsilon(\ket)} \cdot
\frac{1}{f_{LKr}} \cdot \frac{1}{D}\,,
\ee
%
where $N(K_{l2})$ are the numbers of selected $K_{l2}$ candidates ($l
= e,\mu$), $N_B(K_{l2})$ are the numbers of background candidates,
$f_l$ represent the particle ($e/\mu$) ID efficiencies, $A(K_{l2})$ are the
geometrical acceptances determined with MC simulations,
$\epsilon(K_{l2})$ are the trigger efficiencies, $f_{LKr}$ is the
global readout efficiency of the LKr, and $D$ is the downscaling
factor of the \kmt~trigger.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Event selection}
Due to the topological similarity of \ket~and \kmt~decays, a large
part of the event selection is common for both channels, leading to
cancellations of systematic uncertainties in the ratio \rk.
\vspace{-2mm} \\
%
{\bf Main common requirements:}
\bi
\item Exactly one charged track reconstructed by the spectrometer.
\item The impact points of the extrapolated track must be within the
geometrical acceptances of the relevant subdetectors.
\item The decay vertex is defined as the point of closest approach
between the charged track and the nominal beam axis. The minimum
vertex position must be 18\,m downstream the final collimator to
suppress the beam halo background.
\item The track momentum must be between 15 and 65\,GeV/$c$. The lower
limit is due to the requirement of at least 10\,GeV energy deposit
in the LKr calorimeter in the \ket~trigger condition, the upper
restriction is close to the kinematical limit.
\ei
%
{\bf \boldmath \ket/\kmt~separation:}
\bi
\item Kinematical \klt~identification by reconstruction of the squared
missing mass (= neutrino mass) assuming the track to be an electron
or a muon:
\be
\MM(l) = (P_K - P_l)^2\,,
\ee
where $P_K, P_l \,(l=e,\mu)$ are the kaon and lepton four-momenta. The
kaon momentum was measured with reconstructed \kctothreepi~decays
which had been recorded in parallel during the data taking. The selection
requires $\MM(l) < 0.01\,(GeV/c^2)^2$. A
clear kinematical separation is possible only up to track momenta of
25\,GeV/$c$ (see Fig.\,\ref{fig:emu_separation}, left plot),
corresponding to $\sim$15\,$\%$ of the data.
\item Particle identification by the ratio E/p (= LKr energy deposit
over track momentum), requiring E/p\,$<$\,0.85 for muons and
0.95\,$<$\,E/p\,$<$\,1.10 for
electrons. Fig.\,\ref{fig:emu_separation}, right plot, shows the E/p
spectra for electrons and muons in log scale. It's obvious that the
particle IDs have very low inefficiencies ($\sim$1\,$\%$ for
electrons, a few $10^{-5}$ for muons).
\ei
%
\begin{figure}
\begin{minipage}{0.5\linewidth}
\begin{center}
\psfig{figure=../figures/mm2_vs_ptrack.eps,width=0.99\linewidth}
\end{center}
\end{minipage}
\begin{minipage}{0.5\linewidth}
\begin{center}
\psfig{figure=../figures/eop_log.eps,width=0.99\linewidth}
\end{center}
\end{minipage}
\caption{Variables for \ket/\kmt~separation. Left: Missing mass (with
electron mass hypothesis) vs. track momentum for \ket~(red) and
\kmt~candidates (blue). Right: Ratio E/p for electrons and muons.
\label{fig:emu_separation}}
\end{figure}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Muonic background in the \ket~sample}
In very rare cases, a muon can deposit over 95\,$\%$ of
its energy in the LKr by high energetic ('catastrophic')
bremsstrahlung, thus faking an electron. The probability \pmue~for such a
process is only a few $10^{-6}$, however, due to the helicity
suppression of the electron channel by approx. five orders of magnitude, the
background in the \ket~sample originating from \kmt~decays naturally
amounts to several percent and represents one of the major issues of this analysis.
A direct measurement of \pmue~with a few percent accuracy is a
necessary requirement for validation of the theoretical computation of
the bremsstrahlung cross-section~\cite{pmue_theory} in the highly
energetic $\gamma$ region used to evaluate the \kmt~background.
For this purpose, a $\sim$9$X_0$ thick lead
wall covering $\sim$20\,$\%$ of the geometric acceptance had been
installed between the hodoscope planes during approx. 50\,$\%$ of the
data taking (see sketch in Fig.\,\ref{fig:lead}).
Tracks traversing the wall and depositing over 95\,$\%$
of their energy in the calorimeter represent a sufficiently pure sample of
muons with catastrophic bremsstrahlung; the electron contamination is
$< 10^{-7}$ due to the high energy loss in the lead wall.
The following pure muon samples with high E/p were collected: 1) from
the \kmt~decays during the nominal data taking; 2) from special muon
runs with the hadron beam absorbed. In the present analysis, only a
sample from a 20h long special muon run in 2007 has been used. In
2008, an additional sample has been collected, containing about twice
as many muons.
The momentum-dependence of \pmue~measured with the lead wall technique
is shown in Fig.\,\ref{fig:lead}, right plot,
%
\begin{figure}[h]
\begin{minipage}{0.5\linewidth}
\begin{center}
\psfig{figure=../figures/lead_wall.eps,width=0.99\linewidth}
\end{center}
\end{minipage}
%
\begin{minipage}{0.5\linewidth}
\begin{center}
\psfig{figure=../figures/pmue.eps,width=0.99\linewidth}
\end{center}
\end{minipage}
\caption{Left: Illustration of the lead wall installed between the two
planes of the hodoscope. Tracks passing the wall form a sample of
pure muons. Right: Measured and simulated probability \pmue~for muons
identified as electrons due to catastrophic
bremsstrahlung. Including modifications due to the lead wall
(ionization losses, bremsstrahlung), the
simulation describes the data very well.
\label{fig:lead}}
\end{figure}
%
and is in excellent agreement with the
results obtained with a dedicated Geant4-based MC simulation. To
obtain this level of agreement,
the pure \pmue~from the MC had to be modified due to muon ionization losses
(affects the low ptrack region) and bremsstrahlung in the lead (high
ptrack region).
The preliminary background to signal ratio is $B/S = (7.4 \pm
0.2)\,\%$; the uncertainty is mainly due to the limited size of the
data sample used to validate the simulation. Including the larger 2008
sample and studying muons from \kmt~decays in the clear
\ket/\kmt~separation region (p\,$<$\,25\,GeV/$c$) will clearly help to
reduce the error in the future.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Other background sources in the \ket~sample}
{\bf Beam halo:}
Electrons produced by beam halo muons via $\mu\rightarrow e$
decay are kinematically and geometrically compatible with a genuine
\ket~decay. As described above, the halo background can be measured
directly with the \km~only sample, yielding a background to signal
ratio $B/S = (1.3 \pm 0.1)\,\%$. The reasonably small uncertainty is due to the
limited size of the control sample, and will be further reduced by
including the additional 2008 \km~sample.
The beam halo background in the \kmt~sample is measured with the same
technique as for \ket~decays. With only $\sim$0.2\,$\%$ it represents
the only relevant background, i.e. the \kmt~sample is quasi background-free.
\vspace{2mm} \\
%
{\bf \boldmath \ketwog\,(SD$^+$):}
The structure-dependent (SD) \ketwog~decay is considered a background
by the definition of \rk, and its rate is similar to that of \ket. The
existing theoretical predictions are form factor model-dependent and
have large uncertainties ($\sim$15\,$\%$). The experimental precision
is of similar precision: BR = $(1.52 \pm 0.23) \times 10^{-5}$.~\cite{pdg}
Only energetic electrons ($E_e^* > 230$\,MeV) are compatible with the
\ket~kinematic identification. The background contamination is
estimated by a MC simulation to be $B/S
= (1.6 \pm 0.3)\,\%$, where the uncertainty is due to the poor
knowledge of the process. A measurement based on the NA62 2007 data
sample has started, and a strong improvement of the uncertainty is expected.
\vspace{2mm} \\
%
{\bf \boldmath \kmt~with $\mu\rightarrow e$ decay in flight:}
The muon decay has been included in the MC, and na\"{i}vely seems to
be a major background. Fortunately, only energetic forward electrons,
which are strongly suppressed due to the muon polarization,
can be selected as \ket~candidates. The background to signal
ratio is estimated to be $B/S = (1.3 \pm 0.1)\,\%$.
\vspace{2mm} \\
%
{\bf \boldmath Minor background sources:}
Two other background sources in the \ket~sample have been identified
by MC simulations: $\kp \rightarrow\pi^0 e^+\nu$ (called $K_{e3}$) and
$\kp \rightarrow\pi^+\pi^0$ (called $K_{2\pi}$). Both contributions to
%
\begin{figure}[h]
\begin{minipage}{0.5\linewidth}
\begin{center}
\psfig{figure=../figures/mm2e-lin.eps,width=0.99\linewidth}
\end{center}
\end{minipage}
\begin{minipage}{0.5\linewidth}
\begin{center}
\psfig{figure=../figures/mm2m-lin-mrk.eps,width=0.99\linewidth}
\end{center}
\end{minipage}
\caption{Reconstructed squared missing mass distributions for
\ket~(left) and \kmt~(right) candidates. Data (crosses) and
expectations for backgrounds and signal (filled areas). The
\kmt~sample is quasi background-free.
\label{fig:mm2}}
\end{figure}
%
the signal are less than one percent.
%
\begin{figure}[t]
\begin{minipage}{0.5\linewidth}
\begin{center}
\psfig{figure=../figures/rk-offset.eps,width=0.99\linewidth}
\end{center}
\end{minipage}
\begin{minipage}{0.5\linewidth}
\begin{center}
\begin{tabular}{|c|c|}
\hline
\mco{2}{|c|}{Main uncertainties ($40\,\%$ data sample)} \\
\cline{1-2}
Statistical & $0.4\,\%$ \\
\kmt & $0.2\,\%$ \\
\ketwog\,(SD$^+$) & $0.3\,\%$ \\
Beam halo & $0.1\,\%$ \\
IB simulation & $0.3\,\%$ \\ \hline
Expected total error & $0.6-0.7\,\%$ \\ \hline
\end{tabular}
\end{center}
\end{minipage}
\caption{Left: 10 independent measurements of \rk~in track momentum
bins for the $40\,\%$ data sample. An overall offset is applied to
hide the result, setting it to the
SM expectation. The error band represents the total error,
including the correlated uncertainties. Right: Summary of the main
uncertainties.
\label{fig:rk_result}}
\end{figure}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Summary and prospects}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
After applying all selection criteria, about 60000 \ket~candidates and
17.5\,M \kmt~candidates remain from the partial $40\,\%$ data sample.
The total background to signal ratio in
the \ket~sample is estimated to be $B/S(\ket) =
12.3\,\%$. The largest
background fraction is at high track momenta, and the systematic
effect due to background is $\rm\delta\rk/\rk = 0.4\,\%$.
Fig.\,\ref{fig:mm2} shows the squared missing mass
distributions for \ket~and \kmt~candidates. For the \ket~sample, the
sum of estimated background and \ket~signal contributions describe the
data well. The \kmt~sample is almost background-free. Improvements
for each background source are foreseen as described in the text above.
The ten independent measurements of \rk~in track momentum bins are
presented in Fig.\,\ref{fig:rk_result}, with an artificial offset
being applied to hide the result. The stability of \rk~demonstrates
that the strongly momentum-dependent systematic effects
(acceptances, backgrounds etc.) are under control. The table in
Fig.\,\ref{fig:rk_result} summarizes the main systematic uncertainties. The
estimated total uncertainty for this data sample is $0.6-0.7\,\%$,
breaking the $1\,\%$ level for the first time.
The whole NA62 data sample of $>$\,150000 \ket~decay candidates is an
order of magnitude larger than the world sample and allows to push the
statistical uncertainty below $0.3\,\%$. The analysis of the partial
data sample is well advanced, significant improvements of various
uncertainties are realistic. To conclude, an overall uncertainty of
$0.4\,\%$, as declared in the proposal, is within reach.
\section*{References}
\begin{thebibliography}{99}
\bibitem{rk_sm}V. Cirigliano and I. Rosell, \Journal{\PRL}{99}{231801}{2007}.
\bibitem{masiero}Masiero, Paradisi, Petronzio, \Journal{\PRD}{74}{011701}{2006}.
\bibitem{pdg}C. Amsler {\it et al.} (PDG), \Journal{\PLB}{667}{1}{2008}.
\bibitem{kloe}Mario Antonelli for the KLOE collaboration, La Thuile 2009.
\bibitem{na62status}NA62 status report, CERN-SPSC-2008-031.
\bibitem{na48_detector}V. Fanti {\it et al.}, \Journal{\NIM}{574}{433}{2007}.
\bibitem{pmue_theory}S.R. Kelner, R.P. Kokoulin, A.A. Petrukhin, \Journal{\PAN}{60}{576}{1997}.
\end{thebibliography}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%
% End of moriond.tex %
%%%%%%%%%%%%%%%%%%%%%%
|
http://lhcbproject.web.cern.ch/lhcbproject/Publications/LHCbProjectPublic/Directory_LHCb-PAPER-2014-046/Table_1.tex
|
cern.ch
|
CC-MAIN-2019-39
|
application/x-tex
|
application/x-tex
|
crawl-data/CC-MAIN-2019-39/segments/1568514573080.8/warc/CC-MAIN-20190917141045-20190917163045-00199.warc.gz
| 109,678,325
| 977
|
\documentclass[border=5pt,multi=true]{standalone}
\usepackage{standalone}
\usepackage{ifthen}
\usepackage{microtype}
\usepackage{lineno}
\usepackage{xspace}
\usepackage{caption}
\usepackage{graphicx}
\usepackage{color}
\usepackage{colortbl}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{upgreek}
\usepackage{hyperref}
\usepackage{hypcap}
\usepackage{cite}
\usepackage{mciteplus}
\usepackage{longtable}
\usepackage{booktabs}
\begin{document}
\small
\begin{tabular}{lccc}
\toprule
Contribution & $\Delta \at (\%)$ & $\Delta \atb (\%)$ & $\Delta \atv (\%)$ \\
\midrule
Prompt background & $\pm 0.09$ & $\pm 0.08$ & $\pm 0.00$ \\
Detector bias & $\pm 0.04$ & $\pm 0.04$ & $\pm 0.04$ \\
\ct resolution & $\pm 0.02$ & $\pm 0.03$ & $\pm 0.01$ \\
Fit model & $\pm 0.01$ & $\pm 0.01$ & $\pm 0.01$ \\
Flavour misidentification& $\pm 0.08$ & $\pm 0.07$ & $\pm 0.00$ \\
\midrule
Total & $\pm 0.13$ & $\pm 0.12$ & $\pm 0.04$ \\
\bottomrule
\end{tabular}
\end{document}
|
https://ctan.math.washington.edu/tex-archive/info/examples/Math/04-05-15.ltx
|
washington.edu
|
CC-MAIN-2022-27
|
text/x-tex
|
text/x-matlab
|
crawl-data/CC-MAIN-2022-27/segments/1656104676086.90/warc/CC-MAIN-20220706182237-20220706212237-00451.warc.gz
| 233,274,841
| 1,030
|
%%
%% Ein Beispiel der DANTE-Edition
%% Mathematiksatz mit LaTeX
%% 2. Auflage
%%
%% Beispiel 04-05-15 auf Seite 47.
%%
%% Copyright (C) 2012 Herbert Voss
%%
%% It may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%%
%% See http://www.latex-project.org/lppl.txt for details.
%%
%%
%% ====
% Show page(s) 1
%%
%%
\documentclass[]{exaarticle}
\pagestyle{empty}
\setlength\textwidth{118.324pt}
\AtBeginDocument{\setlength\parindent{0pt}}
\StartShownPreambleCommands
\StopShownPreambleCommands
\begin{document}
\fontencoding{OMX}\fontfamily{cmex}\selectfont\char"42
\end{document}
|
http://tcl.tk/cgi-bin/tct/tip/1.tex
|
tcl.tk
|
CC-MAIN-2017-17
|
application/x-latex
| null |
crawl-data/CC-MAIN-2017-17/segments/1492917123590.89/warc/CC-MAIN-20170423031203-00218-ip-10-145-167-34.ec2.internal.warc.gz
| 376,457,069
| 12,599
|
\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#1: TIP Index}
\date{September 14, 2000}
\author{TIP Editor}
\urlstyle{sf}
\setlength{\parskip}{1ex}
\setlength{\parindent}{0pt}
\def\tipversion$#1${\texttt{\$#1\$}}
\def\tiplangle#1{\ensuremath{<}}
\def\tiprangle#1{\ensuremath{>}}
\def\tipbar#1{\ensuremath{|}}
\def\tipmail#1#2{\(\langle\){\small\expandafter\url{#1@#2}}\(\rangle\)}
\ifx\pdfoutput\undefined
\newcommand{\tipimage}[2]{\typeout{Make sure you download #1.eps}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.eps}}{\includegraphics[width=0.8\textwidth]{#1.eps}}}
\newcommand{\tipxref}[1]{}
\newcommand{\tipxrefend}{}
\else
\newcommand{\tipimage}[2]{\typeout{Make sure you create #1.pdf}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.pdf}}{\includegraphics[width=0.8\textwidth]{#1.pdf}}}
\pdfcatalog{/PageMode /UseOutlines}
\newcommand{\tipxref}[1]{\pdfannotlink attr {/C [0.5 0.5 1.0] /Border [0 0 1]} goto name {#1}}
\newcommand{\tipxrefend}{\pdfendlink}
\fi
\newenvironment{tipabstract}{\begin{abstract}}{\end{abstract}}
\begin{document}\maketitle
\begin{center}\begin{tabularx}{\linewidth}{|r@{: }X|}\hline
\textbf{TIP \#1}&\textbf{TIP Index}\\\hline
Author&
TIP Editor \tipmail{donal.fellows}{cs.man.ac.uk}
\\
Created&Thursday, \(\text{14}^{\text{th}}\) September 2000\\
Type&Informative\\
State&Active\\
Vote&No voting\\
Version&\tipversion$Revision: 1.6 $\\
Post History&\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}
This TIP contains the index of all TIPs published over the lifetime of the TCT. It will be continually and automatically updated.
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}
\section{Index}
\begin{center}\begin{supertabular}{c|ll|p{2.5in}}
\textbf{TIP ID}&\textbf{Type}&\textbf{State}& \textbf{Title}\\\hline
\small TIP \#0&\small Process&\small Final&\small Tcl Core Team Basic Rules
\\\small TIP \#1&\small Inform.&\small Active&\small TIP Index
\\\small TIP \#2&\small Process&\small Draft&\small TIP Guidelines
\\\small TIP \#3&\small Process&\small Accep.&\small TIP Format
\\\small TIP \#4&\small Inform.&\small Draft&\small Tcl Release and Distribution Philosophy
\\\small TIP \#5&\small Project&\small Final&\small Make TkClassProcs and TkSetClassProcs Public and Extensible
\\\small TIP \#6&\small Project&\small Rejec.&\small Include [Incr Tcl] in the Core Tcl distribution
\\\small TIP \#7&\small Project&\small Final&\small Increased resolution for TclpGetTime on Windows
\\\small TIP \#8&\small Project&\small Final&\small Add Winico support to the wm command on windows
\\\small TIP \#9&\small Project&\small Withd.&\small Tk Standard Library
\\\small TIP \#10&\small Project&\small Final&\small Tcl I/O Enhancement: Thread-Aware Channels
\\\small TIP \#11&\small Project&\small Final&\small Tk Menubutton Enhancement: -compound option for menubutton
\\\small TIP \#12&\small Inform.&\small Draft&\small The ``Batteries Included'' Distribution
\\\small TIP \#13&\small Process&\small Accep.&\small Web Service for Drafting and Archiving TIPs
\\\small TIP \#14&\small Project&\small Final&\small Access to Tk Photo Image Transparency
\\\small TIP \#15&\small Project&\small Final&\small Functions to List and Detail Math Functions
\\\small TIP \#16&\small Process&\small Accep.&\small Tcl Functional Areas for Maintainer Assignments
\\\small TIP \#17&\small Project&\small Final&\small Redo Tcl's filesystem
\\\small TIP \#18&\small Project&\small Final&\small Add Labels to Frames
\\\small TIP \#19&\small Project&\small Final&\small Add a Text Changed Flag to Tk's Text Widget
\\\small TIP \#20&\small Project&\small Defer.&\small Add C Locale-Exact CType Functions
\\\small TIP \#21&\small Project&\small Final&\small Asymmetric Padding in the Pack and Grid Geometry Managers
\\\small TIP \#22&\small Project&\small Final&\small Multiple Index Arguments to lindex
\\\small TIP \#23&\small Process&\small Accep.&\small Tk Toolkit Functional Areas for Maintainer Assignments
\\\small TIP \#24&\small Inform.&\small Draft&\small Tcl Maintainer Assignments
\\\small TIP \#25&\small Project&\small Withd.&\small Native tk\_messageBox on Macintosh
\\\small TIP \#26&\small Project&\small Final&\small Enhancements for the Tk Text Widget
\\\small TIP \#27&\small Project&\small Final&\small CONST Qualification on Pointers in Tcl API's
\\\small TIP \#28&\small Inform.&\small Draft&\small How to be a good maintainer for Tcl/Tk
\\\small TIP \#29&\small Project&\small Rejec.&\small Allow array syntax for Tcl lists
\\\small TIP \#30&\small Inform.&\small Draft&\small Tk Toolkit Maintainer Assignments
\\\small TIP \#31&\small Inform.&\small Draft&\small CVS tags in the Tcl and Tk repositories
\\\small TIP \#32&\small Project&\small Final&\small Add Tcl\_Obj-enabled counterpart to Tcl\_CreateTrace
\\\small TIP \#33&\small Project&\small Final&\small Add 'lset' Command to Assign to List Elements.
\\\small TIP \#34&\small Project&\small Withd.&\small Modernize TEA Build System
\\\small TIP \#35&\small Project&\small Final&\small Enhanced Support for Serial Communications
\\\small TIP \#36&\small Project&\small Final&\small Library Access to 'Subst' Functionality
\\\small TIP \#37&\small Project&\small Final&\small Uniform Rows and Columns in Grid
\\\small TIP \#38&\small Project&\small Withd.&\small Add Support for Default Bindtags
\\\small TIP \#39&\small Project&\small Withd.&\small Add New Standard Tk Option: -component
\\\small TIP \#40&\small Project&\small Withd.&\small Documentation Generator for Tcl Scripts
\\\small TIP \#41&\small Project&\small Final&\small Paned Window Tk Widget
\\\small TIP \#42&\small Project&\small Withd.&\small Add New Standard Tk Option: -clientdata
\\\small TIP \#43&\small Inform.&\small Draft&\small How to be a TIP Editor
\\\small TIP \#44&\small Project&\small Final&\small Move Tk's Private Commands and Variables into ::tk Namespace
\\\small TIP \#45&\small Project&\small Final&\small Empty index lists for [lindex] and [lset]
\\\small TIP \#46&\small Project&\small Withd.&\small Consistent Overlap Behavior of Area-Defining Canvas Items
\\\small TIP \#47&\small Project&\small Final&\small Modifying Tk to Allow Writing X Window managers
\\\small TIP \#48&\small Project&\small Final&\small Tk Widget Styling Support
\\\small TIP \#49&\small Project&\small Final&\small I/O Subsystem: Add API Tcl\_OutputBuffered(chan)
\\\small TIP \#50&\small Inform.&\small Final&\small Bundle [incr Tcl] with the Core Tcl distribution
\\\small TIP \#51&\small Project&\small Withd.&\small Native Menubutton on Macintosh
\\\small TIP \#52&\small Project&\small Withd.&\small Hierarchical Namespace Lookup of Commands and Variables
\\\small TIP \#53&\small Project&\small Withd.&\small Addition of 'assert' Command
\\\small TIP \#54&\small Process&\small Withd.&\small Using PURLs to Unite the Tcl Webspace
\\\small TIP \#55&\small Inform.&\small Draft&\small Package Format for Tcl Extensions
\\\small TIP \#56&\small Project&\small Final&\small Standardize Call Interface to Tcl\_Eval* Functions
\\\small TIP \#57&\small Project&\small Final&\small Move TclX's [lassign] into the Tcl Core
\\\small TIP \#58&\small Project&\small Rejec.&\small Extend [set] to Assign Multiple Values to Multiple Variables
\\\small TIP \#59&\small Project&\small Final&\small Embed Build Information in Tcl Binary Library
\\\small TIP \#60&\small Project&\small Rejec.&\small EXTERN Macro Change to Support a Wider Set of Attributes
\\\small TIP \#61&\small Project&\small Defer.&\small Make TK\_NO\_SECURITY Run-Time Switchable
\\\small TIP \#62&\small Project&\small Final&\small Add Support for Command Tracing
\\\small TIP \#63&\small Project&\small Final&\small Add -compound Option to Menu Entries
\\\small TIP \#64&\small Project&\small Defer.&\small Improvements to Windows Font Handling
\\\small TIP \#65&\small Project&\small Rejec.&\small Enhanced [info args]
\\\small TIP \#66&\small Inform.&\small Draft&\small Stand-alone and Embedded Tcl/Tk Applications
\\\small TIP \#67&\small Project&\small Withd.&\small Allow Subclassing of tk\_getOpenFile, tk\_getSaveFile on UNIX
\\\small TIP \#68&\small Project&\small Final&\small Dynamic Trace Result Handling
\\\small TIP \#69&\small Project&\small Draft&\small Improvements for the Tcl Hash Table
\\\small TIP \#70&\small Project&\small Withd.&\small A Relational Switch Control Structure
\\\small TIP \#71&\small Project&\small Withd.&\small Tk Bitmap Image Improvements
\\\small TIP \#72&\small Project&\small Final&\small 64-Bit Value Support for Tcl on 32-Bit Platforms
\\\small TIP \#73&\small Project&\small Final&\small Export Tcl\_GetTime in the Public API
\\\small TIP \#74&\small Project&\small Final&\small wm stackorder command
\\\small TIP \#75&\small Project&\small Final&\small Refer to Sub-RegExps Inside 'switch -regexp' Bodies
\\\small TIP \#76&\small Project&\small Final&\small Make 'regsub' Return a String
\\\small TIP \#77&\small Project&\small Withd.&\small Support for Nested Paired Item Lists
\\\small TIP \#78&\small Inform.&\small Draft&\small TEA 2.0 Definitions
\\\small TIP \#79&\small Project&\small Final&\small Add Deletion Callback to Tcl\_CreateObjTrace
\\\small TIP \#80&\small Project&\small Final&\small Additional Options for 'lsearch'
\\\small TIP \#81&\small Process&\small Withd.&\small [incr Tcl] Functional Areas for Maintainer Assignments
\\\small TIP \#82&\small Project&\small Final&\small Add -offrelief Option to Checkbutton and Radiobutton
\\\small TIP \#83&\small Project&\small Withd.&\small Augment Tcl\_EvalFile with Tcl\_EvalChannel and Tcl\_EvalUrl
\\\small TIP \#84&\small Project&\small Final&\small Add control for mouse movement filtering
\\\small TIP \#85&\small Project&\small Final&\small Custom Comparisons in Tcltest
\\\small TIP \#86&\small Project&\small Draft&\small Improved Debugger Support
\\\small TIP \#87&\small Project&\small Final&\small Allow Tcl Access to the Recursion Limit
\\\small TIP \#88&\small Project&\small Rejec.&\small Extend Tcl Process Id Control via 'pid'
\\\small TIP \#89&\small Project&\small Withd.&\small Try/Catch Exception Handling in the Core
\\\small TIP \#90&\small Project&\small Final&\small Enable [return -code] in Control Structure Procs
\\\small TIP \#91&\small Project&\small Final&\small Backward Compatibility for Channel Types with 32-bit SeekProcs
\\\small TIP \#92&\small Project&\small Withd.&\small Move Package Load Decisions to Application Developer
\\\small TIP \#93&\small Project&\small Final&\small Get/Delete Enhancement for the Tk Text Widget
\\\small TIP \#94&\small Project&\small Final&\small Add Listbox -activestyle Option
\\\small TIP \#95&\small Project&\small Final&\small Add [wm attributes] Command
\\\small TIP \#96&\small Project&\small Final&\small Add [tk caret] Command and Tk\_SetCaretPos API
\\\small TIP \#97&\small Project&\small Final&\small Moving Vertices of Canvas Items
\\\small TIP \#98&\small Project&\small Final&\small Adding Transparency Compositing Rules to Photo Images
\\\small TIP \#99&\small Project&\small Final&\small Add 'file link' to Tcl
\\\small TIP \#100&\small Project&\small Final&\small Add Support for Unloading Dynamic Libraries Loaded with [load]
\\\small TIP \#101&\small Project&\small Final&\small Export Tcltest Configuration
\\\small TIP \#102&\small Project&\small Final&\small Change [trace list] to [trace info]
\\\small TIP \#103&\small Project&\small Rejec.&\small Argument Expansion Command
\\\small TIP \#104&\small Project&\small Final&\small Generalization of the Tk Undo Subsystem
\\\small TIP \#105&\small Project&\small Withd.&\small Add Prefix Matching for Switch
\\\small TIP \#106&\small Project&\small Final&\small Add Encoding Abilities to the [dde] Command
\\\small TIP \#107&\small Project&\small Final&\small Fix the 2-second ``raise delay'' in Tk
\\\small TIP \#108&\small Inform.&\small Final&\small Summary of Changes to Generic Tcl/Tk Code to Enable Mac OS X Port
\\\small TIP \#109&\small Project&\small Final&\small New Look for Checkbutton and Radiobutton on Unix
\\\small TIP \#110&\small Project&\small Final&\small Add a Tristate Mode to the Checkbutton and Radiobutton
\\\small TIP \#111&\small Project&\small Final&\small Dictionary Values and Manipulators
\\\small TIP \#112&\small Project&\small Final&\small Ensembles are Namespaces are Commands
\\\small TIP \#113&\small Project&\small Final&\small Multi-Line Searches in the Text Widget
\\\small TIP \#114&\small Project&\small Draft&\small Eliminate Octal Parsing of Leading Zero Integer Strings
\\\small TIP \#115&\small Project&\small Draft&\small Making Tcl Truly 64-Bit Ready
\\\small TIP \#116&\small Project&\small Final&\small More Safety for Large Images
\\\small TIP \#117&\small Project&\small Withd.&\small Object Type Introspection
\\\small TIP \#118&\small Project&\small Final&\small Enhance [file attributes] and [file copy] on Mac OS X \& BSD
\\\small TIP \#119&\small Project&\small Final&\small Angled Text on a Canvas
\\\small TIP \#120&\small Project&\small Final&\small Restricted DDE Services
\\\small TIP \#121&\small Project&\small Final&\small Controlled Application Shutdown via Tcl\_Exit
\\\small TIP \#122&\small Project&\small Rejec.&\small Use tcl\_\{non,\}wordchars Throughout Tcl/Tk
\\\small TIP \#123&\small Project&\small Final&\small Adding an Exponentiation Operator to the [expr] Command
\\\small TIP \#124&\small Project&\small Final&\small High-Resolution Absolute Time Values From [clock]
\\\small TIP \#125&\small Project&\small Final&\small Converting between Frame and Toplevel Windows
\\\small TIP \#126&\small Project&\small Draft&\small Rich Strings for Representation Persistence
\\\small TIP \#127&\small Project&\small Final&\small Add an -index Option to [lsearch]
\\\small TIP \#128&\small Project&\small Rejec.&\small Ability to Install a Custom Memory Allocator
\\\small TIP \#129&\small Project&\small Final&\small New Format Codes for the [binary] Command
\\\small TIP \#130&\small Project&\small Final&\small Unique DDE server names.
\\\small TIP \#131&\small Project&\small Draft&\small Read My Mind and Do What I Mean
\\\small TIP \#132&\small Project&\small Final&\small Revised Floating-Point Conversions in Tcl
\\\small TIP \#133&\small Project&\small Draft&\small Extending [expr] Operators
\\\small TIP \#134&\small Project&\small Withd.&\small Subsystem Per-Thread Data Interfaces
\\\small TIP \#135&\small Project&\small Final&\small Change 'dde servername -exact' Option to -force
\\\small TIP \#136&\small Project&\small Final&\small Large List Initialisation
\\\small TIP \#137&\small Project&\small Final&\small Specifying Script Encodings for [source] and tclsh
\\\small TIP \#138&\small Project&\small Final&\small New TCL\_HASH\_KEY\_SYSTEM\_HASH option for Tcl hash tables
\\\small TIP \#139&\small Project&\small Final&\small Publish Part of Tcl's Namespace API
\\\small TIP \#140&\small Project&\small Defer.&\small Tracing Namespace Modifications
\\\small TIP \#141&\small Project&\small Final&\small Multiple Initial-Files in [tk\_getOpenFile]
\\\small TIP \#142&\small Project&\small Withd.&\small Search Path Variable to Lookup Command Names in Namespaces
\\\small TIP \#143&\small Project&\small Final&\small An Interpreter Resource Limiting Framework
\\\small TIP \#144&\small Project&\small Withd.&\small Argument Expansion Syntax
\\\small TIP \#145&\small Project&\small Final&\small Enhanced Tk Font Handling
\\\small TIP \#146&\small Project&\small Final&\small Add Overall Anchoring to the Grid Geometry Manager
\\\small TIP \#147&\small Project&\small Final&\small Make Grid's Column/Row Configure Easier
\\\small TIP \#148&\small Project&\small Final&\small Correct [list]-Quoting of the '\#' Character
\\\small TIP \#149&\small Project&\small Withd.&\small Allow ``enabled'' as Synonym for ``normal'' in -state Option
\\\small TIP \#150&\small Project&\small Defer.&\small Implement the Tk send Command for Windows
\\\small TIP \#151&\small Project&\small Final&\small Remove -e: Command Line Option from tclsh and wish
\\\small TIP \#152&\small Project&\small Final&\small New -detail Option for tk\_messageBox
\\\small TIP \#153&\small Project&\small Final&\small Enhancing the [winfo toplevel] Command
\\\small TIP \#154&\small Project&\small Draft&\small Add Named Colors to Tk
\\\small TIP \#155&\small Project&\small Final&\small Fix Some of the Text Widget's Limitations
\\\small TIP \#156&\small Project&\small Final&\small Language-Neutral Root Locale for Msgcat
\\\small TIP \#157&\small Project&\small Final&\small Argument Expansion with Leading \{expand\}
\\\small TIP \#158&\small Project&\small Final&\small Distinguish the two 'Enter' keys on Windows
\\\small TIP \#159&\small Project&\small Final&\small Extending Tk 'wm' Command to Support Coloured Icons
\\\small TIP \#160&\small Project&\small Draft&\small Improvements to Terminal and Serial Channel Handling
\\\small TIP \#161&\small Project&\small Draft&\small Change Default for Menu's -tearoff Option to False
\\\small TIP \#162&\small Project&\small Final&\small IPv6 Sockets for Tcl
\\\small TIP \#163&\small Project&\small Final&\small A [dict merge] Subcommand
\\\small TIP \#164&\small Project&\small Draft&\small Add Rotate Subcommand to the Canvas Widget
\\\small TIP \#165&\small Project&\small Final&\small A User-Data Field for Virtual Events
\\\small TIP \#166&\small Project&\small Draft&\small Reading and Writing the Photo Image Alpha Channel
\\\small TIP \#167&\small Project&\small Draft&\small Add a New Option for Context Help for Windows
\\\small TIP \#168&\small Project&\small Final&\small Cubic Bezier Curves on the Canvas
\\\small TIP \#169&\small Project&\small Final&\small Add Peer Text Widgets
\\\small TIP \#170&\small Project&\small Draft&\small Better Support for Nested Lists
\\\small TIP \#171&\small Project&\small Final&\small Change Default \tiplangle{}MouseWheel\tiprangle{} Bindings Behavior
\\\small TIP \#172&\small Project&\small Withd.&\small Improve UNIX Tk Look and Feel
\\\small TIP \#173&\small Project&\small Final&\small Internationalisation and Refactoring of the 'clock' Command
\\\small TIP \#174&\small Project&\small Final&\small Math Operators as Commands
\\\small TIP \#175&\small Project&\small Withd.&\small Add an -async Option to [open]
\\\small TIP \#176&\small Project&\small Final&\small Add String Index Values
\\\small TIP \#177&\small Project&\small Final&\small Add -stretch Option to panedwindow Widget
\\\small TIP \#178&\small Project&\small Draft&\small [info pid] and [info tid] Subcommands
\\\small TIP \#179&\small Project&\small Final&\small Add -hide Option to panedwindow Widget
\\\small TIP \#180&\small Project&\small Draft&\small Add a Megawidget Support Core Package
\\\small TIP \#181&\small Project&\small Final&\small Add a [namespace unknown] Command
\\\small TIP \#182&\small Project&\small Final&\small Add [expr bool] Math Function
\\\small TIP \#183&\small Project&\small Final&\small Add a Binary Flag to [open]
\\\small TIP \#184&\small Project&\small Final&\small Avoid Creating Unusable Variables
\\\small TIP \#185&\small Project&\small Rejec.&\small Null Handling
\\\small TIP \#186&\small Project&\small Draft&\small Expose the Type and Modified-State of Widget Options
\\\small TIP \#187&\small Project&\small Rejec.&\small Procedures as Values
\\\small TIP \#188&\small Project&\small Final&\small Add 'string is wideinteger' to the 'string is' Subcommand
\\\small TIP \#189&\small Project&\small Final&\small Tcl Modules
\\\small TIP \#190&\small Inform.&\small Draft&\small Implementation Choices for Tcl Modules
\\\small TIP \#191&\small Inform.&\small Draft&\small Managing Tcl Packages and Modules in a Multi-Version Environment
\\\small TIP \#192&\small Project&\small Draft&\small Lazy Lists
\\\small TIP \#193&\small Project&\small Draft&\small Simple Syntax Help System
\\\small TIP \#194&\small Project&\small Final&\small Procedures as Values via \textbf{apply}
\\\small TIP \#195&\small Project&\small Final&\small A Unique Prefix Handling Command
\\\small TIP \#196&\small Project&\small Withd.&\small Tcl Commands as Values
\\\small TIP \#197&\small Project&\small Final&\small Unfocussed Text Widget Cursor Control
\\\small TIP \#198&\small Project&\small Draft&\small Image Command XPM Extension
\\\small TIP \#199&\small Project&\small Rejec.&\small Specification of Alternatives to .wishrc/.tclshrc
\\\small TIP \#200&\small Project&\small Rejec.&\small Listing the Values in an Array
\\\small TIP \#201&\small Project&\small Final&\small Add 'in' Operator to [expr]
\\\small TIP \#202&\small Project&\small Final&\small Add 2\tiprangle{}@1 Special Case to [open] and [exec]
\\\small TIP \#203&\small Project&\small Withd.&\small Create tclConfig.sh-Equivalent in Tcl
\\\small TIP \#204&\small Project&\small Final&\small Virtual Events for Keyboard Traversal
\\\small TIP \#205&\small Project&\small Final&\small Use pkgconfig Database to Register Xft Support
\\\small TIP \#206&\small Project&\small Rejec.&\small Add an [ftruncate] Command
\\\small TIP \#207&\small Project&\small Final&\small Add a -namespace Option to [interp invokehidden]
\\\small TIP \#208&\small Project&\small Final&\small Add a 'chan' Command
\\\small TIP \#209&\small Project&\small Final&\small Add [clock milliseconds], and [clock microseconds]
\\\small TIP \#210&\small Project&\small Final&\small Add 'tempfile' Subcommand to 'file'
\\\small TIP \#211&\small Project&\small Withd.&\small Add Full Stack Trace Capability
\\\small TIP \#212&\small Project&\small Final&\small Temporarily Opening out a Dictionary
\\\small TIP \#213&\small Project&\small Withd.&\small A Standard Dialog for Font Selection
\\\small TIP \#214&\small Project&\small Withd.&\small Add New Object Introspection Command
\\\small TIP \#215&\small Project&\small Final&\small Make [incr] Auto-Initialize Undefined Variables
\\\small TIP \#216&\small Project&\small Draft&\small Handling Command-Line Options in Tclsh and Wish
\\\small TIP \#217&\small Project&\small Final&\small Getting Sorted Indices out of Lsort
\\\small TIP \#218&\small Project&\small Final&\small Tcl Channel Driver Thread State Actions
\\\small TIP \#219&\small Project&\small Final&\small Tcl Channel Reflection API
\\\small TIP \#220&\small Project&\small Draft&\small Escalate Privileges in VFS Close Callback
\\\small TIP \#221&\small Project&\small Final&\small Allow Background Error Handlers to Accept Return Options
\\\small TIP \#222&\small Project&\small Final&\small Add [wm attributes -alpha] Attribute on Windows
\\\small TIP \#223&\small Project&\small Final&\small Full-Screen Toplevel Support for Tk
\\\small TIP \#224&\small Project&\small Draft&\small Add New [array] Subcommands 'incr' and 'value'
\\\small TIP \#225&\small Project&\small Draft&\small Arithmetic Series with Optimized Space Complexity
\\\small TIP \#226&\small Project&\small Final&\small Interface to Save and Restore Interpreter State
\\\small TIP \#227&\small Project&\small Final&\small Interface to Get and Set the Return Options of an Interpreter
\\\small TIP \#228&\small Project&\small Draft&\small Tcl Filesystem Reflection API
\\\small TIP \#229&\small Project&\small Final&\small Scripted Control of Name Resolution in Namespaces
\\\small TIP \#230&\small Project&\small Final&\small Tcl Channel Transformation Reflection API
\\\small TIP \#231&\small Project&\small Final&\small Support for [wm attributes] on X11
\\\small TIP \#232&\small Project&\small Final&\small Creating New Math Functions for the 'expr' Command
\\\small TIP \#233&\small Project&\small Final&\small Virtualization of Tcl's Sense of Time
\\\small TIP \#234&\small Project&\small Final&\small Add Support For Zlib Compression
\\\small TIP \#235&\small Project&\small Final&\small Exposing a C API for Ensembles
\\\small TIP \#236&\small Project&\small Final&\small Absolute Positioning of Canvas Items
\\\small TIP \#237&\small Project&\small Final&\small Arbitrary-Precision Integers for Tcl
\\\small TIP \#238&\small Project&\small Draft&\small Fire Event when Widget Created
\\\small TIP \#239&\small Project&\small Draft&\small Enhance the 'load' Command
\\\small TIP \#240&\small Project&\small Draft&\small An Ensemble Command to Manage Processes
\\\small TIP \#241&\small Project&\small Final&\small Case-Insensitive Switches and List Searching and Sorting
\\\small TIP \#242&\small Project&\small Final&\small Preselect Filter on tk\_get*File Dialogs
\\\small TIP \#243&\small Project&\small Draft&\small Supply Find Dialog for the Text Widget
\\\small TIP \#244&\small Project&\small Final&\small PNG Photo Image Support for Tk
\\\small TIP \#245&\small Project&\small Final&\small Discover User Inactivity Time
\\\small TIP \#246&\small Project&\small Draft&\small Unify Pattern Matching
\\\small TIP \#247&\small Inform.&\small Draft&\small Tcl/Tk Engineering Manual
\\\small TIP \#248&\small Project&\small Final&\small Integrate Tile into Tk as Ttk
\\\small TIP \#249&\small Inform.&\small Draft&\small Unification of Tcl's Parsing of Numbers
\\\small TIP \#250&\small Project&\small Final&\small Efficient Access to Namespace Variables
\\\small TIP \#251&\small Project&\small Rejec.&\small Enhance the 'list' Command
\\\small TIP \#252&\small Project&\small Rejec.&\small Add New 'string' Command Options
\\\small TIP \#253&\small Project&\small Draft&\small Consolidate Package-Related Commands
\\\small TIP \#254&\small Project&\small Final&\small New Types for Tcl\_LinkVar
\\\small TIP \#255&\small Project&\small Final&\small Add 'min' and 'max' [expr] Functions
\\\small TIP \#256&\small Project&\small Final&\small Implement Tabular and Wordprocessor Style Tabbing
\\\small TIP \#257&\small Project&\small Final&\small Object Orientation for Tcl
\\\small TIP \#258&\small Project&\small Final&\small Enhanced Interface for Encodings
\\\small TIP \#259&\small Project&\small Draft&\small Making 'exec' Optionally Binary Safe
\\\small TIP \#260&\small Project&\small Final&\small Add Underline Option to Canvas Text Items
\\\small TIP \#261&\small Project&\small Final&\small Return Imported Commands from [namespace import]
\\\small TIP \#262&\small Project&\small Draft&\small Background Images for Frames
\\\small TIP \#263&\small Project&\small Draft&\small Quantum Tcl
\\\small TIP \#264&\small Project&\small Final&\small Add Function to Retrieve the Interpreter of a Window
\\\small TIP \#265&\small Project&\small Final&\small A Convenient C-side Command Option Parser for Tcl
\\\small TIP \#266&\small Project&\small Rejec.&\small Numbers are Commands
\\\small TIP \#267&\small Project&\small Final&\small Allow 'exec' to Ignore Stderr
\\\small TIP \#268&\small Project&\small Final&\small Enhance 'package' Version Handling
\\\small TIP \#269&\small Project&\small Final&\small Add 'string is list' to the 'string is' Subcommand
\\\small TIP \#270&\small Project&\small Final&\small Utility C Routines for String Formatting
\\\small TIP \#271&\small Project&\small Draft&\small Windows-Style Open and Save File Dialog on Unix
\\\small TIP \#272&\small Project&\small Final&\small String and List Reversal Operations
\\\small TIP \#273&\small Project&\small Rejec.&\small Add Tcl\_Expr... Support to Tcl\_Get... Functions
\\\small TIP \#274&\small Project&\small Final&\small Right-Associativity for the Exponentiation Operator
\\\small TIP \#275&\small Project&\small Final&\small Support Unsigned Values in binary Command
\\\small TIP \#276&\small Project&\small Draft&\small Specify and Unify Variable Linking Commands
\\\small TIP \#277&\small Project&\small Draft&\small Create Namespaces as Needed
\\\small TIP \#278&\small Project&\small Draft&\small Fix Variable Name Resolution Quirks
\\\small TIP \#279&\small Project&\small Draft&\small Adding an Extensible Object System to the Core
\\\small TIP \#280&\small Project&\small Final&\small Add Full Stack Trace Capability With Location Introspection
\\\small TIP \#281&\small Project&\small Draft&\small Improvements in System Error Handling
\\\small TIP \#282&\small Project&\small Draft&\small Enhanced Expression Syntax
\\\small TIP \#283&\small Project&\small Draft&\small Modify Ensemble Command Resolution Behaviour
\\\small TIP \#284&\small Project&\small Draft&\small New 'invoke' and 'namespace invoke' Commands
\\\small TIP \#285&\small Project&\small Final&\small Script Cancellation with [interp cancel] and Tcl\_CancelEval
\\\small TIP \#286&\small Project&\small Final&\small Add 'xposition' Command to Menu Widgets
\\\small TIP \#287&\small Project&\small Final&\small Add a Commands for Determining Size of Buffered Data
\\\small TIP \#288&\small Project&\small Draft&\small Allow ``args'' Anywhere in Procedure Formal Arguments
\\\small TIP \#289&\small Project&\small Rejec.&\small Revision of [lrepeat] Argument Order
\\\small TIP \#290&\small Project&\small Draft&\small Registration of Custom Error Handler Scripts
\\\small TIP \#291&\small Project&\small Final&\small Add the 'platform' Package to Tcl
\\\small TIP \#292&\small Project&\small Draft&\small Allow Unquoted Strings in Expressions
\\\small TIP \#293&\small Project&\small Final&\small Argument Expansion with Leading \{*\}
\\\small TIP \#294&\small Project&\small Rejec.&\small The ``entier'' Function: It's Spelt ``entire''
\\\small TIP \#295&\small Project&\small Draft&\small Enhance Arguments to lrange
\\\small TIP \#296&\small Project&\small Draft&\small Enhanced Syntax for Pair-Wise Indices
\\\small TIP \#297&\small Project&\small Draft&\small Integer Type Introspection and Conversion
\\\small TIP \#298&\small Project&\small Final&\small Revise Shared Value Rules for Tcl\_GetBignumAndClearObj
\\\small TIP \#299&\small Project&\small Final&\small Add isqrt() Math Function
\\\small TIP \#300&\small Project&\small Final&\small Examine Glyph Substitution in the 'font actual' Command
\\\small TIP \#301&\small Project&\small Withd.&\small Split Bidirectional Channels For Half-Close
\\\small TIP \#302&\small Project&\small Draft&\small Fix ``after'''s Sensitivity To Adjustments Of System Clock
\\\small TIP \#303&\small Project&\small Draft&\small Enhance 'llength' Command to Support Nested Lists
\\\small TIP \#304&\small Project&\small Final&\small A Standalone [chan pipe] Primitive for Advanced Child IPC
\\\small TIP \#305&\small Project&\small Withd.&\small ANSI Escape Sequence Support for Windows's Console Channel Driver
\\\small TIP \#306&\small Project&\small Rejec.&\small Auto-Naming Widgets
\\\small TIP \#307&\small Project&\small Final&\small Make TclTransferResult() Public
\\\small TIP \#308&\small Inform.&\small Final&\small Tcl Database Connectivity (TDBC)
\\\small TIP \#309&\small Project&\small Draft&\small Expose the Expression Parsing
\\\small TIP \#310&\small Project&\small Rejec.&\small Add a New Pseudo-Random Number Generator
\\\small TIP \#311&\small Inform.&\small Draft&\small Tcl/Tk 8.6 Release Calendar
\\\small TIP \#312&\small Project&\small Draft&\small Add More Link Types
\\\small TIP \#313&\small Project&\small Final&\small Inexact Searching in Sorted List
\\\small TIP \#314&\small Project&\small Final&\small Ensembles with Parameters
\\\small TIP \#315&\small Project&\small Final&\small Add pathSeparator to tcl\_platform Array
\\\small TIP \#316&\small Project&\small Final&\small Portable Access Functions for Stat Buffers
\\\small TIP \#317&\small Project&\small Final&\small Extend binary Ensemble with Binary Encodings
\\\small TIP \#318&\small Project&\small Final&\small Extend Default Whitespace in 'string trim' Beyond ASCII
\\\small TIP \#319&\small Project&\small Draft&\small Implement Backwards Compatibility for ttk Themed Widgets in tk Widgets
\\\small TIP \#320&\small Project&\small Final&\small Improved Variable Handling in the Core Object System
\\\small TIP \#321&\small Project&\small Final&\small Add a [tk busy] Command
\\\small TIP \#322&\small Project&\small Final&\small Publish the NRE API
\\\small TIP \#323&\small Project&\small Final&\small Do Nothing Gracefully
\\\small TIP \#324&\small Project&\small Final&\small A Standard Dialog For Font Selection
\\\small TIP \#325&\small Project&\small Draft&\small System Tray Access
\\\small TIP \#326&\small Project&\small Final&\small Add -stride Option to lsort
\\\small TIP \#327&\small Project&\small Final&\small Proper Tailcalls
\\\small TIP \#328&\small Project&\small Final&\small Coroutines
\\\small TIP \#329&\small Project&\small Final&\small Try/Catch/Finally syntax
\\\small TIP \#330&\small Project&\small Final&\small Eliminate interp-\tiprangle{}result from the Public Headers
\\\small TIP \#331&\small Project&\small Final&\small Allow [lset] to Extend Lists
\\\small TIP \#332&\small Project&\small Final&\small Half-Close for Bidirectional Channels
\\\small TIP \#333&\small Project&\small Draft&\small New Variable and Namespace Resolving Interface
\\\small TIP \#334&\small Project&\small Withd.&\small Make 'lrepeat' Accept Zero as a Count
\\\small TIP \#335&\small Project&\small Final&\small An API for Detecting Active Interpreters
\\\small TIP \#336&\small Project&\small Final&\small Supported Access To interp-\tiprangle{}errorline
\\\small TIP \#337&\small Project&\small Final&\small Make TclBackgroundException() Public
\\\small TIP \#338&\small Project&\small Final&\small Embedder Access to Startup Scripts of *\_Main()
\\\small TIP \#339&\small Project&\small Rejec.&\small Case-Insensitive Package Names
\\\small TIP \#340&\small Project&\small Withd.&\small Const Qualification of Tcl\_SetResult's Argument
\\\small TIP \#341&\small Project&\small Final&\small Multiple 'dict filter' Patterns
\\\small TIP \#342&\small Project&\small Draft&\small Dict Get With Default
\\\small TIP \#343&\small Project&\small Final&\small A Binary Specifier for [format/scan]
\\\small TIP \#344&\small Project&\small Draft&\small Bring TCP\_NODELAY and SO\_KEEPALIVE to socket options
\\\small TIP \#345&\small Project&\small Draft&\small Kill the 'identity' Encoding
\\\small TIP \#346&\small Project&\small Draft&\small Error on Failed String Encodings
\\\small TIP \#347&\small Project&\small Withd.&\small Align 'string is ...' to Type-Conversion Functions in 'expr'
\\\small TIP \#348&\small Project&\small Final&\small Substituted 'errorstack' / 'traceback'
\\\small TIP \#349&\small Project&\small Draft&\small New ``-cargo'' option for every Tk widget
\\\small TIP \#350&\small Inform.&\small Draft&\small Tcl Database Connectivity --- Corrigenda
\\\small TIP \#351&\small Project&\small Draft&\small Add Striding Support to lsearch
\\\small TIP \#352&\small Inform.&\small Draft&\small Tcl Style Guide
\\\small TIP \#353&\small Project&\small Final&\small NR-enabled Expressions for Extensions
\\\small TIP \#354&\small Project&\small Final&\small Minor Production-Driven TclOO Revisions
\\\small TIP \#355&\small Project&\small Draft&\small Stop Fast Recycling of Channel Names on Unix
\\\small TIP \#356&\small Project&\small Final&\small NR-enabled Substitutions for Extensions
\\\small TIP \#357&\small Project&\small Final&\small Export TclLoadFile
\\\small TIP \#358&\small Project&\small Draft&\small Suppress Empty List Element Generation from the Split Command
\\\small TIP \#359&\small Project&\small Final&\small Extended Window Manager Hint Support
\\\small TIP \#360&\small Project&\small Final&\small Modernize X11 Menus
\\\small TIP \#361&\small Project&\small Draft&\small Releasing Channel Buffers
\\\small TIP \#362&\small Project&\small Final&\small Simple 32 and 64 bit Registry Support
\\\small TIP \#363&\small Project&\small Draft&\small Vector Math in the Tcl Core
\\\small TIP \#364&\small Project&\small Final&\small Threading Support: Configuration and Package
\\\small TIP \#365&\small Project&\small Draft&\small Add Python Compatibility Mode
\\\small TIP \#366&\small Project&\small Draft&\small Variable Sized Indicators for Menubuttons
\\\small TIP \#367&\small Project&\small Draft&\small A Command to Remove Elements from a List
\\\small TIP \#368&\small Project&\small Withd.&\small Listbox Justification Option
\\\small TIP \#369&\small Project&\small Draft&\small Widget cargo command
\\\small TIP \#370&\small Project&\small Draft&\small Extend Tk's selection with a -time option
\\\small TIP \#371&\small Project&\small Draft&\small Improvements for the dict command
\\\small TIP \#372&\small Project&\small Draft&\small Multi-argument Yield for Coroutines
\\\small TIP \#373&\small Project&\small Withd.&\small Improved Yielding Support for Coroutines
\\\small TIP \#374&\small Project&\small Draft&\small Stackless Vwait
\\\small TIP \#375&\small Project&\small Draft&\small Symmetric Coroutines and Yieldto
\\\small TIP \#376&\small Project&\small Final&\small Bundle sqlite3 and tdbc::sqlite3 Packages
\\\small TIP \#377&\small Project&\small Withd.&\small Portably Determining the Number of Processors in the System
\\\small TIP \#378&\small Project&\small Final&\small Fixing the Performance of TIP 280
\\\small TIP \#379&\small Project&\small Draft&\small Add a Command for Delivering Events Without Tk
\\\small TIP \#380&\small Project&\small Final&\small TclOO Slots for Flexible Declarations
\\\small TIP \#381&\small Project&\small Final&\small Call Chain Introspection and Control
\\\small TIP \#382&\small Project&\small Final&\small Let tk\_getSaveFile ignore file overwrites
\\\small TIP \#383&\small Project&\small Draft&\small Injecting Code into Suspended Coroutines
\\\small TIP \#384&\small Project&\small Draft&\small Add File Alteration Monitoring to the Tcl Core
\\\small TIP \#385&\small Project&\small Draft&\small Functional Traces On Variables
\\\small TIP \#386&\small Inform.&\small Draft&\small Relocation of Tcl/Tk Source Control Repositories
\\\small TIP \#387&\small Project&\small Withd.&\small Unified Yield Command Syntax
\\\small TIP \#388&\small Project&\small Final&\small Extending Unicode literals past the BMP
\\\small TIP \#389&\small Project&\small Draft&\small Full support for Unicode 8.0 and later
\\\small TIP \#390&\small Project&\small Draft&\small A Logging API for Tcl
\\\small TIP \#391&\small Project&\small Withd.&\small Support for UDP Sockets in Tcl
\\\small TIP \#392&\small Project&\small Draft&\small Allow Bignums to be Disabled at Runtime on a Per-Interp Basis
\\\small TIP \#393&\small Project&\small Draft&\small Add -command Option to lsearch
\\\small TIP \#394&\small Project&\small Draft&\small Platform-Independent Handling of Contemporary Mice
\\\small TIP \#395&\small Project&\small Final&\small New 'string is entier' Command
\\\small TIP \#396&\small Project&\small Final&\small Symmetric Coroutines, Multiple Args, and yieldto
\\\small TIP \#397&\small Project&\small Final&\small Extensible Object Copying
\\\small TIP \#398&\small Project&\small Final&\small Quickly Exit with Non-Blocking Blocked Channels
\\\small TIP \#399&\small Project&\small Accep.&\small Dynamic Locale Changing for msgcat
\\\small TIP \#400&\small Project&\small Final&\small Setting the Compression Dictionary and Other 'zlib' Updates
\\\small TIP \#401&\small Project&\small Draft&\small Comment Words with Leading \{\#\}
\\\small TIP \#402&\small Project&\small Draft&\small General Platform UNC Support
\\\small TIP \#403&\small Project&\small Final&\small Web Colors for Tk
\\\small TIP \#404&\small Project&\small Final&\small Let Message Catalogs get the Locale from their File Name
\\\small TIP \#405&\small Project&\small Final&\small Add Collecting Loops, the 'lmap' and 'dict map' Commands
\\\small TIP \#406&\small Project&\small Draft&\small ``C'' is for Cookie
\\\small TIP \#407&\small Inform.&\small Draft&\small The String Representation of Tcl Lists: the Gory Details
\\\small TIP \#408&\small Project&\small Draft&\small Allow Any Command for expr Functions
\\\small TIP \#409&\small Project&\small Draft&\small UDP in Tcl
\\\small TIP \#410&\small Project&\small Draft&\small Three Features of scan Adapted for binary scan/format
\\\small TIP \#411&\small Project&\small Draft&\small Improved Channel Introspection via ``chan info''
\\\small TIP \#412&\small Project&\small Final&\small Dynamic Locale Changing for msgcat with On-Demand File Load
\\\small TIP \#413&\small Project&\small Final&\small Unicode Support for 'string is space' and 'string trim'
\\\small TIP \#414&\small Project&\small Draft&\small Add (back) Tcl\_InitSubsystems as Public API
\\\small TIP \#415&\small Project&\small Draft&\small Enable Easy Creation of Circular Arc Segments
\\\small TIP \#416&\small Project&\small Final&\small New Options for 'load': -global and -lazy
\\\small TIP \#417&\small Project&\small Draft&\small Use Explicit Option Names for ``file tempfile''
\\\small TIP \#418&\small Project&\small Draft&\small Add [binary] Subcommands for In-Place Modification
\\\small TIP \#419&\small Project&\small Draft&\small A New Command for Binding to Tk Events
\\\small TIP \#420&\small Project&\small Draft&\small 'vexpr', a Vector Expression Command
\\\small TIP \#421&\small Project&\small Draft&\small A Command for Iterating Over Arrays
\\\small TIP \#422&\small Project&\small Draft&\small Don't Use stdarg.h/va\_list in Public API
\\\small TIP \#423&\small Project&\small Draft&\small Formatting Timestamps with Milliseconds
\\\small TIP \#424&\small Project&\small Draft&\small Improving [exec]
\\\small TIP \#425&\small Project&\small Draft&\small Internationalization of Default Panic Callback on Windows
\\\small TIP \#426&\small Project&\small Draft&\small Determining the ``Type'' of Commands
\\\small TIP \#427&\small Project&\small Final&\small Introspection of Asynchronous Socket Connection
\\\small TIP \#428&\small Project&\small Draft&\small Produce Error Dictionary from 'fconfigure -error'
\\\small TIP \#429&\small Project&\small Final&\small A 'string' Subcommand for Concatenation
\\\small TIP \#430&\small Project&\small Draft&\small Add basic ZIP archive support to Tcl
\\\small TIP \#431&\small Project&\small Draft&\small Add 'tempdir' Subcommand to 'file'
\\\small TIP \#432&\small Project&\small Final&\small Support for New Windows File Dialogs in Vista and Later
\\\small TIP \#433&\small Project&\small Final&\small Add \%M binding substitution
\\\small TIP \#434&\small Project&\small Draft&\small Specify Event Sources for 'vwait'
\\\small TIP \#435&\small Project&\small Rejec.&\small Safe Mutex Disposal API
\\\small TIP \#436&\small Project&\small Final&\small Improve TclOO isa Introspection
\\\small TIP \#437&\small Project&\small Final&\small Tk panedwindow options for proxy window
\\\small TIP \#438&\small Project&\small Final&\small Ensure Line Metrics are Up-to-Date
\\\small TIP \#439&\small Project&\small Draft&\small Semantic Versioning
\\\small TIP \#440&\small Project&\small Final&\small Add engine to tcl\_platform Array
\\\small TIP \#441&\small Project&\small Final&\small Add -justify Configuration Option to the listbox Widget
\\\small TIP \#442&\small Project&\small Final&\small Display text in progressbars
\\\small TIP \#443&\small Project&\small Final&\small More Tag Configuration Options for the Text Widget
\\\small TIP \#444&\small Project&\small Final&\small Add ``weekdays'' unit in clock add
\\\small TIP \#445&\small Project&\small Draft&\small Tcl\_ObjType Utility Routines
\\\small TIP \#446&\small Project&\small Final&\small Introspect Undo/Redo Stack Depths
\\\small TIP \#447&\small Project&\small Final&\small Execution Time Verbosity Levels in tcltest::configure
\\\small TIP \#448&\small Project&\small Draft&\small Update Tcl\_SetNotifier to Reinitialize Event Loop
\\\small TIP \#449&\small Project&\small Final&\small [text] undo/redo to Return Range of Characters
\\\small TIP \#450&\small Project&\small Draft&\small Add [binary] subcommand ``set'' for in-place modification
\\\small TIP \#451&\small Project&\small Draft&\small Modify [update] to Give Full Script Access to Tcl\_DoOneEvent
\\\small TIP \#452&\small Project&\small Draft&\small Add ``stubs'' Package to or Along Side of TclTest
\\\small TIP \#453&\small Project&\small Draft&\small Tcl Based Automation for tcl/pkgs
\\\small TIP \#454&\small Project&\small Draft&\small Automatically Resize Frames After Last Child Removed
\\\small TIP \#455&\small Project&\small Draft&\small Extensions to [vwait]: Variable Sets and Scripted Access to Tcl\_DoOneEvent
\\\small TIP \#456&\small Project&\small Final&\small Extend the C API to Support Passing Options to TCP Server Creation
\\\small TIP \#457&\small Project&\small Draft&\small Add Support for Named Arguments
\\\small TIP \#458&\small Project&\small Draft&\small Add Support for epoll() and kqueue() in the Notifier
\\\small TIP \#459&\small Project&\small Draft&\small Tcl Package Introspection Improvements
\\\small TIP \#460&\small Project&\small Draft&\small An Alternative to Upvar
\\\small TIP \#461&\small Project&\small Draft&\small Separate Numeric and String Comparison Operators
\\\small TIP \#462&\small Project&\small Draft&\small Add New [info ps] Ensemble for Subprocess Management
\\\small TIP \#463&\small Project&\small Draft&\small Command-Driven Substitutions for regsub
\\\small TIP \#464&\small Project&\small Final&\small Support for Multimedia Keys on Windows
\\\small TIP \#465&\small Project&\small Draft&\small Change Rule 8 of the Dodekalogue to Cut Some Corner Cases
\\\small TIP \#466&\small Project&\small Draft&\small Revised Implementation of the Text Widget
\\\small TIP \#467&\small Process&\small Draft&\small Move TIP Collection to Fossil
\\\small TIP \#468&\small Project&\small Draft&\small Support Passing TCP listen Backlog Size Option to TCP Socket Creation
\\\small TIP \#469&\small Project&\small Draft&\small A Callback for Channel-Exception Conditions
\\\small TIP \#470&\small Project&\small Draft&\small Reliable Access to OO Definition Context Object
\\\small TIP \#10000&\small Inform.&\small Draft&\small Dummy Proposal for Testing Editing Interfaces
\\\end{supertabular}\end{center}
White backgrounds indicate that the TIP is still a draft, yellow backgrounds highlight TIPs being voted on, and where a TIP has been rejected, withdrawn or obsoleted its index entry has a dark grey background. Blue backgrounds indicate a TIP has been accepted, but still needs an implementation approved by maintainers. Green backgrounds indicate that the TIP is deferred, waiting for someone to work on it.
\section{Explanations and How To Submit New TIPs}
See \cite{tip2} for a description of the editorial process a TIP has to go through and \cite{tip3} for a description of their structure and the commands used to write them. You submit a TIP to this archive by emailing it (preferably in source form) to the TIP editor \tipmail{donal.fellows}{man.ac.uk} who will check it for following of the guidelines, style and general relevance to Tcl/Tk before checking it into the CVS archive and notifying the author, the rest of the Tcl Core Team, and the relevant newsgroups.
\section{Copyright}
This document has been placed in the public domain.
\section{Colophon}
\textit{TIP AutoGenerator --- written by Donal K. Fellows}
\begin{thebibliography}{TIP \#2}
\addcontentsline{toc}{section}{References}
\bibitem[TIP \#2]{tip2}
Andreas Kupries,
Donal K. Fellows,
Don Porter,
Mo DeJong,
Larry W. Virden,
Kevin Kenny,
\emph{TIP Guidelines},
on-line at \url{http://purl.org/tcl/tip/2.html}
\bibitem[TIP \#3]{tip3}
Andreas Kupries,
Donal K. Fellows,
\emph{TIP Format},
on-line at \url{http://purl.org/tcl/tip/3.html}
\end{thebibliography}
\end{document}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.