BundleView(Bundle<T> & bundle, const uint i1, const uint j1, const uint i2, const uint j2) : data(&bundle(i1, j1)), cols(j2-j1), rows(i2-i1), stride(bundle.numCols()) { #ifndef WUP_UNSAFE if (i1 < 0 || j1 < 0 || i2 > bundle.numRows() || j2 > bundle.numCols() || i2 <= i1 || j2 <= j1) throw WUPException("Out of bounds"); #endif }
virtual void onFinish() { if (_noPrint) return; if (_eachStep) return; #ifdef __ANDROID_API__ const int numRows = _bundle.numRows(); const int numCols = _bundle.numCols(); std::stringstream ss; LOGD("%s : %d", _label.c_str(), _onlySample); for (int i=0;i<numRows; ++i) { ss.clear(); for (int j=0;j<numCols; ++j) ss << _bundle(i, j) << ", "; LOGD("%d: %s", i, ss.str().c_str()); } #else print(_label, " : ", _onlySample); print(_bundle); #endif _bundle.clear(); }
BundleView(Bundle<T> & _bundle, const uint _rows, const uint _cols) : data(&_bundle(0, 0)), cols(_cols), rows(_rows), stride(_bundle.numCols()) { }
virtual void onExport(iwriter & writer) { writer.putUnsignedInt(_bundle.numCols()); writer.put(_counter); writer.putBool(_eachStep); writer.putString(_label); writer.put(_onlySample); }