21 views

Skip to first unread message

Feb 26, 2012, 3:42:11 PM2/26/12

to fcla-discuss

I created a exp function for a matrix, had to first create a pow

function then exp could call that

no problem

so I used a taylor expansion to do the work

so it got me thinking, do vectors and matrices all good with taylor

expansions etc

function then exp could call that

no problem

so I used a taylor expansion to do the work

so it got me thinking, do vectors and matrices all good with taylor

expansions etc

Feb 27, 2012, 7:46:36 PM2/27/12

to fcla-d...@googlegroups.com

You can form any polynomial of a square matrix, since powers make sense, and

then scalar multiples and addition are the most basic operations. This is

Subsection EE.PM.

then scalar multiples and addition are the most basic operations. This is

Subsection EE.PM.

With vectors this would not be so natural, but it is sometimes advantageous to

multiply a polynomial of a square matrix times a vector. See the proof of

Theorem EMHE.

Rob

Mar 2, 2012, 8:47:53 AM3/2/12

to fcla-d...@googlegroups.com, goo...@beezer.cotse.net

Thanks, I was considering something along the line of

exp(A) where A is a matrix etc

template <typename T> matrix<T> pow(matrix<T> &radix, int signficand) {

matrix<T> product = radix;

for (int i = 1; i < significand; i++) // Brutal computations

product = product * radix;

return product;

}

template <typename T> matrix<T> exp(matrix<T> &exponent) {

matrix<T> sum = 0; // Maclaurin series expansions

for (int k = 0; k < 6; k++) { // 6 terms should be enough

sum = sum + (pow(exponent, k) / factorial(k)); // Power series

}

return sum;

}

exp(A) where A is a matrix etc

template <typename T> matrix<T> pow(matrix<T> &radix, int signficand) {

matrix<T> product = radix;

for (int i = 1; i < significand; i++) // Brutal computations

product = product * radix;

return product;

}

template <typename T> matrix<T> exp(matrix<T> &exponent) {

matrix<T> sum = 0; // Maclaurin series expansions

for (int k = 0; k < 6; k++) { // 6 terms should be enough

sum = sum + (pow(exponent, k) / factorial(k)); // Power series

}

return sum;

}

Reply all

Reply to author

Forward

0 new messages

Search

Clear search

Close search

Google apps

Main menu