|
 |
Or in code this could look like:
void MZero (MATRIX result)
{
register int i;
for (i = 0 ; i < 16 ; i++) // yes this is legal ANSI C/ISO C++
{
result[i] = 0.0;
}
}
void MIdentity (MATRIX result)
{
register int i;
for (i = 0 ; i < 16 ; i++)
{
result[i] = 0.0;
}
for (i = 0 ; i < 4 ; i++)
{
result[i][i] = 1.0;
}
}
Of course manually unrolling would even account for bad compilers, but the
code above is already unreadable enough. And, some compilers will even be
able to unrole the current nested loop code, at least that in MZero.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |