|
@@ -503,6 +503,39 @@ namespace NICE {
|
|
_position += this->features[_dim].getZeros();
|
|
_position += this->features[_dim].getZeros();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ template <typename T>
|
|
|
|
+ T FeatureMatrixT<T>::getLargestValue () const
|
|
|
|
+ {
|
|
|
|
+ T vmax = (T) 0;
|
|
|
|
+
|
|
|
|
+ for ( std::vector<NICE::SortedVectorSparse<T> >::const_iterator it = this->features.begin();
|
|
|
|
+ it != this->features.end();
|
|
|
|
+ it++
|
|
|
|
+ )
|
|
|
|
+ {
|
|
|
|
+ if ( it->getLargestValueUnsafe( ) > vmax )
|
|
|
|
+ {
|
|
|
|
+ vmax = it->getLargestValueUnsafe( 1.0 /*quantile, we are interested in the largest value*/);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return vmax;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ template <typename T>
|
|
|
|
+ NICE::Vector<T> FeatureMatrixT<T>::getLargestValuePerDimension ( const double & _quantile ) const
|
|
|
|
+ {
|
|
|
|
+ NICE::Vector<T> vmax ( this->get_d() );
|
|
|
|
+
|
|
|
|
+ NICE::Vector<T>::iterator vmaxIt = vmax.begin();
|
|
|
|
+ for ( std::vector<NICE::SortedVectorSparse<T> >::const_iterator it = this->features.begin();
|
|
|
|
+ it != this->features.end();
|
|
|
|
+ it++, vmaxIt+
|
|
|
|
+ )
|
|
|
|
+ {
|
|
|
|
+ *vmaxIt = it->getLargestValueUnsafe( _quantile );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
//------------------------------------------------------
|
|
//------------------------------------------------------
|
|
// high level methods
|
|
// high level methods
|
|
//------------------------------------------------------
|
|
//------------------------------------------------------
|