{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Symmetric Matrix Vector Multiply Routines (stored in lower triangle)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook walks you through how to implement $ y := A x + y $ where $ A $ is symmetric with only the lower triangular part stored."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Getting started"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We will use some functions that are part of our laff library (of which this function will become a part) as well as some routines from the FLAME API (Application Programming Interface) that allows us to write code that closely resembles how we typeset algorithms using the FLAME notation. These functions are imported with the \"import laff as laff\" and \"import flame\" statements."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Algorithm that takes dot products"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"The routine
Symv_l_unb_var1( A, x, y )
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This routine, given symmetric matrix $ A \\in \\mathbb{R}^{n \\times n} $, $ x \\in \\mathbb{R}^n $, and $ y \\in \\mathbb{R}^n $, computes $ y := A x + y $. The \"_l_\" in the name of the routine indicates that $ A $ is stored in the lower triangular part of the matrix.\n",
"\n",
"The specific laff functions we will use are \n",
"
laff.dots( x, y, alpha )
which computes $ \\alpha := x^T y + \\alpha $. Symv_l_unb_var2( A, x, y )
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This routine, given symmetric matrix $ A \\in \\mathbb{R}^{n \\times n} $, $ x \\in \\mathbb{R}^n $, and $ y \\in \\mathbb{R}^n $, computes $ y := A x + y $. The \"_l_\" in the name of the routine indicates that $ A $ is stored in the lower triangular part of the matrix.\n",
"\n",
"The specific laff functions we will use are\n",
" laff.axpy( alpha, x, y )
which computes $ y := \\alpha x + y $.