summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/generic/pst-fit/Changes10
-rw-r--r--Master/texmf-dist/doc/generic/pst-fit/README41
-rw-r--r--Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.bib165
-rw-r--r--Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.data107
-rw-r--r--Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.pdfbin0 -> 101201 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.tex184
-rw-r--r--Master/texmf-dist/source/generic/pst-fit/Makefile71
-rw-r--r--Master/texmf-dist/tex/generic/pst-fit/pst-fit.tex981
-rw-r--r--Master/texmf-dist/tex/latex/pst-fit/pst-fit.sty14
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check2
-rwxr-xr-xMaster/tlpkg/libexec/ctan2tds1
-rw-r--r--Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc1
-rw-r--r--Master/tlpkg/tlpsrc/pst-fit.tlpsrc0
13 files changed, 1576 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-fit/Changes b/Master/texmf-dist/doc/generic/pst-fit/Changes
new file mode 100644
index 00000000000..e4341e78b86
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pst-fit/Changes
@@ -0,0 +1,10 @@
+%% $Id: Changes 673 2012-04-01 09:50:48Z herbert $
+%%
+pst-fit.sty ----------- (hv)
+ v. 0.01 2012-04-01 first CTAN version
+
+
+pst-fit.tex ----------- (bl/hv)
+ v. 0.01 2012-04-01 first CTAN version
+
+
diff --git a/Master/texmf-dist/doc/generic/pst-fit/README b/Master/texmf-dist/doc/generic/pst-fit/README
new file mode 100644
index 00000000000..f03cf6cd819
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pst-fit/README
@@ -0,0 +1,41 @@
+pstricks-add redefines a lot of the pstricks macros.
+#
+# Do not load another PSTricks related package after pstricks-add!!
+#
+pstricks-add collects a lot of the code which was posted
+to the pstricks mailing list and has some more new features:
+
+- pstricks
+ o random dots
+ O braces
+ o define and calculate colors on PS side
+ o Gouraud shading
+ o braces as node connection/linestyle
+ o line style bar
+ o lines, drawn "by hand"
+ o arrows, arrows, arrows, ...
+
+- pst-plot
+ o new syntax for \psplot and \psparametricplot
+ o new macro psTangentLine
+ o new macro psplotTangent
+ o new macro psplotDiffEqn
+
+- pst-node
+ o new option lineAngle for ncdiag
+ o new macros for interpolation nodes
+ and linear combination of two vectors
+ o new macro ncbarr (line with 5 segments)
+
+
+pstricks-add.pro : the prolog file for pstricks-add
+pstricks-add-doc.tex: the included doc file
+
+Save the files pstricks-add.sty|pro|tex in a directory,
+which is part of your local TeX tree. The pro file should go
+into $TEXMF/dvips/pstricks/
+Then do not forget to run texhash to update this tree.
+For more information see the documentation of your LATEX distribution
+on installing packages into your local TeX system or read the
+TeX Frequently Asked Questions:
+(http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages).
diff --git a/Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.bib b/Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.bib
new file mode 100644
index 00000000000..67a3311e6a4
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.bib
@@ -0,0 +1,165 @@
+%% -*-bibtex-*-
+@STRING{tugboat = {TUGboat} }
+@STRING{beiprogramm = {{\TeX}-Beiprogramm} }
+@STRING{bretter = {Bretter, die die Welt bedeuten} }
+@STRING{dtk = {{D}ie {\TeX}nische {K}om{\"o}die} }
+@STRING{editorial = {Editorial} }
+@STRING{fremdebuehne = {Von fremden B{\"u}hnen} }
+@STRING{fundus = {Aus dem Fundus} }
+@STRING{hinterbuehne = {Hinter der B{\"u}hne} }
+@STRING{leserbrief = {Leserbrief(e)} }
+@STRING{magazin = {Magazin} }
+@STRING{rezension = {Rezensionen} }
+@STRING{schonimmer = {Was Sie schon immer {\"u}ber {\TeX} wissen wollten \dots} }
+@STRING{theaterkasse = {Von der Theaterkasse} }
+@STRING{theatertage = {{\TeX}-Theatertage} }
+
+@Book{PSTricks2,
+ author = {Herbert Vo\ss},
+ title = {{\PST} {G}rafik f\"ur \TeX{} und \LaTeX},
+ edition = {6.},
+ publisher = {DANTE -- Lehmanns},
+ year = {2010},
+ address = {Heidelberg/Berlin}
+}
+
+@Book{PSTricks-E,
+ author = {Herbert Vo\ss},
+ title = {{\PST} {G}raphics for \LaTeX},
+ edition = {1},
+ publisher = {UIT},
+ year = {2011},
+ address = {Cambridge}
+}
+
+@Book{companion04,
+ author = {Frank Mittelbach and Michel Goosens et al},
+ title = {The {\LaTeX} {C}ompanion},
+ edition = {second},
+ publisher = {Addison-Wesley Publishing Company},
+ year = {2004},
+ address = {Boston}
+}
+
+@Book{unbound,
+ author = {Alan Hoenig},
+ title = {\TeX{} {U}nbound: \LaTeX{} \& \TeX{} {S}trategies, {F}onts, {G}raphics, and {M}ore},
+ publisher = {Oxford University Press},
+ year = {1998},
+ address = {London}
+}
+@Article{ dtk02.2:jackson.voss:plot-funktionen,
+ author = {Laura E. Jackson and Herbert Vo{\ss}},
+ title = {Die Plot-Funktionen von {\texttt{pst-plot}}},
+ journal = dtk,
+ year = 2002,
+ volume = {2/02},
+ altvolume = 2,
+ altnumber = 14,
+ month = jun,
+ pages = {27--34},
+ annote = bretter,
+ keywords = {},
+ abstract = { Im letzten Heft wurden die mathematischen Funktionen von
+ \PS~im Zusammenhang mit dem {\LaTeX}-Paket
+ \texttt{pst-plot} zum Zeichnen von Funktionen beschrieben
+ und durch Beispiele erl{\"a}utert. In diesem Teil werden
+ die bislang nur erw{\"a}hnten Plot-Funktionen f{\"u}r
+ externe Daten behandelt. }
+}
+
+@Article{ dtk02.1:voss:mathematischen,
+ author = {Herbert Vo{\ss}},
+ title = {Die mathematischen {F}unktionen von {P}ost{S}cript},
+ journal = dtk,
+ year = 2002,
+ volume = {1/02},
+ altvolume = 1,
+ altnumber = 14,
+ month = mar,
+ pages = {},
+ annote = bretter,
+ keywords = {},
+ abstract = { \PS, faktisch genauso alt wie {\TeX}, ist im
+ Verh{\"a}ltnis dazu allgemein noch weniger bekannt, wenn es
+ darum geht zu beurteilen, was es denn nun im eigentlichen
+ Sinne ist. Au{\ss}erdem wird h{\"a}ufig vergessen, dass
+ sich mit den \PS-Funktionen viele Dinge erledigen lassen,
+ bei denen sonst auf externe Programme zur{\"u}ckgegriffen
+ wird. Dies wird im Folgenden f{\"u}r die mathematischen
+ Funktionen im Zusammenhang mit dem Paket \texttt{pst-plot}
+ gezeigt. }
+}
+
+@Book{tlgc2,
+ author = {Michel Goosens and Frank Mittelbach and Sebastian Rahtz and Denis Roegel and Herbert Vo{\ss}},
+ title = {The {\LaTeX} {G}raphics {C}ompanion},
+ publisher = {{Addison-Wesley Publishing Company}},
+ edition = second,
+ year = {2007},
+ address = {Reading, Mass.}
+}
+
+@Article{girou:01:,
+ author = {Denis Girou},
+ title = {Pr\'esentation de {PST}ricks},
+ journal = {Cahier {GUT}enberg},
+ year = 1994,
+ volume = {16},
+ month = apr,
+ pages = {21-70}
+}
+
+@Article{girou:02:,
+ author = {{Timothy Van} Zandt and Denis Girou},
+ title = {Inside {PST}ricks},
+ journal = TUGboat,
+ year = 1994,
+ volume = {15},
+ month = sep,
+ pages = {239-246}
+}
+
+@Book{PostScript,
+ Author = {Kollock, Nikolai G.},
+ Title = {PostScript richtig eingesetzt: vom {K}onzept zum
+ praktischen {E}insatz},
+ Publisher = {IWT},
+ Address = {Vaterstetten},
+ year = 1989,
+}
+
+@Manual{pstricks,
+ Title = {PSTricks - {\PS} macros for generic {\TeX}},
+ Author = {{Timothy Van} Zandt},
+ Organization = {},
+ Address = {\url{http://www.tug.org/application/PSTricks}},
+ Note = {},
+ year = 1993
+}
+
+@Manual{pst-plot,
+ Title = {\texttt{pst-plot}: Plotting two dimensional functions and data},
+ Author = {{Timothy Van} Zandt},
+ Organization = {},
+ Address = {\url{CTAN:graphics/pstricks/generic/pst-plot.tex}},
+ Note = {},
+ year = 1999
+}
+
+@Manual{multido,
+ Title = {\texttt{multido.tex} - a loop macro, that supports fixed-point addition},
+ Author = {{Timothy Van} Zandt},
+ Organization = {},
+ Address = {\url{CTAN:/graphics/pstricks/generic/multido.tex}},
+ Note = {},
+ year = 1997
+}
+
+@MISC{xkeyval,
+ author = {Hendri Adriaens},
+ title = {xkeyval package},
+ howpublished = {\url{CTAN:/macros/latex/contrib/xkeyval}},
+ year = 2004
+}
+
diff --git a/Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.data b/Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.data
new file mode 100644
index 00000000000..f42deca6e10
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.data
@@ -0,0 +1,107 @@
+\usepackage{filecontents}
+%Exp(3*e^2x)
+\begin{filecontents}{exp.dat}
+1 22
+2 164
+3 1210
+4 8943
+\end{filecontents}
+%Recip(100/x)
+\begin{filecontents}{recip.dat}
+1 100
+2 50
+3 33
+4 25
+5 20
+6 12.5
+\end{filecontents}
+%Poly(-7.26*x^4+57.4*x^3-142.94*x^2+294.53*x-109)
+\begin{filecontents}{poly.dat}
+1 93
+2 251
+3 450
+4 597
+5 428
+6 -498
+\end{filecontents}
+%Log(5+20*log(x))
+\begin{filecontents}{logt.dat}
+2 11
+3 14.5
+4 17
+5 19
+6 20.5
+\end{filecontents}
+%Log(5+20*ln(x))
+\begin{filecontents}{loge.dat}
+2 19
+3 27
+4 33
+5 37
+6 41
+\end{filecontents}
+%Power(x^3)
+\begin{filecontents}{power.dat}
+2 8
+3 27
+4 64
+5 125
+6 216
+7 343
+8 512
+9 729
+10 1000
+\end{filecontents}
+%Gauss (e^(-x^2))
+\begin{filecontents}{gauss.dat}
+-10 3.72008E-44
+-8 1.60381E-28
+-6 2.31952E-16
+-4 1.12535E-07
+-2 0.018315639
+2 0.018315639
+4 1.12535E-07
+6 2.31952E-16
+8 1.60381E-28
+10 3.72008E-44
+\end{filecontents}
+%Linear (2x+2)
+\begin{filecontents}{linear.dat}
+1 4
+2 6
+3 8
+4 10
+5 12
+6 14
+7 16
+8 18
+9 20
+10 22
+\end{filecontents}
+%Linear (2x 3x)
+\begin{filecontents}{linearA.dat}
+1 2 3
+2 4 6
+3 6 9
+4 8 12
+5 10 15
+6 12 18
+7 14 21
+8 16 24
+9 18 27
+10 20 30
+\end{filecontents}
+%King (sqrt(5+4*V^0.5))
+\begin{filecontents}{king.dat}
+2 3.264483765
+3 3.453723097
+4 3.605551275
+5 3.734202982
+6 3.846811533
+7 3.947531538
+8 4.039023211
+9 4.123105626
+10 4.20108446
+\end{filecontents}
+
+\endinput
diff --git a/Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.pdf b/Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.pdf
new file mode 100644
index 00000000000..5f8f02117bf
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.tex b/Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.tex
new file mode 100644
index 00000000000..b00c1c98ba4
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pst-fit/pst-fit-doc.tex
@@ -0,0 +1,184 @@
+%% $Id: pst-fit-doc.tex 673 2012-04-01 09:50:48Z herbert $
+\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,
+ smallheadings, headexclude,footexclude,oneside]{pst-doc}
+\usepackage[utf8]{inputenc}
+\usepackage{pst-fit}
+\let\pstFitFV\fileversion
+
+\input{pst-fit-doc.data}
+\readdata[ignoreLines=0]{\Gauss}{gauss.dat}
+\readdata[ignoreLines=0]{\Power}{power.dat}
+\readdata[ignoreLines=0]{\King}{king.dat}
+\readdata[ignoreLines=0]{\Exp}{exp.dat}
+\readdata[ignoreLines=0]{\Linear}{linear.dat}
+\readdata[ignoreLines=0]{\LinearA}{linearA.dat}
+\readdata[ignoreLines=0]{\Recip}{recip.dat}
+\readdata[ignoreLines=0]{\Poly}{poly.dat}
+\readdata[ignoreLines=0]{\Logt}{logt.dat}
+\readdata[ignoreLines=0]{\Loge}{loge.dat}
+
+
+\renewcommand\bgImage{%
+\begin{psgraph}[arrows=<->,Dy=20](0,0)(0,0)(10,100){2in}{2in}
+\listplot[decimals=2,EqPos=5 50,plotstyle=GLLSR,RecipFit,linestyle=dashed]{\Recip}
+\listplot[plotstyle=dots]{\Recip}
+\end{psgraph}
+}
+
+\let\Section\section
+\def\section{\clearpage\Section}
+\begin{document}
+
+\title{\texttt{pst-fit}}
+\subtitle{Curve fitting; v.\pstFitFV}
+\author{Buddy Ledger}
+\docauthor{}
+\date{\today}
+\maketitle
+
+\tableofcontents
+%
+%
+%
+\psset{xAxisLabel=x, %Setup for psgraph env
+ yAxisLabel=y,
+ xAxisLabelPos=,
+ yAxisLabelPos=,
+ lly=-1cm,llx=-1cm}
+
+\section{Fit of Linear Function}
+%Replaces LSM using default options
+
+\begin{LTXexample}[pos=t]
+\begin{psgraph}[arrows=->,Dy=2](0,0)(0,0)(10,22){4.5in}{4.5in}
+\listplot[decimals=2,EqPos=3 15,plotstyle=GLLSR,linestyle=dashed]{\Linear}
+\listplot[plotstyle=dots,linecolor=red,dotscale=2,dotstyle=x]{\Linear}
+\end{psgraph}
+\end{LTXexample}
+
+\section{Fit of Power Function}
+\begin{LTXexample}[pos=t]
+\begin{psgraph}[arrows=->,Dy=100](0,0)(0,0)(10,1000){4.5in}{4.5in}
+\listplot[decimals=2,EqPos=1 800,linestyle=dashed,plotstyle=GLLSR,PowerFit]{\Power}
+\listplot[plotstyle=dots,linecolor=red,dotscale=2,dotstyle=x]{\Power}
+\listplot[EqPos=5 4,plotstyle=GLLSR,linecolor=blue,CustomFit,CheckZeroX,CheckZeroY,FYtrans=log,RYtrans=10 exch exp,FXtrans=log]{\Power}
+\end{psgraph}
+\end{LTXexample}
+
+\section{Fit of exp Function}
+\begin{LTXexample}[pos=t]
+\begin{psgraph}[arrows=->,Dx=1,Dy=1000,xsubticks=1,ysubticks=1](0,0)(0,0)(10,10000){4.5in}{4.5in}
+\listplot[PstDebug=1,decimals=2,EqPos=4 2000,MaPos=5 7000,plotstyle=GLLSR,ExpFit]{\Exp}
+\listplot[plotstyle=dots]{\Exp}
+\end{psgraph}
+\end{LTXexample}
+
+\section{Fit of Log10/Loge Functions}
+\begin{LTXexample}[pos=t]
+\begin{psgraph}[arrows=->,Dx=1,Dy=2,xsubticks=1,ysubticks=1](0,0)(0,0)(10,50){4.5in}{4.5in}
+\listplot[decimals=2,EqPos=5 10,plotstyle=GLLSR,LogTFit]{\Logt}
+\listplot[decimals=2,plotstyle=dots]{\Logt}
+\listplot[decimals=2,EqPos=5 28,plotstyle=GLLSR,LogEFit]{\Loge}
+\listplot[decimals=2,plotstyle=dots]{\Loge}
+%\listplot[EqPos=5 4,plotstyle=GLLSR,CustomFit,CheckZeroX=true,CheckZeroY=true,FYtrans=Yint dup mul sub %log,RYtrans=10 exch exp Yint dup mul add,FXtrans=log]{\Linear}
+\end{psgraph}
+\end{LTXexample}
+
+
+
+\section{Fit of Recip}
+\begin{LTXexample}[pos=t]
+\begin{psgraph}[arrows=<->,Dx=1,Dy=10,xsubticks=1,ysubticks=1](0,0)(0,0)(10,100){4.5in}{4.5in}
+\listplot[decimals=2,EqPos=5 2,plotstyle=GLLSR,RecipFit]{\Recip}
+\listplot[plotstyle=dots]{\Recip}
+\end{psgraph}
+\end{LTXexample}
+
+\section{Fit of Kings Law data}
+
+\begin{LTXexample}[pos=t]
+\begin{psgraph}[arrows=->,Dx=1,Dy=1,xsubticks=1,ysubticks=1](0,0)(0,0)(10,20){4.5in}{4.5in}
+\pstScalePoints(1,1){}{dup mul}
+\listplot[decimals=2,EqPos=5 2,plotstyle=GLLSR,PowerFit,Yint=5]{\King}
+\listplot[plotstyle=dots]{\King}
+\pstScalePoints(1,1){}{}
+\end{psgraph}
+\end{LTXexample}
+
+\section{Fit of Guassian}
+\begin{LTXexample}[pos=t]
+\begin{psgraph}[arrows=->,Dx=1,Dy=0.1,xsubticks=1,ysubticks=1](0,0)(-10,0)(10,1){4.5in}{4.5in}
+\listplot[plotstyle=dots]{\Gauss}
+\listplot[decimals=2,EqPos=5 0.4,plotstyle=GLLSR,GaussFit,plotpoints=400]{\Gauss}
+\end{psgraph}
+\end{LTXexample}
+
+\section{Fit of 4th Order Polynomial}
+\begin{LTXexample}[pos=t]
+\begin{psgraph}[arrows=->,Dx=1,Dy=100,xsubticks=1,ysubticks=1](0,0)(0,-600)(10,600){4.5in}{4.5in}
+\listplot[plotstyle=dots]{\Poly}
+%note that the valuewidth needs to be large for debugging matrices
+\listplot[valuewidth=20,PstDebug=1,decimals=2,EqPos=0.5 -200,plotstyle=GLLSR,MaPos=7 500,MaScale=0.5,PolyOrder=4,plotpoints=400,Yint=500]{\Poly}
+\listplot[linestyle=dashed,decimals=2,EqPos=0.5 -400,plotstyle=GLLSR,PolyOrder=4,plotpoints=400]{\Poly}
+%\listplot[decimals=2,EqPos=0.5 -200,plotstyle=GLLSR,PolyOrder=10,plotpoints=400]{\Power}
+\end{psgraph}
+\end{LTXexample}
+
+\section{LinetoXAxis respects scalepoints.}
+\begin{LTXexample}[pos=t]
+\begin{psgraph}[arrows=<->,Dx=1,Dy=1,xsubticks=1,ysubticks=1](0,0)(0,0)(10,10){4in}{4in}
+\pstScalePoints(0.5,0.25){2 add}{16 add}
+\listplot[plotstyle=line]{\Linear}
+\listplot[arrows=<-,plotstyle=LineToXAxis]{\Linear}
+\pstScalePoints(1,1){}{}
+\rput[lb](1,2){Scaled fluid velocity distribution on a plot of the physical system.}
+\end{psgraph}
+\end{LTXexample}
+
+\section{Prepare Points Modification}
+\begin{LTXexample}[pos=t]
+\begin{psgraph}[arrows=->,Dx=1,Dy=1,xsubticks=1,ysubticks=1](0,0)(0,0)(15,30){4.5in}{4.5in}
+\listplot[plotstyle=line,plotNoMax=2,plotNo=1]{\LinearA}
+\listplot[plotstyle=line,plotNoMax=2,plotNo=2]{\LinearA}
+\listplot[plotstyle=line,linestyle=dashed,plotNoMax=2,plotNo=1,plotNoTwo=2,plotNoTwoFunc=add 2 div]{\LinearA}
+\rput[lb](10,18){1st Column}
+\rput[lb](10,29){2nd Column}
+\rput[lb](10,24){Average of 1st and 2nd Columns}
+\end{psgraph}
+\end{LTXexample}
+
+\section{PrintCoor Demo}
+\begin{LTXexample}[pos=t]
+\begin{psgraph}[arrows=->,Dx=1,Dy=1,xsubticks=1,ysubticks=1](0,0)(0,0)(10,15){4.5in}{4.5in}
+%PrintCoor Demo
+\psset{xEnd=,xStart=,decimals=2,valuewidth=50,fontscale=10,PstDebug=1}
+\pstScalePoints(1,1){0.75 mul}{0.5 exp 3 mul}
+\listplot[plotstyle=PrintCoor,plotNoMax=1,plotNo=1,PstDebug=0,relxerr=0,relyerr=0.1]{\Linear}
+\listplot[plotstyle=dots,plotNoMax=1,plotNo=1]{\Linear}
+\pstScalePoints(1,1){}{}
+\end{psgraph}
+\end{LTXexample}
+
+\clearpage
+\section{List of all optional arguments for \texttt{pst-fit}}
+
+\xkvview{family=pst-fit,columns={key,type,default}}
+
+
+
+
+\bgroup
+\raggedright
+\nocite{*}
+\bibliographystyle{plain}
+\bibliography{pst-fit-doc}
+\egroup
+
+\printindex
+
+
+
+
+
+\end{document}
+
diff --git a/Master/texmf-dist/source/generic/pst-fit/Makefile b/Master/texmf-dist/source/generic/pst-fit/Makefile
new file mode 100644
index 00000000000..0d272b0d730
--- /dev/null
+++ b/Master/texmf-dist/source/generic/pst-fit/Makefile
@@ -0,0 +1,71 @@
+# `Makefile' for `pst-fit.pdf', hv, 2006/08/11
+
+.SUFFIXES : .tex .ltx .dvi .ps .pdf .eps
+
+PACKAGE = pst-fit
+
+MAIN = $(PACKAGE)-doc
+
+LATEX = latex
+
+ARCHNAME = $(MAIN)-$(shell date +%y%m%d)
+
+ARCHFILES = $(PACKAGE).sty $(PACKAGE).tex $(PACKAGE).pro $(MAIN).tex README Changes Makefile
+
+TDS = ~/PSTricks/PSTricks-TDS
+
+all : doc clean tds
+doc: $(MAIN).pdf
+
+$(MAIN).pdf : $(MAIN).ps
+ GS_OPTIONS=-dAutoRotatePages=/None ps2pdf $<
+
+$(MAIN).ps : $(MAIN).dvi
+ dvips $<
+
+$(MAIN).dvi : $(MAIN).tex
+ $(LATEX) $<
+ $(LATEX) $<
+ if ! test -f $(basename $<).glo ; then touch $(basename $<).glo; fi
+ if ! test -f $(basename $<).idx ; then touch $(basename $<).idx; fi
+ makeindex -s gglo.ist -t $(basename $<).glg -o $(basename $<).gls \
+ $(basename $<).glo
+ makeindex -s pst-doc.ist -t $(basename $<).ilg -o $(basename $<).ind \
+ $(basename $<).idx
+ bibtex $(basename $<)
+ $(LATEX) $<
+ $(LATEX) $<
+
+clean :
+ $(RM) $(addprefix $(MAIN), .log .aux .bbl .blg .glg .glo .gls .ilg .idx .ind .tmp .toc .out)
+ $(RM) $(addprefix $(MAIN), .dvi .ps .xcp)
+ $(RM) *.dat
+
+veryclean : clean
+ $(RM) $(addprefix $(MAIN), .pdf .bbl .blg)
+
+arch :
+ zip $(ARCHNAME).zip $(ARCHFILES)
+
+tds:
+ cp -u Changes $(TDS)/doc/generic/$(PACKAGE)/
+ cp -u README $(TDS)/doc/generic/$(PACKAGE)/
+ cp -u $(MAIN).pdf $(TDS)/doc/generic/$(PACKAGE)/
+#
+ cp -u Changes $(TDS)/tex/latex/$(PACKAGE)/
+ cp -u $(PACKAGE).sty $(TDS)/tex/latex/$(PACKAGE)/
+#
+ cp -u Changes $(TDS)/tex/generic/$(PACKAGE)/
+ cp -u $(PACKAGE).tex $(TDS)/tex/generic/$(PACKAGE)/
+#
+# cp -u Changes $(TDS)/dvips/$(PACKAGE)/
+# cp -u $(PACKAGE).pro $(TDS)/dvips/$(PACKAGE)/
+# cp -u $(PACKAGE).pro ~/Links/dvips-local/
+#
+ cp -u Changes $(TDS)/source/$(PACKAGE)/
+ cp -u $(MAIN).tex $(TDS)/source/$(PACKAGE)/
+ cp -u $(MAIN).bib $(TDS)/source/$(PACKAGE)/
+ cp -u $(MAIN).data $(TDS)/source/$(PACKAGE)/
+ cp -u Makefile $(TDS)/source/$(PACKAGE)/
+
+# EOF
diff --git a/Master/texmf-dist/tex/generic/pst-fit/pst-fit.tex b/Master/texmf-dist/tex/generic/pst-fit/pst-fit.tex
new file mode 100644
index 00000000000..2336d5c20b3
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pst-fit/pst-fit.tex
@@ -0,0 +1,981 @@
+%% $Id: pst-fit.tex 673 2012-04-01 09:50:48Z herbert $
+%%
+%% This is file `pst-fit.tex',
+%%
+%% IMPORTANT NOTICE:
+%%
+%% Package `pst-fit.tex'
+%%
+%% Buddy Ledger <buddyledger@gmail.com>
+%% Herbert Voss <hvoss@tug.org>
+%%
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN archives
+%% in directory macros/latex/base/lppl.txt.
+%%
+%% DESCRIPTION:
+%% `pst-fit' is a PSTricks package for curve fitting
+%%
+\csname PSTfitLoaded\endcsname
+\let\PSTfitLoaded\endinput
+% Requires PSTricks, pst-plot
+\ifx\PSTricksLoaded\endinput\else \input pstricks.tex\fi
+\ifx\PSTricksAddLoaded\endinput\else\input pstricks-add.tex\fi
+\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi
+%
+\def\fileversion{0.01}
+\def\filedate{2012/04/01}
+\message{`PST-fit' v\fileversion, \filedate\space (BL,HV)}
+%
+\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
+
+\pst@addfams{pst-fit}
+\def\beginplot@ErrorLine{\begin@OpenObj}
+\def\endplot@ErrorLine{\psErrorLine@ii}
+\def\psErrorLine@ii{%
+ \addto@pscode{
+ \pst@cp % current point
+ \psline@iii % arc and lineto type
+ \tx@ErrorLine
+ }%
+ \end@OpenObj%
+}
+%
+\def\tx@ErrorLine{ErrorLine }
+\pst@def{ErrorLine}<{
+ /copypt { dup 3 2 roll dup 4 1 roll exch } def %copy point
+ NArray n 0 eq not
+ { n { \psk@relyerr\space 0 eq not
+ {copypt copypt dup \psk@relyerr\space mul add ArrowA
+ dup \psk@relyerr\space mul sub
+ Lineto
+ copypt dup \psk@relyerr\space mul sub ArrowB L} if
+ \psk@relxerr\space 0 eq not
+ {copypt copypt exch dup \psk@relxerr\space mul add exch ArrowA
+ exch dup \psk@relxerr\space mul sub exch
+ Lineto
+ copypt exch dup \psk@relxerr\space mul sub exch ArrowB L pop pop }
+ { pop pop } ifelse } repeat
+ } if
+}>
+
+\define@boolkey[psset]{pst-fit}[Pst@]{ScyBase}[true]{}%
+\define@boolkey[psset]{pst-fit}[Pst@]{ScxBase}[true]{}%
+\psset{ScyBase=true,ScxBase=true}
+
+\def\pstScalePoints(#1,#2)#3#4{%
+% xScale | yScale | xOperator | yOperator
+% the operators can be any Postscript code
+\pst@def{ScalePoints}<%
+ /y ED /x ED
+ /yOper { #4\space y mul #2\space mul } def
+ /xOper { #3\space x mul #1\space mul } def
+ counttomark dup dup cvi eq not { exch pop } if
+ /m exch def /n m 2 div cvi def
+ n {
+ #4\space y mul #2\space mul m 1 roll
+ #3\space x mul #1\space mul m 1 roll
+ /m m 2 sub
+ def } repeat>%
+}
+\def\psLineToXAxis@ii{%
+\addto@pscode{\pst@cp \psline@iii \tx@LineToXAxis}%
+\end@OpenObj}
+
+\def\tx@LineToXAxis{LineToXAxis }
+
+\pst@def{LineToXAxis}<{%
+NArray
+n 0 eq not
+ { %n 1 eq { 0 0 /n 2 def } if
+ %ArrowA
+ %/n n 2 sub def
+ %2 copy pop 0 \ifPst@ScyBase yOper \fi moveto Lineto
+ n { 2 copy 2 copy pop 0 \ifPst@ScyBase yOper \fi 4 2 roll ArrowA Lineto
+ 2 copy pop 0 \ifPst@ScyBase yOper \fi ArrowB L pop pop
+ } repeat
+ %2 copy moveto pop 0 \ifPst@ScyBase yOper \fi
+ %L
+ %pop pop
+} if}>
+
+\def\psLineToYAxis@ii{%
+\addto@pscode{\pst@cp \psline@iii \tx@LineToYAxis}%
+\end@OpenObj}
+\def\tx@LineToYAxis{LineToYAxis }
+\pst@def{LineToYAxis}<{
+NArray
+n 0 eq not
+ { %n 1 eq { 0 0 /n 2 def } if
+ %ArrowA
+ %/n n 2 sub def
+ %CP 2 copy moveto exch pop 0 \ifPst@ScxBase xOper \fi exch Lineto
+ n { 2 copy 2 copy exch pop 0 \ifPst@ScxBase xOper \fi exch 4 2 roll ArrowA Lineto
+ 2 copy exch pop 0 \ifPst@ScxBase xOper \fi exch ArrowB L pop pop
+ } repeat
+ %2 copy moveto exch pop 0 \ifPst@ScxBase xOper \fi exch
+ %L
+ %pop pop
+} if}>
+%
+%%%%%%PREPAREPOINTS
+\define@key[psset]{pst-fit}{plotNoTwo}{\def\psk@plotNoTwo{#1}}%
+\define@key[psset]{pst-fit}{plotNoTwoFunc}{\def\psk@plotNoTwoFunc{#1}} %Must operate on two stack elements and return one
+\psset{plotNoTwo=0,plotNoTwoFunc=dup mul exch dup mul add sqrt}
+
+%\def\tx@PreparePoints{PreparePoints }
+\pst@def{PreparePoints}<{%
+ counttomark /m exch def
+ \ifPsk@xyValues\else % we have only y values
+ /mm m def
+ /M m 1 add def
+ m { mm exch M 2 roll /M M 1 add def /mm mm 1 sub def } repeat
+ /m m dup add def
+ \fi
+ \ifPst@ChangeOrder
+ /m0 m def
+ m \psk@plotNoMax\space 1 add div 1 sub cvi {
+ m0 \psk@plotNoMax\space 1 add roll /m0 m0 \psk@plotNoMax\space 1 add sub def
+ } repeat
+ \fi
+ /n m \psk@plotNoMax\space 1 add div cvi def
+ \psk@plotNoMax\space 1 gt {% multiple data files?
+ n {
+ \psk@plotNoTwo\space 0 gt {
+ \psk@plotNoMax\space copy
+ \psk@plotNoMax\space \psk@plotNoTwo\space 1 sub neg roll % x yNo y yNoTwo y [yNo y yNoTwo y]
+ \psk@plotNoMax\space 1 sub { pop } repeat % x yNo y yNoTwo y yNoTwo
+ \psk@plotNoMax\space 1 add 1 roll } if
+ \psk@plotNoMax\space \psk@plotNo\space 1 sub neg roll % x yNo y y y ...
+ \psk@plotNoMax\space 1 sub { pop } repeat % x [yNoTwo] yNo
+ \psk@plotNoTwo\space 0 gt {
+ \psk@plotNoTwoFunc\space } if %x f(yNo,yNoTwo)
+ /m m \psk@plotNoMax\space 1 sub sub def
+ m 2 roll
+ } repeat
+ } if % no multiple data files
+% counttomark /m exch def
+% /n m 2 div cvi def
+ /xMax -99999 def /yMax -99999 def
+ /xP 0 def /yP 0 def
+ m copy
+ n {
+ /y exch def /x exch def
+ xMax x lt { /xMax x def } if
+ yMax y lt {/yMax y def } if
+ xP x gt { /xP x def } if
+ yP y gt { /yP y def } if
+ } repeat
+% m 2 roll
+ \psk@xStep\space 0 gt \psk@yStep\space 0 gt or (\psk@xStart) length 0 gt or
+ (\psk@yStart) length 0 gt or (\psk@xEnd) length 0 gt or (\psk@yEnd) length 0 gt or {
+%
+ (\psk@xStart) length 0 gt {\psk@xStart\space }{ xP } ifelse /xStart exch def
+ (\psk@yStart) length 0 gt {\psk@yStart\space }{ yP } ifelse /yStart exch def
+ (\psk@xEnd) length 0 gt { \psk@xEnd\space }{ xMax } ifelse /xEnd exch def
+ (\psk@yEnd) length 0 gt { \psk@yEnd\space }{ yMax } ifelse /yEnd exch def
+ n {
+ m -2 roll
+ 2 copy /yVal exch def /xVal exch def
+ xVal xP ge
+ yVal yP ge and
+ xVal xEnd le and
+ yVal yEnd le and
+ xVal xStart ge and
+ yVal yStart ge and {
+ /xP xP \psk@xStep\space add def
+ /yP yP \psk@yStep\space add def
+ }{%
+ pop pop
+ /m m 2 sub def
+ } ifelse
+ } repeat
+ }{%
+ /ncount 0 def
+ (\psk@nEnd) length 0 gt { \psk@nEnd\space }{ m } ifelse
+ /nEnd exch def
+ n {
+ m -2 roll
+ \psk@nStep\space 1 gt {
+ ncount \psk@nStart\space sub \psk@nStep\space mod 0 eq }{ true } ifelse
+ ncount nEnd le and
+ ncount \psk@nStart\space ge and not {
+ pop pop
+ /m m 2 sub def
+ } if
+ /ncount ncount 1 add def
+ } repeat
+ } ifelse
+}>
+%
+
+\def\beginplot@PrintCoor{\begin@SpecialObj}
+\def\endplot@PrintCoor{%
+ \psPrintCoor@ii %\psk@fillstyle\ifpsshadow\pst@closedshadow\fi%
+ %\pst@stroke
+ \end@SpecialObj%
+}
+\define@key[psset]{pst-fit}{relxerr}{\def\psk@relxerr{#1}}
+\define@key[psset]{pst-fit}{relyerr}{\def\psk@relyerr{#1}}
+\define@key[psset]{pst-fit}{yShift}{\def\psk@yShift{#1}}
+\define@boolkey[psset]{pst-fit}[Pst@]{science}[true]{}%
+\psset[pst-fit]{science=false,relxerr=0.1,relyerr=0.1,yShift=0}
+%Following is new pst-func.tex key which conflicts with mine.
+%Must specify [pst-fit] in psset to correct.
+%\define@boolkey[psset]{pst-add}[Pst@]{science}[true]{%
+% \ifPst@science\def\psk@Scin{true }\else\def\psk@Scin{false }\fi}
+
+\def\psPrintCoor@ii{%
+ \addto@pscode{%
+ false
+ \tx@NArray
+ \pst@number\psxunit
+ \pst@number\psyunit
+ \psPrintCoor@iii
+}}
+
+\def\psPrintCoor@iii{%
+ /mfont { \psk@PSfont\space findfont \psk@fontscale\space scalefont setfont } bind def
+ /mfontexp { \psk@PSfont findfont \psk@fontscale 1.2 div scalefont setfont } bind def
+ /s1 { /Symbol findfont \psk@fontscale\space scalefont setfont } bind def
+ /ttxspc \psk@fontscale\space 4 div def
+ /txspc ttxspc 4 div def
+ %pop
+ /ysc ED
+ /xsc ED
+ n 0 eq not {%
+ n {%
+ ysc div /Yval ED
+ xsc div /Xval ED
+ \ifPst@science
+ %X Coordinate
+ Xval 0 gt { Xval log floor }{ Xval 0 lt { Xval -1 mul log floor }{ 0 } ifelse } ifelse
+ cvi /xcoorexp ED
+ Xval 10 xcoorexp exp div
+ \psk@decimals\space -1 gt {%
+ 10 \psk@decimals\space exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if /xcoor ED
+ %Y Coordinate
+ Yval 0 gt { Yval log floor }{ Yval 0 lt { Yval -1 mul log floor }{ 0 } ifelse } ifelse
+ cvi /ycoorexp ED
+ Yval 10 ycoorexp exp div
+ \psk@decimals\space -1 gt {%
+ 10 \psk@decimals\space exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if /ycoor exch def
+ %Prep Strings
+ xcoorexp \psk@valuewidth\space string cvs /xcoorexp ED
+ ycoorexp \psk@valuewidth\space string cvs /ycoorexp ED
+ xcoor \psk@valuewidth\space string cvs /xcoor ED
+ ycoor \psk@valuewidth\space string cvs /ycoor ED
+ %X Error
+ \psk@relxerr\space Xval mul /delx ED \psk@relxerr\space 0 ne {%
+ delx 0 gt { delx log floor }{ delx 0 lt { delx -1 mul log floor }{ 0 } ifelse } ifelse
+ cvi /delxexp ED
+ delx 10 delxexp exp div dup mul sqrt
+ \psk@decimals\space -1 gt {%
+ 10 \psk@decimals\space exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if /delx ED
+ %Prep Strings
+ delxexp \psk@valuewidth\space string cvs /delxexp ED
+ delx \psk@valuewidth\space string cvs /delx ED } if
+ %Y Error
+ \psk@relyerr\space Yval mul /dely ED \psk@relyerr\space 0 ne {%
+ dely 0 gt { dely log floor }{ dely 0 lt { dely -1 mul log floor }{ 0 } ifelse } ifelse
+ cvi /delyexp ED
+ dely 10 delyexp exp div dup mul sqrt
+ \psk@decimals\space -1 gt {%
+ 10 \psk@decimals\space exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if /dely ED
+ %Prep Strings
+ delyexp \psk@valuewidth\space string cvs /delyexp ED
+ dely \psk@valuewidth\space string cvs /dely ED } if
+ \else
+ Xval \psk@decimals\space -1 gt
+ { 10 \psk@decimals\space exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq {cvi} if /xcoor ED
+ Yval \psk@decimals\space -1 gt
+ { 10 \psk@decimals\space exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq {cvi} if /ycoor ED
+ xcoor \psk@valuewidth\space string cvs /xcoor ED
+ ycoor \psk@valuewidth\space string cvs /ycoor ED
+ %
+ \psk@relxerr\space Xval mul dup mul sqrt
+ \psk@decimals\space -1 gt
+ { 10 \psk@decimals\space exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq {cvi} if /delx ED
+ \psk@relyerr\space Yval mul dup mul sqrt
+ \psk@decimals\space -1 gt
+ { 10 \psk@decimals\space exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq {cvi} if /dely ED
+ delx \psk@valuewidth\space string cvs /delx ED
+ dely \psk@valuewidth\space string cvs /dely ED
+ \fi
+%
+ newpath
+ Xval xsc mul %\psk@xShift\space xsc mul add
+ Yval ysc mul %\psk@yShift\space ysc mul add
+ moveto
+ \Pst@Debug\space 0 gt {
+ mfont
+ Xval \psk@valuewidth\space string cvs show (,) show
+ Yval \psk@valuewidth\space string cvs show }
+ {s1 (\string\050) show
+ mfont xcoor show
+ \ifPst@science
+ mfont (x) show
+ mfont (10) show
+ 0 ttxspc rmoveto mfontexp xcoorexp show
+ \fi
+ \psk@relxerr\space 0 ne
+ { \ifPst@science
+ 0 ttxspc neg rmoveto s1 (\string\261) show
+ mfont delx show
+ mfont (x) show
+ mfont (10) show
+ 0 ttxspc rmoveto mfontexp delxexp show
+ 0 ttxspc neg rmoveto s1 (,) show
+ \else
+ s1 (\string\261) show
+ mfont delx show
+ s1 (,) show
+ \fi }
+ { \ifPst@science
+ 0 ttxspc neg rmoveto s1 (,) show
+ \else
+ s1 (,) show
+ \fi } ifelse
+%start on ycoor
+ mfont ycoor show
+ \ifPst@science
+ mfont (x) show
+ mfont (10) show
+ 0 ttxspc rmoveto mfontexp ycoorexp show
+ \fi
+ \psk@relyerr\space 0 ne
+ { \ifPst@science
+ 0 ttxspc neg rmoveto s1 (\string\261) show
+ mfont dely show
+ mfont (x) show
+ mfont (10) show
+ 0 ttxspc rmoveto mfontexp delyexp show
+ 0 ttxspc neg rmoveto s1 (\string\051) show
+ \else
+ s1 (\string\261) show
+ mfont dely show
+ s1 (\string\051) show
+ \fi }
+ { s1 (\string\051) show } ifelse } ifelse
+ } repeat } if }
+
+%%%POLY FIT
+\define@key[psset]{pst-fit}{EqPos}[{}]{\def\psk@EqPos{#1}}
+\define@key[psset]{pst-fit}{MaPos}[{}]{\def\psk@MaPos{#1}}%added Feb3, 2012 Matrix out
+\define@key[psset]{pst-fit}{MaScale}[{}]{\def\psk@MaScale{#1}}%added Feb3, 2012 Matrix out
+\define@boolkey[psset]{pst-fit}[Pst@]{ShowEq}[true]{}%
+\psset{EqPos=,ShowEq=true,MaPos=0 0,MaScale=1}
+
+\define@key[psset]{pst-fit}{PolyOrder}[{}]{\def\psk@PolyOrder{#1}}
+\define@boolkey[psset]{pst-fit}[Pst@]{ReduceOrder}[true]{%these percents are critical removal results in shift to in x-dir
+\ifPst@ReduceOrder%
+\def\psk@ReduceOrder{true}\else\def\psk@ReduceOrder{false}\fi}%
+\define@boolkey[psset]{pst-fit}[Pst@]{PowerFit}[true]{%these percents are critical removal results in shift to in x-dir
+\ifPst@PowerFit%
+\def\psk@PowerFit{true}\def\psk@LogEFit{false}%
+\def\psk@LogTFit{false}\def\psk@ExpFit{false}%
+\def\psk@GaussFit{false}\def\psk@CustomFit{false}\def\psk@RecipFit{false}%
+\else\def\psk@PowerFit{false}\fi}%
+\define@boolkey[psset]{pst-fit}[Pst@]{LogEFit}[true]{%
+\ifPst@LogEFit%
+\def\psk@PowerFit{false}\def\psk@LogEFit{true}%
+\def\psk@LogTFit{false}\def\psk@ExpFit{false}%
+\def\psk@GaussFit{false}\def\psk@CustomFit{false}\def\psk@RecipFit{false}%
+\else\def\psk@LogEFit{false}\fi}%
+\define@boolkey[psset]{pst-fit}[Pst@]{LogTFit}[true]{%
+\ifPst@LogTFit%
+\def\psk@PowerFit{false}\def\psk@LogEFit{false}%
+\def\psk@LogTFit{true}\def\psk@ExpFit{false}%
+\def\psk@GaussFit{false}\def\psk@CustomFit{false}\def\psk@RecipFit{false}%
+\else\def\psk@LogTFit{false}\fi}%
+\define@boolkey[psset]{pst-fit}[Pst@]{ExpFit}[true]{%
+\ifPst@ExpFit%
+\def\psk@PowerFit{false}\def\psk@LogEFit{false}%
+\def\psk@LogTFit{false}\def\psk@ExpFit{true}%
+\def\psk@GaussFit{false}\def\psk@CustomFit{false}\def\psk@RecipFit{false}%
+\else\def\psk@ExpFit{false}\fi}%
+\define@boolkey[psset]{pst-fit}[Pst@]{GaussFit}[true]{%
+\ifPst@GaussFit%
+\def\psk@PowerFit{false}\def\psk@LogEFit{false}%
+\def\psk@LogTFit{false}\def\psk@ExpFit{false}%
+\def\psk@GaussFit{true}\def\psk@CustomFit{false}\def\psk@RecipFit{false}%
+\else\def\psk@GaussFit{false}\fi}%
+\define@boolkey[psset]{pst-fit}[Pst@]{RecipFit}[true]{%
+\ifPst@RecipFit%
+\def\psk@PowerFit{false}\def\psk@LogEFit{false}%
+\def\psk@LogTFit{false}\def\psk@ExpFit{false}%
+\def\psk@GaussFit{false}\def\psk@CustomFit{false}\def\psk@RecipFit{true}%
+\else\def\psk@RecipFit{false}\fi}%
+\define@boolkey[psset]{pst-fit}[Pst@]{CustomFit}[true]{%
+\ifPst@CustomFit%
+\def\psk@PowerFit{false}\def\psk@LogEFit{false}%
+\def\psk@LogTFit{false}\def\psk@ExpFit{false}%
+\def\psk@GaussFit{false}\def\psk@CustomFit{true}\def\psk@RecipFit{false}%
+\else\def\psk@CustomFit{false}\fi}%
+\define@key[psset]{pst-fit}{FXtrans}[{}]{\def\psk@FXtrans{#1}}
+\define@key[psset]{pst-fit}{FYtrans}[{}]{\def\psk@FYtrans{#1}}
+\define@key[psset]{pst-fit}{RYtrans}[{}]{\def\psk@RYtrans{#1}}
+\define@key[psset]{pst-fit}{Yint}[{}]{\def\psk@Yint{#1}}
+\define@key[psset]{pst-fit}{CheckZeroX}[{}]{\def\psk@CheckZeroX{#1}}
+\define@key[psset]{pst-fit}{CheckZeroY}[{}]{\def\psk@CheckZeroY{#1}}
+\psset{PolyOrder=1,ReduceOrder=false,PowerFit=false,LogEFit=false,LogTFit=false,%
+ ExpFit=false,GaussFit=false,RecipFit=false,CustomFit=false,%
+ FXtrans=,FYtrans=,RYtrans=,Yint=,CheckZeroX=,CheckZeroY=}
+
+\def\beginplot@GLLSR{\begin@SpecialObj}
+\def\endplot@GLLSR{%
+ \psGLLSR@ii\psk@fillstyle\ifpsshadow\pst@closedshadow\fi%
+ \pst@stroke
+ \end@SpecialObj%
+}
+\def\psGLLSR@ii{\addto@pscode{false \tx@NArray \psGLLSR@iii }}
+\def\psGLLSR@iii{%
+ %General Fit Model: y = a0 + a1*x + a2*x^2 + ... + an*x^n
+ %Define Fonts
+ /mfont { \psk@PSfont\space findfont \psk@fontscale\space scalefont setfont } bind def
+ /mfontbig { \psk@PSfont\space findfont \psk@fontscale\space 2 mul scalefont setfont } bind def
+ /mfontexp { \psk@PSfont\space findfont \psk@fontscale\space 2 div scalefont setfont } bind def
+ mfont
+ %Default parameters
+ (\psk@PolyOrder) length 0 gt { \psk@PolyOrder\space /order ED }{ /order 1 def } ifelse
+ /PolyEq true def
+ (\psk@Yint) length 0 gt
+ {\psk@Yint\space /Yint ED /setYint true def /ReduceOrder true def }
+ { /Yint 0 def /setYint false def /ReduceOrder false def} ifelse
+ /CheckZeroX false def
+ /CheckZeroY false def
+ /FXtrans {1 mul} def
+ /FYtrans { Yint sub } def
+ /RYtrans {1 mul} def
+ /xPr {(x) show} def
+ %Special Fit Functions (Linear Transforms)
+ \psk@PowerFit\space { /order 1 def /CheckZeroX true def /CheckZeroY true def /PolyEq false def
+ /FXtrans {log} def /FYtrans {Yint sub log} def /RYtrans {10 exch exp Yint add} def /ReduceOrder false def } if
+ \psk@LogTFit\space { /order 1 def /CheckZeroX true def /PolyEq true def
+ /xPr { (log) show (\string\050) show (x) show (\string\051) show } def
+ /FXtrans {log} def /FYtrans {1 mul} def /RYtrans {1 mul} def } if %
+ \psk@LogEFit\space { /order 1 def /CheckZeroX true def /PolyEq true def
+ /xPr { (ln) show (\string\050) show (x) show (\string\051) show } def
+ /FXtrans {ln} def /FYtrans {1 mul} def /RYtrans {1 mul} def } if %
+ \psk@ExpFit\space { /order 1 def /CheckZeroY true def /PolyEq false def
+ /FXtrans {1 mul} def /FYtrans {Yint sub ln} def /RYtrans {Euler exch exp Yint add} def /ReduceOrder false def } if %
+ \psk@GaussFit\space { /order 2 def /CheckZeroY true def /PolyEq false def
+ /FXtrans {1 mul} def /FYtrans {Yint sub ln} def /RYtrans {Euler exch exp Yint add} def /ReduceOrder false def } if %
+ \psk@RecipFit\space { /order 1 def /CheckZeroX true def /PolyEq true def
+ /xPr { (\string\050) show (1) show (\string\244) show (x) show (\string\051) show } def
+ /FXtrans { 1 exch div } def /FYtrans {1 mul} def /RYtrans {1 mul} def } if
+ \psk@CustomFit\space { /PolyFit false def
+ (\psk@FXtrans) length 0 gt { {\psk@FXtrans\space} /FXtrans ED } if
+ (\psk@FYtrans) length 0 gt { {\psk@FYtrans\space} /FYtrans ED } if
+ (\psk@RYtrans) length 0 gt { {\psk@RYtrans\space} /RYtrans ED } if
+ (\psk@CheckZeroX) length 0 gt { {\psk@CheckZeroX\space} /CheckZeroX ED } if
+ (\psk@CheckZeroY) length 0 gt { {\psk@CheckZeroY\space} /CheckZeroY ED } if
+ (\psk@ReduceOrder) length 0 gt { {\psk@ReduceOrder\space} /ReduceOrder ED } if } if %
+ %Initialize Arrays
+ /A order 1 add order 1 add mul array def
+ /B order 1 add array def
+ /ai order 1 add array def
+ %Coordinate Conversion Operators X Y PLU -> Plot Units (pts), X Y RLU -> Real Units (arbitrary)
+ /PLU {exch \pst@number\psxunit\space mul exch \pst@number\psyunit\space mul } def
+ /RLU {exch \pst@number\psxunit\space div exch \pst@number\psyunit\space div } def
+ /PRA { %Inputs: Array [ #rows #cols X Y Scale boolean(print equal sign) boolean(return) ]
+ %"pra" prefix has been added to all variables to minimize chance of naming conflicts
+% /praSc exch def /praYc exch def /praXc exch def
+% /praCol exch def /praRow exch def /praARY exch def
+ /praTemp exch def /praARY exch def
+ praTemp length 7 eq {%
+ %praTemp 4 get /praSc exch def
+ %praTemp 3 get /praYc exch def
+ %praTemp 2 get /praXc exch def
+ %praTemp 1 get /praCol exch def
+ %praTemp 0 get /praRow exch def pop
+ /tempfontscale \psk@fontscale praTemp 4 get mul def
+ %/praXc praTemp 2 get \pst@number\psxunit\space mul def
+ /praYc praTemp 3 get \pst@number\psyunit\space mul def
+ /praXmax -999999 def
+ /praYmin 999999 def
+ /prafont {\psk@PSfont\space findfont tempfontscale scalefont setfont} bind def
+ /prasym { /Symbol findfont tempfontscale 2 mul scalefont setfont} bind def
+ prafont
+ praTemp 2 get \pst@number\psxunit\space mul praTemp 3 get \pst@number\psyunit\space mul moveto
+ praARY length praTemp 1 get praTemp 0 get mul eq not { (Row x Col > Vector Dim) show }{%
+ /praXstart praTemp 2 get \pst@number\psxunit\space mul def
+ 0 1 praTemp 1 get 1 sub {/praj ED
+ 0 1 praTemp 0 get 1 sub {/prai ED /prak praj praTemp 1 get prai mul add def
+ praARY prak get \psk@valuewidth string cvs show
+ currentpoint pop dup praXmax gt { /praXmax ED }{ pop } ifelse
+ currentpoint pop praXstart sub neg tempfontscale 1.5 mul neg rmoveto
+ } for
+ currentpoint exch pop dup praYmin lt { /praYmin ED }{ pop } ifelse
+ /praXstart praXmax tempfontscale 0.75 mul add def
+ praXstart praTemp 3 get \pst@number\psyunit\space mul moveto
+ } for
+ %Brackets
+ newpath
+ praTemp 2 get \pst@number\psxunit\space mul tempfontscale 0.125 mul add
+ praTemp 3 get \pst@number\psyunit\space mul tempfontscale add moveto
+ praTemp 2 get \pst@number\psxunit\space mul tempfontscale 0.125 mul sub
+ praTemp 3 get \pst@number\psyunit\space mul tempfontscale add lineto
+ praTemp 2 get \pst@number\psxunit\space mul tempfontscale 0.125 mul sub
+ praYmin tempfontscale add lineto
+ praTemp 2 get \pst@number\psxunit\space mul tempfontscale 0.125 mul add
+ praYmin tempfontscale add lineto
+ stroke
+ newpath
+ praXmax tempfontscale 0.125 mul sub
+ praTemp 3 get \pst@number\psyunit\space mul tempfontscale add moveto
+ praXmax tempfontscale 0.125 mul add
+ praTemp 3 get \pst@number\psyunit\space mul tempfontscale add lineto
+ praXmax tempfontscale 0.125 mul add
+ praYmin tempfontscale add lineto
+ praXmax tempfontscale 0.125 mul sub
+ praYmin tempfontscale add lineto
+ stroke
+ praTemp 5 get {
+ praXmax tempfontscale add
+ praTemp 3 get \pst@number\psyunit\space mul tempfontscale add praYmin add 2 div moveto
+ prasym (=) show currentpoint pop /praXmax ED} if
+ %Left Bracket
+ praTemp 2 get \pst@number\psxunit\space mul praYmin tempfontscale 2 mul sub moveto %Return to bottom left
+ %the following are defined for use with cascade calls to PRA
+ % (Xl,Yb) - Print next matrix below last
+ % (Xr,Yt) - Print next matrix beside last
+ % (Xr,Yb) - Print next matrix beside and below last
+ tx@Dict /praYb known {
+ praYmin tempfontscale 1.5 mul sub \pst@number\psyunit\space div praYb lt {
+ /praYb praYmin tempfontscale 1.5 mul sub \pst@number\psyunit\space div def } if }
+ { /praYb praYmin tempfontscale 1.5 mul sub \pst@number\psyunit\space div def } ifelse
+ /praYb praYmin tempfontscale 1.5 mul sub \pst@number\psyunit\space div def
+ %
+ tx@Dict /praXl known not {/praXl praTemp 2 get def } if
+ % { praTemp 6 get {/praXl praTemp 2 get def} if } ifelse
+ tx@Dict /praYt known not {/praYt praTemp 3 get def }
+ { praTemp 6 get {/praYt praYb def} if } ifelse
+ %
+ tx@Dict /praXr known {
+ praTemp 6 get { /praXr praXl def }{ /praXr praXmax tempfontscale add \pst@number\psxunit\space div def } ifelse }{%
+ /praXr praXmax tempfontscale add \pst@number\psxunit\space div def } ifelse
+ \psk@PSfont\space findfont \psk@fontscale\space scalefont setfont } ifelse
+ }{ \psk@PSfont\space findfont \psk@fontscale\space scalefont setfont
+ 0 0 moveto (PRA Error Not Enough Parameters) show } ifelse } def
+ 0 1 A length 1 sub { A exch 0 put } for
+ 0 1 B length 1 sub { B exch 0 put } for
+ 0 1 ai length 1 sub { ai exch 0 put } for
+ %%%%%%%%
+ %Remove Zero Data (As Required By Transformation Functions)
+ CheckZeroX CheckZeroY or {
+ n { /tmpx false def /tmpy false def
+ CheckZeroY { dup \pst@number\psyunit\space div Yint sub 0 le { /tmpy true def } if } if
+ CheckZeroX { exch dup \pst@number\psxunit\space div 0 le { /tmpx true def } if exch } if
+ tmpx tmpy or { pop pop /n n 1 sub def }{ n 2 mul 2 roll } ifelse
+ } repeat } if
+ %%%
+ %%%%
+ %Determine Max/Min X for Plotting
+ exch dup dup
+ \pst@number\psxunit\space div /xEnd ED
+ \pst@number\psxunit\space div /xStart ED
+ exch
+ /ybar 0 def
+ n { % number of data pairs
+ dup \pst@number\psyunit\space div ybar add /ybar ED
+ 2 copy %copy point
+ \pst@number\psyunit\space div /Yval ED
+ \pst@number\psxunit\space div /Xval ED
+ Xval xStart lt { /xStart Xval def } if % find the lowest xi
+ Xval xEnd gt { /xEnd Xval def } if % find the largest xi
+ n 2 mul 2 roll %roll the original point to the bottom of the stack
+ } repeat
+ ybar n div /ybar ED
+ %Scale X & Y variables and apply Linear Transform if applicable
+ n {
+ \pst@number\psyunit\space div FYtrans
+ n 2 mul 1 roll
+ \pst@number\psxunit\space div FXtrans
+ n 2 mul 1 roll
+ } repeat
+ %START ASSEMBLY OF LEAST SQUARES MATRIX
+ 1 1 order 1 add { /ci exch def
+ 1 1 ci { /cj exch def
+ /epk ci cj add 2 sub def
+ /sum 0 def
+ n { n 2 mul 1 roll
+ dup epk exp sum add /sum ED
+ n 2 mul 1 roll
+ } repeat
+ A
+ ci 1 sub order 1 add mul cj add 1 sub
+ sum put %i row, j col standard
+ A
+ cj 1 sub order 1 add mul ci add 1 sub
+ sum put %j row, i col reversed
+ } for
+ /sum 0 def
+ 1 1 n { /cl exch def
+ 2 copy
+ exch
+ ci 1 sub exp mul sum add /sum ED
+ n 2 mul 2 roll
+ } for
+ B
+ ci 1 sub
+ sum put
+ } for
+ \Pst@Debug\space 1 eq {
+ %A [ order 1 add order 1 add 5 20 0.5 false false ] PRA
+ A [ order 1 add order 1 add \psk@MaPos\space \psk@MaScale\space true false ] PRA
+ B [ order 1 add 1 praXr praYt \psk@MaScale\space false true ] PRA
+ } if
+ %END OF ASSEMBLE MATRIX
+ %REDUCE ORDER FOR Y INTERCEPT FOR MODELS WHICH ARE APPROPRIATE
+ ReduceOrder {
+ /elemOld { exch 1 sub order 1 add mul add 1 sub } def
+ /elemNew { exch 2 sub order mul add 2 sub } def
+ /dummyA order order mul array def
+ 0 1 dummyA length 1 sub { dummyA exch 0 put } for
+ /dummyB order array def
+ 0 1 dummyB length 1 sub { dummyB exch 0 put } for
+ /ai order array def
+ 0 1 ai length 1 sub { ai exch 0 put } for
+ %Translate A to dummyA
+ 2 1 order 1 add {/ci ED
+ 2 1 order 1 add {/cj ED
+ dummyA ci cj elemNew
+ A ci cj elemOld get
+ put
+ } for
+ dummyB ci 2 sub
+ B ci 1 sub get
+ put
+ } for
+ /order order 1 sub def %temporarily reduce system order
+ /A order 1 add order 1 add mul array def 0 1 A length 1 sub {/ci ED A ci dummyA ci get put } for %put dummyA in new A
+ /B order 1 add array def 0 1 B length 1 sub {/ci ED B ci dummyB ci get put } for %put dummyB in new B
+ \Pst@Debug\space 1 eq {
+ A [ order 1 add order 1 add praXr praYt \psk@MaScale\space true false ] PRA
+ B [ order 1 add 1 praXr praYt \psk@MaScale\space false true ] PRA } if
+ \tx@GaussSolve
+ /order order 1 add def %restore system order
+ /m m 1 add def
+ % \Pst@Debug\space 1 eq {
+ %ai [ order 1 add 1 praXr praYt \psk@MaScale\space false false ] PRA } if
+ /dummyai order 1 add array def
+ 0 1 dummyai length 1 sub {/ci ED dummyai ci 0 put } for
+ 0 1 ai length 1 sub {/ci ED dummyai ci 1 add ai ci get put } for
+ /ai dummyai def
+ ai 0 Yint put
+ %ai [ order 2 sub 1 0 0 \psk@MaScale\space true false ] PRA
+ }{ \tx@GaussSolve } ifelse
+ %\Pst@Debug\space 1 eq {
+ %ai [ order 1 add 1 praXr praYt \psk@MaScale\space false false ] PRA } if
+ %%%%%%%%%%%%%%%%%%%%%%%%%%
+ %% END SOLVE CURVE FITS %%
+ %%%%%%%%%%%%%%%%%%%%%%%%%%
+ %%%%%%%%%%%%%%%%%%%%%
+ %% PLOT CURVE FITS %%
+ %%%%%%%%%%%%%%%%%%%%%
+ newpath
+ (\psk@xStart) length 0 gt % special start value?
+ { \psk@xStart\space /xStart ED } if
+ (\psk@xEnd) length 0 gt % special end value?
+ { \psk@xEnd\space /xEnd ED } if
+ /xStep xEnd xStart sub \psk@plotpoints\space div def
+ /Xnow xStart def
+ /Ynow 0 def
+ 1 1 m { /ci exch def ai ci 1 sub get ci 1 sub { Xnow FXtrans mul } repeat Ynow add /Ynow exch def } for
+ Xnow Ynow RYtrans PLU moveto
+ \psk@plotpoints\space cvi
+ { /Xnow Xnow xStep add def
+ /Ynow 0 def
+ 1 1 m { /ci exch def ai ci 1 sub get ci 1 sub { Xnow FXtrans mul } repeat Ynow add /Ynow exch def } for
+ Xnow Ynow RYtrans PLU lineto
+ } repeat
+ %
+ /yminusdot 0 def
+ /yminusbar 0 def
+ n {
+ 2 copy
+ /Ynow ED
+ /Xnow ED
+ /Ydot 0 def
+ 1 1 m { /ci exch def
+ ai ci 1 sub get ci 1 sub { Xnow mul } repeat Ydot add /Ydot exch def } for %
+ Ynow Ydot sub dup mul yminusdot add /yminusdot ED
+ Ynow ybar sub dup mul yminusbar add /yminusbar ED
+ n 2 mul 2 roll
+ } repeat
+ 1 yminusdot yminusbar div sub /rsquared ED
+ %%%%%%%%%%%%%%%%%%%%%%%%%
+ %% END PLOT CURVE FITS %%
+ %%%%%%%%%%%%%%%%%%%%%%%%%
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %% START PRINT EQUATIONS %%
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \ifPst@ShowEq
+ % Setup Cursor
+ (\psk@EqPos) length 0 gt
+ {\psk@EqPos\space PLU }
+ {2 -5 PLU } ifelse moveto
+ % Power Fit Equation %
+ \psk@PowerFit\space {
+ 10 ai 0 get exp
+ \psk@decimals\space -1 gt
+ { 10 \psk@decimals exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if /tmpA exch def
+ ai 1 get
+ \psk@decimals\space -1 gt
+ { 10 \psk@decimals exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if /tmpB exch def
+ (y = ) show
+ tmpA \psk@valuewidth string cvs show
+ (x) show
+ 0 \psk@fontscale 4 div rmoveto
+ mfontexp tmpB \psk@valuewidth string cvs show mfont
+ 0 \psk@fontscale 4 div neg rmoveto
+ setYint Yint 0 ne and { Yint 0 gt { (+) show } if Yint \psk@valuewidth string cvs show } if } if
+ % Exponential Fit Equation %
+ \psk@ExpFit\space {
+ Euler ai 0 get exp
+ \psk@decimals\space -1 gt
+ { 10 \psk@decimals exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if /tmpA exch def
+ Euler ai 1 get exp
+ \psk@decimals\space -1 gt
+ { 10 \psk@decimals exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if /tmpB exch def
+ (y = ) show
+ (\string\050) show tmpA \psk@valuewidth string cvs show (\string\051) show
+ %(e) show
+ (\string\264) show
+ %0 \psk@fontscale 4 div rmoveto
+ %mfontexp tmpB \psk@valuewidth string cvs show
+ (\string\050) show tmpB \psk@valuewidth string cvs show (\string\051) show
+ 0 \psk@fontscale 2 div rmoveto
+ mfontexp (x) show mfont
+ 0 \psk@fontscale 2 div neg rmoveto
+ setYint Yint 0 ne and { Yint 0 gt { (+) show } if Yint \psk@valuewidth string cvs show } if} if
+ % Gaussian Fit Equation %
+ \psk@GaussFit\space {
+ /tmpA Euler ai 0 get ai 1 get dup mul 4 div ai 2 get div sub exp def
+ /tmpB ai 1 get 2 div ai 2 get div def
+ /tmpC ai 2 get def
+ tmpA
+ \psk@decimals\space -1 gt
+ { 10 \psk@decimals exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if /tmpA exch def
+ tmpB
+ \psk@decimals\space -1 gt
+ { 10 \psk@decimals exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if /tmpB exch def
+ tmpC
+ \psk@decimals\space -1 gt
+ { 10 \psk@decimals exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if /tmpC exch def
+ (y = ) show
+ tmpA 30 string cvs show
+ (e) show
+ 0 \psk@fontscale 4 div rmoveto
+ mfontexp tmpC \psk@valuewidth string cvs show
+ (\string\(x) show
+ tmpB 0 ne { tmpB 0 ge { (+) show } if tmpB \psk@valuewidth string cvs show } if
+ (\string\)) show
+ 0 \psk@fontscale 4 div rmoveto (2) show mfont
+ 0 \psk@fontscale 2 div neg rmoveto
+ setYint Yint 0 ne and { Yint 0 gt { (+) show } if Yint \psk@valuewidth string cvs show } if } if
+ %%%%%%%%%%%%%%%
+ % Round Coeff %
+ %%%%%%%%%%%%%%%
+ 0 1 ai length 1 sub {/ci exch def
+ ai ci get
+ \psk@decimals\space -1 gt
+ { 10 \psk@decimals exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if
+ ai ci 3 -1 roll put } for
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ % Plot Polynomial (including Linear) Fit %
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ PolyEq { (y =) show
+ 1 1 m { /ci exch def
+ ai ci 1 sub get 30 string cvs show
+ ci 1 sub 0 gt { xPr } if
+ ci 1 sub 1 gt {%
+ 0 \psk@fontscale 4 div rmoveto ci 1 sub 30 string cvs show
+ 0 \psk@fontscale 4 div neg rmoveto } if
+ ci m eq not { ai ci get 0 lt {}{ (+) show } ifelse } if
+ } for } if
+ %Print Rsquared
+ rsquared
+ \psk@decimals\space -1 gt
+ { 10 \psk@decimals exp dup 3 1 roll mul round exch div } if
+ \psk@decimals\space 0 eq { cvi } if /rsquared exch def
+ \psk@EqPos\space PLU moveto
+ 0 \psk@fontscale 1.5 mul neg rmoveto
+ (R) show
+ 0 \psk@fontscale 2 div rmoveto
+ mfontexp (2) show mfont
+ 0 \psk@fontscale 2 div neg rmoveto
+ ( = ) show
+ rsquared \psk@valuewidth string cvs show
+ \fi
+}
+%
+\def\tx@GaussSolve{GaussSolve }
+\pst@def{GaussSolve}<{%
+%Required Variables
+%order,A,B,ai
+ /er 1 def %
+ /tol 0.00001 def %
+ /m order 1 add def %number of equations
+ /Aout m m mul array def %This is for printing the scaled identity matrix which A becomes
+ 0 1 Aout length 1 sub { Aout exch 0 put } for
+ /elem { exch 1 sub m mul add 1 sub } def %Array i j
+ %DETERMINE SCALE FACTORS
+ /sc m array def %row scale factors
+ 0 1 sc length 1 sub { sc exch 0 put } for
+ 1 1 m { /ci exch def
+ sc
+ ci 1 sub
+ A ci 1 elem get
+ dup mul sqrt
+ put
+ 2 1 m { /cj exch def
+ A ci cj elem get
+ dup mul sqrt
+ sc ci 1 sub get gt {%
+ sc
+ ci 1 sub
+ A ci cj elem get
+ dup mul sqrt
+ put } if
+ } for
+ % 1 ci mul 1 sc ci 1 sub get 30 string cvs show
+ } for
+ %END OF SCALE FACTORS
+ %CALL ELIMINATE
+ order 1 ge {%
+ 1 1 m 1 sub { /ck exch def
+ %Call Pivot
+ /p ck def
+ A ck ck elem get
+ sc ck 1 sub get div
+ dup mul sqrt
+ /big exch def
+ ck 1 add 1 m {/cii exch def
+ A cii ck elem get
+ sc cii 1 sub get div
+ dup mul sqrt
+ /dummy exch def
+ dummy big gt { /big dummy def /p cii def } if
+ } for
+ p ck eq not {
+ ck 1 m {/cjj exch def
+ A p cjj elem get
+ /dummy exch def
+ A p cjj elem
+ A ck cjj elem get
+ put
+ A ck cjj elem
+ dummy
+ put
+ } for
+ B p 1 sub get
+ /dummy exch def
+ B p 1 sub
+ B ck 1 sub get
+ put
+ B ck 1 sub
+ dummy
+ put
+ sc p 1 sub get
+ /dummy exch def
+ sc p 1 sub
+ sc ck 1 sub get
+ put
+ sc ck 1 sub
+ dummy
+ put
+ } if
+ %End Pivot
+ %Back to Eliminate
+ A ck ck elem get
+ sc ck 1 sub get div
+ dup mul sqrt tol lt { /er -1 def } if
+ ck 1 add 1 m { /ci exch def
+ A ci ck elem get
+ A ck ck elem get div
+ /factor exch def
+ %ck 1 add 1 m { /cj exch def
+ 1 1 m { /cj exch def %Line Changed from above, requires more calcs but allows debugging of matrix ops.
+ A ci cj elem %index
+ A ci cj elem get
+ A ck cj elem get
+ factor
+ mul sub %value
+ put
+ } for
+ B ci 1 sub %index
+ B ci 1 sub get
+ B ck 1 sub get
+ factor
+ mul sub %value
+ put
+ } for
+ } for
+ \Pst@Debug\space 1 eq {
+ A [ order 1 add order 1 add praXr praYt \psk@MaScale\space true false ] PRA
+ B [ order 1 add 1 praXr praYt \psk@MaScale\space false true ] PRA
+ } if
+ } if
+ %Start Back Substitution
+ %Add Error check for er -1
+ ai m 1 sub
+ B m 1 sub get
+ A m m elem get
+ div put
+ %%%%Added for debug
+ Aout m m elem
+ A m m elem get dup div
+ put
+ %%%%
+ order 1 ge {%
+ m 1 sub -1 1 { /ci exch def
+ /sum 0 def
+ ci 1 add 1 m { /cj exch def
+ A ci cj elem get
+ ai cj 1 sub get
+ mul sum add
+ /sum exch def
+ } for
+ ai ci 1 sub
+ B ci 1 sub get
+ sum sub
+ A ci ci elem get
+ div put
+ %%%%Added for debug
+ Aout ci ci elem
+ A ci ci elem get dup div
+ put
+ %%%%
+ } for
+ A ck ck elem get
+ sc ck 1 sub get div
+ dup mul sqrt tol lt { /er -1 def } if
+ } if
+ \Pst@Debug\space 1 eq {
+ Aout [ order 1 add order 1 add praXr praYt \psk@MaScale\space true false ] PRA
+ ai [ order 1 add 1 praXr praYt \psk@MaScale\space false false ] PRA } if}>
+
+%
+\catcode`\@=\PstAtCode\relax
+%
+%% END: pst-fit.tex
+\endinput
+
diff --git a/Master/texmf-dist/tex/latex/pst-fit/pst-fit.sty b/Master/texmf-dist/tex/latex/pst-fit/pst-fit.sty
new file mode 100644
index 00000000000..20a84e819a0
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pst-fit/pst-fit.sty
@@ -0,0 +1,14 @@
+%% $Id: pst-fit.sty 673 2012-04-01 09:50:48Z herbert $
+\RequirePackage{pstricks}
+\RequirePackage{pstricks-add}
+\ProvidesPackage{pst-fit}[2012/04/01 package wrapper for
+ pst-fit.tex (hv)]
+\input{pst-fit.tex}
+%\IfFileExists{pst-fit.pro}{%
+% \ProvidesFile{pst-fit.pro}
+% [2012/04/01 v. 0.01, PostScript prologue file (hv)]
+% \@addtofilelist{pst-fit.pro}}{}%
+\ProvidesFile{pst-fit.tex}
+ [\filedate\space v\fileversion\space `PST-fit' (hv)]
+\endinput
+
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index 18ecc5c35d9..aba17c56e57 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -338,7 +338,7 @@ my @TLP_working = qw(
pst-barcode pst-bezier pst-blur pst-bspline
pst-calendar pst-circ pst-coil pst-cox pst-dbicons pst-diffraction
pst-electricfield pst-eps pst-eucl pst-eucl-translation-bg pst-exa
- pst-fill pst-fr3d pst-fractal pst-fun pst-func
+ pst-fill pst-fit pst-fr3d pst-fractal pst-fun pst-func
pst-gantt pst-geo pst-gr3d pst-grad pst-graphicx
pst-infixplot pst-jtree pst-knot pst-labo pst-layout
pst-lens pst-light3d pst-magneticfield pst-math pst-mirror pst-node
diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds
index 5018df94cf2..aad650a5a38 100755
--- a/Master/tlpkg/libexec/ctan2tds
+++ b/Master/tlpkg/libexec/ctan2tds
@@ -773,6 +773,7 @@ chomp ($Build = `cd $Master/../Build/source && pwd`);
'pst-eps', "&MAKEpst",
'pst-eucl', "&MAKEpst",
'pst-fill', "&MAKEpst",
+ 'pst-fit', "&MAKEpst",
'pst-fr3d', "&MAKEpst",
'pst-fractal', "&MAKEpst",
'pst-fun', "&MAKEpst",
diff --git a/Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc b/Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc
index 6d1d3152585..a47e7736991 100644
--- a/Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc
@@ -32,6 +32,7 @@ depend pst-eps
depend pst-eucl
depend pst-exa
depend pst-fill
+depend pst-fit
depend pst-fr3d
depend pst-fractal
depend pst-fun
diff --git a/Master/tlpkg/tlpsrc/pst-fit.tlpsrc b/Master/tlpkg/tlpsrc/pst-fit.tlpsrc
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/pst-fit.tlpsrc