Remove unused code related to legacy island implementation.
Also fix a docstring. PiperOrigin-RevId: 757939564 Change-Id: I3a970fd38c63886d34cd23b1fb45617a9ce5c147
This commit is contained in:
committed by
Copybara-Service
parent
8a7c42c747
commit
755564a348
@@ -28,9 +28,9 @@ extern "C" {
|
||||
|
||||
//------------------------------ sparse operations -------------------------------------------------
|
||||
|
||||
// dot-product, both vectors are sparse, vec2 can be uncompressed
|
||||
MJAPI mjtNum mju_dotSparse2(const mjtNum* vec1, const mjtNum* vec2, int nnz1, const int* ind1,
|
||||
int nnz2, const int* ind2, int flg_unc2);
|
||||
// dot-product, both vectors are sparse
|
||||
MJAPI mjtNum mju_dotSparse2(const mjtNum* vec1, const int* ind1, int nnz1,
|
||||
const mjtNum* vec2, const int* ind2, int nnz2);
|
||||
|
||||
// convert matrix from dense to sparse
|
||||
// nnz is size of res and colind, return 1 if too small, 0 otherwise
|
||||
@@ -128,12 +128,10 @@ MJAPI void mju_blockDiagSparse(
|
||||
// ------------------------------ inlined functions ------------------------------------------------
|
||||
|
||||
// dot-product, first vector is sparse
|
||||
// flg_unc1: is vec1 memory layout uncompressed
|
||||
static inline
|
||||
mjtNum mju_dotSparse(const mjtNum* vec1, const mjtNum* vec2, int nnz1, const int* ind1,
|
||||
int flg_unc1) {
|
||||
mjtNum mju_dotSparse(const mjtNum* vec1, const mjtNum* vec2, int nnz1, const int* ind1) {
|
||||
#ifdef mjUSEAVX
|
||||
return mju_dotSparse_avx(vec1, vec2, nnz1, ind1, flg_unc1);
|
||||
return mju_dotSparse_avx(vec1, vec2, nnz1, ind1);
|
||||
#else
|
||||
int i = 0;
|
||||
mjtNum res = 0;
|
||||
@@ -143,33 +141,18 @@ mjtNum mju_dotSparse(const mjtNum* vec1, const mjtNum* vec2, int nnz1, const int
|
||||
mjtNum res2 = 0;
|
||||
mjtNum res3 = 0;
|
||||
|
||||
|
||||
if (flg_unc1) {
|
||||
for (; i <= n_4; i+=4) {
|
||||
res0 += vec1[ind1[i+0]] * vec2[ind1[i+0]];
|
||||
res1 += vec1[ind1[i+1]] * vec2[ind1[i+1]];
|
||||
res2 += vec1[ind1[i+2]] * vec2[ind1[i+2]];
|
||||
res3 += vec1[ind1[i+3]] * vec2[ind1[i+3]];
|
||||
}
|
||||
} else {
|
||||
for (; i <= n_4; i+=4) {
|
||||
res0 += vec1[i+0] * vec2[ind1[i+0]];
|
||||
res1 += vec1[i+1] * vec2[ind1[i+1]];
|
||||
res2 += vec1[i+2] * vec2[ind1[i+2]];
|
||||
res3 += vec1[i+3] * vec2[ind1[i+3]];
|
||||
}
|
||||
for (; i <= n_4; i+=4) {
|
||||
res0 += vec1[i+0] * vec2[ind1[i+0]];
|
||||
res1 += vec1[i+1] * vec2[ind1[i+1]];
|
||||
res2 += vec1[i+2] * vec2[ind1[i+2]];
|
||||
res3 += vec1[i+3] * vec2[ind1[i+3]];
|
||||
}
|
||||
|
||||
res = (res0 + res2) + (res1 + res3);
|
||||
|
||||
// scalar part
|
||||
if (flg_unc1) {
|
||||
for (; i < nnz1; i++) {
|
||||
res += vec1[ind1[i]] * vec2[ind1[i]];
|
||||
}
|
||||
} else {
|
||||
for (; i < nnz1; i++) {
|
||||
res += vec1[i] * vec2[ind1[i]];
|
||||
}
|
||||
for (; i < nnz1; i++) {
|
||||
res += vec1[i] * vec2[ind1[i]];
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user