minor simplification
This commit is contained in:
+2
-3
@@ -124,11 +124,10 @@ void lina_transpose(double *A, double *B, int m, int n)
|
|||||||
|
|
||||||
if(m == 1 || n == 1)
|
if(m == 1 || n == 1)
|
||||||
{
|
{
|
||||||
|
if(A != B) // Does the copy or the branch cost more?
|
||||||
memcpy(B, A, sizeof(A[0]) * m * n);
|
memcpy(B, A, sizeof(A[0]) * m * n);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else if(m == n)
|
||||||
if(m == n)
|
|
||||||
{
|
{
|
||||||
for(int i = 0; i < n; i += 1)
|
for(int i = 0; i < n; i += 1)
|
||||||
for(int j = 0; j < i+1; j += 1)
|
for(int j = 0; j < i+1; j += 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user