diff --git a/Chapters/Chapter02.tex b/Chapters/Chapter02.tex index 2f93213..5b334c1 100644 --- a/Chapters/Chapter02.tex +++ b/Chapters/Chapter02.tex @@ -45,4 +45,44 @@ Las cantidades usan comas y punto decimal correctamente para México. Es decir 1 \section{Agregando Acrónimos y Glosario} A continuación se muestran algunos ejemplos del uso del glosario y los comandos que lo invocan. Por ejemplo, para hablar del lenguaje \Gls{latex} y su especial aplicación en todo tipo de documentos que contienen ecuaciones \gls{maths}. Las \Glspl{formula} que aparecen en los documentos son renderizadas de forma adecuada y fácil una vez que se acostumbra al uso de los comandos. - Por otro lado, dado un conjunto de resultados numéricos, existen diferentes métodos básicos para calcular el \acrlong{ecm}, el cual se abrevia como \acrshort{ecm}. Este error es común de usarse en en el cálculo de las estimaciones por \acrfull{ls}. \ No newline at end of file +Por otro lado, dado un conjunto de resultados numéricos, existen diferentes métodos básicos para calcular el \acrlong{ecm}, el cual se abrevia como \acrshort{ecm}. Este error es común de usarse en en el cálculo de las estimaciones por \acrfull{ls}. + +\section{Secciones de código} + + +\begin{lstlisting} +import numpy as np + +def incmatrix(genl1,genl2): + m = len(genl1) + n = len(genl2) + M = None #to become the incidence matrix + VT = np.zeros((n*m,1), int) #dummy variable + + #compute the bitwise xor matrix + M1 = bitxormatrix(genl1) + M2 = np.triu(bitxormatrix(genl2),1) + + for i in range(m-1): + for j in range(i+1, m): + [r,c] = np.where(M2 == M1[i,j]) + for k in range(len(r)): + VT[(i)*n + r[k]] = 1; + VT[(i)*n + c[k]] = 1; + VT[(j)*n + r[k]] = 1; + VT[(j)*n + c[k]] = 1; + + if M is None: + M = np.copy(VT) + else: + M = np.concatenate((M, VT), 1) + + VT = np.zeros((n*m,1), int) + + return M +\end{lstlisting} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: "../thesisStructure" +%%% End: diff --git a/configuration.tex b/configuration.tex index a94e603..fdb1f1d 100644 --- a/configuration.tex +++ b/configuration.tex @@ -4,6 +4,9 @@ % 1 Code listing setup %------------------ \RequirePackage{listings} +\RequirePackage{xcolor} +\definecolor{gray97}{gray}{0.97} +\definecolor{gray45}{gray}{0.45} \newcaptionname{spanish}{\lstlistlistingname}{Sección de Códigos} \renewcommand{\lstlistingname}{Código} \renewcommand{\lstlistlistingname}{Códigos} diff --git a/thesisStructure.tex b/thesisStructure.tex index 45dba3c..8f266a6 100644 --- a/thesisStructure.tex +++ b/thesisStructure.tex @@ -30,4 +30,8 @@ \cleardoublepage \include{FrontBackMatter/Colophon} %-=-=-=-=-=-=-=-=-=-=-=-=- -\end{document} \ No newline at end of file +\end{document} +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: