\section{lib/sfdpgen/sparse\-\_\-solve.c File Reference}
\label{sparse__solve_8c}\index{lib/sfdpgen/sparse\-\_\-solve.\-c@{lib/sfdpgen/sparse\-\_\-solve.\-c}}
{\ttfamily \#include $<$assert.\-h$>$}\\*
{\ttfamily \#include $<$string.\-h$>$}\\*
{\ttfamily \#include \char`\"{}sparse\-\_\-solve.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}sfdpinternal.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}memory.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}logic.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}math.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}arith.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}types.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}globals.\-h\char`\"{}}\\*
Include dependency graph for sparse\-\_\-solve.\-c\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{sparse__solve_8c__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct {\bf uniform\-\_\-stress\-\_\-matmul\-\_\-data}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void {\bf Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-delete} ({\bf Operator} o)
\item 
{\bf real} $\ast$ {\bf Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-apply} ({\bf Operator} o, {\bf real} $\ast$x, {\bf real} $\ast$y)
\item 
{\bf Operator} {\bf Operator\-\_\-uniform\-\_\-stress\-\_\-matmul} ({\bf Sparse\-Matrix} A, {\bf real} {\bf alpha})
\item 
{\bf real} $\ast$ {\bf Operator\-\_\-matmul\-\_\-apply} ({\bf Operator} o, {\bf real} $\ast$x, {\bf real} $\ast$y)
\item 
{\bf Operator} {\bf Operator\-\_\-matmul\-\_\-new} ({\bf Sparse\-Matrix} A)
\item 
void {\bf Operator\-\_\-matmul\-\_\-delete} ({\bf Operator} o)
\item 
{\bf real} $\ast$ {\bf Operator\-\_\-diag\-\_\-precon\-\_\-apply} ({\bf Operator} o, {\bf real} $\ast$x, {\bf real} $\ast$y)
\item 
{\bf Operator} {\bf Operator\-\_\-uniform\-\_\-stress\-\_\-diag\-\_\-precon\-\_\-new} ({\bf Sparse\-Matrix} A, {\bf real} {\bf alpha})
\item 
{\bf Operator} {\bf Operator\-\_\-diag\-\_\-precon\-\_\-new} ({\bf Sparse\-Matrix} A)
\item 
void {\bf Operator\-\_\-diag\-\_\-precon\-\_\-delete} ({\bf Operator} o)
\item 
{\bf real} {\bf cg} ({\bf Operator} Ax, {\bf Operator} precond, {\bf int} n, {\bf int} dim, {\bf real} $\ast$x0, {\bf real} $\ast$rhs, {\bf real} tol, {\bf int} maxit, {\bf int} $\ast$flag)
\item 
{\bf real} $\ast$ {\bf jacobi} ({\bf Sparse\-Matrix} A, {\bf int} dim, {\bf real} $\ast$x0, {\bf real} $\ast$rhs, {\bf int} maxit, {\bf int} $\ast$flag)
\item 
{\bf real} {\bf Sparse\-Matrix\-\_\-solve} ({\bf Sparse\-Matrix} A, {\bf int} dim, {\bf real} $\ast$x0, {\bf real} $\ast$rhs, {\bf real} tol, {\bf int} maxit, {\bf int} method, {\bf int} $\ast$flag)
\end{DoxyCompactItemize}


\subsection{Function Documentation}
\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!cg@{cg}}
\index{cg@{cg}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{cg}]{\setlength{\rightskip}{0pt plus 5cm}{\bf real} cg (
\begin{DoxyParamCaption}
\item[{{\bf Operator}}]{Ax, }
\item[{{\bf Operator}}]{precond, }
\item[{{\bf int}}]{n, }
\item[{{\bf int}}]{dim, }
\item[{{\bf real} $\ast$}]{x0, }
\item[{{\bf real} $\ast$}]{rhs, }
\item[{{\bf real}}]{tol, }
\item[{{\bf int}}]{maxit, }
\item[{{\bf int} $\ast$}]{flag}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_a61eca95072bf98c4ea2c90f214591a2c}


Definition at line 227 of file sparse\-\_\-solve.\-c.



References conjugate\-\_\-gradient(), F\-R\-E\-E, N\-\_\-\-G\-N\-E\-W, and real.



Referenced by Sparse\-Matrix\-\_\-solve().

\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!jacobi@{jacobi}}
\index{jacobi@{jacobi}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{jacobi}]{\setlength{\rightskip}{0pt plus 5cm}{\bf real}$\ast$ jacobi (
\begin{DoxyParamCaption}
\item[{{\bf Sparse\-Matrix}}]{A, }
\item[{{\bf int}}]{dim, }
\item[{{\bf real} $\ast$}]{x0, }
\item[{{\bf real} $\ast$}]{rhs, }
\item[{{\bf int}}]{maxit, }
\item[{{\bf int} $\ast$}]{flag}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_a5cc175ee0d22c9c42087ff19a70edfaa}


Definition at line 249 of file sparse\-\_\-solve.\-c.



References Sparse\-Matrix\-\_\-struct\-::a, assert, for(), F\-R\-E\-E, Sparse\-Matrix\-\_\-struct\-::ia, Sparse\-Matrix\-\_\-struct\-::ja, M\-A\-L\-L\-O\-C, M\-A\-T\-R\-I\-X\-\_\-\-T\-Y\-P\-E\-\_\-\-R\-E\-A\-L, M\-E\-M\-C\-P\-Y, Sparse\-Matrix\-\_\-struct\-::n, real, and Sparse\-Matrix\-\_\-struct\-::type.



Referenced by Sparse\-Matrix\-\_\-solve().

\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!Operator\-\_\-diag\-\_\-precon\-\_\-apply@{Operator\-\_\-diag\-\_\-precon\-\_\-apply}}
\index{Operator\-\_\-diag\-\_\-precon\-\_\-apply@{Operator\-\_\-diag\-\_\-precon\-\_\-apply}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{Operator\-\_\-diag\-\_\-precon\-\_\-apply}]{\setlength{\rightskip}{0pt plus 5cm}{\bf real}$\ast$ Operator\-\_\-diag\-\_\-precon\-\_\-apply (
\begin{DoxyParamCaption}
\item[{{\bf Operator}}]{o, }
\item[{{\bf real} $\ast$}]{x, }
\item[{{\bf real} $\ast$}]{y}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_af5e171052cd8144f1c977001c10fa499}


Definition at line 90 of file sparse\-\_\-solve.\-c.



References Operator\-\_\-struct\-::data, and real.



Referenced by Operator\-\_\-diag\-\_\-precon\-\_\-new(), and Operator\-\_\-uniform\-\_\-stress\-\_\-diag\-\_\-precon\-\_\-new().

\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!Operator\-\_\-diag\-\_\-precon\-\_\-delete@{Operator\-\_\-diag\-\_\-precon\-\_\-delete}}
\index{Operator\-\_\-diag\-\_\-precon\-\_\-delete@{Operator\-\_\-diag\-\_\-precon\-\_\-delete}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{Operator\-\_\-diag\-\_\-precon\-\_\-delete}]{\setlength{\rightskip}{0pt plus 5cm}void Operator\-\_\-diag\-\_\-precon\-\_\-delete (
\begin{DoxyParamCaption}
\item[{{\bf Operator}}]{o}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_a702985a220c7a29219c9b6e140589f20}


Definition at line 157 of file sparse\-\_\-solve.\-c.



References Operator\-\_\-struct\-::data, and F\-R\-E\-E.



Referenced by Sparse\-Matrix\-\_\-solve().

\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!Operator\-\_\-diag\-\_\-precon\-\_\-new@{Operator\-\_\-diag\-\_\-precon\-\_\-new}}
\index{Operator\-\_\-diag\-\_\-precon\-\_\-new@{Operator\-\_\-diag\-\_\-precon\-\_\-new}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{Operator\-\_\-diag\-\_\-precon\-\_\-new}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Operator} Operator\-\_\-diag\-\_\-precon\-\_\-new (
\begin{DoxyParamCaption}
\item[{{\bf Sparse\-Matrix}}]{A}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_a7ad643d23cc213fa3e523c53452df6c9}


Definition at line 129 of file sparse\-\_\-solve.\-c.



References Sparse\-Matrix\-\_\-struct\-::a, A\-B\-S, assert, Operator\-\_\-struct\-::data, for(), Sparse\-Matrix\-\_\-struct\-::ia, Sparse\-Matrix\-\_\-struct\-::ja, Sparse\-Matrix\-\_\-struct\-::m, M\-A\-T\-R\-I\-X\-\_\-\-T\-Y\-P\-E\-\_\-\-R\-E\-A\-L, N\-\_\-\-G\-N\-E\-W, Operator\-\_\-struct\-::\-Operator\-\_\-apply, Operator\-\_\-diag\-\_\-precon\-\_\-apply(), real, and Sparse\-Matrix\-\_\-struct\-::type.



Referenced by Sparse\-Matrix\-\_\-solve().

\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!Operator\-\_\-matmul\-\_\-apply@{Operator\-\_\-matmul\-\_\-apply}}
\index{Operator\-\_\-matmul\-\_\-apply@{Operator\-\_\-matmul\-\_\-apply}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{Operator\-\_\-matmul\-\_\-apply}]{\setlength{\rightskip}{0pt plus 5cm}{\bf real}$\ast$ Operator\-\_\-matmul\-\_\-apply (
\begin{DoxyParamCaption}
\item[{{\bf Operator}}]{o, }
\item[{{\bf real} $\ast$}]{x, }
\item[{{\bf real} $\ast$}]{y}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_a132619ff361da03ba07fcbbffc3ebaff}


Definition at line 69 of file sparse\-\_\-solve.\-c.



References uniform\-\_\-stress\-\_\-matmul\-\_\-data\-::\-A, Operator\-\_\-struct\-::data, F\-A\-L\-S\-E, and Sparse\-Matrix\-\_\-multiply\-\_\-vector().



Referenced by Operator\-\_\-matmul\-\_\-new().

\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!Operator\-\_\-matmul\-\_\-delete@{Operator\-\_\-matmul\-\_\-delete}}
\index{Operator\-\_\-matmul\-\_\-delete@{Operator\-\_\-matmul\-\_\-delete}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{Operator\-\_\-matmul\-\_\-delete}]{\setlength{\rightskip}{0pt plus 5cm}void Operator\-\_\-matmul\-\_\-delete (
\begin{DoxyParamCaption}
\item[{{\bf Operator}}]{o}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_ac578209b33bb5029024b2174ebc55733}


Definition at line 85 of file sparse\-\_\-solve.\-c.



References F\-R\-E\-E.



Referenced by Sparse\-Matrix\-\_\-solve().

\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!Operator\-\_\-matmul\-\_\-new@{Operator\-\_\-matmul\-\_\-new}}
\index{Operator\-\_\-matmul\-\_\-new@{Operator\-\_\-matmul\-\_\-new}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{Operator\-\_\-matmul\-\_\-new}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Operator} Operator\-\_\-matmul\-\_\-new (
\begin{DoxyParamCaption}
\item[{{\bf Sparse\-Matrix}}]{A}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_a800bd65eff0087d63ef889713e5ca828}


Definition at line 75 of file sparse\-\_\-solve.\-c.



References Operator\-\_\-struct\-::data, G\-N\-E\-W, Operator\-\_\-struct\-::\-Operator\-\_\-apply, and Operator\-\_\-matmul\-\_\-apply().



Referenced by Sparse\-Matrix\-\_\-solve().

\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!Operator\-\_\-uniform\-\_\-stress\-\_\-diag\-\_\-precon\-\_\-new@{Operator\-\_\-uniform\-\_\-stress\-\_\-diag\-\_\-precon\-\_\-new}}
\index{Operator\-\_\-uniform\-\_\-stress\-\_\-diag\-\_\-precon\-\_\-new@{Operator\-\_\-uniform\-\_\-stress\-\_\-diag\-\_\-precon\-\_\-new}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{Operator\-\_\-uniform\-\_\-stress\-\_\-diag\-\_\-precon\-\_\-new}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Operator} Operator\-\_\-uniform\-\_\-stress\-\_\-diag\-\_\-precon\-\_\-new (
\begin{DoxyParamCaption}
\item[{{\bf Sparse\-Matrix}}]{A, }
\item[{{\bf real}}]{alpha}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_a44b37b94e1fcbc83ed17fb1bd8a0ac38}


Definition at line 100 of file sparse\-\_\-solve.\-c.



References Sparse\-Matrix\-\_\-struct\-::a, A\-B\-S, assert, Operator\-\_\-struct\-::data, for(), Sparse\-Matrix\-\_\-struct\-::ia, Sparse\-Matrix\-\_\-struct\-::ja, Sparse\-Matrix\-\_\-struct\-::m, M\-A\-L\-L\-O\-C, M\-A\-T\-R\-I\-X\-\_\-\-T\-Y\-P\-E\-\_\-\-R\-E\-A\-L, Operator\-\_\-struct\-::\-Operator\-\_\-apply, Operator\-\_\-diag\-\_\-precon\-\_\-apply(), real, and Sparse\-Matrix\-\_\-struct\-::type.

\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!Operator\-\_\-uniform\-\_\-stress\-\_\-matmul@{Operator\-\_\-uniform\-\_\-stress\-\_\-matmul}}
\index{Operator\-\_\-uniform\-\_\-stress\-\_\-matmul@{Operator\-\_\-uniform\-\_\-stress\-\_\-matmul}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{Operator\-\_\-uniform\-\_\-stress\-\_\-matmul}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Operator} Operator\-\_\-uniform\-\_\-stress\-\_\-matmul (
\begin{DoxyParamCaption}
\item[{{\bf Sparse\-Matrix}}]{A, }
\item[{{\bf real}}]{alpha}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_ae8dc94b9e1a01dc1fb3218499febb320}


Definition at line 56 of file sparse\-\_\-solve.\-c.



References uniform\-\_\-stress\-\_\-matmul\-\_\-data\-::\-A, uniform\-\_\-stress\-\_\-matmul\-\_\-data\-::alpha, alpha, Operator\-\_\-struct\-::data, M\-A\-L\-L\-O\-C, Operator\-\_\-struct\-::\-Operator\-\_\-apply, and Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-apply().

\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-apply@{Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-apply}}
\index{Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-apply@{Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-apply}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-apply}]{\setlength{\rightskip}{0pt plus 5cm}{\bf real}$\ast$ Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-apply (
\begin{DoxyParamCaption}
\item[{{\bf Operator}}]{o, }
\item[{{\bf real} $\ast$}]{x, }
\item[{{\bf real} $\ast$}]{y}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_a1638c85d6c4ec6877760810eaade5bdd}


Definition at line 37 of file sparse\-\_\-solve.\-c.



References uniform\-\_\-stress\-\_\-matmul\-\_\-data\-::\-A, uniform\-\_\-stress\-\_\-matmul\-\_\-data\-::alpha, alpha, Operator\-\_\-struct\-::data, F\-A\-L\-S\-E, Sparse\-Matrix\-\_\-struct\-::m, real, and Sparse\-Matrix\-\_\-multiply\-\_\-vector().



Referenced by Operator\-\_\-uniform\-\_\-stress\-\_\-matmul().

\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-delete@{Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-delete}}
\index{Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-delete@{Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-delete}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-delete}]{\setlength{\rightskip}{0pt plus 5cm}void Operator\-\_\-uniform\-\_\-stress\-\_\-matmul\-\_\-delete (
\begin{DoxyParamCaption}
\item[{{\bf Operator}}]{o}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_a9915a57c5c8b7f3dda870bf451eed9f4}


Definition at line 33 of file sparse\-\_\-solve.\-c.



References Operator\-\_\-struct\-::data, and F\-R\-E\-E.

\index{sparse\-\_\-solve.\-c@{sparse\-\_\-solve.\-c}!Sparse\-Matrix\-\_\-solve@{Sparse\-Matrix\-\_\-solve}}
\index{Sparse\-Matrix\-\_\-solve@{Sparse\-Matrix\-\_\-solve}!sparse_solve.c@{sparse\-\_\-solve.\-c}}
\subsubsection[{Sparse\-Matrix\-\_\-solve}]{\setlength{\rightskip}{0pt plus 5cm}{\bf real} Sparse\-Matrix\-\_\-solve (
\begin{DoxyParamCaption}
\item[{{\bf Sparse\-Matrix}}]{A, }
\item[{{\bf int}}]{dim, }
\item[{{\bf real} $\ast$}]{x0, }
\item[{{\bf real} $\ast$}]{rhs, }
\item[{{\bf real}}]{tol, }
\item[{{\bf int}}]{maxit, }
\item[{{\bf int}}]{method, }
\item[{{\bf int} $\ast$}]{flag}
\end{DoxyParamCaption}
)}\label{sparse__solve_8c_a8dc2d7b191617801135af367c191d602}


Definition at line 296 of file sparse\-\_\-solve.\-c.



References assert, cg(), jacobi(), Sparse\-Matrix\-\_\-struct\-::m, Operator\-\_\-diag\-\_\-precon\-\_\-delete(), Operator\-\_\-diag\-\_\-precon\-\_\-new(), Operator\-\_\-matmul\-\_\-delete(), Operator\-\_\-matmul\-\_\-new(), real, S\-O\-L\-V\-E\-\_\-\-M\-E\-T\-H\-O\-D\-\_\-\-C\-G, and S\-O\-L\-V\-E\-\_\-\-M\-E\-T\-H\-O\-D\-\_\-\-J\-A\-C\-O\-B\-I.



Referenced by Stress\-Majorization\-Smoother\-\_\-smooth().

