Fixed more warnings

release/4.3a0
Frank Dellaert 2018-10-08 21:38:50 -04:00
parent eb4659bcb6
commit ca80678ffc
3 changed files with 19 additions and 19 deletions

View File

@ -206,7 +206,7 @@ int main(int argc, char *argv[]) {
}
#ifdef GTSAM_USE_TBB
std::auto_ptr<tbb::task_scheduler_init> init;
std::unique_ptr<tbb::task_scheduler_init> init;
if(nThreads > 0) {
cout << "Using " << nThreads << " threads" << endl;
init.reset(new tbb::task_scheduler_init(nThreads));

View File

@ -1349,27 +1349,26 @@ void gk_csr_Normalize(gk_csr_t *mat, int what, int norm)
}
}
if (what&GK_CSR_COL && mat->colval) {
n = mat->ncols;
if (what & GK_CSR_COL && mat->colval) {
n = mat->ncols;
ptr = mat->colptr;
val = mat->colval;
#pragma omp parallel if (ptr[n] > OMPMINOPS)
#pragma omp parallel if (ptr[n] > OMPMINOPS)
{
#pragma omp for private(j,sum) schedule(static)
for (i=0; i<n; i++) {
for (sum=0.0, j=ptr[i]; j<ptr[i+1]; j++)
if (norm == 2)
sum += val[j]*val[j];
else if (norm == 1)
sum += val[j];
#pragma omp for private(j, sum) schedule(static)
for (i = 0; i < n; i++) {
for (sum = 0.0, j = ptr[i]; j < ptr[i + 1]; j++)
if (norm == 2)
sum += val[j] * val[j];
else if (norm == 1)
sum += val[j];
if (sum > 0) {
if (norm == 2)
sum=1.0/sqrt(sum);
else if (norm == 1)
sum=1.0/sum;
for (j=ptr[i]; j<ptr[i+1]; j++)
val[j] *= sum;
if (norm == 2)
sum = 1.0 / sqrt(sum);
else if (norm == 1)
sum = 1.0 / sum;
for (j = ptr[i]; j < ptr[i + 1]; j++) val[j] *= sum;
}
}
}

View File

@ -111,8 +111,9 @@ bool choleskyPartial(Matrix& ABC, size_t nFrontal, size_t topleft) {
return true;
assert(ABC.cols() == ABC.rows());
const Eigen::DenseIndex n = ABC.rows() - topleft;
assert(n >= 0 && nFrontal <= size_t(n));
assert(ABC.rows() >= topleft);
const size_t n = static_cast<size_t>(ABC.rows() - topleft);
assert(nFrontal <= size_t(n));
// Create views on blocks
auto A = ABC.block(topleft, topleft, nFrontal, nFrontal);