code: public static int getMaxIndex(DoubleMatrix1D v){
  	  	int maxIndex = -1;
  	  	double maxValue = -Double.MAX_VALUE;
  	  	for(int i=0; i<v.size(); i++){
  	  		if(v.getQuick(i)>maxValue){
  	  			maxIndex = i;
  	  			maxValue = v.getQuick(i); 
  	  		}
  	  	}
  	  	return maxIndex; 
  	  }
docs: Get the index of the maximum entry.