Skip to content

Commit 47ab212

Browse files
author
Denis Jelovina
committed
Add example output for ALP/GraphBLAS API usage and refine terminal style settings
1 parent 56ee6c9 commit 47ab212

File tree

2 files changed

+37
-13
lines changed

2 files changed

+37
-13
lines changed

ALP_Tutorial.tex

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,27 @@ \section{Solution to Exercise 8}\label{sec:simple_example}
552552
}
553553
\end{lstlisting}
554554

555+
The expected output is (bash)
556+
557+
\begin{lstlisting}[style=terminal]
558+
559+
example (ALP/GraphBLAS) corrected API usage
560+
561+
Step 1: Constructing a 3x3 sparse matrix A.
562+
Step 2: Creating vector x = [1, 2, 3]^T.
563+
Step 3: Computing y = A·x under plus‐times semiring.
564+
Step 4: Computing z = x ⊙ y (element‐wise multiply).
565+
Step 5: Computing dot_val = xᵀ·x under plus‐times semiring.
566+
567+
-- Results --
568+
x = [ 1, 2, 3 ]
569+
y = A·x = [ 7, 18, 17 ]
570+
z = x ⊙ y = [ 7, 36, 51 ]
571+
dot(x,x) = 14
572+
$
573+
\end{lstlisting}
574+
575+
555576

556577
\section{Makefile and CMake Instructions}\label{sec:build_instructions}
557578

main.tex

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@
99
\usepackage{listings}
1010
\usepackage{xcolor}
1111

12-
% \lstset{
13-
% % Other useful options
14-
% breaklines=true, % Automatic line breaking for long lines
15-
% breakatwhitespace=true, % Break lines only at whitespace
16-
% tabsize=2, % Number of spaces a tab represents
17-
% captionpos=b, % Caption position: b (bottom) or t (top)
18-
% showspaces=false, % Do not show dots for spaces
19-
% showtabs=false, % Do not show markers for tabs
20-
% showstringspaces=false, % Do not show dots for spaces within strings
21-
% extendedchars=true, % Allow extended ASCII characters
22-
% inputencoding=utf8, % Specify input encoding
23-
% literate={_}{_}1 {~}{~}1 {^}{^}1 {\textless}{<}1 {\textgreater}{>}1, % Handle special characters
24-
% }
12+
% Define colors for the terminal style
13+
\definecolor{terminalback}{rgb}{0.1, 0.1, 0.1}
14+
\definecolor{terminaltext}{rgb}{0.9, 0.9, 0.9}
15+
16+
% Define the 'terminal' style
17+
\lstdefinestyle{terminal}{
18+
backgroundcolor=\color{terminalback},
19+
basicstyle=\ttfamily\small\color{terminaltext},
20+
frame=single,
21+
rulecolor=\color{white},
22+
breaklines=true,
23+
captionpos=b,
24+
showstringspaces=false,
25+
title=\texttt{Terminal}
26+
}
27+
2528

2629
\lstset{
2730
% Colors (requires xcolor package)

0 commit comments

Comments
 (0)