Skip to content

Warning during the build: warning: conversion from 'long long unsigned int' to 'arma::uword' {aka 'unsigned int'} changes value from '18446744073709551615' to '4294967295' [-Woverflow] #5

@barracuda156

Description

@barracuda156

This seems to work, however does not look really safe:

In file included from /opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/nmf_lib.inl:7,
                 from /opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/nmf_lib.cpp:4:
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp: In member function 'void planc::ONLINEINMF<T1>::permuteChunkIdx(int) [with T1 = planc::H5Mat]':
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp:827:31: warning: conversion from 'long long unsigned int' to 'arma::uword' {aka 'unsigned int'} changes value from '18446744073709551615' to '4294967295' [-Woverflow]
  827 |         arma::uword lastEnd = -1ull;
      |                               ^~~~~
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp: In instantiation of 'void planc::ONLINEINMF<T1>::permuteChunkIdx(int) [with T1 = arma::Mat<double>]':
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp:464:23:   required from 'void planc::ONLINEINMF<T1>::solveHALS(arma::uword, arma::uword, arma::uword, bool, const int&) [with T1 = arma::Mat<double>; arma::uword = unsigned int]'
  464 |                 this->permuteChunkIdx(idx);
      |                 ~~~~~~^~~~~~~~~~~~~~~
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp:751:19:   required from 'void planc::ONLINEINMF<T1>::runOnlineINMF(arma::uword, arma::uword, arma::uword, arma::uword, bool, const int&) [with T1 = arma::Mat<double>; arma::uword = unsigned int]'
  751 |             this->solveHALS(minibatchSize, inputmaxEpochs, maxHALSIter, verbose, ncores);
      |             ~~~~~~^~~~~~~~~
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/nmf_lib.inl:147:29:   required from 'static planc::oinmfOutput<eT> planc::nmflib<T, eT>::oinmf(std::vector<std::shared_ptr<_Tp> >, const arma::uword&, const int&, const double&, const arma::uword&, const arma::uword&, const arma::uword&, const arma::uword&, const bool&) [with T = arma::Mat<double>; eT = double; arma::uword = unsigned int]'
  147 |         solver.runOnlineINMF(minibatchSize, maxEpoch, maxHALSIter, permuteChunkSize, verbose, nCores);
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/inmf_types.inc:1:1:   required from here
   16 | template planc::oinmfOutput<double> planc::nmflib<T, double>::oinmf(std::vector<std::shared_ptr<T>> matPtrVec, const arma::uword &k, const int &nCores, const double &lambda, const arma::uword &maxEpoch, const arma::uword &minibatchSize, const arma::uword &maxHALSIter, const arma::uword &permuteChunkSize, const bool &verbose); \
      |                                                                                                                                                                                                                                                                                                                                      ^
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp:133:35: warning: conversion from 'long long unsigned int' to 'arma::uword' {aka 'unsigned int'} changes value from '18446744073709551615' to '4294967295' [-Woverflow]
  133 |             arma::uword lastEnd = -1ull;
      |                                   ^~~~~
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp: In instantiation of 'void planc::ONLINEINMF<T1>::permuteChunkIdx(int) [with T1 = arma::SpMat<double>]':
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp:464:23:   required from 'void planc::ONLINEINMF<T1>::solveHALS(arma::uword, arma::uword, arma::uword, bool, const int&) [with T1 = arma::SpMat<double>; arma::uword = unsigned int]'
  464 |                 this->permuteChunkIdx(idx);
      |                 ~~~~~~^~~~~~~~~~~~~~~
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp:751:19:   required from 'void planc::ONLINEINMF<T1>::runOnlineINMF(arma::uword, arma::uword, arma::uword, arma::uword, bool, const int&) [with T1 = arma::SpMat<double>; arma::uword = unsigned int]'
  751 |             this->solveHALS(minibatchSize, inputmaxEpochs, maxHALSIter, verbose, ncores);
      |             ~~~~~~^~~~~~~~~
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/nmf_lib.inl:147:29:   required from 'static planc::oinmfOutput<eT> planc::nmflib<T, eT>::oinmf(std::vector<std::shared_ptr<_Tp> >, const arma::uword&, const int&, const double&, const arma::uword&, const arma::uword&, const arma::uword&, const arma::uword&, const bool&) [with T = arma::SpMat<double>; eT = double; arma::uword = unsigned int]'
  147 |         solver.runOnlineINMF(minibatchSize, maxEpoch, maxHALSIter, permuteChunkSize, verbose, nCores);
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/inmf_types.inc:3:1:   required from here
   16 | template planc::oinmfOutput<double> planc::nmflib<T, double>::oinmf(std::vector<std::shared_ptr<T>> matPtrVec, const arma::uword &k, const int &nCores, const double &lambda, const arma::uword &maxEpoch, const arma::uword &minibatchSize, const arma::uword &maxHALSIter, const arma::uword &permuteChunkSize, const bool &verbose); \
      |                                                                                                                                                                                                                                                                                                                                      ^
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp:133:35: warning: conversion from 'long long unsigned int' to 'arma::uword' {aka 'unsigned int'} changes value from '18446744073709551615' to '4294967295' [-Woverflow]
  133 |             arma::uword lastEnd = -1ull;
      |                                   ^~~~~
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp: In instantiation of 'void planc::ONLINEINMF<T1>::permuteChunkIdx(int) [with T1 = planc::H5SpMat]':
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp:464:23:   required from 'void planc::ONLINEINMF<T1>::solveHALS(arma::uword, arma::uword, arma::uword, bool, const int&) [with T1 = planc::H5SpMat; arma::uword = unsigned int]'
  464 |                 this->permuteChunkIdx(idx);
      |                 ~~~~~~^~~~~~~~~~~~~~~
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp:751:19:   required from 'void planc::ONLINEINMF<T1>::runOnlineINMF(arma::uword, arma::uword, arma::uword, arma::uword, bool, const int&) [with T1 = planc::H5SpMat; arma::uword = unsigned int]'
  751 |             this->solveHALS(minibatchSize, inputmaxEpochs, maxHALSIter, verbose, ncores);
      |             ~~~~~~^~~~~~~~~
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/nmf_lib.inl:147:29:   required from 'static planc::oinmfOutput<eT> planc::nmflib<T, eT>::oinmf(std::vector<std::shared_ptr<_Tp> >, const arma::uword&, const int&, const double&, const arma::uword&, const arma::uword&, const arma::uword&, const arma::uword&, const bool&) [with T = planc::H5SpMat; eT = double; arma::uword = unsigned int]'
  147 |         solver.runOnlineINMF(minibatchSize, maxEpoch, maxHALSIter, permuteChunkSize, verbose, nCores);
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/inmf_types.inc:7:1:   required from here
   16 | template planc::oinmfOutput<double> planc::nmflib<T, double>::oinmf(std::vector<std::shared_ptr<T>> matPtrVec, const arma::uword &k, const int &nCores, const double &lambda, const arma::uword &maxEpoch, const arma::uword &minibatchSize, const arma::uword &maxHALSIter, const arma::uword &permuteChunkSize, const bool &verbose); \
      |                                                                                                                                                                                                                                                                                                                                      ^
/opt/local/var/macports/build/R-RcSvYgAR/work/RcppPlanc/src/planc/nmf/onlineinmf.hpp:133:35: warning: conversion from 'long long unsigned int' to 'arma::uword' {aka 'unsigned int'} changes value from '18446744073709551615' to '4294967295' [-Woverflow]
  133 |             arma::uword lastEnd = -1ull;
      |                                   ^~~~~

If it is possible to fix these, would be nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions