Expm small patches

John W. Eaton jwe at bevo.che.wisc.edu
Fri Dec 14 12:29:52 CST 2007


On 14-Dec-2007, Marco Caliari wrote:

| I have two small patches for expm in liboctave/dMatrix.cc and 
| liboctave/CMatrix.cc. They essentially substitute elem with fortran_vec 
| everywhere.

It seems your patch does a little more than just that:

| --- liboctave/dMatrix.cc.orig	2007-12-14 10:06:10.000000000 +0100
| +++ liboctave/dMatrix.cc	2007-12-14 10:07:33.000000000 +0100

| @@ -2479,32 +2481,31 @@
|    
|    // Now powers a^8 ... a^1.
|    
| -  octave_idx_type minus_one_j = -1;
| +  octave_idx_type minus_one_j = 1;
|    for (octave_idx_type j = 7; j >= 0; j--)
|      {
|        for (octave_idx_type i = 0; i < nc; i++)

| --- liboctave/CMatrix.cc.orig	2007-12-14 10:06:18.000000000 +0100
| +++ liboctave/CMatrix.cc	2007-12-14 10:08:06.000000000 +0100

| @@ -2859,32 +2864,31 @@
|  
|    // Now powers a^8 ... a^1.
|  
| -  int minus_one_j = -1;
| +  octave_idx_type minus_one_j = 1;
|    for (octave_idx_type j = 7; j >= 0; j--)
|      {
|        for (octave_idx_type i = 0; i < nc; i++)

Why did you make these changes?

Also, there are other arrays that use "operator() (int)" for indexing,
which ultimately calls elem.

I'm not sure this change is necessary, and in any case I think it can
wait until after 3.0.

jwe


More information about the Octave-maintainers mailing list