public long [ ] translateToPhysical ( long [ ] virtualIndexes ) { long [ ] physicalIndexes = new long [ underlyingRank ( ) ] ; int idxPhy = 0 ; int hidden = 0 ; for ( int idxVir = 0 ; idxVir < virtualIndexes . length ; idxVir ++ ) { if ( hidden < getNumHiddenDimension ( ) && hiddenDimensions ( ) [ hidden ] == idxVir ) { hidden ++ ; } else { while ( idxPhy < underlyingRank ( ) && isDimensionFixed ( idxPhy ) ) { physicalIndexes [ idxPhy ] = sparseOffsets ( ) [ idxPhy ] ; idxPhy ++ ; } if ( idxPhy < underlyingRank ( ) && ! isDimensionFixed ( idxPhy ) ) { physicalIndexes [ idxPhy ] = sparseOffsets ( ) [ idxPhy ] + virtualIndexes [ idxVir ] ; idxPhy ++ ; } } } return physicalIndexes ; }
Translate the view index to the corresponding index of the original ndarray