matmult.py
def Column_Swap(M,v,n):
	"""
	Given some matrix M and some vector v and some integer
	index n, we want to swap out the n mod len(M) column
	with vector v.
	
	In the context of this algorithm, n is in 
	interval [1,infinity], where [1,infinity] is a subset
	of the integers, rather than the reals.
	
	n is supposed to be the exponent that matrix M is
	raised to.
	
	If it's zero, then v is multiplied by the identity
	matrix.
	
	For Mv = w, where w is some other vector, the implied
	value of n is 1.
	
	"""
	swap_index = int((n-1)%len(M))
	i = 0
	while i<len(v):
		M[i][swap_index] = v[i]
		i = i + 1
	return M

	Given some matrix M and some vector v and some integer
	index n, we want to swap out the n mod len(M) column
	with vector v.
	
	In the context of this algorithm, n is in 
	interval [1,infinity], where [1,infinity] is a subset
	of the integers, rather than the reals.
	
	n is supposed to be the exponent that matrix M is
	raised to.
	
	If it's zero, then v is multiplied by the identity
	matrix.
	
	For Mv = w, where w is some other vector, the implied
	value of n is 1.
	
	
Given some matrix M and some vector v and some integer
index n, we want to swap out the n mod len(M) column
with vector v.

In the context of this algorithm, n is in
interval [1,infinity], where [1,infinity] is a subset
of the integers, rather than the reals.

n is supposed to be the exponent that matrix M is
raised to.

If it's zero, then v is multiplied by the identity
matrix.

For Mv = w, where w is some other vector, the implied
value of n is 1.
Given some matrix M and some vector v and some integer index n we want to swap out the n mod len ( M ) column with vector v . In the context of this algorithm n is in interval [ 1 infinity ] where [ 1 infinity ] is a subset of the integers rather than the reals . n is supposed to be the exponent that matrix M is raised to . If it ' s zero then v is multiplied by the identity matrix . For Mv = w where w is some other vector the implied value of n is 1 .
def Column_Swap(M,v,n):
	swap_index = int((n-1)%len(M))
	i = 0
	while i<len(v):
		M[i][swap_index] = v[i]
		i = i + 1
	return M
def Column_Swap ( M , v , n ) : swap_index = int ( ( n - 1 ) % len ( M ) ) i = 0 while i < len ( v ) : M [ i ] [ swap_index ] = v [ i ] i = i + 1 return M
Given some matrix M and some vector v and some integer
index n, we want to swap out the n mod len(M) column
with vector v.
Given some matrix M and some vector v and some integer index n we want to swap out the n mod len ( M ) column with vector v .
"""
	Given some matrix M and some vector v and some integer
	index n, we want to swap out the n mod len(M) column
	with vector v.
	
	In the context of this algorithm, n is in 
	interval [1,infinity], where [1,infinity] is a subset
	of the integers, rather than the reals.
	
	n is supposed to be the exponent that matrix M is
	raised to.
	
	If it's zero, then v is multiplied by the identity
	matrix.
	
	For Mv = w, where w is some other vector, the implied
	value of n is 1.
	
	"""
M
v
n