* Add fixed-size template versions of corner(), start(), end().

* Use them to write an unrolled path in echelon.cpp, as an
  experiment before I do this LU module.
* For floating-point types, make ei_random() use an amplitude
  of 1.
This commit is contained in:
Benoit Jacob
2008-04-12 17:37:27 +00:00
parent dcebc46cdc
commit ab4046970b
8 changed files with 272 additions and 47 deletions

View File

@@ -10,24 +10,24 @@ USING_PART_OF_NAMESPACE_EIGEN
#endif
#ifndef MATSIZE
#define MATSIZE 400
#define MATSIZE 1000000
#endif
#ifndef REPEAT
#define REPEAT 10000
#define REPEAT 1000
#endif
int main(int argc, char *argv[])
{
MATTYPE I = MATTYPE::ones(MATSIZE,MATSIZE);
MATTYPE m(MATSIZE,MATSIZE);
for(int i = 0; i < MATSIZE; i++) for(int j = 0; j < MATSIZE; j++)
MATTYPE I = MATTYPE::ones(MATSIZE,1);
MATTYPE m(MATSIZE,1);
for(int i = 0; i < MATSIZE; i++) for(int j = 0; j < 1; j++)
{
m(i,j) = 0.1 * (i+j+1)/(MATSIZE*MATSIZE);
m(i,j) = 0.1 * (i+j+1)/MATSIZE/MATSIZE;
}
for(int a = 0; a < REPEAT; a++)
{
m = I + 0.00005 * (m + m/4);
m = MATTYPE::ones(MATSIZE,1) + 0.00005 * (m.cwiseProduct(m) + m/4);
}
cout << m(0,0) << endl;
return 0;