mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-07-23 17:01:06 +02:00
minor changes to the symmetrify function
This commit is contained in:
parent
9c701f6e5b
commit
542759353b
2 changed files with 7 additions and 3 deletions
|
|
@ -203,7 +203,7 @@ class linear(kernpart):
|
||||||
target_mu(n,q) += factor*tmp;
|
target_mu(n,q) += factor*tmp;
|
||||||
target_S(n,q) += factor*AZZA_2(q,m,mm,q);
|
target_S(n,q) += factor*AZZA_2(q,m,mm,q);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -257,16 +257,20 @@ def symmetrify(A,upper=False):
|
||||||
N,M = A.shape
|
N,M = A.shape
|
||||||
assert N==M
|
assert N==M
|
||||||
c_contig_code = """
|
c_contig_code = """
|
||||||
|
int iN;
|
||||||
for (int i=1; i<N; i++){
|
for (int i=1; i<N; i++){
|
||||||
|
iN = i*N;
|
||||||
for (int j=0; j<i; j++){
|
for (int j=0; j<i; j++){
|
||||||
A[i+j*N] = A[i*N+j];
|
A[i+j*N] = A[iN+j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
f_contig_code = """
|
f_contig_code = """
|
||||||
|
int iN;
|
||||||
for (int i=1; i<N; i++){
|
for (int i=1; i<N; i++){
|
||||||
|
iN = i*N;
|
||||||
for (int j=0; j<i; j++){
|
for (int j=0; j<i; j++){
|
||||||
A[i*N+j] = A[i+j*N];
|
A[iN+j] = A[i+j*N];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue