public static DMatrixRMaj insideSpan ( DMatrixRMaj [ ] span , double min , double max , Random rand ) { DMatrixRMaj A = new DMatrixRMaj ( span . length , 1 ) ; DMatrixRMaj B = new DMatrixRMaj ( span [ 0 ] . getNumElements ( ) , 1 ) ; for ( int i = 0 ; i < span . length ; i ++ ) { B . set ( span [ i ] ) ; double val = rand . nextDouble ( ) * ( max - min ) + min ; CommonOps_DDRM . scale ( val , B ) ; CommonOps_DDRM . add ( A , B , A ) ; } return A ; }
Creates a random vector that is inside the specified span .