|
Re: OPR-computation-related linear algebra problem
Quote:
Originally Posted by Greg McKaskle
I haven't used Pascal in a long time, but seem to remember it storing 2D arrays with different elements adjacent. It was column-major and C was row-major.
|
I tried reversing the indices and it took 59.1 (vs 11.9) seconds. A couple other websites say Pascal is row-major.
Quote:
Originally Posted by Ether
I was thinking the extra computation required for this might be the culprit:
Code:
#define ELEMENT(M, i,j) (M[(i)*((i)+1)/2+(j)])
|
I was worried about the same thing. In the most recent version of the code I posted, that macro is only used once (not in a loop) to calculate a pointer to the end of the matrix.
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Last edited by RyanCahoon : 30-05-2013 at 23:07.
|