{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Lower Triangular Matrix Vector Multiply Routines"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook walks you through how to implement $ y := L x + y $ where $ L $ is lower triangular."
]
},
{
"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 allow 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": [
"The routine
Tmvmult_ln_unb_var1( L, x, y )
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This routine, given lower triangular $ L \\in \\mathbb{R}^{n \\times n} $, $ x \\in \\mathbb{R}^n $, and $ y \\in \\mathbb{R}^n $, computes $ y := L x + y $. The \"_ln_\" in the name of the routine indicates this is the \"lower triangular, no transpose\" matrix-vector multiplication. \n",
"\n",
"The specific laff functions we will use are \n",
"
laff.dots( x, y, alpha )
which computes $ \\alpha := x^T y + \\alpha $. Tmvmult_ln_unb_var2( L, x, y )
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This routine, given lower triangular $ L \\in \\mathbb{R}^{n \\times n} $, $ x \\in \\mathbb{R}^n $, and $ y \\in \\mathbb{R}^n $, computes $ y := L x + y $. The \"_ln_\" in the name of the routine indicates this is the \"lower triangular, no transpose\" matrix-vector multiplication. \n",
"\n",
"The specific laff functions we will use are \n",
" laff.axpy( alpha, x, y )
which computes $ y := \\alpha x + y $.