github.com/djordje200179/extendedlibrary/datastructures@v1.7.1-0.20240227175559-d09520a92dd4/cols/bitarray/inplace_shift_operations.go (about)

     1  package bitarray
     2  
     3  // ShiftType is an enum for the type of shift operation to perform.
     4  type ShiftType uint8
     5  
     6  const (
     7  	FillZero   ShiftType = iota // FillZero is a shift type that fills the empty bits with zeros.
     8  	FillOne                     // FillOne is a shift type that fills the empty bits with ones.
     9  	Arithmetic                  /*
    10  		Arithmetic is a shift type that fills the empty bits with the same value
    11  		as the sign bit during a right shift, and with zeros during a left shift.
    12  	*/
    13  )
    14  
    15  // ShiftLeft performs an in-place left shift operation on the array.
    16  func (array *Array) ShiftLeft(operationType ShiftType) {
    17  	size := array.Size()
    18  	if size == 0 {
    19  		return
    20  	}
    21  
    22  	panic("not implemented")
    23  }
    24  
    25  // ShiftRight performs an in-place right shift operation on the array.
    26  func (array *Array) ShiftRight(operationType ShiftType) {
    27  	size := array.Size()
    28  	if size == 0 {
    29  		return
    30  	}
    31  
    32  	panic("not implemented")
    33  }